Description
Describe the bug
Grid files that have longitude to ranges from 0 to 180 then -180 to 0 are not being read correctly by data_override when using "OCN" and "ICE" grids.
The code gets here:
FMS/data_override/include/get_grid_version.inc
Lines 218 to 224 in 460c592
At the dateline, it will use values around -180 and 180 and average those which will cause bad longitudes.
You can see the issue in this file:
ncview /gpfs/f5/gfdl_f/scratch/Uriel.Ramirez/REGIONAL_MODEL/FMS/build/test_fms/data_override/LineOfWeirdness_Test /grid_read_in_ocn.nc
MOM6 seems to use the centroids when it reads its grid:
https://github.com/NOAA-GFDL/MOM6/blob/8ecb2603119b8c9d4dee9ee6b174e1864415d1cc/src/initialization/MOM_grid_initialize.F90#L220-L222
To Reproduce
This Test reproduces the error:
https://github.com/uramirez8707/FMS/blob/LineOfWeirdnessTest/test_fms/data_override/test_data_override_LOW.F90
The data files to run it can be found here:
/gpfs/f5/scratch/Uriel.Ramirez/gfdl_f/REGIONAL_MODEL/FMS/build/test_fms/data_override/LineOfWeirdness_Test
Expected behavior
The grid file should be read correctly by data override. We should either:
- Read the centroids from the file directly
- Add logic to the averaging to deal with this corner case
- Model components can pass in their own lat/lon to use by data_override
System Environment
This happens in any system
Additional context
This was seen by @theresa-morrison and @kshedstrom
Activity