Skip to content

Add support for mom (supergrid) grid format#993

Merged
apcraig merged 44 commits into
CICE-Consortium:mainfrom
ACCESS-NRI:mom_mosaic
Apr 29, 2025
Merged

Add support for mom (supergrid) grid format#993
apcraig merged 44 commits into
CICE-Consortium:mainfrom
ACCESS-NRI:mom_mosaic

Conversation

@anton-seaice
Copy link
Copy Markdown
Contributor

@anton-seaice anton-seaice commented Nov 7, 2024

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.

  • all lats & lons are read from the file
  • all cell x/y lengths are read from the file
  • A grid and B grid areas are read from the file, C grid areas are calculated internally (per Initialising areaC NOAA-GFDL/MOM6#740)
  • angles are calculated internally (even though they exist in the mosaic file)

There are a few limitations:

  • If the CHANNEL_CONFIG option is used in MOM6, this can change some cell sizes at runtime, however we are loading these from the file.
  • MOM6 generates a land-sea mask by making land where the bathymetry<0.5m , however we are still loading from a kmt file which needs to be generated "offline".

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

  • Short (1 sentence) summary of your PR:
    Add support for creating the CICE grid from a MOM mosaic (supergrid) format
  • Developer(s):
    @anton-seaice
  • Suggest PR reviewers from list in the column to the right.
    @dabail10
  • Please copy the PR test results link or provide a summary of testing completed below.
    To-do, if the change & scope looks ok, I will run the cice standalone tests, https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#07bb8a004f0dff968441bf1f5852d79680d3d514
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
    • Yes
    • No
  • Does this PR add any new test cases?
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please document the changes in detail, including why the changes are made. This will become part of the PR commit log.
    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

anton-seaice and others added 28 commits October 14, 2024 13:24
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
@eclare108213
Copy link
Copy Markdown
Contributor

@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?

@dabail10
Copy link
Copy Markdown
Contributor

dabail10 commented Nov 7, 2024

@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'?

Copy link
Copy Markdown
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, overall, with some minor suggestions. Please remove Icepack from the PR.

Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90 Outdated
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90 Outdated
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
@apcraig
Copy link
Copy Markdown
Contributor

apcraig commented Apr 4, 2025

@anton-seaice, is the PR ready for formal review and testing?

Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
@anton-seaice anton-seaice marked this pull request as ready for review April 6, 2025 23:28
Comment thread cicecore/cicedyn/general/ice_init.F90 Outdated
@anton-seaice
Copy link
Copy Markdown
Contributor Author

Thanks @apcraig - this is ready for review. The issue I mentioned in the last meeting has been fixed (was using cm instead of m for a few fields).

Copy link
Copy Markdown
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few comments that I'm not sure have been addressed. Otherwise this looks good. I have one question re namelist -- should we also use pop_nc instead of just nc now?

Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90 Outdated
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
Copy link
Copy Markdown
Contributor

@apcraig apcraig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding all the memory allocation/deallocation checks. I added a few comments for further review. Then I will run a large test suite on derecho with multiple compilers. I hope we can add a mom grid testcase soon to the standalone model.

Comment thread cicecore/cicedyn/general/ice_init.F90
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90 Outdated
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90
@anton-seaice
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @apcraig - I will implement and update this PR soon

@anton-seaice
Copy link
Copy Markdown
Contributor Author

I think i've addressed the comments @apcraig & @eclare108213

@apcraig
Copy link
Copy Markdown
Contributor

apcraig commented Apr 24, 2025

I am carrying out a full test suite on derecho. If all looks good, I'll approve and merge tomorrow unless there are any other concerns.

Comment thread cicecore/cicedyn/infrastructure/ice_grid.F90 Outdated
@apcraig
Copy link
Copy Markdown
Contributor

apcraig commented Apr 25, 2025

With the one line fix above at ice_grid.F90, line 355, these changes pass the full test suite on derecho with 6 compilers. Once the one line fix is added to the PR, I will approve and merge the PR. https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#07bb8a004f0dff968441bf1f5852d79680d3d514

anton-seaice and others added 2 commits April 28, 2025 08:51
Co-authored-by: Tony Craig <apcraig@users.noreply.github.com>
@anton-seaice
Copy link
Copy Markdown
Contributor Author

Thanks @apcraig - sounds good :)

@apcraig
Copy link
Copy Markdown
Contributor

apcraig commented Apr 28, 2025

I reviewed the latest changes and ran a quick suite on the latest changes with all compilers on derecho and results look good. I will approve and merge in the next day or so unless there are other comments.

@apcraig apcraig merged commit 2986b9f into CICE-Consortium:main Apr 29, 2025
2 checks passed
@anton-seaice anton-seaice deleted the mom_mosaic branch August 10, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants