{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# CROCO 3D tutorial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This tutorial will show how to run a 3D simulation with output from the CROCO model." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example setup" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We start with loading the relevant modules and the data." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import xarray as xr\n", "\n", "import parcels\n", "\n", "example_dataset_folder = parcels.download_example_dataset(\"CROCOidealized_data\")\n", "file = os.path.join(example_dataset_folder, \"CROCO_idealized.nc\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The simulation will be a very simple, idealised flow: a purely zonal flow over a sloping bottom. This flow (which is somewhat unrealistic of course) nicely showcases that particles stay on their initial depth levels, even though the sigma-layers slope down. \n", "\n", "This flow has been created by first running the example from the [Shelf front example on the CROCO website](https://croco-ocean.gitlabpages.inria.fr/croco_doc/model/model.test_cases.shelfront.html). Then, we took the restart file are manually replaced all the `u`-velocities with `1` m/s and all the `v`-velocities with `0` m/s. This way we get a purely zonal flow. We then started a new simulation from the restart file, and CROCO then automatically calculated the `w` velocities to match the new zonal field. We saved the `time=0` snapshot from this new run and use it below." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we create a FieldSet object using the `FieldSet.from_croco()` method. Note that CROCO is a C-grid (with similar indexing at MITgcm), so we need to provide the longitudes and latitudes of the $\\rho$-points of the grid (`lon_rho` and `lat_rho`). We also need to provide the sigma levels at the depth points (`s_w`). Finally, it is important to also provide the bathymetry field (`h`), which is needed to convert the depth levels of the particles to sigma-coordinates." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "