NEMO 3.4 : Différence entre versions

Un article de Informaticiens département des sciences de la Terre et l'atmosphère
Aller à: navigation, charcher
(NEMO 3.4 guide)
(Setting up a simulation)
Ligne 45: Ligne 45:
 
===Setting up a simulation===  
 
===Setting up a simulation===  
  
A guide covering the basic aspects of the set-up (namelist, input files) can be found at http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Advanced/How-to-set-up-one-simulation.  
+
A guide covering the basic aspects of the set-up (namelist, input files) can be found [here](http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Advanced/How-to-set-up-one-simulation).  
  
 
====Grid definition====  
 
====Grid definition====  
Ligne 65: Ligne 65:
 
bathy_meter.nc: contains the bathymetry in meters.  
 
bathy_meter.nc: contains the bathymetry in meters.  
  
temperature and salinity: Names and location must be defined in the &namtsd namelist.  
+
temperature and salinity: Names and location must be defined in the &namtsd namelist.
  
 
===Running the model===
 
===Running the model===

Version depuis le 25 de février 2014 à 22:18

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

- First of all, registration is required at NEMO's web site: http://www.nemo-ocean.eu - Download NEMO by entering the following command from the directory where the model will be copied (where "mylogin" is the username selected when registering at NEMO):

svn --username "mylogin" co -r 3819 http://forge.ipsl.jussieu.fr/nemo/svn/branches/2012/dev_v3_4_STABLE_2012

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:

-m COMP: use compiling options referred by COMP. Must be specified the first time the script is called! After that, if not specified, defaults to the last options used. The compiling options available can be found in NEMOGCM/ARCH; the ones that will be used are the ones specified in arch-COMP.fcm.

-n CONF: specifies which configuration to compile; CONF refers to one of the subdirectories in NEMOGCM/CONFIG. If not specified, defaults to the last configuration used. If used with -r, CONF is the name of the new configuration created.

-r REFCONF: reference configuration; allows creating a new configuration based on an existing one (specified by REFCONF). Must be used with -n.

-j#: determines how many parallel processes are used for compilation (-j0: no compilation).

add_key LIST, del_key LIST: adds (or deletes) one or more C pre-processor keys to be used in the compilation, LIST being a list of keys enclosed between double quotes. The list of CPP keys used for a given configuration can be found in the file cpp_CONF.fcm located in the config's directory; the list of all CPP keys available can be found at http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/cpp-keys-v3_4.

clean: cleans a configuration.

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

Modifying the code

There are two ways to modify the code:

  • The subdirectory WORK contains links to all the source files used to build the program. Opening and changing any of these files will modify the original source code (unless the link points to the MY_SRC subdirectory), and take effect on all configurations.
  • The subdirectory MY_SRC can be used to store modified sources. These files are used only when compiling the given configuration, and take precedence over the original code, so copying an original source file from the WORK directory to the MY_SRC directory allows changing the program without modifying the original code.

Setting up a simulation

A guide covering the basic aspects of the set-up (namelist, input files) can be found [here](http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Advanced/How-to-set-up-one-simulation).

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:

jpidta: number of points in the first dimension. jpjdta: number of points in the second dimension. jphgr_msh: type of grid. Setting this to 0 will make NEMO use the grid defined in coordinates.nc; setting it to any other value (1 to 5) makes it define an analytical grid.

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.

coordinates.nc: contains the definition (longitude, latitude, scale factors in each direction) of the grid points in the horizontal grid.

bathy_meter.nc: contains the bathymetry in meters.

temperature and salinity: Names and location must be defined in the &namtsd namelist.

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: ${expname}_${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.

- To compile rebuild_nemo, go in NEMOGCM/TOOLS and execute the following command (where COMP is the compile argument used with the makenemo script): maketools -m COMP -n REBUILD_NEMO

- The program rebuild_nemo uses two arguments: the base name of the files to merge (corresponds to the names of the files, with the process number and the .nc extension removed), and the number of files.