OceanParcels / Parcels

Main code for Parcels (Probably A Really Computationally Efficient Lagrangian Simulator)
https://www.oceanparcels.org
MIT License
297 stars 139 forks source link

from_croco() enhancement; correct conversion from z to sigma grid #1763

Open erikvansebille opened 1 week ago

erikvansebille commented 1 week ago

In Parcels v3.1.0, we implemented support for CROCO sigma grids. We assumed that the conversion from the depth-coordinate (z) to the terrain-following coordinate (sigma) was simply sigma(t, y, x) = z(t, y, x) / H(y, x), where H is the local seafloor depth.

However, following the discussion in https://github.com/OceanParcels/Parcels/discussions/1752, we now realise that this conversion is a bit more complex, and requires not only the free-surface field (eta), but also a a critical depth controlling the stretching depth_c , and a dimensionless vertical coordinate stretching function C[zi] as a function of vertical grid

See http://cfconventions.org/cf-conventions/cf-conventions.html#_ocean_s_coordinate_generic_form_1 for detailed information about this conversion

It would be good to implement this conversion under the hood in Parcels too, so that the mapping between sigma and z is more in line with CROCO numerics