.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_constant_current.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_example_constant_current.py: Constant current ================ .. GENERATED FROM PYTHON SOURCE LINES 6-12 .. code-block:: Python from datetime import datetime, timedelta from opendrift.models.oceandrift import OceanDrift o = OceanDrift(loglevel=20) # Set loglevel to 0 for debug information .. rst-class:: sphx-glr-script-out .. code-block:: none 13:54:10 INFO opendrift:576: OpenDriftSimulation initialised (version 1.14.7 / v1.14.7-15-g2988cd4) .. GENERATED FROM PYTHON SOURCE LINES 13-14 Adding no input models, but instead constant northwards current of 1 m/s .. GENERATED FROM PYTHON SOURCE LINES 14-18 .. code-block:: Python o.set_config('environment:fallback:x_sea_water_velocity', 0) o.set_config('environment:fallback:y_sea_water_velocity', 1) o.set_config('environment:fallback:land_binary_mask', 0) .. GENERATED FROM PYTHON SOURCE LINES 19-20 Seed elements at defined position and time .. GENERATED FROM PYTHON SOURCE LINES 20-23 .. code-block:: Python o.seed_elements(lon=4.0, lat=60.0, radius=5000, number=100, time=datetime(2015, 9, 22, 6, 0, 0)) .. rst-class:: sphx-glr-script-out .. code-block:: none 13:54:10 INFO opendrift.models.basemodel.environment:203: Adding a global landmask from GSHHG 13:54:14 INFO opendrift.models.basemodel.environment:227: Fallback values will be used for the following variables which have no readers: 13:54:14 INFO opendrift.models.basemodel.environment:230: x_sea_water_velocity: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: y_sea_water_velocity: 1.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: sea_surface_height: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: x_wind: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: y_wind: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: upward_sea_water_velocity: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: ocean_vertical_diffusivity: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_significant_height: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_x_velocity: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: sea_surface_wave_stokes_drift_y_velocity: 0.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: ocean_mixed_layer_thickness: 50.000000 13:54:14 INFO opendrift.models.basemodel.environment:230: sea_floor_depth_below_sea_level: 10000.000000 .. GENERATED FROM PYTHON SOURCE LINES 24-25 Running model for 50 hours .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python o.run(duration=timedelta(hours=50)) .. rst-class:: sphx-glr-script-out .. code-block:: none 13:54:14 INFO opendrift:1803: Skipping environment variable ocean_vertical_diffusivity because of condition ['drift:vertical_mixing', 'is', False] 13:54:14 INFO opendrift:1803: Skipping environment variable ocean_mixed_layer_thickness because of condition ['drift:vertical_mixing', 'is', False] 13:54:14 INFO opendrift:1814: Storing previous values of element property lon because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous'])) 13:54:14 INFO opendrift:1814: Storing previous values of element property lat because of condition (('general:coastline_action', 'in', ['stranding', 'previous']), 'or', ('general:seafloor_action', 'in', ['previous'])) 13:54:14 INFO opendrift:1822: Storing previous values of environment variable sea_surface_height because of condition ['drift:vertical_advection', 'is', True] 13:54:14 INFO opendrift:952: Using existing reader for land_binary_mask to move elements to ocean 13:54:14 INFO opendrift:982: All points are in ocean 13:54:14 INFO opendrift:2111: 2015-09-22 06:00:00 - step 1 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 07:00:00 - step 2 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 08:00:00 - step 3 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 09:00:00 - step 4 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 10:00:00 - step 5 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 11:00:00 - step 6 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 12:00:00 - step 7 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 13:00:00 - step 8 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 14:00:00 - step 9 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 15:00:00 - step 10 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 16:00:00 - step 11 of 50 - 100 active elements (0 deactivated) 13:54:14 INFO opendrift:2111: 2015-09-22 17:00:00 - step 12 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 18:00:00 - step 13 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 19:00:00 - step 14 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 20:00:00 - step 15 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 21:00:00 - step 16 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 22:00:00 - step 17 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-22 23:00:00 - step 18 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 00:00:00 - step 19 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 01:00:00 - step 20 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 02:00:00 - step 21 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 03:00:00 - step 22 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 04:00:00 - step 23 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 05:00:00 - step 24 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 06:00:00 - step 25 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 07:00:00 - step 26 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 08:00:00 - step 27 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 09:00:00 - step 28 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 10:00:00 - step 29 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 11:00:00 - step 30 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 12:00:00 - step 31 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 13:00:00 - step 32 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 14:00:00 - step 33 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 15:00:00 - step 34 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 16:00:00 - step 35 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 17:00:00 - step 36 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 18:00:00 - step 37 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 19:00:00 - step 38 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 20:00:00 - step 39 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 21:00:00 - step 40 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 22:00:00 - step 41 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-23 23:00:00 - step 42 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 00:00:00 - step 43 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 01:00:00 - step 44 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 02:00:00 - step 45 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 03:00:00 - step 46 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 04:00:00 - step 47 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 05:00:00 - step 48 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 06:00:00 - step 49 of 50 - 100 active elements (0 deactivated) 13:54:15 INFO opendrift:2111: 2015-09-24 07:00:00 - step 50 of 50 - 100 active elements (0 deactivated) .. raw:: html
<xarray.Dataset> Size: 430kB
    Dimensions:                                   (trajectory: 100, time: 51)
    Coordinates:
      * trajectory                                (trajectory) int64 800B 0 1 ... 99
      * time                                      (time) datetime64[ns] 408B 2015...
    Data variables: (12/21)
        status                                    (trajectory, time) float32 20kB ...
        moving                                    (trajectory, time) float32 20kB ...
        age_seconds                               (trajectory, time) float32 20kB ...
        origin_marker                             (trajectory, time) float32 20kB ...
        lon                                       (trajectory, time) float32 20kB ...
        lat                                       (trajectory, time) float32 20kB ...
        ...                                        ...
        upward_sea_water_velocity                 (trajectory, time) float32 20kB ...
        sea_surface_wave_significant_height       (trajectory, time) float32 20kB ...
        sea_surface_wave_stokes_drift_x_velocity  (trajectory, time) float32 20kB ...
        sea_surface_wave_stokes_drift_y_velocity  (trajectory, time) float32 20kB ...
        sea_floor_depth_below_sea_level           (trajectory, time) float32 20kB ...
        land_binary_mask                          (trajectory, time) float32 20kB ...
    Attributes: (12/119)
        Conventions:                                                           CF...
        standard_name_vocabulary:                                              CF...
        featureType:                                                           tr...
        title:                                                                 Op...
        summary:                                                               Ou...
        keywords:                                                              tr...
        ...                                                                    ...
        geospatial_lon_units:                                                  de...
        geospatial_lon_resolution:                                             point
        runtime:                                                               0:...
        geospatial_vertical_min:                                               0.0
        geospatial_vertical_max:                                               0.0
        geospatial_vertical_positive:                                          up


