{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Mixing down to Mixed Layer Depth\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from datetime import datetime, timedelta\nfrom opendrift.models.oceandrift import OceanDrift\nfrom opendrift.readers.reader_constant import Reader as ConstantReader"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Mixed Layer Depth of 20m West of 3 deg E, and 50m to the east\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"r1 = ConstantReader({'ocean_mixed_layer_thickness': 20})\nr2 = ConstantReader({'ocean_mixed_layer_thickness': 50})\nr1.xmax = 3\nr2.xmin = 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First with Sundby1983 parameterization of diffusivity, based on wind and MLD\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o = OceanDrift(loglevel=50)\no.add_reader([r1, r2])\no.set_config('environment:constant:y_wind', 8) # Some wind for mixing\no.set_config('drift:vertical_mixing', True)\no.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Sundby1983')\n# Increasing background diffusivity beyond default (1.2e-5) to avoid artefact due to sharp gradient at MLD\no.set_config('vertical_mixing:background_diffusivity', 0.001)\no.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000)\no.run(duration=timedelta(hours=48))\no.animation_profile()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Same, but with Large1994 parameterization of diffusivity\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o = OceanDrift(loglevel=50)\no.add_reader([r1, r2])\no.set_config('environment:constant:y_wind', 8) # Some wind for mixing\no.set_config('drift:vertical_mixing', True)\no.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')\no.set_config('vertical_mixing:background_diffusivity', 0.001)\no.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000)\no.run(duration=timedelta(hours=48))\no.animation_profile()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Using Large1994, but with 0 diffusivity below MLD\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o = OceanDrift(loglevel=50)\no.add_reader([r1, r2])\no.set_config('environment:constant:y_wind', 8) # Some wind for mixing\no.set_config('drift:vertical_mixing', True)\no.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')\no.set_config('vertical_mixing:background_diffusivity', 0)\no.seed_cone(lon=[2, 4], lat=[60, 60], time=datetime.now(), number=5000)\no.run(duration=timedelta(hours=48))\no.animation_profile()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}