-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add support for mom (supergrid) grid format #993
base: main
Are you sure you want to change the base?
Conversation
Tidy compiler flags extend a few tests extend one more tidy fix gadi test submission Tidy compiler flags extend a few tests longer again
commit 9555346 Author: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> Date: Mon Oct 28 09:26:14 2024 +1100 Update cicecore/cicedyn/general/ice_init.F90 commit 388612d Author: anton-seaice <anton.steketee@anu.edu.au> Date: Tue Oct 22 11:38:46 2024 +1100 fix gadi test submission Tidy compiler flags extend a few tests extend one more tidy fix gadi test submission Tidy compiler flags extend a few tests longer again commit 3d9566a Author: anton-seaice <anton.steketee@anu.edu.au> Date: Tue Oct 22 13:43:42 2024 +1100 deprecate cpom orca grid
@anton-seaice, it looks like 'mosaic' in this context has nothing to do with the field campaign. Is that correct? If so, it could be confusing for other users interested in the MOSAiC data. Let's figure out how to document both to reduce confusion. Certainly explain what they are in the readthedocs, but also perhaps add some comments to the diagnostic output? |
I agree. Maybe mosaic is not the right term to use here. Maybe mom_supergrid or just 'mom'. Also, I would add that grid_type has the following options currently: 'displaced_pole', 'tripole', 'default', 'regional', and 'latlon'. So, perhaps we should do something like 'mom_tripole'? |
Thanks both Yes definitely unrelated to MOSAiC voyages. The term mosaic and supergrid are used a little bit interchangeably, although most of the MOM6 source code and the ESMF docs refer to a mosaic specification, so I used that. Happy to change to calling it supergrid if that is clearer. I didn't want to only refer to it as the MOM format because there are is an earlier mom format which is different. @dabail10 - apologies - there was an error in the description, which i've just amended. This changes adds |
I understand now. However isn't grid format either nc or bin? Maybe this should be mom_nc? |
I figured there would never be a mom_mosaic grid not in a netcdf format, so i didn't think we needed to included If it is clearer we could use |
This might be better. However, I think this is overkill. I think grid_format = 'pop_nc' or 'mom_nc' is fine. I also really think you should not have "mosaic" in the name. This is going to be confusing. |
I guess if we just cover that a mom_grid refers to a mom mosaic / supergrid format in the docs then its sufficiently clear that is the format being referred to ? Its unlikely that configs using the latest CICE will want to use an old MOM grid format ? |
Before I get more into this, I am so grateful that you've done the work on this! I just talked to one of our MOM6 developers here. Here is what I think we should do: For POP binary and netcdf files: grid_format = 'bin','nc' , kmt_type = 'file'. This maintains backward compatibility. For MOM6 supergrid files: grid_format = 'mom6_nc' and kmt_type = 'none'. Then key off grid_format to see if we need to read in the MOM6 bathymetry file. The "mosaic" file was an older MOM file. We will never have to support this. Our MOM developer has a script called mosaic_to_supergrid.py. I agree that we should stop using 'kmt' but again for backward compatibility, I think we leave it as kmt for now. |
Hopefully it saves us generating many CICE grid files offline :) Ok great - those namelist options are ok with me. I haven't tried loading a bathymetry file yet, is the format of the CICE bathymetry file different to the MOM6 format ? I was planning to, in a later PR, generate the CICE land/sea mask from the bathymetry file. In the interim, we would keep using the current |
I think the MOM6 bathymetry is very different from the one CICE expects. So we will also have to use grid_format here. I definitely agree with keeping kmt_file around for the near future. |
@apcraig - are these option names ok ? implementing the MOM6 bathymetry would be a future PR |
I think the current plan is fine. We should maintain the current namelist and backwards compatibility whenever possible. I also agree that using "mosaic" could be confusing. Would having a kmt_type='grid' make sense? That would mean the kmt info is on the grid file? Or maybe even kmt_type='grid' and kmt_type='grid_bathy'. The former means the mask is read off the grid file, the latter means the bathymetry is read off the grid file then a kmt mask is created. And how does that interact with the bathymetry namelist values? I haven't looked at all the current and possible permutations of grid/kmt/bathy options, but maybe we should clarify all the existing and potential options and make sure we have a clear set of namelist values that make implementation of them clear (without breaking backwards compatibility). |
Thanks - I change |
|
||
! check tripole flags here | ||
! can't check in init_data because ns_boundary_type is not yet read | ||
! can't check in init_domain_blocks because grid_type is not accessible due to circular logic | ||
|
||
if (grid_type == 'tripole' .and. ns_boundary_type /= 'tripole' .and. & | ||
if (trim(grid_type) == 'tripole' .and. ns_boundary_type /= 'tripole' .and. & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never understand the use of trim. However, should this not be consistent here?
This changes adds
grid_format = 'mom_nc'
support to directly load the grid from a netcdf file which uses the mom (supergrid) definition, and calculates all fields to follow the method MOM6 uses. i.e.There are a few limitations:
I haven't tested every permutation of boundary conditions and grid type, I focussed on on tripolar grids and did best-effots checks on the other boundary conditions.
I found exact matches (to single point precision) between the MOM6 & CICE6 saved grids, see https://github.com/anton-seaice/sandbox/blob/main/new_cice_grid/mom_mosaic_in_cice.ipynb
The NUOPC driver checks for consistency in areas, and lon/lats between the model and the mediator. It applies a correction for differences in area between the model and the mediator. Even if the cell area field is populated in the mediator mesh file, this is not used and the area calculated by ESMF is used instead. Therefore depending on how the mosaic file was created (and how the areas are calculated for that process), the correction between model and mediator areas may not be 1 everywhere.
This change doesn't include any new tests, and I suggest deferring adding tests as it requires new forcing data
I also added kmt_type = 'none' - This is only for testing / idealised configurations, so it's not in the docs. It's not essential for this PR.
PR checklist
Add support for creating the CICE grid from a MOM mosaic (supergrid) format
@anton-seaice
@dabail10
To-do, if the change & scope looks ok, I will run the cice standalone tests
This changes adds
grid_format = 'mom_nc'
support to directly load the grid from a netcdf file which uses the mom mosaic (supergrid) definition, and calculates all fields to follow the method MOM6 uses. Contributes to MOM supergrid and other grid types #807