-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This issue will document the changes required in the mom6 nuopc cap to allow ice shelves to run in MOM6. A draft codebase (definitely needs some fixes/clean up) is here in branch https://github.com/ACCESS-NRI/MOM6/tree/ice-shelf-dev and it compiles with ACCESS-OM3 e.g. here.
Key issues were
- Preventing ocean below ice shelf talking to atmosphere
- Properly initialising ice shelves
Important context: to avoid ocean talking to atmosphere, everything the coupler sees should just be open ocean i.e. sea ice mask (no sea ice below ice shelves, sea ice mask + ice sheet mask must exactly match full ocean mask). MOM should keep the fact that the ocean is larger and has ice shelf cavities to itself, and does meltwater fluxes by itself.
Changes made
- Mesh mask mismatch error: Ocean nuopc mesh mask not matching MOM6 ocean mask needs to be allowed. We replace the error
ERROR: ESMF mesh and MOM6 domain masks are inconsistent!with a warning instead of fatal error:call MOM_error(WARNING, err_msg) So_omaskexport: Needed to change theSo_omaskexport (omaskvariable) inmom_exportsubroutine ofmom_cap_methods.F90. This is because MOM was using the internal mask, which differed from the mask given to the mediator to initialise e.g. the atmosphere-ocean fluxes, which is a static field defined innuopc.runconfig. We had given nuopc the sea ice mask not the ocean mask to avoid the coupler sending fluxes into the cavities, but MOM was sending data back in these files resulting in NaNs in the mediator. The change is here
omask(i,j) = nint(ocean_grid%mask2dT(ig,jg)) - ceiling(ocean_state%ice_shelf_CSp%ISS%hmask(ig,jg))
and also required making ocean_state_type and ice_shelf_CS contents public (i.e. removing ; private for each of them) Please see note 1
- Correctly initialising ice shelf in MOM nuopc cap: By comparing the FMS and nuopc cap I realised the ice shelf was being initialised differently, so added the following:
use MOM_ice_shelf, only : initialize_ice_shelf_fluxes, initialize_ice_shelf_forces
initialise ice shelf fluxes and forces:
if (OS%use_ice_shelf) then
call initialize_ice_shelf_fluxes(OS%ice_shelf_CSp, OS%grid, OS%US, OS%fluxes)
call initialize_ice_shelf_forces(OS%ice_shelf_CSp, OS%grid, OS%US, OS%forces)
endif
Please see note 2
Note 1:
- The subroutine
State_SetExportalso uses the ocean grid internal mask, applying a mask again as it exports. It doesn't do anything really, and I didn't need to change it. - Potentially other places need this mask too. E.g.
So_tcurrently has ocean in the cavities in the mediator output.... but it doesn't seem to be a problem becauseSo_omaskis correct. Maybe also in the input.
Note 2:
- MOM6 FMS cap just uses the fluxes and forces initialisations and not
initialize_ice_shelfwhich I left above. If I did only the fluxes and forces I got a segfault.
Suggested improvements to code
- Currently I rely on making control structures
ocean_state_typeandice_shelf_CScontents public to allow the nuopc cap to access them. Ideally this shouldn't happen, may need some feeder submodules that allow the required variables to be accessed - I'm using
ISS%hmaskfor the ice shelf - this could have values not 0 or 1 though (e.g. 2). Usingfluxes%frac_shelf_hcould also work (this was a previous attempt but the variable hadn't been properly initialized), but likewise can vary and have values between 0 and 1. - I don't have an "if using ice shelf then apply this different
omask" statement, this needs to be added tomom_export.
special thanks to @dougiesquire @anton-seaice for helpful discussions/hacking during the ACCESS workshop.