Repository navigation
2. Create the Domain
Once XIOS, NEMO, and Tools have been successfully compiled, the domain can be generated using the script make_domain.sh.
For the hindcast runs of SANH, we use the ORCA bathymetry at a 1/12th degree resolution. For SANH, this is done using a subdomain of the GLOBAL_ORCA_R12 coordinates in create_coordinates.nc. Open a fresh terminal window to avoid module conflicts.
Edit thenamelist.input for your chosen parent coordinates file, region, and resolution (compared to the parent file) e.g.:
&coarse_grid_files
parent_coordinate_file = 'coordinates_ORCA_R12.nc'
/
&bathymetry
/
&nesting
imin = XXXX
imax = XXXX
jmin = XXXX
jmax = XXXX
rho = 1
rhot = 1
bathy_update = false
Load the correct modules (tested Jun 2022) and copy the namelist.input file to the Tools directory:
module swap craype-network-ofi craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load cray-hdf5-parallel/1.12.0.7
module load cray-netcdf-hdf5parallel/4.7.4.7
cd $TDIR/NESTING
cp $GITCLONE/DOMAIN/namelist.input $TDIR/NESTING/
Download the parent coordinates file:
wget http://gws-access.jasmin.ac.uk/public/nemo/runs/ORCA0083-N06/domain/coordinates.nc -O ./coordinates_ORCA_R12.nc
Run the AGRIF tool to generate the coordinates:
./agrif_create_coordinates.exe
cp 1_coordinates_ORCA_R12.nc $DOMAIN/coordinates.nc
cd $SCRIPTS
NOTE: the above can also be run as a serial job, but it is not necessary for this model configuration.
The bathymetry is created using the NEMO tools, submitted as a serial job (job_create_bathy.slurm), in a new terminal window.
First, copy the namelist_reshape_billin_eORCA12 file to the $DOMAIN directory, and edit for your input_file (in this case, the ORCA bathymetry).
The bathy_meter.nc file is generated by using the SCRIP tools in NEMO (modules tested Jul 2022), and editing the paths for your TOOLS directory (note the $TDIR shortcut does not work when using a slurm job script):
module swap craype-network-ofi craype-network-ucx
module swap cray-mpich cray-mpich-ucx
module load cray-hdf5-parallel/1.12.0.7
module load cray-netcdf-hdf5parallel/4.7.4.7
XX_YOUR_TOOLS_DIR_XX/WEIGHTS/scripgrid.exe namelist_reshape_bilin_eORCA12
XX_YOUR_TOOLS_DIR_XX/WEIGHTS/scrip.exe namelist_reshape_bilin_eORCA12
XX_YOUR_TOOLS_DIR_XX/WEIGHTS/scripinterp.exe namelist_reshape_bilin_eORCA12
To generate the file, submit the job:
sbatch job_create_bathy.slurm
Once the bathy_meter.nc file is created, fix very shallow (<10m) bathymetry values to account for wetting/drying:
ncap2 -s 'where(Bathymetry < 0) Bathymetry=0' bathy_meter.nc tmp1.nc
ncap2 -s 'where(Bathymetry < 10 && Bathymetry > 0) Bathymetry=10' tmp1.nc -O bathy_meter.nc
rm tmp1.nc
Once you have coordinates.nc and bathy_meter.nc, make the domain configuration file (domain_cfg.nc) in a new terminal window.
The tools used are the DOMAINcfg and REBUILD_NEMO tools. The DOMAINcfg tool is submitted as a slurm job.
Copy over the namelist_cfg into the DOMAINcfg directory and edit the x,y coordinate bounds (i,j) appropriately:
cp $GITCLONE/DOMAIN/namelist_cfg $TDIR/DOMAINcfg/namelist_cfg
Link your coordinates and bathymetry to the TOOLS domain directory:
ln -s $DOMAIN/coordinates.nc $TDIR/DOMAINcfg/
ln -s $DOMAIN/bathy_meter.nc $TDIR/DOMAINcfg/
Copy an updated file into the domain config directory (edited to incorporate z-s hybrid namdom)::
cp $GITCLONE/DOMAIN/domzgr_jelt_changes.f90 $TDIR/DOMAINcfg/src/domzgz.f90
The domain creation is submitted as a job:
cd $TDIR/DOMAINcfg
cp $GITCLONE/DOMAIN/job_create_1proc.slurm $TDIR/DOMAINcfg/job_create.sh
sbatch job_create_domain.sh
This will create a domain_cfg.nc file that needs to be copied into your $DOMAIN directory (being sure to keep track of the parent bathymetry)::
cp $TDIR/DOMAINcfg/domain_cfg.nc $DOMAIN/domain_cfg_ORCA12.nc
cd $DOMAIN
NOTE: For higher resolution domains, multiple processors may need to be used. The domain_cfg.nc will therefore be outputted as multiple files, depending on how many processors defined in the job script, and will need to be rebuilt into a single file.