NEMO 3.4 guide

Getting the code

(local note)
. s.ssmuse.dot nemo-3.4
clone_nemo
clones the nemo 3.4 image from our git repository (st/skynet/beluga/participating workstations/guillimin)
the s.f90 "nemo architecture" can be used to compile with our tools

The model will be located in dev_v3_4_STABLE_2012/NEMOGCM.

Compilation

Compilation of the model can be done by calling the script makenemo in NEMOGCM/CONFIG. Help for this script can be found by entering makenemo -h.

Common options:

Once a configuration has been compiled, the three following subdirectories should appear in the configuration directory: EXP00, MY_SRC, WORK.

Example:

./makenemo -n GLK -j20 -m s.f90 add_key "key_trabbl key_lim2 key_ldfslp key_traldf_c2d key_dynldf_c3d key_zdftke key_zdfddm key_glk \
           key_trddyn key_trdtra key_dynspg_flt key_mpp_mpi key_mpp_rep"

Modifying the code

There are two ways to modify the code:

Setting up a simulation

A guide covering the basic aspects of the set-up (namelist, input files) can be found here.

Grid definition

Parameters for the horizontal grid are hard-coded in the model. They are typically stored in header files named par_${gridconf}.h90, which are then used in par_oce.F90, depending on the CPP key that is defined. In order to define a new grid, the best way is to copy one of the header files to use as a template, and then add the new header file in par_oce, with its own CPP key. The important parameters are:

The vertical grid depends mostly on the bathymetry file used.

Parameters for the vertical grid are mostly defined in the namelist. The only exception is the maximal number of levels (jpkdta), which is defined in the par_oce header files.

Required input

All files described below must be in NetCDF format.

Running the model

The subdirectory EXP00 contains a link to the NEMO executable (opa) as well as a namelist containing various parameters for the run. To start a simulation, copy all necessary input files in EXP00, and then execute opa from that directory.

To run the model with MPI, simply make sure that the program was compiled with key_mpp_mpi enabled. When the model is executed, it will automatically subdivide the horizontal domain based on the number of processes available.

Outputs

Output files are written in EXP00. The outputs for the ocean dynamics are written in four NetCDF files, with names under the following format:

${cn_exp}_${timestep}_${startdate}_${enddate}_grid_[TUVW].nc

Other files might be produced, for instance if sea ice was modelled.

If the model was running using MPI, each output file will be split in several parts, one for each processor. A postprocessing tool (rebuild_nemo) to combine all subparts into one single file is provided with NEMO, but it must be compiled.

Restarting a simulation

Besides the outputs, NEMO will produce a number of restart files (name format: ${cn_exp}_${timestep}_${cn_ocerst_out}_${procnb}.nc), which can be used to restart a run. This can be done by making the following changes on the namelist:

ln_rstart: must be set to true.

nn_it000, nn_itend: nn_it000 should be set to the first time step of the restarted run, namely the time step of the restart file + 1. nn_itend should be set accordingly.

nn_rstctl: this should be set to 2. That way, the initial date will be taken from the restart file, saving the trouble of setting nn_date0 to a consistent value.

cn_ocerst_in: normally, this should correspond to the restart name suffix (cn_ocerst_out), but this won't work as expected. Instead, this parameter must be set to the name of the restart file (without the process number and the file extension).

Note: rebuilding the restart file is not necessary, unless the restart runs on a different number of processors!