cpld_gridgen
1.12.0
|
The cpld_gengrid program and associated script related functions create the files required for Fix and IC files for the coupled model.
This document is part of the UFS_UTILS documentation.
The cpld_gengrid program is part of the UFS_UTILS project.
For the UFS coupled model application S2S or S2SW, the following fix files are required:
Since MOM6 creates the model grid at runtime (including adjusting the land mask, if required), the required files for CICE and UFSAtm must be created in a pre-processing step using only the MOM6 supergrid, topography and land mask files as input. This allows the mapped ocean mask (used for creating of the ATM ICs) and the CICE6 grid and mask files to be consistent with the run-time configuration of MOM6.
The MOM6 supergrid contains a MOM6 grid at twice the desired resolution. The indexing of the supergrid vs the reduced grid is:
Super Grid Reduced Grid I-1,J+1 I+1,J+1 X─────X─────X I-1,J i,j │ │ │ X─────X │ │ │ │ │ │ i│j │ │ T │ X─────X─────X │ │ │ │ │ X─────X │ │ │ I-1,J-1 I,J-1 │ │ │ X─────X─────X I-1,J-1 I+1,J-1
MOM6 uses an Arakawa C grid. Within cpld_gridgen, these are referred to as "stagger" locations, and named as follows:
Bu────Cv─────Bu │ │ │ │ Cu Ct Cu │ │ │ │ Bu────Cv─────Bu
For the tripole grid, a rotation angle is defined to translate vectors to/from the grid (i-j) orientation from/to true E-W. The rotation angle is calculated at run-time in MOM6 (src/initialization/MOM_shared_initialization.F90). However, CICE6 requires a rotation at the corner (Bu
) grid points, which for points along the tripole seam requires values on the other side of the tripole fold. In cpld_gridgen, these values are found by "flipping over" the values on the last row of the MOM6 super-grid. If ipL
and ipR
are the i-indices of the poles along the last j-row:
ipL-1 ipL ipL+1 ipR-1 ipR ipR+1 x-------x-------x ||| x-------x-------x
then after folding along the tripole seam, ipL
and ipR
must align:
ipR+1 ipR ipR-1 x-------x-------x ipL-1 ipL ipL+1 x-------x-------x
Using the folded seam, the values required for calculating the rotation angle on the Bu
grid points are available and can be calculated in the same way as MOM6 calculates rotation angles for the Ct
grid points.
For calculating interpolation weights using ESMF, a SCRIP file needs to be provided. A SCIP file contains the both the grid locations of any stagger grid location (e.g. Ct
) and the associated grid vertices for that point. As seen from the above diagram, for the Ct
points, those grid vertices are given by the Bu
grid locations.
SCRIP requires that the vertices be ordered counter-clockwise so that the center grid point is always to the left of the vertex. In cpld_gridgen, vertices are defined counter-clockwise from upper right. Ct
vertices are located on the Bu
grid (as shown above), Cu
vertices on the Cv
grid, Cv
vertices on the Cu
grid and Bu
vertices on the Ct
grid. For example, for the Ct
grid, the vertices are:
Vertex #2 Vertex #1 Bu(i-1,j) Bu(i,j) Ct(i,j) Bu(i-1,j-1) Bu(i,j-1) Vertex #3 Vertex #4
so that the vertices for the Ct
grid are found as off-sets of the i,j index of the Bu
grid
iVertCt(4) = (/0, -1, -1, 0/) jVertCt(4) = (/0, 0, -1, -1/)
Careful examination of the remaining stagger locations lead to similar definitions for the i,j offsets required to extract the vertices, all of which can be defined in terms of the iVertCt
and jVertCt
values.
Special treatment is require at the bottom of the grid, where the vertices of the Ct
and Cu
grid must be set manually (note, these points are on land.) The top of the grid also requires special treatment because the required vertices are located across the tripole seam. This is accomplished by creating 1-d arrays which hold the Ct
and Cu
grid point locations across the matched seam.
The cpld_gridgen program and associated script related functions perform the following tasks:
Ct
) grid points and a second SCRIP file also containing the land maskThe exact list of files produced by the cpld_gridgen.sh script will vary depending on several factors. For example, if the DO_POSTWGHTS flag is true, then a SCRIP format file will be produced for each rectilinear destination grid desired and a file containing the regridding weights to map from the center Ct
stagger point to the rectilinear grid will also be written. Because both MOM6 and CICE6 velocity variables are located at Cu
,Cv
or Bu
locations, additional files will also be created to regrid from the velocity stagger locations to the center Ct
location. If an OCN/ICE grid resolution less than 1/4 degree is chosen, then a file containing regridding weights from the 1/4 degree grid to a lower resolution grid will also be written. Note also that multiple intermediate SCRIP format files may be produced depending on the options chosen.
File name | Description | Function |
---|---|---|
tripole.mx025.nc | master grid file | Creating all subsequent grid or mapping files |
grid_cice_NEMS_mx025.nc | the CICE grid file | used at runtime by CICE6 |
kmtu_cice_NEMS_mx025.nc | the CICE mask file | used at runtime by CICE6 |
mesh.mx025.nc | the ocean and ice mesh file | used at runtime by CICE6, MOM6, and CMEPS |
C384.mx025.tile[1-6].nc | the mapped ocean mask on the ATM tiles | used to create ATM ICs consistent with the fractional grid |
File name | Function |
---|---|
tripole.mx025.[Cu][Cv][Bu].to.Ct.bilinear.nc | the ESMF weights for mapping OCN or ICE output fields from the various stagger locations on the tripole grid to the center (Ct) stagger location on the same tripole grid using bilinear mapping |
tripole.mx025.Ct.to.rect.[destination resolution].[bilinear][conserve].nc | the ESMF weights for mapping variables on the center (Ct) stagger location on the tripole grid to a rectilinear grid with [destination resolution] using either bilinear or conservative mapping |
File name | Function |
---|---|
tripole.mx025.Ct.to.mx[destination resolution].Ct.neareststod.nc | the ESMF weights for mapping the 1/4 CICE ICs to a tripole [destination resolution] using nearest source-to-destination mapping |
File name | Function |
---|---|
ufs.[Default filename].nc | Topo-edits required for UFS application. These are appended to the existing default topo edits file and implemented at run time with the parameter flag ALLOW_LANDMASK_CHANGES=true . All files produced by the cpld_gridgen.sh will be consistent with this run-time land mask. |