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

Save all grid variables unmasked #375

Open
aekiss opened this issue Feb 3, 2023 · 6 comments · May be fixed by #376
Open

Save all grid variables unmasked #375

aekiss opened this issue Feb 3, 2023 · 6 comments · May be fixed by #376

Comments

@aekiss
Copy link
Collaborator

aekiss commented Feb 3, 2023

Many grid variables (area_t, area_u, geolon_t, geolat_t, etc) are saved with no mask, but others including dxt, dyt, dxu, dyu are land-masked - e.g. see /g/data/ik11/grids/ocean_grid_10.nc.

This makes it impossible to supply a single grid file that can be used with any land mask, which is what we're attempting in COSIMA/cosima-recipes#212

This difference is because area_t, area_u, geolon_t, geolat_t, etc are output by send_data
https://github.com/mom-ocean/MOM5/blob/5f70c21/src/mom5/ocean_core/ocean_grids.F90#L1691-L1713
whereas dxt, dyt, dxu, dyu are output via diagnose_2d or diagnose_2d_u
https://github.com/mom-ocean/MOM5/blob/5f70c21/src/mom5/ocean_core/ocean_grids.F90#L1752-L1774
which mask the fields
https://github.com/mom-ocean/MOM5/blob/master/src/mom5/ocean_core/ocean_util.F90#L898-L991

Is there any reason we shouldn't use send_data for all the horizontal grid diagnostics? diagnose_2d calls it anyway (via diagnose_2d_mask).

@russfiedler
Copy link
Collaborator

@aekiss Are you sure about that being the only problem? You still have to take tile masking into account. The 1 degree model isn't masked (I think) but the others are and you get missing/Fill values where there are no tiles. Is this an issue?

@aekiss
Copy link
Collaborator Author

aekiss commented Feb 3, 2023

Yes, there will also be tile masking in production runs (even at 1 deg) but this fix is for a short one-off run to generate these grid files, where we remove ocean_mask_table so processor masking won't be used - see https://github.com/COSIMA/access-om2/wiki/Technical-documentation#Outputting-grid-files-with-no-processor-land-masking

@russfiedler
Copy link
Collaborator

No need for anything so complicated. Mostly done here https://github.com/russfiedler/grid_spec_tools/blob/master/create_old_grid_spec.F90 Just need to change a few variable names and do the area/u grid stuff. There's a debug version there too.

@aekiss
Copy link
Collaborator Author

aekiss commented Feb 6, 2023

Ah thanks @russfiedler is that was was used to create /g/data/ik11/grids/ocean_grid_01.nc?

@russfiedler
Copy link
Collaborator

@aekiss Yes, it looks like it. I think I may have had an enhanced version. I'll look about.

@aekiss
Copy link
Collaborator Author

aekiss commented Feb 6, 2023

@russfiedler I agree something like your create_old_grid_spec is way more sensible than running the model, and I'm writing code to do what I want based on this.

But I also think it's worth removing the masking for these fields so I've made a PR to do that. Would you like to look it over before I merge it?

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

Successfully merging a pull request may close this issue.

2 participants