2. Build domain configuration file - NOC-MSM/Regional-NEMO-Medusa GitHub Wiki
To create a new configuration a domain configuration file must be created that defines the grid. This only needs to be done once for a new configuration. This includes bathymetry, depth and horizontal grid discretisation.
Edit make_paths.sh
as necessary, then execute
. ./make_paths.sh
. ./make_directories.sh
. ./make_tools.sh
Start with a coordinates file from a parent NEMO simulation (E.g. Global 1/12deg ORCA). This parent coordinates file come from JASMIN (http://gws-access.jasmin.ac.uk/public/nemo/runs/ORCA0083-N06/domain/coordinates.nc) and is renamed as coordinates_ORCA_R12.nc
. This file stores the horizontal grid information.
The following script simply crops out the area of interest, preserving the resolution. (This should be done in a fresh kernel as the required nco
tools can clash with other modules previously used.)
. ./make_coordinates_from_parent_EAFRICA.sh
The output is a coordinates.nc
file.
For more complex problems, such as mesh refinement, the AGRIF tool can be used. This AGRIF NESTING tool is used to generate child grid horizontal coordinates from the parent grid. To control this one needs to figure out the indices of the child domain start and end, and also the resolution scale factor. This information is edited in the BUILD_CFG/DOMAIN/namelist.input
file. An outline workflow is given (and commented out) in the above script.
This is managed by the
. ./make_bathymetry_from_parent_EAfrica.sh
script, which extracts the chosen subdomain from the parent model bathymetry file.
Minor modifications can then be applied to the output bathymetry to open straits, set a minimum depth, or handle spurious land or inland lakes.
The output is a $DOMAIN/bathy_meter.nc
file.
Finally generate the domain_cfg.nc
file using the coordinates.nc
, bathy_meter.nc
. This is done in the tools directory using make_domain_cfg.sh
script. The tools used are the DOMAINcfg
and REBUILD_NEMO
tools. The DOMAINcfg
tool is submitted as a slurm job.
If making changes to the configuration, these are controlled by the namelist_cfg
file. Ensure this has the appropriate parameters and number of lat,lon,depth levels etc set.
For example the lateral size of the domain can be extracted from bathy_meter.nc
using ncdump -h bathy_meter.nc
, then namelist can be edited accordingly e.g.:
vi namelist_cfg
...
jpidta = 57 ! 1st lateral dimension ( >= jpi )
jpjdta = 124 ! 2nd " " ( >= jpj )
jpkdta = 75 ! number of levels ( >= jpk )
...
When ready, run:
cd SCRIPTS
. ./make_domain_cfg.sh
creating $DOMAIN/domain_cfg.nc
Below shows in details the coordinates (latitudes/longitudes) used for the regional model of the EAFRICA for a resolution of 1/12°.
Latitudes bounds : [-1.333213°S ; -11.50523°S ]
Longitudes bounds : [38.41667°E ; 43.08333°E ]
The dimensions of the domain_cfg.nc
are :
netcdf domain_cfg {
dimensions:
x = 57 ;
y = 124 ;
z = 75 ;
t = UNLIMITED ; // (1 currently)