Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Creating custom grids for MOM6+CICE

paulhall

Paul Hall
Member
I am trying to develop a small, high-resolution grid to use for a process model using CESM 2 with the GMOM compset. I have created an ocean/ice grid (Cartesian, 0.5° x 1° domain) that works with the CMOM compset, but fails when I try to use the GMOM compset. I suspect this is because CICE requires extra grid files, and possibly some namelist settings, beyond those required for just MOM6 (CMOM). Does anyone have any tips on how to create the required grid files for CICE from MOM6 grid files (ESMF mesh file, MOM6 supergrid, and ocean topography files)? I have not had much luck finding relevant documentation. Thanks in advance!
 
I've run the B-grid version of CICE. It had multiple file formats it would accept, including a POP netcdf grid. I wrote a roms_to_pop.py grid converter. It should be just as simple to create a mom_to_pop grid converter. Or if enough people are running MOM6 and CICE, perhaps one could write a routine in CICE that would accept the MOM6 grid. @dbailey ?
 

paulhall

Paul Hall
Member
Thanks! You may be right, a converter may be the simplest way forward. Any chance you would be willing to share you roms_to_pop script so that I could use it for reference/as a starting point?
 

paulhall

Paul Hall
Member
Thanks! Much appreciated! For my own future reference, is there a good, centralized place for sharing scripts like this that might be useful within the CESM community?
 
There are people running MOM6-CICE outside the CESM community as well, as part of NOAA's UFS. I don't know the answer to your question, though, except maybe github.
 

gmarques

Gustavo Marques
Moderator
Staff member
Section 3 of this notebook has instructions on how to generate the binary grid files for CICE using MOM6's files.
 

paulhall

Paul Hall
Member
Section 3 of this notebook has instructions on how to generate the binary grid files for CICE using MOM6's files.
Hi Gustavo. The notebooks you pointed me to seem to assume the existence of a vertical grid file for MOM6. I have only been using a topography file, supergrid file, and ESMF mesh file for my MOM6 grids. Could you point me to instructions for generating a vertical grid file?
 

paulhall

Paul Hall
Member
We need a tutorial on this topic. I use a vertical grid file someone gave me, see attached.
Thanks! And yes, a tutorial on custom grid generation would be useful! My understanding is that, at least with NUOPC, the vertical grid file isn't really necessary. Is this correct? I've been able to run CMOM compsets on custom grids in CESM by defining the vertical grid options in user_nl_mom instead of using an actual vertical grid file. It seems to work? But a vertical grid file is apparently still required for CICE.
 

gmarques

Gustavo Marques
Moderator
Staff member
The vertical grid is necessary, see the NCL scrip in section B.3

Here is our latest z* grid:

Code:
netcdf vgrid_65L_20200626 {
dimensions:
    z = 65 ;
variables:
    double dz(z) ;
        dz:_FillValue = NaN ;
        dz:long_name = "Nominal thickness of level" ;
        dz:units = "meter" ;

// global attributes:
        :title = "Vertical resolution using 65 layers" ;
        :maximum_depth = "6000.0 m" ;
        :minimum_depth = "10 m" ;
        :url = "created using https://gist.github.com/gustavo-marques/3e11fd764749599559c45807c3f9b570" ;
        :author = "Gustavo Marques (gmarques@ucar.edu)" ;
        :Created = "2020-06-26T12:04:45.719416" ;
data:

 dz = 2.5, 2.5, 2.5, 2.5, 2.77, 3.38, 4.01, 4.65, 5.29, 5.95, 6.61, 7.28, 
    7.97, 8.66, 9.37, 10.08, 10.81, 11.54, 12.29, 13.06, 13.85, 14.69, 15.59, 
    16.56, 17.61, 18.76, 20.02, 21.42, 23, 24.77, 26.79, 29.1, 31.76, 34.87, 
    38.5, 42.79, 47.9, 54.01, 61.37, 70.25, 80.95, 93.75, 108.8, 126.04, 
    145.04, 164.81, 184.05, 201.34, 215.66, 226.64, 234.5, 239.84, 243.31, 
    245.52, 246.88, 247.72, 248.23, 248.54, 248.73, 248.84, 248.64, 248.68, 
    248.71, 248.72, 248.73 ;
}
 

paulhall

Paul Hall
Member
Thanks Gustavo! Do you know if the vertical grid used in CICE should match the vertical structure used in MOM6? I have just been defining the vertical structure in MOM6 in user_nl_mom (hence my lack of an existing vertical grid file).
 

gmarques

Gustavo Marques
Moderator
Staff member
I am not sure if they should match. I suggest following the script I referred to in the previous post.
 

paulhall

Paul Hall
Member
Thanks Gustavo. I am working from a MOM6 supergrid file, with no netCDF grid file or mask file (model domain is open ocean and flat bottom, so no coasts to deal with). I can use the gen_nc_grid.ipynb you linked to to create the netCDF file, but do you have any scripts or instructions for creating a mask file? Thanks!
 

gmarques

Gustavo Marques
Moderator
Staff member
The tracer mask should have the exact dimensions as, for example, tlon and tlat. You can construct the latter using the supergrid as follows:

Code:
# MOM6 supergrid:
sgrd = netCDF4.Dataset(hgrid.nc')
x = sgrd.variables['x'][:]
y = sgrd.variables['y'][:]
# T point locations
tlon = x[1::2,1::2]
tlat = y[1::2,1::2]

Since you do not have land points, your mask can be defined as mask = np.ones(tlon.shape).
 

paulhall

Paul Hall
Member
Thanks Gustavo! This seems to work, and I have what appear to be viable CICE grids now.

Follow up question: can you point me to instructions for adding the new grid to CESM/CICE? The examples in the relevant instructions in the gist you linked to earlier (see section 8) don't appear to exist on Cheyenne anymore. In case it is relevant, I am using cesm2_3_alpha08a and NUOPC.

Thanks again for your help with this!
 

gmarques

Gustavo Marques
Moderator
Staff member
Hi Paul,
I've been (slowly) working on instructions for adding new configurations in CESM /NUOPC. I will be happy to share them once they are more developed. In the meantime, have you already created a mesh for your new domain? if so, perhaps the best way forward is to mimic what was done for the tx0.66v1 grid in CESM CIME Case Control System configuration files (a new way of managing compsets). Search for tx.066v1 and follow the results in the *nuopc* files.
 

peterchu

cwc950106
New Member
Section 3 of this notebook has instructions on how to generate the binary grid files for CICE using MOM6's files.
Hi Gustavo,

I want to create binary grid and kmt file for CICE as well, but the NCL script link in the notebook seems invalid. Would you be kind to share the script with me?

Thanks
 
Top