.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/example_mixed_layer_depth.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_mixed_layer_depth.py: Mixing down to Mixed Layer Depth ================================ .. GENERATED FROM PYTHON SOURCE LINES 6-11 .. code-block:: Python from datetime import datetime, timedelta from opendrift.models.oceandrift import OceanDrift from opendrift.readers.reader_constant import Reader as ConstantReader .. GENERATED FROM PYTHON SOURCE LINES 12-13 Mixed Layer Depth of 20m West of 3 deg E, and 50m to the east .. GENERATED FROM PYTHON SOURCE LINES 13-18 .. code-block:: Python r1 = ConstantReader({'ocean_mixed_layer_thickness': 20}) r2 = ConstantReader({'ocean_mixed_layer_thickness': 50}) r1.xmax = 3 r2.xmin = 3 .. GENERATED FROM PYTHON SOURCE LINES 19-20 First with Sundby1983 parameterization of diffusivity, based on wind and MLD .. GENERATED FROM PYTHON SOURCE LINES 20-31 .. code-block:: Python o = OceanDrift(loglevel=50) o.add_reader([r1, r2]) o.set_config('environment:constant:y_wind', 8) # Some wind for mixing o.set_config('drift:vertical_mixing', True) o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Sundby1983') # Increasing background diffusivity beyond default (1.2e-5) to avoid artefact due to sharp gradient at MLD o.set_config('vertical_mixing:background_diffusivity', 0.001) o.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000) o.run(duration=timedelta(hours=48)) o.animation_profile() .. rst-class:: sphx-glr-script-out .. code-block:: none /root/project/opendrift/models/basemodel/__init__.py:3122: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored points = ax.scatter([], [], .. GENERATED FROM PYTHON SOURCE LINES 32-33 .. image:: /gallery/animations/example_mixed_layer_depth_0.gif .. GENERATED FROM PYTHON SOURCE LINES 35-36 Same, but with Large1994 parameterization of diffusivity .. GENERATED FROM PYTHON SOURCE LINES 36-46 .. code-block:: Python o = OceanDrift(loglevel=50) o.add_reader([r1, r2]) o.set_config('environment:constant:y_wind', 8) # Some wind for mixing o.set_config('drift:vertical_mixing', True) o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994') o.set_config('vertical_mixing:background_diffusivity', 0.001) o.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000) o.run(duration=timedelta(hours=48)) o.animation_profile() .. rst-class:: sphx-glr-script-out .. code-block:: none /root/project/opendrift/models/basemodel/__init__.py:3122: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored points = ax.scatter([], [], .. GENERATED FROM PYTHON SOURCE LINES 47-48 .. image:: /gallery/animations/example_mixed_layer_depth_1.gif .. GENERATED FROM PYTHON SOURCE LINES 50-51 Using Large1994, but with 0 diffusivity below MLD .. GENERATED FROM PYTHON SOURCE LINES 51-61 .. code-block:: Python o = OceanDrift(loglevel=50) o.add_reader([r1, r2]) o.set_config('environment:constant:y_wind', 8) # Some wind for mixing o.set_config('drift:vertical_mixing', True) o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994') o.set_config('vertical_mixing:background_diffusivity', 0) o.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000) o.run(duration=timedelta(hours=48)) o.animation_profile() .. rst-class:: sphx-glr-script-out .. code-block:: none /root/project/opendrift/models/basemodel/__init__.py:3122: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored points = ax.scatter([], [], .. GENERATED FROM PYTHON SOURCE LINES 62-63 .. image:: /gallery/animations/example_mixed_layer_depth_2.gif .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 49.652 seconds) .. _sphx_glr_download_gallery_example_mixed_layer_depth.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_mixed_layer_depth.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_mixed_layer_depth.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_