Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coordinates #6

Open
anton-seaice opened this issue Oct 1, 2024 · 0 comments
Open

Fix coordinates #6

anton-seaice opened this issue Oct 1, 2024 · 0 comments

Comments

@anton-seaice
Copy link

In the MOM6 code, it says this in a comment about the initial conditions:

  ! Read input grid coordinates for temperature and salinity field
  ! in z-coordinate dataset. The file is REQUIRED to contain the
  ! following:
  !
  ! dimension variables:
  !          lon (degrees_E), lat (degrees_N), depth(meters)
  ! variables:
  !          ptemp(lon,lat,depth) : degC, potential temperature
  !          salt (lon,lat,depth) : ppt, salinity
  !
  ! The first record will be read if there are multiple time levels.
  ! The observation grid MUST tile the model grid. If the model grid extends
  ! to the North/South Pole past the limits of the input data, they are extrapolated using the average
  ! value at the northernmost/southernmost latitude.

It appears this is not enforced, as our current initial conditions use different dimension names:

ncdump -hs /g/data/vk83/configurations/inputs/access-om3/mom/initial_conditions/global.1deg/2020.10.22/ocean_temp_salt.res.nc
netcdf ocean_temp_salt.res {
dimensions:
        GRID_X_T = 360 ;
        GRID_Y_T = 300 ;
        ZT = 50 ;
        time = UNLIMITED ; // (1 currently)
variables:
        double GRID_X_T(GRID_X_T) ;
                GRID_X_T:long_name = "Nominal Longitude of T-cell center" ;
                GRID_X_T:units = "degree_east" ;
                GRID_X_T:modulo = 360. ;
                GRID_X_T:point_spacing = "even" ;
                GRID_X_T:axis = "X" ;
                GRID_X_T:_Storage = "contiguous" ;
                GRID_X_T:_Endianness = "little" ;
        double GRID_Y_T(GRID_Y_T) ;
                GRID_Y_T:long_name = "Nominal Latitude of T-cell center" ;
                GRID_Y_T:units = "degree_north" ;
                GRID_Y_T:point_spacing = "uneven" ;
                GRID_Y_T:axis = "Y" ;
                GRID_Y_T:_Storage = "contiguous" ;
                GRID_Y_T:_Endianness = "little" ;
        double ZT(ZT) ;
                ZT:long_name = "zt" ;
                ZT:units = "meters" ;
                ZT:positive = "down" ;
                ZT:point_spacing = "uneven" ;
                ZT:axis = "Z" ;
                ZT:_Storage = "contiguous" ;
                ZT:_Endianness = "little" ;

We should change to the MOM names, as these data are on the MOM grid after the regridding.

Similarly, the time coordinates have the wrong metadata:

        double time(time) ;
                time:long_name = "time" ;
                time:units = "days since 0001-01-01 00:00:00" ;
                time:cartesian_axis = "T" ;
                time:calendar_type = "GREGORIAN" ;
                time:calendar = "GREGORIAN" ;
                time:_Storage = "chunked" ;
                time:_ChunkSizes = 512 ;
                time:_Endianness = "little" ;

We need to update this to use months since and use a valid calendar (Gregorian starts in 1582).

These two changes are in https://github.com/COSIMA/ocean-regrid/blob/e3e5404807c05ec4060624dcc0773f419860c8f0/util.py#L121

Once we've done that, we should use a cf-compliance checker on the output also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant