Skip to content

8. Running NEMO

jpolton edited this page May 19, 2022 · 2 revisions

Running the SANH hindcast model in NEMO

Instructions for setting up and running the SANH model in NEMO.

  1. Copy over files

If following this wiki, a RUN_DIRECTORY should have already been created. Inside is your first experiment directory: EXP_01.

Copy over the relevant namelists, .xml files and your xios and nemo executables (xios_server.exe and opa) into the EXP folder using the script::

. ./setup_run.sh

The above script also creates a restarts directory, in which all the restart files are saved.

Move your domain_cfg.nc and coordinates.nc files into your EXP directory. If not there already, move the initial conditions into the $ICS directory.

On livljobs, transfer the OBC, river and ERA5 data into the relevant folders on ARCHER, e.g. ::

scp OUTPUT/1993/* jenjar93@login.archer.ac.uk:/work/n01/n01/jenjar93/SANH/OBC/
scp OUTPUT/TIDES/* jenjar93@login.archer.ac.uk:/work/n01/n01/jenjar93/SANH/TIDES/
scp RIVERS/* jenjar93@login.archer.ac.uk:/work/n01/n01/jenjar93/SANH/RIVERS/
scp ERA5_data/* jenjar93@login.archer.ac.uk:/work/n01/n01/jenjar93/SANH/FORCING/

For ease, move the coordinates.bdy file directly into the EXP folder::

cp $OBC/coordinates.bdy $EXP/

NOTE: make sure this is the 'regular' one and not the TIDES coordinates

  1. Running NEMO from scratch

You can control/modify the output files in the file_def_nemo.xml file. These .xml files are quite unforgiving so be sure to be consistent with the structure.

Modify the paths and filenames in the namelist_cfg file to reflect your files/file locations.

To run NEMO on ARCHER, we use two different run scripts:

  • The short queue (run_script_short.pbs) for 20-min test runs
  • The standard queue (run_script.pbs) for longer runs up to 12 hours

Both scripts needs to be edited for your username, email and project code. Whichever script you use also needs to be reflected in the processors defined in the namelist_cfg file::

jpni        =  30    ! standardqueue:30 ! shortqueue:11      !  jpni   number of processors following i (set automatically if < 1)
jpnj        = 16     ! standardqueue:16 ! shortqueue: 8      !  jpnj   number of processors following j (set automatically if < 1)
jpnij       =  480    ! standardqueue:480 ! shortqueue:88 !  jpnij  number of local domains (set automatically if < 1)

Once ready,submit the job, e.g.::

qsub run_script.pbs
  1. Running NEMO from a restart file

After NEMO has run for 1 year, a series of restart files will have been created and saved in the restarts directory. You can then use these restarts to initialise NEMO for following years.

To run NEMO from a restart, the namelist_cfg should look like::

ln_rstart   = .true.   !  start from rest (F) or from a restart file (T)
  nn_euler    =    1            !  = 0 : start with forward time step if ln_rstart=T
  nn_rstctl   =    2            !  restart control ==> activated only if ln_rstart=T
  !                             !    = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
  !                             !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
  !                             !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
  cn_ocerst_in    = "SANH_00087600_restart"   !  suffix of ocean restart name (input)
  cn_ocerst_indir = "./restarts"         !  directory from which to read input ocean restarts
  cn_ocerst_out   = "restart"   !  suffix of ocean restart name (output)
  cn_ocerst_outdir= "./restarts"         !  directory in which to write output ocean restarts

Note that the cn_ocerst_in file will change depending on what was the last time step.

As we are now initialising from a restart file, we won't need the ICS files anymore. In the namelist_cfg, set::

ln_tsd_init   = .false.   !  Initialisation of ocean T & S with T &S input data (T) or not (F)
ln_tsd_interp = .true.    !  Interpolation of T & S in the vertical input data (T) or not (F)
ln_tsd_tradmp = .false.   !  damping of ocean T & S toward T &S input data (T) or not (F)

Then submit the job script

  1. Rebuilding restarts

In some cases, it may be necessary to test the current NEMO configuration using the short queue. Restart files are only configured to work using the same number of processors as when they were created; i.e. a series of restart files created using the standard queue will not work when submitted for use in the short queue.

In order to get around this, we need to rebuild the restart files into a single .nc file that can be read by any number of cores/processors. This is done using the rebuild.pbs script.

In your $WDIR::

mkdir RESTARTS_rebuild
cp START_FILES/rebuild.pbs RESTARTS_rebuild
cd RESTARTS_rebuild

Edit the path in the rebuild.pbs files to reflect the location of your restart files, and the number of cores used to create them, e.g.::

/work/n01/n01/nibrun/NEMO/AMM15_v3_6_STABLE_package/NEMOGCM/TOOLS/REBUILD_NEMO/rebuild_nemo -t 1 /work/n01/n01/jenjar93/SANH/RUN_DIRECTORY/restarts/SANH_00087600_restart 480

Edit for your project code and then submit the script::

qsub rebuild.pbs

This will create a single SANH_00087600_restart.nc in your restarts directory. Simply define this restart file in the namelist_cfg, being sure to add the .nc, and it can then be used for any number of processors.

Clone this wiki locally