Skip to content

Porting Notes

jmm edited this page Jul 26, 2018 · 1 revision

Porting notes

Introduction remarks:

NEMO4 is a major release of the NEMO modelisation system. It is the result of a simplification procedure started in 2017. Simplification occurs in many aspect of the code :

  1. Reorganization of the tree structure of NEMO, now mainly under src/ directory.
  2. Obsolete features of NEMO removed (e.g: Neptune effect, or no-slip accurate).
  3. Externalization of all mesh building actions : NEMO now read a domain_cfg.nc file containing basic input field (ex-coordinates, bathymetry, vertical metrics ... ). A tool is proposed for building the domain_cfg.nc file from the input files used in NEMO_3.6.
  4. As a consequence, the core of NEMO has no more differentiation according to the config (e.g: no more hard coded changes of e1, e2 in some straits, according to cp_cfg and jp_cfg). If modifications are relevant in the code they are concentrated in usrdef_xxx modules (e.g. usrdef_fmask.F90 where shlat conditions are changed in some straits). But for changes in the horizontal metrics, previously performed in the domhgr.F90 module, no changes are reported in usrdef_domhgr.F90 (which is used only for defining different --and user dependent-- domain.)

According to these introduction remarks, DCM need a strong lift-up to follow this new NEMO version. We take the opportunity to clean up DCM from obsolescence (e.g: systematic use of bash instead of ksh in the scripts), to add functionalities (such as the ability to easy install and run NEMO test-cases, or NEMO reference configurations) and to develop this new version on GitHub.

This remodeled version of DCM is dedicated to NEMO4 and no backward compatibility with previous version is provided. However, the rationale stays the same:

  • 2 complementary parts:
    • DCMTOOLS for building the code for a given configuration (hierarchical source management, compilation). The DCM command used so far are maintained and the DCM user will not feel the NEMO differences at this level.
    • RUNTOOLS for running complex ocean configurations. Centralisation of the management of a simulation from a CTL directory, with easy commands such as run_nemo.sh !

DCM coding rules

  • all DCM tools in bin/ are prefixed by dcm_, no extension, bash assumed.
  • all fortran code in DRAKKAR ( modified from NEMO reference) uses #if defined key_drakkar statement to clearly identify drakkar modifications. (This imply thay if key_drakkar is defined in CPP.keys, drakkar modifications are taken into account, else the code is the standard NEMO code). makefile in the config directory, manage this cpp key according to the REFONLYkeyword.
  • When a namelist block is modified with respect to the standard one, we in fact put the modifications only in a second independent block suffixed with _drk (e.g.: namrun_drk). This allow the final namelists to be compatible between DRAKKAR and NEMO standard versions (in this latter case, drakkar namelist block are just ignored.

DCM layout:

  • You clone DCM from github with :

git clone https://github.com/meom-group/DCM.git DCM_4.0beta

  • Now in DCM_4.Obeta directory you have:
    • DCMTOOLS DOC License README.md RUNTOOLS
  • After this cloning, you need to load the NEMO reference version (at the svn revision compatible with the DRAKKAR modified files), in DCMTOOLS/NEMOREF:

cd DCMTOOLS/NEMOREF
./getnemoref.sh

  • DCMTOOLS/DRAKKAR and DCMTOOLS/NEMOREF hold NEMO4 sub-directory, where the nemo4 system take place.

cd DCMTOOLS/DRAKKAR/NEMO4
ls

arch cfgs doc ext mk src tests tools which is the new NEMO layout.

  • arch holds the arch file for fcm compilation
  • cfgs holds the reference configurations
  • ext holds all external packages ( e.g: IOIPS AGRIF and FCM)
  • mk holds the compilation tools based on ext/FCM
  • src holds the core NEMO code (fortran90)
  • tests holds the test-case configurations
  • tools holds the NEMO associated tools ( e.g: WEIGHTS, MPP_PREP ... )

Porting DCMTOOLS

  • DCM tools are now in $HOMEDCM/bin
  • templates file (makefile, module_example, bash setup files, CPP.keys, etc...) are in $HOMEDCM/templates

Porting NEMO tools :

  • porting WEIGHTS, MPP_PREP, REBUILD_MPP OK
  • problem detected for OBSTOOLS : link to the core NEMO routine is dangerous as changing files there, ( needed because of compilation error) also changes the files in core NEMO. A ticket will be sent.

Porting NEMO code :

  • In order to do this porting, we first check the differences between DRAKKAR and NEMOREF in the last NEMODRAK revision.
  • Then we try to implement the relevant changes in the NEMO4 code (in the DRAKKAR tree, of course).
  • A decicated page is used to describe this action, in order not to fill up this page.

Porting RUNTOOLS

Clone this wiki locally