FWIW these were some old instructions @marshallward sent to me in 2014!
Creating the mask (non-mosaic)
- Copy
check_mask and grid_spec.nc into a common directory
- To generate every possible (uniform) layout mask:
check_mask --grid_file grid_spec.nc
- To generate a specific layout (eg. 8, 8):
check_mask --grid_file grid_spec.nc --layout 8,8
NOTE: If there are no land cells, then it will report “success” but will not
generate a file!
e.g. try
check_mask --grid_file grid_spec.nc --layout 8,5
Creating the mask (mosaic)
- Copy these files into a common directory:
check_mask
ocean_mosaic.nc
ocean_hgrid.nc
topog.nc
- Generate the mask
./check_mask --grid_file ocean_mosaic.nc --ocean_topog topog.nc --layout 32,30
Using the masks
- Copy the mask table into MOM’s
INPUT directory, e.g.:
cp mask_table.199.32x30 /path/to/mom/INPUT/ocean_mask_table
cp mask_table.199.32x30 /path/to/mom/INPUT/ice_mask_table
In this case, both ocean and ice share the same grid, so I use the same mask
file.
These are the default file names. If a file with this name exists, then MOM
reads it and uses the mask.
You can set the filename explicitly in input.nml:
&ocean_model_nml
#...
mask_table='some_filename'
/
same for ice_model_nml
Additional info from me
check_mask tells you how many CPUS are masked (e.g. 199 in above example). You have to subtract that number of CPUs from the CPU count in your config.yaml.
Some gotchas: sometimes it will just complain about a bad domain decomposition, so in that case I just remove one of the masked cells in the file (one of the lines) and change the header and name to reflect that it is now one less masked cell. Usually it works by removing one, but in rare cases I had to remove 2 or 3.