.. GENERATED FROM PYTHON SOURCE LINES 28-29 Print and plot results .. GENERATED FROM PYTHON SOURCE LINES 29-31 .. code-block:: Python print(o) o.plot(fast=True, buffer=1) .. image-sg:: /gallery/images/sphx_glr_example_constant_current_001.png :alt: OpenDrift - OceanDrift 2015-09-22 06:00 to 2015-09-24 08:00 UTC (51 steps) :srcset: /gallery/images/sphx_glr_example_constant_current_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none =========================== -------------------- Reader performance: -------------------- global_landmask 0:00:00.0 total 0:00:00.0 preparing 0:00:00.0 reading 0:00:00.0 masking -------------------- Performance: 4.7 total time 3.9 configuration 0.0 preparing main loop 0.0 moving elements to ocean 0.8 main loop 0.0 updating elements 0.0 cleaning up -------------------- =========================== Model: OceanDrift (OpenDrift version 1.14.7) 100 active Lagrangian3DArray particles (0 deactivated, 0 scheduled) ------------------- Environment variables: ----- land_binary_mask 1) global_landmask ----- Readers not added for the following variables: sea_floor_depth_below_sea_level sea_surface_height sea_surface_wave_significant_height sea_surface_wave_stokes_drift_x_velocity sea_surface_wave_stokes_drift_y_velocity upward_sea_water_velocity x_sea_water_velocity x_wind y_sea_water_velocity y_wind Discarded readers: Time: Start: 2015-09-22 06:00:00 UTC Present: 2015-09-24 08:00:00 UTC Calculation steps: 50 * 1:00:00 - total time: 2 days, 2:00:00 Output steps: 51 * 1:00:00 =========================== 13:54:15 WARNING opendrift:2473: Plotting fast. This will make your plots less accurate. (,
) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 11.722 seconds) .. _sphx_glr_download_gallery_example_constant_current.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_constant_current.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_constant_current.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: example_constant_current.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_