NEMO-code Repository

These notes describe the GEOTRACES Arctic project. This project is currently using the same NEMO code base as the Salish Sea MEOPAR NEMO-code repository

The NEMO-code repo is a Mercurial repository in which is maintained the merger of the trunk of the main NEMO svn repository and the changes made by the Salish Sea MEOPAR project team.


The NEMO-code repository is a private repository for members of the Salish Sea MEOPAR project team and associated teams: GEOTRACES Arctic included. That is because it contains parts of the NEMO codebase. Although that codebase is openly licensed it’s developers require registration to access the code.

If you have completed that registration and would like access to the NEMO-code, please contact Susan Allen, the Salish Sea MEOPAR project leader.

Getting the Code

Team members using SSH key authentication on Bitbucket may clone the NEMO-code repo with:

hg clone ssh:// NEMO-code

For password authentication use:

hg clone https://<you> NEMO-code

where <you> is your Bitbucket user id.


Making Gyre-Lobster with 2 Extra Tracers

To create a this new configuration based on, GYRE_LOBSTER use:

./makenemo -r GYRE_LOBSTER -n YourTrcGyreLobster -m ocean add_key "key_netcdf4 key_nosignedzero key_my_trc"

That will use the existing GYRE_LOBSTER configuration as a basis to build a new configuration called YourTrcGyreLobster with the ocean architecture definitions. The C Pre-Processor (CPP) keys key_netcdf4 and key_nosignedzero will be added to configurations. The key key_my_trc added the code in TOP_SRC/MY_TRC to the compile. The resulting configuration, including a compiled and link NEMO executable, is located in NEMO-code/NEMOGCM/CONFIG/YourTrcGyreLobster.

See ./makenemo -h for details of options and sub-commands.

Running the Model

For now, we will run the model in the EXP00 directory. In future, once we have stabilized a few model configurations, we will move to running outside.

Inside EXP00 there are two namelist files: namelist_lobster and namelist_top, two output definition files: iodef.xml and xmlio_server.def and three links.

By including the key_my_trc flag we have added two tracers but have not defined them in the io file. We need to add four lines.

<field id="TR_7"     description="Northern Source"                               unit="none" />
<field id="TR_8"     description="Southern Source"                               unit="none" />
<field ref="TR_7"     />
<field ref="TR_8"     />

To get these lines and put them in the correct place, copy into your EXP00 the iodef.xml from the configuration MyTrcGyreLobster

cd YourGyreLobster/EXP00
cp ../../MyTrcGyreLobster/EXP00/iodef.xml .

We also need to add these tracers to namelist_top to initialize them

sn_tracer(7)   = 'TR_7'  , 'Southern Source            ',  'none      ' ,  .false.     ,  .false.
sn_tracer(8)   = 'TR_8'  , 'Northern Source            ',  'none      ' ,  .false.     ,  .false.

To get these lines and put them in the correct place, copy into your EXP00 the namelist_top from the configuration MyTrcGyreLobster

cp ../../MyTrcGyreLobster/EXP00/namelist_top .

In addition we need to modify two of the fortran codes. First we need a version of trcnam_trp.F90 that does not assume tracer damping has been set. Files that are changed from the base configuration go in your MY_SRC directory.

cd ../MY_SRC
cp ../../MyTrcGyreLobster/MY_SRC/trcnam_trp.F90 .

Second, the generic tracer source sink algorithm put the tracers into the Pacific... but our simulation is the Atlantic. We need a different trcsms_my_trc.F90. This is also the file you should edit to simulate your traces of choice.

cp ../../MyTrcGyreLobster/MY_SRC/trcsms_my_trc.F90 .

Now we need to remake the code. Go back upto CONFIG and run:

cd ../../
./makenemo -n YourTrcGyreLobster

Then we can run the code by going back into EXP00 and typing

cd YourTrcGyreLobster/EXP00
nice ./opa &

After a good little while, you will see

namelist read -->  F F nemo.x                                                                                              ionemo
filename : iodef.xml
Le parsing est termine !!!
trc_rst_wri_my_trc: No specific variables to write on unit           1  at time         4318        4320
trc_rst_wri_my_trc: No specific variables to write on unit           1  at time         4319        4320
trc_rst_wri_my_trc: No specific variables to write on unit           1  at time         4320        4320

and then your job is done. Results from the tracers are in:

you can look at this using a notebook, An example is at:


Making ORCA-Lim-PISCES with 2 Extra Tracers

This is almost identical to above except:

  • In namelist_top these are traces sn_tracer(25) and sn_tracer(26) as PISCES has more tracers. Note, however, for some undetermined reason, they are still called TR_7 and TR_8.
  • You don’t need to copy a new version of trcnam_trp.F90
  • and don’t forget that you need to download all the forcing files for ORCA-LIM-PISCES