# README for AWI-ESM-1-REcoM data for SOFIA

- contact: christopher.danek@awi.de

# Changelog

## v20250724

- added more requested variables and tier1 and tier2 runs incl. ensembles
- corrected nc attributes
- renamed MIP name from 'SOFIA' to 'SOFIAMIP'
- `mlotst` data missing for some experiments; please contact if you need them

## v20240107

- `msftmz` data only includes resolved advective processes, **not** parameterized ones as requested in the CMIP6 data request
- some global nc attributes do not follow CF convention

# Unstructured mesh of ocean model component FESOM1.4

The ocean model component FESOM1.4 uses an unstructured mesh discretization (finite elements) which leads to a non-constant horizontal grid resolution. For example, along the Antarctic coast, where the freshwater is applied in the antwater experiment, the horizontal grid resolution decreases to ~20 km compared to the ~100 km in the subtropical gyres:
```
# field statistics in km:
for fldstat in fldmin fldmax fldmean fldmedian; do printf $fldstat:; cdo -s -output -$fldstat dmax_elem.nc; done
fldmin:      11.8474
fldmax:      146.616
fldmean:      76.3513
fldmedian:      40.6304

# for visual inspection:
ncview -minmax all dmax_elem_remapycon_0.25.nc
```

All modeled ocean realms, i.e. ocean physics, sea ice, and ocean biogeochemistry utilize the same spatial discretization. Following Danilov (2022), the horizontal resolution of the irregular triangles was approximated by `dmax = sqrt(2*A)` with `A` being the area of a surface element.

Note that every single cmorized file on the native unstructured mesh (`gn`) has the grid description of that unstructured mesh attached to it. Hence, commands such as `cdo fldmean` work out of the box, also on that unstructured data. In addition, regularly interpolated data is provided, see next section.

## Interpolation effect on unstructred model data

The unstructured ocean model data was interpolated conservatively to a regular 1° grid. The interpolation command is
```
cdo remapycon,global_1 fin_unstructured fout_regular
```

This interpolation of course changes the actual model data, examplarily shown here for the ocean 2D variable `wfo`, i.e. the freshwater flux into the ocean:
```
cd SOFIAMIP/AWI/AWI-ESM-1-REcoM/antwater/r1i1p1f1/Omon/wfo
version="v20240107"
find . -path "*${version}*.nc" | sort
./gn/v20240107/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gn_187001-197012.nc
./gr1adj/v20240107/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gr1adj_187001-197012.nc
./gr1/v20240107/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gr1_187001-197012.nc
```

On the native unstructured grid (called 'gn'), the globally integrated freshwater flux is ~-0.77 Sv (in January 1870; factor 1e-3 for kg m-2 s-1 to m s-1 and factor 1e-6 from m3 s-1 to Sv):
```
cdo -s -output -divc,1e6 -divc,1e3 -fldint -seltimestep,1 ./gn/$version/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gn_187001-197012.nc
-0.769885
```

On the regular 1° grid (called 'gr1'), the globally integrated freshwater flux is ~-0.95 Sv:
```
cdo -s -output -divc,1e6 -divc,1e3 -fldint -seltimestep,1 ./gr1/$version/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gr1_187001-197012.nc
-0.950518
```

Hence, they differ quite substantially by ~23%. To adjust for this inconsistency, we applied a 'residual flux redistribution', as outlined in section 2.4.3 of Rackow (2014). In this approach the difference between the spatial sums of the unstructured and interpolated fields (their eq. 2.49) is distributed onto the interpolated field taking the local grid cell area into account (eq. 2.50 and 2.51). The resulting global integral on the adjusted regular grid (called 'gr1adj') reproduces the ~-0.77 Sv from the native grid:
```
cdo -s -output -divc,1e6 -divc,1e3 -fldint -seltimestep,1 ./gr1adj/$version/wfo_Omon_AWI-ESM-1-REcoM_antwater_r1i1p1f1_gr1adj_187001-197012.nc
-0.769885
```

In the SOFIA freshwater experiments we also saved (but not uploaded since not requested) the applied freshwater forcing (e.g. 0.1 Sv in `antwater`) on the native unstructured mesh. Here the effect of the interpolation is even larger. The cdo commands above yield 0.100078 Sv on the native grid 'gn' (as expected) but 0.366123 Sv on the regular grid 'gr1', i.e. more than tripled! On the adjusted regular grid 'gr1adj' the global integral yields 0.100078 Sv.

# References

- Danilov 2022: https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2022MS003177
- Griffies et al. 2016: www.geosci-model-dev.net/9/3231/2016
- Rackow, T. (2014, PhD thesis): https://media.suub.uni-bremen.de/handle/elib/829

