Pierre-Yves Barriat 7 rokov pred
rodič
commit
6a8837f120
72 zmenil súbory, kde vykonal 8209 pridanie a 0 odobranie
  1. 484 0
      .gitignore
  2. 2 0
      AUTHORS
  3. 12 0
      BUGS
  4. 4 0
      NEWS
  5. 24 0
      TODO
  6. 143 0
      archive/librunscript.sh
  7. 108 0
      archive/nemo.cfg
  8. 372 0
      archive/run.sh
  9. 317 0
      coral
  10. 4 0
      setup-coral.sh
  11. 6 0
      templates/files.txt
  12. 39 0
      templates/lemaitre2_regional/data.cfg
  13. 22 0
      templates/lemaitre2_regional/experiment.cfg
  14. 19 0
      templates/lemaitre2_regional/job.cfg
  15. 485 0
      templates/lemaitre2_regional/namelists/build_namelist_cfg.sh
  16. 38 0
      templates/lemaitre2_regional/namelists/namelist_ice_cfg
  17. 19 0
      templates/lemaitre2_regional/programs.cfg
  18. 125 0
      templates/lemaitre2_regional/xios_config/context.xml
  19. 180 0
      templates/lemaitre2_regional/xios_config/file_def_nemo-lim.xml
  20. 153 0
      templates/lemaitre2_regional/xios_config/file_def_nemo-opa.xml
  21. 30 0
      templates/lemaitre2_regional/xios_config/iodef.xml
  22. 1 0
      templates/lemaitre2_xios-2.0/.coral_template
  23. 32 0
      templates/lemaitre2_xios-2.0/data.cfg
  24. 22 0
      templates/lemaitre2_xios-2.0/experiment.cfg
  25. 20 0
      templates/lemaitre2_xios-2.0/job.cfg
  26. 407 0
      templates/lemaitre2_xios-2.0/namelists/build_namelist_cfg.sh
  27. 36 0
      templates/lemaitre2_xios-2.0/namelists/namelist_ice_cfg
  28. 19 0
      templates/lemaitre2_xios-2.0/programs.cfg
  29. 125 0
      templates/lemaitre2_xios-2.0/xios_config/context.xml
  30. 180 0
      templates/lemaitre2_xios-2.0/xios_config/file_def_nemo-lim.xml
  31. 153 0
      templates/lemaitre2_xios-2.0/xios_config/file_def_nemo-opa.xml
  32. 30 0
      templates/lemaitre2_xios-2.0/xios_config/iodef.xml
  33. 90 0
      templates/scripts/rebuild.sh
  34. 10 0
      templates/scripts/repomaster.txt
  35. 264 0
      templates/scripts/skeleton.sh
  36. 1 0
      templates/storm/.coral_template
  37. 31 0
      templates/storm/data.cfg
  38. 22 0
      templates/storm/experiment.cfg
  39. 7 0
      templates/storm/job.cfg
  40. 406 0
      templates/storm/namelists/build_namelist_cfg.sh
  41. 36 0
      templates/storm/namelists/namelist_ice_cfg
  42. 19 0
      templates/storm/programs.cfg
  43. 125 0
      templates/storm/xios_config/context_nemo.xml
  44. 194 0
      templates/storm/xios_config/domain_def_nemo.xml
  45. 199 0
      templates/storm/xios_config/field_def_nemo-lim.xml
  46. 826 0
      templates/storm/xios_config/field_def_nemo-opa.xml
  47. 165 0
      templates/storm/xios_config/file_def_nemo-lim.xml
  48. 141 0
      templates/storm/xios_config/file_def_nemo-opa.xml
  49. 30 0
      templates/storm/xios_config/iodef.xml
  50. 31 0
      templates/zenobe_xios-1.0/data.cfg
  51. 22 0
      templates/zenobe_xios-1.0/experiment.cfg
  52. 30 0
      templates/zenobe_xios-1.0/job.cfg
  53. 406 0
      templates/zenobe_xios-1.0/namelists/build_namelist_cfg.sh
  54. 38 0
      templates/zenobe_xios-1.0/namelists/namelist_ice_cfg
  55. 19 0
      templates/zenobe_xios-1.0/programs.cfg
  56. 55 0
      templates/zenobe_xios-1.0/xios_config/context.xml
  57. 173 0
      templates/zenobe_xios-1.0/xios_config/file_def.xml
  58. 33 0
      templates/zenobe_xios-1.0/xios_config/iodef.xml
  59. 32 0
      templates/zenobe_xios-2.0/data.cfg
  60. 22 0
      templates/zenobe_xios-2.0/experiment.cfg
  61. 30 0
      templates/zenobe_xios-2.0/job.cfg
  62. 407 0
      templates/zenobe_xios-2.0/namelists/build_namelist_cfg.sh
  63. 36 0
      templates/zenobe_xios-2.0/namelists/namelist_ice_cfg
  64. 19 0
      templates/zenobe_xios-2.0/programs.cfg
  65. 125 0
      templates/zenobe_xios-2.0/xios_config/context.xml
  66. 180 0
      templates/zenobe_xios-2.0/xios_config/file_def_nemo-lim.xml
  67. 153 0
      templates/zenobe_xios-2.0/xios_config/file_def_nemo-opa.xml
  68. 30 0
      templates/zenobe_xios-2.0/xios_config/iodef.xml
  69. 15 0
      utils/tools.inc
  70. 8 0
      zone/iterdate.sh
  71. 159 0
      zone/run.dates.sh
  72. 9 0
      zone/t.sh

+ 484 - 0
.gitignore

@@ -0,0 +1,484 @@
+# ---> NetCDF
+*.nc
+
+# ---> C
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+
+# ---> C++
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# ---> CMake
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Makefile
+cmake_install.cmake
+install_manifest.txt
+
+# ---> CVS
+/CVS/*
+*/CVS/*
+.cvsignore
+*/.cvsignore
+
+# ---> Eclipse
+*.pydevproject
+.metadata
+.gradle
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+
+# Eclipse Core
+.project
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# TeXlipse plugin
+.texlipse
+
+# ---> Emacs
+# -*- mode: gitignore; -*-
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+
+# cask packages
+.cask/
+
+# ---> Kate
+# Swap Files #
+.*.kate-swp
+.swp.*
+
+# ---> LibreOffice
+# LibreOffice locks
+.~lock.*#
+
+# ---> LyX
+# Ignore LyX backup and autosave files
+# http://www.lyx.org/
+*.lyx~
+*.lyx#
+
+# ---> Matlab
+##---------------------------------------------------
+## Remove autosaves generated by the Matlab editor
+## We have git for backups!
+##---------------------------------------------------
+
+# Windows default autosave extension
+*.asv
+
+# OSX / *nix default autosave extension
+*.m~
+
+# Compiled MEX binaries (all platforms)
+*.mex*
+
+# Simulink Code Generation
+slprj/
+
+# ---> Mercurial
+.hg/
+.hgignore
+.hgsigs
+.hgsub
+.hgsubstate
+.hgtags
+
+# ---> Python
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# ---> R
+# History files
+.Rhistory
+.Rapp.history
+
+# Example code in package build process
+*-Ex.R
+
+# RStudio files
+.Rproj.user/
+
+# produced vignettes
+vignettes/*.html
+vignettes/*.pdf
+
+# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
+.httr-oauth
+
+# ---> SVN
+.svn/
+
+# ---> SublimeText
+# cache files for sublime text
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+
+# workspace files are user-specific
+*.sublime-workspace
+
+# project files should be checked into the repository, unless a significant
+# proportion of contributors will probably not be using SublimeText
+# *.sublime-project
+
+# sftp configuration file
+sftp-config.json
+
+# ---> TeX
+## Core latex/pdflatex auxiliary files:
+*.aux
+*.lof
+*.log
+*.lot
+*.fls
+*.out
+*.toc
+
+## Intermediate documents:
+*.dvi
+*-converted-to.*
+# these rules might exclude image files for figures etc.
+# *.ps
+# *.eps
+# *.pdf
+*.png
+
+## Bibliography auxiliary files (bibtex/biblatex/biber):
+*.bbl
+*.bcf
+*.blg
+*-blx.aux
+*-blx.bib
+*.brf
+*.run.xml
+
+## Build tool auxiliary files:
+*.fdb_latexmk
+*.synctex
+*.synctex.gz
+*.synctex.gz(busy)
+*.pdfsync
+
+## Auxiliary and intermediate files from other packages:
+
+
+# algorithms
+*.alg
+*.loa
+
+# achemso
+acs-*.bib
+
+# amsthm
+*.thm
+
+# beamer
+*.nav
+*.snm
+*.vrb
+
+#(e)ledmac/(e)ledpar
+*.end
+*.[1-9]
+*.[1-9][0-9]
+*.[1-9][0-9][0-9]
+*.[1-9]R
+*.[1-9][0-9]R
+*.[1-9][0-9][0-9]R
+*.eledsec[1-9]
+*.eledsec[1-9]R
+*.eledsec[1-9][0-9]
+*.eledsec[1-9][0-9]R
+*.eledsec[1-9][0-9][0-9]
+*.eledsec[1-9][0-9][0-9]R
+
+# glossaries
+*.acn
+*.acr
+*.glg
+*.glo
+*.gls
+
+# gnuplottex
+*-gnuplottex-*
+
+# hyperref
+*.brf
+
+# knitr
+*-concordance.tex
+*.tikz
+*-tikzDictionary
+
+# listings
+*.lol
+
+# makeidx
+*.idx
+*.ilg
+*.ind
+*.ist
+
+# minitoc
+*.maf
+*.mtc
+*.mtc[0-9]
+*.mtc[1-9][0-9]
+
+# minted
+_minted*
+*.pyg
+
+# morewrites
+*.mw
+
+# mylatexformat
+*.fmt
+
+# nomencl
+*.nlo
+
+# sagetex
+*.sagetex.sage
+*.sagetex.py
+*.sagetex.scmd
+
+# sympy
+*.sout
+*.sympy
+sympy-plots-for-*.tex/
+
+# TikZ & PGF
+*.dpth
+*.md5
+*.auxlock
+
+# todonotes
+*.tdo
+
+# xindy
+*.xdy
+
+# WinEdt
+*.bak
+*.sav
+
+# ---> TortoiseGit
+# Project-level settings
+/.tgitconfig
+
+# ---> Vim
+[._]*.s[a-w][a-z]
+[._]s[a-w][a-z]
+*.un~
+Session.vim
+.netrwhist
+*~
+
+# ---> Windows
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# ---> WordPress
+*.log
+.htaccess
+sitemap.xml
+sitemap.xml.gz
+wp-config.php
+wp-content/advanced-cache.php
+wp-content/backup-db/
+wp-content/backups/
+wp-content/blogs.dir/
+wp-content/cache/
+wp-content/upgrade/
+wp-content/uploads/
+wp-content/wp-cache-config.php
+wp-content/plugins/hello.php
+
+/readme.html
+/license.txt
+

+ 2 - 0
AUTHORS

@@ -0,0 +1,2 @@
+Damien François <damien.francois@uclouvain.be>
+Pierre-Yves Barriat <pierre-yves.barriat@uclouvain.be>

+ 12 - 0
BUGS

@@ -0,0 +1,12 @@
+Report:
+======
+
+Report bugs to Pierre-Yves Barriat <pierre-yves.barriat@uclouvain.be>
+
+Known bugs and caveats:
+======================
+
+  - Tested for Slurm on Lemaitre2
+  - Tested for PBS on Zenobe
+  - Tested for interactive mode on Storm
+

+ 4 - 0
NEWS

@@ -0,0 +1,4 @@
+2016-02-24
+==========
+
+  - create initial repository

+ 24 - 0
TODO

@@ -0,0 +1,24 @@
+Elements du script original non repris
+======================================
+
+- trap cleanup
+- "Remove all leftover output files from previous legs" line 237 of PYB's run.sh
+- "Check for NEMO success" line 290 of PYB's run.sh
+
+Travail futur
+=============
+
+- retirer toutes les redondances dans les définitions des paramètres
+- automatiser le déployement conjoint de nemo xios et coral (playbook ansible)
+- pourquoi pas un 'fromdir' pour permettre d'aller rechercher les restart dans les archives
+- attention les  for v in grid_U grid_V grid_W grid_T icemod SBC SBC_scalar scalar dans skeleton sont définis dans le xml de xios
+
+Petites corrections
+===================
+
+- [√] mettre nem_time_step_sec, etc. dans experiment.cfg
+- [√] Attention duplication de parametres nombre de processors
+- [√] les BC et INIT de ligne 245 de skeleton devraient être des paramètres
+- [√] coral ligne 303: remoter le rm -rf avant le sbatch ?!
+- [√] remove archive et zone du repository
+

+ 143 - 0
archive/librunscript.sh

@@ -0,0 +1,143 @@
+# librunscript.sh is a library of shell script functions that can be used in
+# NEMO run scripts.
+#
+# Usage: source ./librunscript.sh
+
+# Function info writes information to standard out.
+#
+# Usage: info MESSAGE ...
+#
+function info()
+{
+    echo "*II* $@"
+}
+
+# Function error writes information to standard out and exits the script with
+# error code 1.
+#
+# Usage: error MESSAGE ...
+#
+function error()
+{
+    echo "*EE* $@"
+    exit 1
+}
+
+# Function cleanup is called automatically by trapping signals. It is supposed
+# to clean up after interruptions.
+function cleanup()
+{
+    [[ -n "${tempfile:-}" ]] && if [ -r ${tempfile} ]
+    then
+        rm -f ${tempfile}
+    fi
+}
+trap 'cleanup' EXIT SIGHUP SIGINT SIGTERM
+
+# Function has_config checks it's arguments for matches in the $config variable
+# and returns true (0) or false (1) accordingly. Optionally, the first argument
+# can be either "all" (all arguments must match) or "any" (at least one
+# argument must match). If the first argument is neither "all" nor "any", the
+# function behaves like "all" was given as the first argument.
+#
+# Usage: has_config [all|any] ARGS ...
+#
+# Syntax rules:
+#
+# The $config variable takes a list of names (typically software components),
+# separated by white spaces:
+#
+# config="foo bar baz"  # Specifies three components: 'foo', 'bar', and 'baz'
+#
+# It is possible to add comma-separated lists of options to components. The
+# list is separated from the component by a colon:
+#
+# config="foo bar:qux,fred baz:plugh"  # Adds the options 'qux' and 'fred' to
+#                                      # component 'bar' as well as option
+#                                      # 'plugh' to  component 'baz'
+#
+# When using the has_config function to check the $config variable, it is
+# important to list every component-option pair separately. To check for both
+# the 'qux' and 'fred' options of component 'bar' in the above example, use:
+#
+# has_config bar:qux bar:fred && echo "Got it!"
+#
+function has_config()
+{
+    # If called without arguments, return false
+    (( $# )) || return 1
+
+    # If $config unset or empty, return false
+    [[ -z "${config:-}" ]] && return 1
+
+    local __c
+    local __m
+
+    # If first argument is "any" then only one of the arguments needs to match
+    # to return true. Return false otherwise
+    if [ "$1" == "any" ]
+    then
+        shift
+        for __c in "$@"
+        do
+            for __m in $config
+            do
+                [[ "$__m" =~ "${__c%:*}" ]] && [[ "$__m" =~ "${__c#*:}" ]] && return 0
+            done
+        done
+        return 1
+    fi
+
+    # If first argument is "all", or neither "any" nor "all", all arguments
+    # must match to return true. Return false otherwise.
+    [[ "$1" == "all" ]] && shift
+
+    local __f
+    for __c in "$@"
+    do
+        __f=0
+        for __m in $config
+        do
+            [[ "$__m" =~ "${__c%:*}" ]] && [[ "$__m" =~ "${__c#*:}" ]] && __f=1
+        done
+        (( __f )) || return 1
+    done
+    return 0
+}
+
+# Function leap days calculates the number of leap days (29th of Februrary) in
+# a time intervall between two dates.
+#
+# Usage leap_days START_DATE END_DATE
+function leap_days()
+{
+    local ld=0
+    local frstYYYY=$(date -ud "$1" +%Y)
+    local lastYYYY=$(date -ud "$2" +%Y)
+
+    set +e
+
+    # Check first year for leap day between start and end date
+    $(date -ud "${frstYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    # Check intermediate years for leap day
+    for (( y=(( ${frstYYYY}+1 )); y<=(( ${lastYYYY}-1 )); y++ ))
+    do
+        $(date -ud "$y-02-29" > /dev/null 2>&1) && (( ld++ ))
+    done
+
+    # Check last year (if different from first year) for leap day between start
+    # and end date
+    (( $lastYYYY > $frstYYYY )) \
+    && $(date -ud "${lastYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    set -e
+
+    echo "$ld"
+}

+ 108 - 0
archive/nemo.cfg

@@ -0,0 +1,108 @@
+# Platform dependent configuration functions for the 'cenaero' machine
+# (hpc.cenaero.be)
+
+function configure()
+{
+    # This function should configure all settings/modules needed to
+    # later prepare the NEMO run directory and set variables used
+    # in the run script
+
+
+    # Configure paths for building/running NEMO
+    nemo_src_dir=${HOME}/modeles/NEMO/3.6
+    run_dir=$GLOBALSCRATCH/nemo/run/${exp_name}
+    ini_data_dir=$GLOBALSCRATCH/DATA/nemo
+
+    # File for standard output.
+    # NOTE: This will be modified for restart jobs!
+    #stdout_file=${start_dir}/out/${PBS_JOBNAME}.out
+
+    # Resubmit this job for automatic restarts? [true/false]
+    # Also, add options for the resubmit command here.
+    resubmit_job=true
+
+    # Configure and load modules
+    pre_load_modules_cmd="module purge"
+    module_list="module load intel/compilerpro/13.0.1.117 openmpi/1.6.4/intel-13.0.1.117 hdf5/1.8.15p1_intel13_ompi1.6.4 netcdf/intel/4.3.3.1_ompi1.6.4 cdo/intel/1.5.4"
+
+    module load ${module_list}
+}
+
+function configure_opa()
+{
+    # Configure paths for NEMO IC
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/coordinates.nc ]                          && ln -s ${ini_data_dir}/INIT/${nem_grid}/coordinates.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/bathy_meter.nc ]                          && ln -s ${ini_data_dir}/INIT/${nem_grid}/bathy_meter.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/runoff_core_monthly.nc ]                  && ln -s ${ini_data_dir}/INIT/${nem_grid}/runoff_core_monthly.nc runoffs_depth.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/ahmcoef.nc ]                              && ln -s ${ini_data_dir}/INIT/${nem_grid}/ahmcoef.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/mask_itf.nc ]                             && ln -s ${ini_data_dir}/INIT/${nem_grid}/mask_itf.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/K1rowdrg.nc ]                             && ln -s ${ini_data_dir}/INIT/${nem_grid}/K1rowdrg.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/M2rowdrg.nc ]                             && ln -s ${ini_data_dir}/INIT/${nem_grid}/M2rowdrg.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/data_1m_potential_temperature_nomask.nc ] && ln -s ${ini_data_dir}/INIT/${nem_grid}/data_1m_potential_temperature_nomask.nc temperature.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/data_1m_salinity_nomask.nc ]              && ln -s ${ini_data_dir}/INIT/${nem_grid}/data_1m_salinity_nomask.nc salinity.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/subbasins.nc ]                            && ln -s ${ini_data_dir}/INIT/${nem_grid}/subbasins.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/resto.nc ]                                && ln -s ${ini_data_dir}/INIT/${nem_grid}/resto.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/chlorophyll.nc ]                          && ln -s ${ini_data_dir}/INIT/${nem_grid}/chlorophyll.nc
+    [ -f ${ini_data_dir}/INIT/${nem_grid}/geothermal_heating.nc ]                   && ln -s ${ini_data_dir}/INIT/${nem_grid}/geothermal_heating.nc
+
+    # Configure paths for NEMO Forcings
+    ln -sf ${ini_data_dir}/BC/${nem_grid}/${nem_forcing_set}/*.nc .
+    [ -f ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bicubic_noc.nc ]       && ln -s ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bicubic_noc.nc
+    [ -f ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bilinear_noc.nc ]      && ln -s ${ini_data_dir}/BC/${nem_grid}/weights_core_orca2_bilinear_noc.nc
+}
+
+function configure_xios()
+{
+    # Configure paths for XIOS files
+    ln -sf ${ctrl_file_dir}/*.xml .
+}
+
+function launch()
+{
+    # Compute and check the node distribution
+    info "======================="
+    info "Node/proc distribution:"
+    info "-----------------------"
+    info "XIOS:  ${xio_numproc}"
+    info "NEMO:  ${nem_numproc}"
+    info "======================="
+
+    cmd="mpirun"
+
+    while (( "$#" ))
+    do
+        nranks=$1
+        executable=./$(basename $2)
+        shift
+        shift
+
+        cmd+=" -np $nranks $executable"
+
+        while (( "$#" )) && [ "$1" != "--" ]
+        do
+            cmd+=" $1"
+            shift
+        done
+        shift || true
+
+        (( "$#" )) && cmd+=" :"
+    done
+
+    export OMP_NUM_THREADS=1
+    $cmd
+}
+
+function finalise()
+{
+    # This function should execute of any post run functionality, e.g.
+    # platform dependent cleaning or a resubmit
+
+    if ${resubmit_job} && [ $(date -d "${leg_end_date}" +%s) -lt $(date -d "${run_end_date}" +%s) ]
+    then
+        info "Resubmitting job ${start_dir}/${script_name} for leg $((leg_number+1))"
+        # Need to go to start_dir to find the run script
+        cd ${start_dir}
+        # Submit command
+        sbatch ./${script_name}
+    fi
+}

+ 372 - 0
archive/run.sh

@@ -0,0 +1,372 @@
+#!/bin/bash
+
+# Submission script for Lemaitre2
+#SBATCH --job-name=NEMO2r0
+#SBATCH --time=10:00:00
+#
+#SBATCH --ntasks=65
+#SBATCH --mem-per-cpu=3072
+#SBATCH --partition=Def
+#
+#SBATCH --mail-user=pierre-yves.barriat@uclouvain.be
+#SBATCH --mail-type=ALL
+
+set -ue
+
+# =============================================================================
+# *** BEGIN User configuration
+# =============================================================================
+
+script_name="run.sh"
+
+# -----------------------------------------------------------------------------
+# *** General configuration
+# -----------------------------------------------------------------------------
+
+# Component configuration
+# (for syntax of the $config variable, see librunscript.sh)
+config="nemo lim3 xios:detached"
+
+# Experiment name (exactly 4 letters!)
+exp_name=EXP9
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1990-01-01"
+run_end_date="${run_start_date} + 4 years"
+
+# Set $force_run_from_scratch to 'true' if you want to force this run to start
+# from scratch, possibly ignoring any restart files present in the run
+# directory. Leave set to 'false' otherwise.
+# NOTE: If set to 'true' the run directory $run_dir is cleaned!
+force_run_from_scratch=false
+
+# Resolution
+#nem_grid=ORCA1L75
+nem_grid=ORCA2L31
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty
+rst_freq="1 year"
+
+# Number of restart legs to be run in one go
+run_num_legs=2
+
+# Directories
+start_dir=${SLURM_SUBMIT_DIR}
+#start_dir=${PWD}
+ctrl_file_dir=${start_dir}/ctrl
+
+# This file is used to store information about restarts
+ece_info_file="ece.info"
+
+# -----------------------------------------------------------------------------
+# *** Read platform dependent configuration
+# -----------------------------------------------------------------------------
+
+# librunscript defines some helper functions
+source ${start_dir}/librunscript.sh
+
+source ${start_dir}/nemo.cfg
+
+configure
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nem_time_step_sec=2700
+lim_time_step_sec=2700
+
+nem_restart_offset=0
+
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+
+nem_forcing_set=fill
+
+nem_config_name=ORCA2_LIM3
+
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+
+nem_numproc=64
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-1.0/bin/xios_server.exe
+
+xio_numproc=1
+
+# =============================================================================
+# *** END of User configuration
+# =============================================================================
+
+# =============================================================================
+# *** This is where the code begins ...
+# =============================================================================
+
+# -----------------------------------------------------------------------------
+# *** Make sure to clean up on exit
+# -----------------------------------------------------------------------------
+
+trap 'cleanup' EXIT SIGHUP SIGINT SIGTERM
+
+# -----------------------------------------------------------------------------
+# *** Create the run dir if necessary and go there
+#     Everything is done from here.
+# -----------------------------------------------------------------------------
+if [ ! -d ${run_dir} ]
+then
+    mkdir -p ${run_dir}
+    force_run_from_scratch=true
+else
+    force_run_from_scratch=false
+    if ! [ -r ${run_dir}/${ece_info_file} ]
+    then
+        info "Problem: ${ece_info_file} doesn't exist. Exiting."
+        exit 0
+    fi
+fi
+cd ${run_dir}
+
+# -----------------------------------------------------------------------------
+# *** Determine the time span of this run and whether it's a restart leg
+# -----------------------------------------------------------------------------
+
+# Regularise the format of the start and end date of the simulation
+run_start_date=$(date -uR -d "${run_start_date}")
+run_end_date=$(date -uR -d "${run_end_date}")
+
+# Loop over the number of legs
+for (( ; run_num_legs>0 ; run_num_legs-- ))
+do
+
+    # Check for restart information file and set the current leg start date
+    #   Ignore restart information file if force_run_from_scratch is true
+    if ${force_run_from_scratch} || ! [ -r ${ece_info_file} ]
+    then
+        leg_is_restart=false
+        leg_start_date=${run_start_date}
+        leg_number=1
+    else
+        leg_is_restart=true
+        . ./${ece_info_file}
+        leg_start_date=${leg_end_date}
+        leg_number=$((leg_number+1))
+    fi
+
+    # Compute the end date of the current leg
+    if [ -n "${rst_freq}" ]
+    then
+        leg_end_date=$(date -uR -d "${leg_start_date} + ${rst_freq}")
+    else
+        leg_end_date=${run_end_date}
+    fi
+
+    if [ $(date -d "${leg_end_date}" +%s) -gt $(date -d "${run_end_date}" +%s) ]
+    then
+        leg_end_date=${run_end_date}
+    fi
+
+    # Some time variables needed later
+    leg_length_sec=$(( $(date -d "${leg_end_date}" +%s) - $(date -d "${leg_start_date}" +%s) ))
+    leg_start_sec=$(( $(date -d "${leg_start_date}" +%s) - $(date -d "${run_start_date}" +%s) ))
+    leg_end_sec=$(( $(date -d "${leg_end_date}" +%s) - $(date -d "${run_start_date}" +%s) ))
+    leg_start_date_yyyymmdd=$(date -u -d "${leg_start_date}" +%Y%m%d)
+    leg_start_date_yyyy=$(date -u -d "${leg_start_date}" +%Y)
+    leg_end_date_yyyy=$(date -u -d "${leg_end_date}" +%Y)
+
+    # Correct for leap days because NEMO standalone uses no-leap calendar
+    leg_length_sec=$(( leg_length_sec - $(leap_days "${leg_start_date}" "${leg_end_date}")*24*3600 ))
+    leg_start_sec=$(( leg_start_sec - $(leap_days "${run_start_date}" "${leg_start_date}")*24*3600 ))
+    leg_end_sec=$(( leg_end_sec - $(leap_days "${run_start_date}" "${leg_end_date}")*24*3600 ))
+
+    # Check whether there's actually time left to simulate - exit otherwise
+    if [ ${leg_length_sec} -le 0 ]
+    then
+        info "Leg start date equal to or after end of simulation."
+        info "Nothing left to do. Exiting."
+        exit 0
+    fi
+
+    # -------------------------------------------------------------------------
+    # *** Prepare the run directory for a run from scratch
+    # -------------------------------------------------------------------------
+    if ! $leg_is_restart
+    then
+        # ---------------------------------------------------------------------
+        # *** Check if run dir is empty. If not, and if we are allowed to do so
+        #     by ${force_run_from_scratch}, remove everything
+        # ---------------------------------------------------------------------
+        if $(ls * >& /dev/null)
+        then
+            if ${force_run_from_scratch}
+            then
+                rm -fr ${run_dir}/*
+            else
+                error "Run directory not empty and \$force_run_from_scratch not set."
+            fi
+        fi
+
+        # ---------------------------------------------------------------------
+        # *** Copy executables of model components
+        # *** Additionally, create symlinks to the original place for reference
+        # ---------------------------------------------------------------------
+        cp    ${nem_exe_file} .
+        ln -s ${nem_exe_file} $(basename ${nem_exe_file}).lnk
+
+        cp    ${xio_exe_file} .
+        ln -s ${xio_exe_file} $(basename ${xio_exe_file}).lnk
+
+        # ---------------------------------------------------------------------
+        # *** Files needed for NEMO (linked)
+        # ---------------------------------------------------------------------
+
+        # Various initialisation and forcing files
+        configure_opa 
+
+        # Write fake file for previous fresh water budget adjustment (nn_fwb==2 in namelist)
+        echo "                               0  0.0000000000000000E+00  0.0000000000000000E+00" > EMPave_old.dat
+
+        # XIOS files
+        configure_xios
+
+    else # i.e. $leg_is_restart == true
+
+        # ---------------------------------------------------------------------
+        # *** Remove all leftover output files from previous legs
+        # ---------------------------------------------------------------------
+
+        # NEMO output files
+        rm -f ${exp_name}_??_????????_????????_{grid_U,grid_V,grid_W,grid_T,icemod,SBC,SBC_scalar,scalar}.nc
+        rm -f ${exp_name}_??_{grid_U,grid_V,grid_W,grid_T,icemod,SBC,SBC_scalar,scalar}.nc
+
+    fi # ! $leg_is_restart
+
+    # -------------------------------------------------------------------------
+    # *** Create some control files
+    # -------------------------------------------------------------------------
+
+    # NEMO and LIM namelists 
+    cp ${ctrl_file_dir}/namelist_ref                 .
+    cp ${ctrl_file_dir}/namelist_ice_lim3_ref        ./namelist_ice_ref
+    cp ${ctrl_file_dir}/namelist_ice_lim3_cfg        ./namelist_ice_cfg
+    . ${ctrl_file_dir}/namelist_${nem_grid}_cfg.sh   > namelist_cfg
+
+    # -------------------------------------------------------------------------
+    # *** Link the appropriate NEMO restart files of the previous leg
+    # -------------------------------------------------------------------------
+    if $leg_is_restart
+    then
+        ns=$(printf %08d $(( leg_start_sec / nem_time_step_sec - nem_restart_offset )))
+        for (( n=0 ; n<nem_numproc ; n++ ))
+        do
+            np=$(printf %04d ${n})
+            ln -fs ${exp_name}_${ns}_restart_oce_${np}.nc restart_oce_${np}.nc
+            ln -fs ${exp_name}_${ns}_restart_ice_${np}.nc restart_ice_${np}.nc
+        done
+    fi
+
+    # -------------------------------------------------------------------------
+    # *** Start the run
+    # -------------------------------------------------------------------------
+
+    # Use the launch function from the platform configuration file
+    t1=$(date +%s)
+    launch \
+        ${xio_numproc} ${xio_exe_file} -- \
+        ${nem_numproc} ${nem_exe_file}
+    t2=$(date +%s)
+
+    tr=$(date -d "0 -$t1 sec + $t2 sec" +%T)
+
+    # -------------------------------------------------------------------------
+    # *** Check for signs of success
+    #     Note the tests provide no guarantee that things went fine! They are
+    #     just based on the IFS and NEMO log files. More tests (e.g. checking
+    #     restart files) could be implemented.
+    # -------------------------------------------------------------------------
+    # Check for NEMO success
+    if [ -f ocean.output ]
+    then
+        if [ "$(awk '/New day/{d=$10}END{print d}' ocean.output)" == "$(date -d "${leg_end_date} - 1 day" +%Y/%m/%d)" ]
+        then
+            info "Leg successfully completed according to NEMO log file 'ocean.output'."
+        else
+            error "Leg not completed according to NEMO log file 'ocean.output'."
+        fi
+
+    else
+        error "NEMO log file 'ocean.output' not found after run."
+    fi
+
+    # -------------------------------------------------------------------------
+    # *** Move NEMO output files to archive directory
+    # -------------------------------------------------------------------------
+    outdir="output/nemo/$(printf %03d $((leg_number)))"
+    mkdir -p ${outdir}
+
+    for v in grid_U grid_V grid_W grid_T icemod SBC SBC_scalar scalar
+    do
+        for f in ${exp_name}_??_????????_????????_${v}.nc
+        do
+            test -f $f && mv $f $outdir/
+        done
+        for f in ${exp_name}_??_${v}.nc
+        do
+            test -f $f && mv $f $outdir/
+        done
+    done
+
+    # -------------------------------------------------------------------------
+    # *** Move NEMO restart files to archive directory
+    # -------------------------------------------------------------------------
+    if $leg_is_restart
+    then
+        outdir="restart/nemo/$(printf %03d $((leg_number)))"
+        mkdir -p ${outdir}
+
+        ls .
+        ns=$(printf %08d $(( leg_start_sec / nem_time_step_sec - nem_restart_offset )))
+        for f in oce ice
+        do
+            mv ${exp_name}_${ns}_restart_${f}_????.nc ${outdir}
+        done
+        echo "PEDRO"
+        ls .
+    fi
+
+    # -------------------------------------------------------------------------
+    # *** Move log files to archive directory
+    # -------------------------------------------------------------------------
+    outdir="log/$(printf %03d $((leg_number)))"
+    mkdir -p ${outdir}
+
+    for f in \
+        ocean.output time.step solver.stat
+    do
+        test -f ${f} && mv ${f} ${outdir}
+    done
+
+    # -------------------------------------------------------------------------
+    # *** Write the restart control file
+    # -------------------------------------------------------------------------
+
+    echo "#"                                             | tee -a ${ece_info_file}
+    echo "# Finished leg at `date '+%F %T'` after ${tr} (hh:mm:ss)" \
+                                                         | tee -a ${ece_info_file}
+    echo "leg_number=${leg_number}"                      | tee -a ${ece_info_file}
+    echo "leg_start_date=\"${leg_start_date}\""          | tee -a ${ece_info_file}
+    echo "leg_end_date=\"${leg_end_date}\""              | tee -a ${ece_info_file}
+
+    # Need to reset force_run_from_scratch in order to avoid destroying the next leg
+    force_run_from_scratch=false
+
+done # loop over legs
+
+# -----------------------------------------------------------------------------
+# *** Platform dependent finalising of the run
+# -----------------------------------------------------------------------------
+finalise
+
+exit 0

+ 317 - 0
coral

@@ -0,0 +1,317 @@
+#! /bin/bash 
+# 
+# Coral - collaborative job submission script  manager for NEMO
+#
+
+output_script="run.sh"
+
+CORAL_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ; export CORAL_HOME
+HOSTNAME="$(hostname -s)" ; export HOSTNAME
+FQDN=$(hostname) ; export FQDN
+USER_EMAIL=$(getent passwd "${USER}" | egrep -o '[a-zA-Z0-9_-.]*@[]*\.[a-z]+') ; export USER_EMAIL
+MAINTAINER_EMAIL="damien.francois@uclouvain.be" ; export MAINTAINER_EMAIL
+
+source "${CORAL_HOME}"/utils/tools.inc
+
+init() {
+doc "$@" <<EOT
+init [<template name>] - Initialize current directory with files from template <template name>
+     Templates contain configuration files, namelists, and xios configurations.
+     By default, the template name is the machine short name (as given by hostname -s)
+EOT
+
+  local template_name=${1:-${HOSTNAME}}
+  local template_path=${CORAL_HOME}/templates/${template_name}
+
+  [[ ! -d ${template_path} ]] && die 1 "Error: Template '${template_name}' not found."
+  [[ -f experiment.cfg ]]     && die 2 "Error: Directory not empty. Remove all *.cfg files."
+  [[ -d namelists ]]          && die 2 "Error: Directory not empty. Remove directory namelists."
+  [[ -d xios_config ]]        && die 2 "Error: Directory not empty. Remove directory xios_config."
+  [[ -f ${output_script} ]]     && die 2 "Error: Directory not empty. Remove ${output_script}"
+
+  echo -e "Importing '${template_name}' template in the current directory..."
+  < "${template_path}"/../files.txt column -t -s\|
+
+  cp    "${template_path}"/*cfg .
+  cp -r "${template_path}"/xios_config .
+  cp -r "${template_path}"/namelists .
+  echo "${template_name}" > .coral_template
+
+  echo -e "Done. Modify them to your needs and then run 'coral build' to build and"
+  echo -e "review the submission script and 'coral submit' to submit the job."
+}
+
+build() {
+doc "$@" <<EOT
+build - Build submission script from the configuraiton files in the current directory.
+EOT
+
+  [[ -f experiment.cfg ]] || die 1 "Error: configuration files not found. Run 'coral init' first"
+
+  echo -e "Generating job submission script '${output_script}'..."
+
+  echo "#!/bin/bash" >${output_script} ; (
+  set -e
+  source experiment.cfg
+  export exp_name
+  export nem_config_name
+  source programs.cfg
+  export nem_numproc
+  export xio_numproc
+  export total_nb_cpu=$((nem_numproc + xio_numproc))
+  export email=$USER_EMAIL
+  submit_command=$(grep -q SBATCH job.cfg && echo sbatch || echo qsub) ; export submit_command
+  echo -e  "\n#\n# Job options\n#"
+  <job.cfg egrep -v "(^\#|^$)" | sed "s/SBATCH/#SBATCH/" | sed "s/PBS -/#PBS -/" | envsubst \$exp_name,\$email,\$total_nb_cpu
+  echo -e  "\n#\n# Experiment options\n#"
+  <experiment.cfg egrep -v "(^\#|^$)" 
+  echo -e  "\n#\n# Data configuration\n#"
+  <data.cfg cat
+  echo -e  "\n#\n# Program configuration\n#"
+  <programs.cfg egrep -v "(^\#|^$)" 
+  echo -e  "\n#\n# Script logic\n#"
+  <"${CORAL_HOME}"/templates/scripts/skeleton.sh egrep  -v '^[[:space:]]*\#'  | envsubst \$submit_command
+  ) >>${output_script} 2>/dev/null \
+    || die 3 "Error: Syntax error in configuration files. Please review them."
+
+  echo -e "Done. Run 'coral submit' to submit the job, or submit it manually." 
+}
+
+submit() {
+doc "$@" <<EOT
+submit [<options>] - Submit the job based on the submission script present in the current directory.
+options can include:
+    * local: run the script locally rather than submitting it to the job scheduler
+    * preponly: run only the part of the script that prepares the run (copies files, links data, etc.)
+    * noresubmit: run only one job and prevent submission of continuation jobs.
+    * fromscratch: restart computations from scratch ignoring checkpoint files. Use with care.
+    * verbose: show everything during submission
+EOT
+
+  [[ -f ${output_script} ]] || die 1 "Error: submission script not found. Run 'coral build' first"
+
+  echo Making script executable and submitting it...
+
+  chmod +x ${output_script}
+
+  ( 
+  set -e
+  source experiment.cfg
+  eval "$(grep run_dir job.cfg)"
+
+  [[ "$@" == *fromscratch* ]] && rm -rf "${run_dir:?}"
+  [[ "$@" == *local* ]] && { ./"${output_script}" "$@" ; exit 0; }
+
+  which sbatch &> /dev/null  && {
+     jobid="$(sbatch "${output_script}" "$@")"
+     sleep 2
+     jobid=${jobid##* }
+     mkdir -p "${run_dir:?}"
+     echo "${jobid}" >> "${run_dir}"/.coral_jobs ; 
+     #squeue --start -j "${jobid}" # FIXME
+     squeue -j "${jobid}"
+     exit 0; 
+  } 
+
+  which qsub &> /dev/null && {
+     #qsub "${output_script}" "$@" | tee -a "${run_dir}"/.coral_jobs;
+     qsub -v PBS_OPTIONS="$@" "${output_script}" | tee -a coral_jobs;
+     sleep 2
+     jobid=`cat coral_jobs`
+     rm -f coral_jobs
+     jobid=${jobid%.*} 
+     mkdir -p "${run_dir:?}"
+     echo "${jobid}" >> "${run_dir}"/.coral_jobs ;
+     qstat -J "${jobid}"
+     exit 0; 
+  } 
+  )
+  echo "Done."
+}
+
+save() {
+doc "$@" <<EOT
+save [<name>] - Save configuration files in the current template or create a new template if <name> is given.
+     The new template can consequently be used with 'coral init <name>' in another directory'
+EOT
+
+  local target
+  local current_template
+  local template
+  local target
+
+  current_template=$(<.coral_template)
+  template=${1-$current_template}
+  target=$CORAL_HOME/templates/$template
+
+  [[ -z ${template} ]]        && die 1 "Error: No template name defined."
+  [[ -f experiment.cfg ]]     || die 1 "Error: No configuration files found."
+  [[ -d namelists ]]          || die 1 "Error: namelist directory not found."
+  [[ -d xios_config ]]        || die 1 "Error: xios_config directory not found."
+
+  echo "Saving template ${1-$current_template} to ${target}..."
+
+  mkdir -p "${target}"
+  rsync -q -va -- *.cfg namelists xios_config "${target}"
+  echo "${template}" > .coral_template
+
+  echo Done.
+}
+
+share() {
+doc "$@" <<EOT
+share [<name>] - Make template files for template '<name>' world readable and display
+     instructions on how to import the template.'
+EOT
+
+  local curr
+  local target
+  local current_template
+
+  [[ -f .coral_template ]] || die 1 "No coral template found in current directory."
+
+  current_template=$(<.coral_template)
+  template=${1-$current_template}
+  target=$CORAL_HOME/templates/${template}
+
+  [[ -d ${target} ]] || save "${template}"
+
+  echo "Making sure the template is world readable..."
+
+  chmod o+rx "${target}"
+
+  export curr=${target}
+  while curr="$(dirname "${curr}")" ; do 
+    chmod o+x "${curr}"
+    [[ "${curr}" == "$HOME" || "${curr}" == / ]] && break ; 
+  done
+
+  echo -e "Done. Other users can now use template '${template}' by issuing \n    coral import $target"
+}
+
+import() {
+doc "$@" <<EOT
+import <path> - Import template located at <path> into the local coral installation.
+EOT
+
+  [[ -n $1 ]] || die 1 "Usage: $(basename "$0") import <path>"
+
+  local template_name
+
+  template_name=$(basename "$1")
+
+  echo "Importing template in $1..."
+
+  rsync -q -va "$1" "$CORAL_HOME"/templates
+
+  echo "Done. You can test it with 'coral init ${template_name}'"
+}
+
+publish() {
+doc "$@" <<EOT
+publish [<template>] - Submits template to the central repository manager for inclusion
+        in the main coral repository.
+EOT
+
+  [[ -f .coral_template ]]        || die 1 "Error: No template name defined."
+
+  local current_template
+
+  current_template=$(<.coral_template)
+
+  export template=${1-$current_template}
+  export target=$CORAL_HOME/templates/${template}
+
+  [[ -d $target ]] || save "${template}"
+
+  echo "Commiting template to local Hg repository and contacting repository master..."
+
+  cd "$CORAL_HOME" && (
+  hg status | grep -q "^?.*$template" && hg -q add "${target}"
+  hg status | grep -q "$template"  && hg -q commit "${target}" -m"Commit template ${template}"   )
+  <"${CORAL_HOME}"/templates/scripts/repomaster.txt envsubst \$HOSTNAME,\$FQDN,\$USER,\$CORAL_HOME |\
+    mail  -s "Coral template publish request" $MAINTAINER_EMAIL
+
+  echo "Email to $MAINTAINER_EMAIL sent."
+}
+
+status() {
+doc "$@" <<EOT
+status - Displays the current status of the simulation.
+EOT
+
+  [[ -f .coral_jobs ]] || die 2 "Error: no job information found in current directory. Make sure you run 'coral status' in the run directory."
+
+  local jobid
+
+  jobid=$(tail -1 .coral_jobs)
+
+  [[ -f nemo.info ]] && {
+    tail -4 nemo.info
+  }
+
+  which squeue &> /dev/null  &&  squeue -j "${jobid}" &>/dev/null && {
+    echo "Current job:"
+    squeue -j "${jobid}"
+  }
+  
+  [[ -f time.step ]] && {
+    echo "Current timestep: (hit CTRL-C to stop)"
+  (while [ -f time.step ] ;do echo -en "$(cat time.step)" ; sleep 1 ; echo -en "\e[0K\r" ; done)
+  }
+}
+
+update() {
+doc "$@" <<EOT
+update - undocumented. Do not use.
+EOT
+
+  ( cd "${CORAL_HOME}" && hg pull --update ; )
+}
+
+list() {
+doc "$@" <<EOT
+list - List all templates available in local coral install
+EOT
+
+  ls -l "${CORAL_HOME}"/templates | grep -v files.txt | grep -v scripts
+}
+
+help() {
+  cat <<RTFM
+Usage: $0 <command> [<arguments>], where command is one of:
+  init  - Initialize template in current directory. Default template is the machine name.
+  build - Build submission script from template in current directory.
+  submit - Submit job from submission script in current directory.
+  status - Displays the current status of the simulation.
+  save - Save modifications to template in current directory
+  share  - Share template with other users on the same machine
+  import - Import template from other user on the same machine
+  publish - Submit template for inclusing in central coral repository
+  list - List all available templates
+Use 'coral <command> -h' for more information about a specific command.
+RTFM
+}
+
+completion() { #FIXME 
+  cat <<'EOTCOMPLETION'
+_coral ()   #  By convention, the function name
+{                 #+ starts with an underscore.
+
+    _get_comp_words_by_ref cur prev words cword
+    _split_long_opt
+
+    COMPREPLY=( $(compgen -W "init commit submit build edit share save import publish update list status" -- $cur) )
+}
+
+complete -F _coral coral
+EOTCOMPLETION
+}
+
+
+if [[ ! "$1" =~ ^(init|commit|submit|build|edit|share|save|import|publish|update|list|status|completion)$ ]]; then
+  help >&2
+  exit 1
+else
+  "$@"
+fi

+ 4 - 0
setup-coral.sh

@@ -0,0 +1,4 @@
+#! /bin/echo This file must be sourced not exece'd
+
+export CORAL_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export PATH=$PATH:${CORAL_HOME}

+ 6 - 0
templates/files.txt

@@ -0,0 +1,6 @@
+  - experiment.cfg | Specifications of the experiment: start- and end time, etc.
+  - data.cfg | Location of data files: forcings, boundary conditions, etc.
+  - job.cfg | Job parameters and checkpointing options. 
+  - programs.cfg | Options related to the programs 
+  - xios_config directory | Directory with XML files for XIOS
+  - namelists | Directory with namelists for Nemo

+ 39 - 0
templates/lemaitre2_regional/data.cfg

@@ -0,0 +1,39 @@
+ini_data_dir=/home/ucl/elic/phuot
+ic_subdir=CONF_files
+nem_grid=ORCA025
+ic_files=(    
+    "1_coordinates_shrinked.nc => coordinates.nc" 
+    "1_bathy_meter_shrinked.nc => bathy_meter.nc" 
+    "1_mesh_mask_shrinked.nc => mesh_mask.nc" 
+    "clipped_eORCA_R1_ahmcoef_v1.0.nc => ahmcoef.nc" 
+    "clipped_eORCA_R1_maskITF_v1.0.nc => mask_itf.nc" 
+    "clipped_eORCA_R1_K1_v1.0.nc => K1rowdrg.nc" 
+    "clipped_eORCA_R1_M2_v1.0.nc => M2rowdrg.nc"
+    "clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc"
+    "conservative_temperature_WOA13_decav_Reg1L75_clim.nc"
+    "absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "WEIGHTS/weights_bicub_DFS.nc => weights_bicub_DFS.nc"
+    "WEIGHTS/weights_bilin_WOA13.nc => weights_bilin_WOA13.nc"
+    "WEIGHTS/weights_bilin_ORCA1.nc => weights_bilin_ORCA1.nc"
+    "WEIGHTS/weights_bilin_DFS.nc => weights_bilin_DFS.nc"
+    "WEIGHTS/weights_bilin_ghflux.nc => weights_bilin_ghflux.nc"
+    "1_init_gridT_shrinked.nc"
+    "1_init_gridS_shrinked.nc"
+)
+
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+#
+forcing_subdir=FORCINGS
+nem_forcing_set=DFS5.2
+forcing_files=(
+    "* => ."
+)
+#
+shared_files=(
+    "namelist_ice_lim3_ref => namelist_ice_ref"
+    "namelist_ref"
+    "ForXIOS2/domain_def_nemo.xml"
+    "ForXIOS2/field_def_nemo-opa.xml"
+    "ForXIOS2/field_def_nemo-lim.xml"
+)

+ 22 - 0
templates/lemaitre2_regional/experiment.cfg

@@ -0,0 +1,22 @@
+# Experience name
+exp_name=TANGO
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="2005-01-01"
+run_duration="6 month"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 month"
+
+# Number of restart legs to be run in one go
+run_num_legs=1
+
+# Parameters
+nem_time_step_sec=600
+lim_time_step_sec=3600
+nem_restart_offset=0
+nem_config_name=REG_TEST
+
+# This file is used to store information about restarts
+info_file="nemo.info"

+ 19 - 0
templates/lemaitre2_regional/job.cfg

@@ -0,0 +1,19 @@
+# Slurm job options
+SBATCH --job-name=${exp_name}
+SBATCH --time=2:25:00
+
+SBATCH --ntasks=${total_nb_cpu}
+SBATCH --mem-per-cpu=2048
+SBATCH --partition=Def
+#SBATCH --partition=PostP
+
+#SBATCH --mail-user=${email}
+SBATCH --mail-type=ALL
+SBATCH --open-mode=append
+
+start_dir=${SLURM_SUBMIT_DIR-$PWD}
+run_dir="$GLOBALSCRATCH/nemo/run/${exp_name}"
+archive_dir="$GLOBALSCRATCH/nemo/archive/${exp_name}"
+
+# Cancel job on error
+set -ueo pipefail

+ 485 - 0
templates/lemaitre2_regional/namelists/build_namelist_cfg.sh

@@ -0,0 +1,485 @@
+# namelist.nemo-ORCA1L75.cfg.sh writes the NEMO namelist for ORCA1L75 in
+# This namelist will overwrite the reference namelist (namelist.nemo.ref.sh). 
+#
+if $leg_is_restart
+then
+    nemo_restart=".FALSE."
+else
+    nemo_restart=".FALSE."
+fi
+
+cat << EOF
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OPA  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp        =  "${exp_name}" !  experience name
+   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
+   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
+   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
+                                  !    used if ln_rstart=F or
+                                  !    (ln_rstart=T and nn_rstctl=0 or 1)
+   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
+   nn_rstctl     =  0             !  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  = "restart_oce"  !  suffix of ocean restart name (input)
+   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
+   nn_stock      =  0             !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_write      = -1             !  frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration
+!-----------------------------------------------------------------------
+   cp_cfg      =  "orca"               !  name of the configuration
+   jp_cfg      =       1               !  resolution of the configuration
+   jpidta      =     124               !  1st lateral dimension ( >= jpi )
+   jpjdta      =     104               !  2nd    "         "    ( >= jpj )
+   jpkdta      =      75               !  number of levels      ( >= jpk )
+   jpiglo      =     124               !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     104               !  2nd    -                  -    --> j  =jpjdta
+   jperio      =       1               !  6 cyclic East-West AND North fold F-point pivot
+   ln_use_jattr = .false.               !  use (T) the file attribute: open_ocean_jstart if present
+/
+!-----------------------------------------------------------------------
+&namzgr        !   vertical coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdom        !   space and time domain (bathymetry, mesh, timestep)
+!-----------------------------------------------------------------------
+   nn_msh      =    0                  !  create (=1) a mesh file or not (=0)
+   rn_hmin     =    20.                !  min depth of the ocean (>0) or min number of ocean level (<0)
+   rn_rdt      = ${nem_time_step_sec} !  time step for the dynamics (and tracer if nn_acc=0)
+   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
+   ppgphi0     =  999999.0             !  latitude  of first raw and column T-point (jphgr_msh = 1)
+   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
+   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
+   ppsur       =  -3958.951371276829   !  ORCA r4, r2 and r05 coefficients
+   ppa0        =    103.95300960000000 ! (default coefficients)
+   ppa1        =      2.41595126900000 !
+   ppkth       =     15.35101370000000 !
+   ppacr       =      7.0              !
+   ppdzmin     =  999999.              !  Minimum vertical spacing
+   pphmax      =  999999.              !  Maximum depth
+   ppa2        =  100.7609285000000    !  Double tanh function parameters
+   ppkth2      =  48.02989372000000    !
+   ppacr2      =  13.00000000000       !
+/
+!-----------------------------------------------------------------------
+&namsplit      !   time splitting parameters  ("key_dynspg_ts")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options                             ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtsd    !   data : Temperature  & Salinity
+!-----------------------------------------------------------------------
+!          !  file name                                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!          !                                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+!   sn_tem  = 'conservative_temperature_WOA13_decav_Reg1L75_clim.nc',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'  ,'weights_bilin_WOA13.nc',   ''     ,    ''
+   sn_tem  = '1_init_gridT_shrinked.nc',         -1        ,'thetao' ,    .true.    , .true. , 'yearly'  ,'',   ''     ,    ''
+
+   sn_sal  = '1_init_gridS_shrinked.nc'       ,         -1        ,'so' ,    .true.    , .true. , 'yearly'  ,'',   ''     ,    ''
+   !
+   ln_tsd_init   = .true.   !  Initialisation of ocean T & S with T &S input data (T) or not (F)
+
+   ln_tsd_tradmp = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition (surface module)
+!-----------------------------------------------------------------------
+   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of surface boundary condition computation
+                           !     (also = the frequency of sea-ice model call)
+   nn_isf      = 0         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf)
+                           !  0 =no isf                  1 = presence of ISF
+                           !  2 = bg03 parametrisation   3 = rnf file for isf
+                           !  4 = ISF fwf specified
+                           !  option 1 and 4 need ln_isfcav = .true. (domzgr)
+   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
+                           !     =1 global mean of e-p-r set to zero at each time step
+                           !     =2 annual global mean of e-p-r set to zero
+   ln_ssr      = .false.    !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
+
+/
+!-----------------------------------------------------------------------
+&namsbc_ana    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_flx    !   surface boundary condition : flux formulation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_utau     = 'uwnd_10m'  ,       24          , 'uwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_vtau     = 'vwnd_10m'  ,       24          , 'vwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_wndm     = 'ncep_bulk' ,       24          , 'wspd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_tair     = 'ncep_bulk' ,       24          , 'air'     ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_humi     = 'flx_correc',       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_ccov     = 'flx_correc',       -1          , 'socliocl',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_prec     = 'flx_correc',       -1          , 'socliopl',   .true.     , .true. , 'yearly'  , ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_core   !   namsbc_core  CORE bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name              ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights                                     ! rotation ! land/sea mask !
+!              !                         !  (if <0  months)  !   name   !   (logical)  !  (T/F)  ! 'monthly' ! filename                                    ! pairing  ! filename      !
+
+   sn_wndi     = 'drowned_u10_DFS5.2'    ,        3         , 'u10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS.nc' , 'U1'     , ''
+   sn_wndj     = 'drowned_v10_DFS5.2'    ,        3         , 'v10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS.nc' , 'V1'     , ''
+   sn_qsr      = 'drowned_radsw_DFS5.2'  ,        24         , 'radsw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+   sn_qlw      = 'drowned_radlw_DFS5.2'  ,        24         , 'radlw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+   sn_tair     = 'drowned_t2_DFS5.2'     ,        3         , 't2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+   sn_humi     = 'drowned_q2_DFS5.2'     ,        3         , 'q2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+   sn_prec     = 'drowned_precip_DFS5.2' ,        24         , 'precip' ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+   sn_snow     = 'drowned_snow_DFS5.2'   ,        24         , 'snow'   ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS.nc' , ''       , ''
+
+   rn_zqt      = 2.        !  Air temperature and humidity reference height (m)
+/
+!-----------------------------------------------------------------------
+&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_qsr    !   penetrative solar radiation
+!-----------------------------------------------------------------------
+   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf    !   runoffs namelist surface boundary condition
+!-----------------------------------------------------------------------
+!              !  file name                                              ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !                                                         !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_rnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',        -1         , 'sorunoff' , .true.       , .true. , 'yearly'  , 'weights_bilin_ORCA1.nc'       , ''       , ''
+   sn_cnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',         0         , 'socoefr'  , .false.      , .true. , 'yearly'  , 'weights_bilin_ORCA1.nc'       , ''       , ''
+
+   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_depth_ini = .true.   ! compute depth at initialisation from runoff file
+   rn_rnf_max   = 0.05      !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+/
+!-----------------------------------------------------------------------
+&namsbc_isf    !  Top boundary layer (ISF)
+!-----------------------------------------------------------------------
+!                ! file name                                                ! frequency (hours) ! variable     ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
+!                !                                                          !  (if <0  months)  !   name       !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
+   sn_rnfisf     = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sornfisf'    ,    .false.     , .true.  , 'yearly'  ,  'weights_bilin_ORCA1.nc'      ,   ''
+   sn_depmax_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmax_isf',    .false.     , .true.  , 'yearly'  ,  'weights_bilin_ORCA1.nc'      ,   ''
+   sn_depmin_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmin_isf',    .false.     , .true.  , 'yearly'  ,  'weights_bilin_ORCA1.nc'      ,   ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr    !   surface boundary condition : sea surface restoring
+!-----------------------------------------------------------------------
+!              !  file name                                          ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!              !                                                     !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_sss      = 'sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc' ,        -1         , 'sosaline',    .true.    , .true. , 'yearly'  ,'weights_bilin_WOA13.nc', ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_alb    !   albedo parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
+                           !  free slip  !   partial slip  !   no slip   ! strong slip
+/
+!-----------------------------------------------------------------------
+&namcla        !   cross land advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namagrif      !  AGRIF zoom                                            ("key_agrif")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_tide      !   tide parameters (#ifdef key_tide)
+!-----------------------------------------------------------------------
+   ln_tide_pot = .false.
+   rdttideramp   =    1.    !
+   clname(1)     = 'K1'  !  name of constituent - all tidal components must be set in namelist_cfg
+/
+!-----------------------------------------------------------------------
+&nambdy        !  unstructured open boundaries                          ("key_bdy")
+!-----------------------------------------------------------------------
+    nb_bdy         = 1                    !  number of open boundary sets
+    ln_coords_file = .true.               !  =T : read bdy coordinates from file
+    cn_coords_file = '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_coord_bdy.nc' !  bdy coordinates files
+    ln_mask_file   = .false.              !  =T : read mask from file
+    cn_mask_file   = 'none'                   !  name of mask file (if ln_mask_file=.TRUE.)
+    cn_dyn2d       = 'flather'               !
+    nn_dyn2d_dta   =  1                   !  = 0, bdy data are equal to the initial state
+                                          !  = 1, bdy data are read in 'bdydata   .nc' files
+                                          !  = 2, use tidal harmonic forcing data from files
+                                          !  = 3, use external data AND tidal harmonic forcing
+    cn_dyn3d      =  'flather'               !
+    nn_dyn3d_dta  =  1                    !  = 0, bdy data are equal to the initial state
+                                          !  = 1, bdy data are read in 'bdydata   .nc' files
+    cn_tra        =  'frs'               !
+    nn_tra_dta    =  1                    !  = 0, bdy data are equal to the initial state
+                                          !  = 1, bdy data are read in 'bdydata   .nc' files
+    cn_ice_lim      =  'frs'             !
+    nn_ice_lim_dta  =  1                  !  = 0, bdy data are equal to the initial state
+                                          !  = 1, bdy data are read in 'bdydata   .nc' files
+    rn_ice_tem      = 270.                !  lim3 only: arbitrary temperature of incoming sea ice
+    rn_ice_sal      = 10.                 !  lim3 only:      --   salinity           --
+    rn_ice_age      = 30.                 !  lim3 only:      --   age                --
+
+    ln_tra_dmp    =.true.                !  open boudaries conditions for tracers
+    ln_dyn3d_dmp  =.true.                !  open boundary condition for baroclinic velocities
+    rn_time_dmp   =  1.                   ! Damping time scale in days
+    rn_time_dmp_out =  1.                 ! Outflow damping time scale
+    nn_rimwidth   = 1                    !  width of the relaxation zone
+    ln_vol        = .false.               !  total volume correction (see nn_volctl parameter)
+    nn_volctl     = 1                     !  = 0, the total water flux across open boundaries is zero
+
+/
+!-----------------------------------------------------------------------
+&nambdy_dta      !  open boundaries - external data           ("key_bdy")
+!-----------------------------------------------------------------------
+!              !  file name     				 ! frequency (hours) ! variable   ! time interp.   !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !              				         !  (if <0  months)  !   name     !   (logical)    !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      !
+   bn_ssh =     '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_2D' ,         -1        , 'zos' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_u2d =     '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_u2d' ,         -1        , 'uo' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_v2d =     '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_v2d' ,         -1        , 'vo' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_u3d  =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_u3d' ,         -1        , 'uo' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_v3d  =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_v3d' ,         -1        , 'vo' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_tem  =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdyT_tem' ,         -1        , 'thetao' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_sal  =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdyT_tem' ,         -1        , 'so' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+! for lim2
+!   bn_frld  =    'amm12_bdyT_ice' ,         -1        , 'ileadfra' ,     .true.     , .false. ,  'daily'  ,    ''    ,   ''     , ''
+!   bn_hicif =    'amm12_bdyT_ice' ,         -1        , 'iicethic' ,     .true.     , .false. ,  'daily'  ,    ''    ,   ''     , ''
+!   bn_hsnif =    'amm12_bdyT_ice' ,         -1        , 'isnowthi' ,     .true.     , .false. ,  'daily'  ,    ''    ,   ''     , ''
+! for lim3
+   bn_a_i  =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_ice' ,         -1        , 'siconc' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_ht_i =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_ice' ,         -1        , 'sithic' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   bn_ht_s =    '/home/ucl/elic/phuot/BDY/ADE25/ORCA025_bdy_ice' ,         -1        , 'snthic' ,     .true.     , .false. ,  'yearly'  ,    ''    ,   ''     , ''
+   cn_dir  =    '/home/ucl/elic/phuot/BDY/ADE25'
+   ln_full_vel = .false.
+/
+!-----------------------------------------------------------------------
+&nambdy_tide     ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambfr        !   bottom friction
+!-----------------------------------------------------------------------
+   nn_bfr      =    2      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
+                           !                              = 2 : nonlinear friction
+   rn_bfeb2    =    0 !  bottom turbulent kinetic energy background  (m2/s2)
+/
+!-----------------------------------------------------------------------
+&nambbc        !   bottom temperature boundary condition
+!-----------------------------------------------------------------------
+   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
+                           !     = 1 constant flux
+                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
+/
+!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nameos        !   ocean physical parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv    !   advection scheme for tracer
+!-----------------------------------------------------------------------
+   ln_traadv_tvd    =  .false.    !  TVD scheme
+   ln_traadv_ubs    =  .true.   !  UBS scheme
+/
+!-----------------------------------------------------------------------
+&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
+!-----------------------------------------------------------------------
+/
+!----------------------------------------------------------------------------------
+&namtra_ldf    !   lateral diffusion scheme for tracers
+!----------------------------------------------------------------------------------
+!   rn_aht_0         =  1000.     !  horizontal eddy diffusivity for tracers [m2/s]
+!   rn_aeiv_0        =  1000.     !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
+    ln_traldf_iso    =  .true.   !  iso-neutral                 (needs "key_ldfslp")
+    ln_traldf_bilap  =  .false.  !  bilaplacian operator
+    ln_traldf_lap    =  .true.
+!    rn_aht_0         =  -1    !  horizontal eddy diffusivity for tracers [m2/s]
+/
+!-----------------------------------------------------------------------
+&namtra_dmp    !   tracer: T & S newtonian damping
+!-----------------------------------------------------------------------
+   ln_tradmp   =  .false.  !  add a damping termn (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv    !   formulation of the momentum advection
+!-----------------------------------------------------------------------
+   ln_dynadv_vec = .true.  !  vector form (T) or flux form (F)
+
+/
+!-----------------------------------------------------------------------
+&nam_vvl    !   vertical coordinate options
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg    !   Hydrostatic pressure gradient option
+!-----------------------------------------------------------------------
+   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .true.    !  s-coordinate (standard jacobian formulation)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf    !   lateral diffusion on momentum
+!-----------------------------------------------------------------------
+   rn_ahm_0_lap     = 20000.    !  horizontal laplacian eddy viscosity   [m2/s]
+/
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!-----------------------------------------------------------------------
+/
+!------------------------------------------------------------------------
+&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
+!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsol        !   elliptic solver / island / free surface
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints & Benchmark
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto       ! Stochastic parametrization of EOS
+!-----------------------------------------------------------------------
+   ln_rststo = .false.           ! start from mean parameter (F) or from restart file (T)
+   ln_rstseed = .false.           ! read seed of RNG from restart file
+   cn_storst_in  = "none" !  suffix of stochastic parameter restart file (input)
+   cn_storst_out = "none" !  suffix of stochastic parameter restart file (output)
+
+   ln_sto_eos = .false.          ! stochastic equation of state
+   nn_sto_eos = 1                ! number of independent random walks
+   rn_eos_stdxy = 1.4            ! random walk horz. standard deviation (in grid points)
+   rn_eos_stdz  = 0.7            ! random walk vert. standard deviation (in grid points)
+   rn_eos_tcor  = 1440.0         ! random walk time correlation (in timesteps)
+   nn_eos_ord  = 1               ! order of autoregressive processes
+   nn_eos_flt  = 0               ! passes of Laplacian filter
+   rn_eos_lim  = 2.0             ! limitation factor (default = 3.0)
+/
+!-----------------------------------------------------------------------
+&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namflo       !   float parameters                                      ("key_float")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namptr       !   Poleward Transport Diagnostic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namhsb       !  Heat and salt budgets
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_diaharm   !   Harmonic analysis of tidal constituents ('key_diaharm')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdct        ! transports through sections
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namobs       !  observation usage switch                               ('key_diaobs')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_asminc   !   assimilation increments                               ('key_asminc')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_wave   ! External fields from wave model
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
+!-----------------------------------------------------------------------
+/
+EOF

+ 38 - 0
templates/lemaitre2_regional/namelists/namelist_ice_cfg

@@ -0,0 +1,38 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/LIM-3 : Ice configuration namelist. Overwrites SHARED/namelist_ice_lim3_ref
+!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!-----------------------------------------------------------------------
+&namicerun     !   Share parameters for dynamics/advection/thermo
+!-----------------------------------------------------------------------
+!   ln_limdiahsb  = .false.         !  check the heat and salt budgets (T) or not (F)
+!   ln_limdiaout  = .false.         !  output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namiceini     !   ice initialisation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitd     !   Ice discretization
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicedyn     !   ice dynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicehdf     !   Ice horizontal diffusion
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicethd     !   ice thermodynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicesal     !   ice salinity
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitdme   !   parameters for mechanical redistribution of ice 
+!-----------------------------------------------------------------------
+/

+ 19 - 0
templates/lemaitre2_regional/programs.cfg

@@ -0,0 +1,19 @@
+module_list="netCDF/4.4.0-foss-2016a"
+extralibs_list="/usr/local/netcdf/netcdf-fortran-4.4.2/lib"
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nemo_src_dir=${HOME}/NEMO
+shared_dir=${nemo_src_dir}/CONFIG/SHARED
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+nem_numproc=16
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-2.0/bin/xios_server.exe
+xio_numproc=1
+

+ 125 - 0
templates/lemaitre2_regional/xios_config/context.xml

@@ -0,0 +1,125 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-opa.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-lim.xml"/>   <!--  NEMO ocean sea ice                      -->
+    <!-- <field_definition src="./field_def_nemo-pisces.xml"/> -->  <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-opa.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-lim.xml"/>     <!--  NEMO ocean sea ice                      -->
+    <!-- <file_definition src="./file_def_nemo-pisces.xml"/> -->    <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+      <axis id="nfloat" long_name="Float number"      unit="-"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+      <axis id="ncatice" long_name="Ice category"       unit="1"               />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition>    
+
+        <!--  -->
+       <grid id="grid_T_2D" >
+         <domain id="grid_T" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D_ncatice" >
+         <domain id="grid_T" />
+         <axis id="ncatice" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D" >
+         <domain id="grid_T" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_2D" >
+         <domain id="grid_U" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_3D" >
+         <domain id="grid_U" />
+         <axis id="depthu" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_2D" >
+         <domain id="grid_V" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_3D" >
+         <domain id="grid_V" />
+         <axis id="depthv" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_2D" >
+         <domain id="grid_W" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_3D" >
+         <domain id="grid_W" />
+         <axis id="depthw" />
+       </grid>
+        <!--  -->
+       <grid id="grid_1point" >
+         <domain domain_ref="1point"/>
+       </grid>
+        <!--  -->
+       <grid id="grid_T_nfloat" >
+         <domain id="grid_T" />
+         <axis id="nfloat" />
+       </grid>
+        <!--  -->
+       <grid id="grid_EqT" >
+         <domain domain_ref="EqT" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_2D">
+         <domain id="gznl" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_3D">
+         <domain id="gznl" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_W_3D">
+         <domain id="gznl" />
+         <axis id="depthw" />
+       </grid>
+
+      <grid id="grid_ptr_T_2D">
+       <domain id="ptr" />
+      </grid>
+
+      <grid id="grid_ptr_T_3D">
+       <domain id="ptr" />
+         <axis id="deptht" />
+       </grid>
+
+      <grid id="grid_ptr_W_3D">
+       <domain id="ptr" />
+         <axis id="depthw" />
+      </grid>
+
+    </grid_definition>   
+
+</context>

+ 180 - 0
templates/lemaitre2_regional/xios_config/file_def_nemo-lim.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files for lim3                                =
+=                                         put the variables you want...                                    =
+============================================================================================================
+  -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file10" name_suffix="_icemod" description="ice variables" enabled=".TRUE." >
+        <field field_ref="isst"             name="sst" />
+        <field field_ref="isss"             name="sss" />
+
+        <field field_ref="snowthic_cea"     name="snthic"     long_name="surface_snow_thickness"   />
+        <field field_ref="snowvol"          name="snvolu" />
+        <field field_ref="isnowhc"          name="snheco" />
+
+        <field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        />
+        <field field_ref="icevolu"          name="sivolu" />
+        <field field_ref="iceconc"          name="siconc"  />
+        <field field_ref="micesalt"         name="sisali" />
+        <field field_ref="micet"            name="sitemp" />
+        <field field_ref="icest"            name="sistem" />
+        <field field_ref="icehc"            name="siheco" />
+        <field field_ref="uice_ipa"         name="sivelu" />
+        <field field_ref="vice_ipa"         name="sivelv" />
+        <field field_ref="icevel"           name="sivelo" />
+        <field field_ref="idive"            name="sidive" />
+        <field field_ref="ishear"           name="sishea" />
+        <field field_ref="icestr"           name="sistre" />
+
+        <!--
+    <field field_ref="tau_icebfr"       name="sibfri"    long_name="sea_ice_friction_at_ocean_bottom" />
+
+    <field field_ref="miceage"          name="siages" />
+    <field field_ref="ibrinv"           name="sibrin" />
+    <field field_ref="icecolf"          name="sicolf" />
+
+    <field field_ref="vfxice"           name="vfxice" />
+    <field field_ref="vfxsnw"           name="vfxsnw" />
+    <field field_ref="vfxsub"           name="vfxsub" />
+    <field field_ref="vfxsub_err"       name="vfxsub_err" />
+    <field field_ref="vfxspr"           name="vfxspr" />
+    <field field_ref="vfxbog"           name="vfxbog" />
+    <field field_ref="vfxdyn"           name="vfxdyn" />
+    <field field_ref="vfxopw"           name="vfxopw" />
+    <field field_ref="vfxsni"           name="vfxsni" />
+    <field field_ref="vfxsum"           name="vfxsum" />
+    <field field_ref="vfxbom"           name="vfxbom" />
+    <field field_ref="vfxres"           name="vfxres" />
+    <field field_ref="vfxthin"          name="vfxthin" />           
+    <field field_ref="vfxlam"           name="vfxlam" />
+
+    <field field_ref="sfx"              name="sfx" />
+    <field field_ref="sfxbri"           name="sfxbri" />
+    <field field_ref="sfxdyn"           name="sfxdyn" />
+    <field field_ref="sfxres"           name="sfxres" />
+    <field field_ref="sfxbog"           name="sfxbog" />
+    <field field_ref="sfxbom"           name="sfxbom" />
+    <field field_ref="sfxsum"           name="sfxsum" />
+    <field field_ref="sfxsni"           name="sfxsni" />
+    <field field_ref="sfxopw"           name="sfxopw" />
+    <field field_ref="sfxsub"           name="sfxsub" />
+    <field field_ref="sfxlam"           name="sfxlam" />
+
+    <field field_ref="hfxsum"          name="hfxsum"    />
+    <field field_ref="hfxbom"          name="hfxbom"    />
+    <field field_ref="hfxbog"          name="hfxbog"    />
+    <field field_ref="hfxdif"          name="hfxdif"    />
+    <field field_ref="hfxopw"          name="hfxopw"    />
+    <field field_ref="hfxout"          name="hfxout"    />
+    <field field_ref="hfxin"           name="hfxin"    />
+    <field field_ref="hfxsnw"          name="hfxsnw"    />
+    <field field_ref="hfxerr"          name="hfxerr"    />
+    -->
+
+    <!-- ice-ocean heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxdyn"          name="hfxdyn"    />
+    <field field_ref="hfxres"          name="hfxres"    />
+    <field field_ref="hfxthd"          name="hfxthd"    />
+    -->
+    <!-- ice-atm. heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxsub"          name="hfxsub"    />
+    <field field_ref="hfxspr"          name="hfxspr"    />
+    -->
+    <!-- diags -->
+    <!--
+    <field field_ref="hfxdhc"          name="hfxdhc"    />
+    <field field_ref="hfxtur"          name="hfxtur"    />
+    <field field_ref="afxthd"          name="afxthd"    />
+    <field field_ref="afxdyn"          name="afxdyn"    />
+    -->
+    <!-- transported fields -->
+    <!--
+    <field field_ref="icetrp"          name="sivtrp" />
+    <field field_ref="snwtrp"          name="snvtrp" />
+    <field field_ref="saltrp"          name="saltrp" />
+    <field field_ref="deitrp"          name="deitrp" />
+    <field field_ref="destrp"          name="destrp" />
+          -->
+    <!-- categories -->
+    <field field_ref="snowthic_cat"     name="snthicat"/>
+    <field field_ref="iceconc_cat"      name="siconcat"/>
+    <field field_ref="icethic_cat"      name="sithicat"/>
+    <field field_ref="salinity_cat"     name="salincat"/>
+    <field field_ref="iceage_cat"       name="siagecat"/>
+    <field field_ref="brinevol_cat"     name="sibricat"/>
+    <field field_ref="icetemp_cat"      name="sitemcat"/>
+    <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+  </file>
+
+  <file id="file11" name_suffix="_SBC_scalar" description="scalar variables" >
+    <!-- global contents -->
+    <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
+    <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
+    <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
+    <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
+    <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
+    <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
+
+    <!-- global drifts (conservation checks) -->
+    <field field_ref="ibgvolume"        name="ibgvolume"    />
+    <field field_ref="ibgsaltco"        name="ibgsaltco"    />
+    <field field_ref="ibgheatco"        name="ibgheatco"    />
+    <field field_ref="ibgheatfx"        name="ibgheatfx"    />
+
+    <!-- global forcings  -->
+    <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
+    <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
+    <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
+    <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
+    <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
+    <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
+    <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
+  </file>
+
+</file_group>
+
+<file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+<file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+<file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+<file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+<file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+<file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->       
+
+<file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   	
+  <file id="file12" name_suffix="_icemod" >
+    <field field_ref="snowthic_cea"   name="snthic"  />
+    <field field_ref="icethic_cea"    name="sithic"  />
+    <field field_ref="iceconc"        name="siconc"  />
+
+    <field field_ref="uice_ipa"       name="sivelu"  />
+    <field field_ref="vice_ipa"       name="sivelv"  />
+    <field field_ref="icevel"         name="sivelo"  />
+    <field field_ref="idive"          name="sidive"  />
+    <field field_ref="ishear"         name="sishea"  />
+  </file>
+
+</file_group>
+
+<file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   	
+<file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+<file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+<file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+<file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+<file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+<file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+<file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+<file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>

+ 153 - 0
templates/lemaitre2_regional/xios_config/file_def_nemo-opa.xml

@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="e3t"      name="e3t"         long_name="vertical scale factor"                     />
+        <field field_ref="eken"     name="eke"         long_name="kinetic energy"                            />
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="ssh"      name="zos"         long_name="sea_surface_height_above_geoid"            />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+        <field field_ref="sbt"      name="tob"                                                               />
+        <field field_ref="sbs"      name="sob"                                                               />
+        <field field_ref="heatc"    name="heatc"       long_name="Heat content vertically integrated"        />
+        <field field_ref="saltc"    name="saltc"       long_name="Salt content vertically integrated"        />
+
+        <field field_ref="toce"     name="to"          long_name="sea_water_potential_temperature"                    operation="instant" freq_op="1d" > @toce_e3t / @e3t </field>
+        <field field_ref="soce"     name="so"          long_name="sea_water_salinity"                                 operation="instant" freq_op="1d" > @soce_e3t / @e3t </field>
+        <field field_ref="sst"      name="tosstd"      long_name="sea_surface_temperature_standard_deviation"         operation="instant" freq_op="1d" > sqrt( @sst2 - @sst * @sst ) </field>
+        <field field_ref="ssh"      name="zosstd"      long_name="sea_surface_height_above_geoid_standard_deviation"  operation="instant" freq_op="1d" > sqrt( @ssh2 - @ssh * @ssh ) </field>
+        <field field_ref="sst"      name="tosdcy"      long_name="amplitude of sst diurnal cycle"                     operation="average" freq_op="1d" > @sstmax - @sstmin </field>
+        <field field_ref="mldr10_1" name="mldr10_1dcy" long_name="amplitude of mldr10_1 diurnal cycle"                operation="average" freq_op="1d" > @mldr10_1max - @mldr10_1min </field>
+      </file>
+
+      <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
+        <field field_ref="e3u"          name="e3u"      long_name="vertical scale factor"       />
+        <field field_ref="ubar"         name="ubar"     long_name="ocean_barotropic_x_velocity" />
+        <field field_ref="ssu"          name="uos"      long_name="sea_surface_x_velocity"      />
+        <field field_ref="sbu"          name="uob"      long_name="sea_bottom_x_velocity"       />
+        <field field_ref="utau"         name="tauu"     long_name="surface_downward_x_stress"   />
+        <field field_ref="uocetr_eff"   name="uotr_eff" long_name="effective ocean transport along i-axis"      />
+        <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity" operation="instant" freq_op="1d" > @uoce_e3u / @e3u </field>
+      </file>
+
+      <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
+        <field field_ref="e3v"          name="e3v"      long_name="vertical scale factor"      />
+        <field field_ref="vbar"         name="vbar"     long_name="ocean_barotropic_y_velocity" />
+        <field field_ref="ssv"          name="vos"      long_name="sea_surface_y_velocity"     />
+        <field field_ref="sbv"          name="vob"      long_name="sea_bottom_y_velocity"      />
+        <field field_ref="vtau"         name="tauv"     long_name="surface_downward_y_stress"  />
+        <field field_ref="vocetr_eff"   name="votr_eff" long_name="effective ocean transport along j-axis"      />
+        <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity" operation="instant" freq_op="1d" > @voce_e3v / @e3v </field>
+      </file>
+
+      <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
+        <field field_ref="e3w"          name="e3w"     long_name="vertical scale factor"           />
+        <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         />
+        <field field_ref="avt"          name="avt"     long_name="ocean_vertical_heat_diffusivity" />
+        <field field_ref="avs"          name="avs"     long_name="ocean_vertical_salt_diffusivity" />
+        <field field_ref="avm"          name="avm"     long_name="ocean_vertical_momentum_diffusivity" />
+      </file>
+
+      <file id="file5" name_suffix="_SBC" description="surface fluxes variables" > 
+        <field field_ref="erp"          name="erp"      long_name="Surface Water Flux: Damping"                 />
+        <field field_ref="qrp"          name="qrp"      long_name="Surface Heat Flux: Damping"                 />
+        <field field_ref="empmr"        name="empmr"    long_name="water_flux_into_sea_water"                 />
+        <field field_ref="qsr_oce"      name="qsr_oce"  long_name="downward shortwave flux at ocean surface"  />
+        <field field_ref="qns_oce"      name="qns_oce"  long_name="downward non solar flux at ocean surface"  />
+        <field field_ref="qt_oce"       name="qt_oce"   long_name="downward total flux at ocean surface"      />
+        <field field_ref="qemp_oce"     name="qemp_oce" long_name="downward heat flux from E-P over ocean"    />
+        <field field_ref="qsr_ice"      name="qsr_ice"  long_name="downward shortwave flux at ice surface"    />
+        <field field_ref="qns_ice"      name="qns_ice"  long_name="downward non solar flux at ice surface"    />
+        <field field_ref="qtr_ice"      name="qtr_ice"  long_name="shortwave flux transmitted thru the ice"   />
+        <field field_ref="qt_ice"       name="qt_ice"   long_name="downward total flux at ice surface"        />
+        <field field_ref="qemp_ice"     name="qemp_ice" long_name="downward heat flux from E-P over ice"      />
+        <field field_ref="emp_oce"      name="emp_oce"  long_name="Evap minus Precip over ocean"              />
+        <field field_ref="emp_ice"      name="emp_ice"  long_name="Evap minus Precip over ice"                />
+        <field field_ref="taum"         name="taum"                                                           />
+        <field field_ref="taum_oce"     name="taum_oce"                                                       />
+        <field field_ref="wspd"         name="windsp"                                                         />
+        <field field_ref="precip"       name="precip"                                                         />
+        <field field_ref="snowpre"      name="sprecip"                                                        />
+        <field field_ref="utau_ice"     name="tauu_ice"                                                       />
+        <field field_ref="vtau_ice"     name="tauv_ice"                                                       />
+        <field field_ref="alb_ice"      name="alb_ice"                                                        />
+        <field field_ref="albedo"       name="albedo"                                                         />
+      </file>
+
+      <file id="file6" name_suffix="_scalar" description="scalar variables" >
+        <!-- global contents -->
+        <field field_ref="voltot"       name="scvoltot"  />
+        <field field_ref="sshtot"       name="scsshtot"  />
+        <field field_ref="sshsteric"    name="scsshste"  />
+        <field field_ref="sshthster"    name="scsshtst"  />
+        <field field_ref="masstot"      name="scmastot"  />
+        <field field_ref="temptot"      name="sctemtot"  />
+        <field field_ref="saltot"       name="scsaltot"  />
+
+        <!-- global drifts (conservation checks) -->
+        <field field_ref="bgtemper"     name="bgtemper"    />
+        <field field_ref="bgsaline"     name="bgsaline"    />
+        <field field_ref="bgheatco"     name="bgheatco"    />
+        <field field_ref="bgheatfx"     name="bgheatfx"    />
+        <field field_ref="bgsaltco"     name="bgsaltco"    />
+        <field field_ref="bgvolssh"     name="bgvolssh"    />
+        <field field_ref="bgvole3t"     name="bgvole3t"    />
+
+        <!-- global surface forcings  -->
+        <field field_ref="bgfrcvol"     name="bgfrcvol"    />
+        <field field_ref="bgfrctem"     name="bgfrctem"    />
+        <field field_ref="bgfrchfx"     name="bgfrchfx"    />
+        <field field_ref="bgfrcsal"     name="bgfrcsal"    />
+      </file>
+
+    </file_group> 
+
+
+    <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+    <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+    <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+    <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+    <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+    <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->    
+
+    <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   
+
+      <file id="file7" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+      </file>
+
+    </file_group>
+
+
+    <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   
+    <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+    <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+    <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+    <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+    <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+    <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+    <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+    <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>
+
+
+
+

+ 30 - 0
templates/lemaitre2_regional/xios_config/iodef.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+
+          <!--
+          <variable id="optimal_buffer_size"       type="string">memory</variable>
+          <variable id="buffer_size_factor"        type="double">1.0</variable>
+          -->
+	  <variable id="info_level"                type="int">10</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context.xml"/>       <!--  NEMO       -->
+
+</simulation>

+ 1 - 0
templates/lemaitre2_xios-2.0/.coral_template

@@ -0,0 +1 @@
+lemaitre2

+ 32 - 0
templates/lemaitre2_xios-2.0/data.cfg

@@ -0,0 +1,32 @@
+ini_data_dir=/scratch/ucl/elic/barthele/NEMO
+ic_subdir=CONFIG_FILES
+nem_grid=ORCA1
+ic_files=(
+    "clipped_eORCA_R1_coordinates_v1.0.nc => coordinates.nc" 
+    "clipped_eORCA1_R1_bathy_meter_v2.1.nc => bathy_meter.nc" 
+    "clipped_eORCA_R1_ahmcoef_v1.0.nc => ahmcoef.nc" 
+    "clipped_eORCA_R1_maskITF_v1.0.nc => mask_itf.nc" 
+    "clipped_eORCA_R1_K1_v1.0.nc => K1rowdrg.nc" 
+    "clipped_eORCA_R1_M2_v1.0.nc => M2rowdrg.nc"
+    "clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc"
+    "conservative_temperature_WOA13_decav_Reg1L75_clim.nc"
+    "absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_2D.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_3D.nc"
+)
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+#
+forcing_subdir=FORCINGS
+nem_forcing_set=DFS5.2
+forcing_files=(
+    "* => ."
+)
+#
+shared_files=(
+    "namelist_ice_lim3_ref => namelist_ice_ref"
+    "namelist_ref"
+    "ForXIOS2/domain_def_nemo.xml"
+    "ForXIOS2/field_def_nemo-opa.xml"
+    "ForXIOS2/field_def_nemo-lim.xml"
+)

+ 22 - 0
templates/lemaitre2_xios-2.0/experiment.cfg

@@ -0,0 +1,22 @@
+# Experience name
+exp_name=REF0
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1958-01-01"
+run_duration="50 year"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 year"
+
+# Number of restart legs to be run in one go
+run_num_legs=2
+
+# Parameters
+nem_time_step_sec=3600
+lim_time_step_sec=21600
+nem_restart_offset=0
+nem_config_name=ORCA1_LIM3_REF
+
+# This file is used to store information about restarts
+info_file="nemo.info"

+ 20 - 0
templates/lemaitre2_xios-2.0/job.cfg

@@ -0,0 +1,20 @@
+# Slurm job options
+SBATCH --job-name=${exp_name}
+SBATCH --time=23:55:00
+#SBATCH --time=05:55:00
+
+SBATCH --ntasks=${total_nb_cpu}
+SBATCH --mem-per-cpu=3072
+SBATCH --partition=Def
+i#SBATCH --partition=PostP
+
+#SBATCH --mail-user=${email}
+SBATCH --mail-type=ALL
+SBATCH --open-mode=append
+
+start_dir=${SLURM_SUBMIT_DIR-$PWD}
+run_dir="$GLOBALSCRATCH/nemo/run/${exp_name}"
+archive_dir="$GLOBALSCRATCH/nemo/archive/${exp_name}"
+
+# Cancel job on error
+set -ueo pipefail

+ 407 - 0
templates/lemaitre2_xios-2.0/namelists/build_namelist_cfg.sh

@@ -0,0 +1,407 @@
+# This configuration namelist will overwrite SHARED/namelist_ref
+#
+if $leg_is_restart
+then
+    nemo_restart=".TRUE."
+else
+    nemo_restart=".FALSE."
+fi
+
+cat << EOF
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OPA  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp        =  "${exp_name}" !  experience name
+   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
+   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
+   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
+                                  !    used if ln_rstart=F or
+                                  !    (ln_rstart=T and nn_rstctl=0 or 1)
+   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
+   nn_rstctl     =  1             !  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  = "restart_oce"  !  suffix of ocean restart name (input)
+   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
+   nn_stock      =  0             !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_write      = -1             !  frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration
+!-----------------------------------------------------------------------
+   cp_cfg      =  "orca"               !  name of the configuration
+   jp_cfg      =       1               !  resolution of the configuration
+   jpidta      =     362               !  1st lateral dimension ( >= jpi )
+   jpjdta      =     292               !  2nd    "         "    ( >= jpj )
+   jpkdta      =      75               !  number of levels      ( >= jpk )
+   jpiglo      =     362               !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     292               !  2nd    -                  -    --> j  =jpjdta
+   jperio      =       6               !  6 cyclic East-West AND North fold F-point pivot
+   ln_use_jattr = .true.               !  use (T) the file attribute: open_ocean_jstart if present
+/
+!-----------------------------------------------------------------------
+&namzgr        !   vertical coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdom        !   space and time domain (bathymetry, mesh, timestep)
+!-----------------------------------------------------------------------
+   nn_msh      =    0                  !  create (=1) a mesh file or not (=0)
+   rn_hmin     =    20.                !  min depth of the ocean (>0) or min number of ocean level (<0)
+   rn_rdt      = ${nem_time_step_sec} !  time step for the dynamics (and tracer if nn_acc=0)
+   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
+   ppgphi0     =  999999.0             !  latitude  of first raw and column T-point (jphgr_msh = 1)
+   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
+   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
+   ppsur       =  -3958.951371276829   !  ORCA r4, r2 and r05 coefficients
+   ppa0        =    103.95300960000000 ! (default coefficients)
+   ppa1        =      2.41595126900000 !
+   ppkth       =     15.35101370000000 !
+   ppacr       =      7.0              !
+   ppdzmin     =  999999.              !  Minimum vertical spacing
+   pphmax      =  999999.              !  Maximum depth
+   ppa2        =  100.7609285000000    !  Double tanh function parameters
+   ppkth2      =  48.02989372000000    !
+   ppacr2      =  13.00000000000       !
+/
+!-----------------------------------------------------------------------
+&namsplit      !   time splitting parameters  ("key_dynspg_ts")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options                             ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtsd    !   data : Temperature  & Salinity
+!-----------------------------------------------------------------------
+!          !  file name                                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!          !                                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_tem  = 'conservative_temperature_WOA13_decav_Reg1L75_clim.nc',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   sn_sal  = 'absolute_salinity_WOA13_decav_Reg1L75_clim.nc'       ,         -1        ,'vosaline' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   !
+   ln_tsd_tradmp = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition (surface module)
+!-----------------------------------------------------------------------
+   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of surface boundary condition computation
+                           !     (also = the frequency of sea-ice model call)
+   nn_isf      = 3         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf)
+                           !  0 =no isf                  1 = presence of ISF
+                           !  2 = bg03 parametrisation   3 = rnf file for isf
+                           !  4 = ISF fwf specified
+                           !  option 1 and 4 need ln_isfcav = .true. (domzgr)
+   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
+                           !     =1 global mean of e-p-r set to zero at each time step
+                           !     =2 annual global mean of e-p-r set to zero
+/
+!-----------------------------------------------------------------------
+&namsbc_ana    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_flx    !   surface boundary condition : flux formulation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_utau     = 'uwnd_10m'  ,       24          , 'uwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_vtau     = 'vwnd_10m'  ,       24          , 'vwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_wndm     = 'ncep_bulk' ,       24          , 'wspd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_tair     = 'ncep_bulk' ,       24          , 'air'     ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_humi     = 'flx_correc',       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_ccov     = 'flx_correc',       -1          , 'socliocl',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_prec     = 'flx_correc',       -1          , 'socliopl',   .true.     , .true. , 'yearly'  , ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_core   !   namsbc_core  CORE bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name              ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights                                     ! rotation ! land/sea mask !
+!              !                         !  (if <0  months)  !   name   !   (logical)  !  (T/F)  ! 'monthly' ! filename                                    ! pairing  ! filename      !
+
+   sn_wndi     = 'drowned_u10_DFS5.2'    ,         3         , 'u10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'U1'     , ''
+   sn_wndj     = 'drowned_v10_DFS5.2'    ,         3         , 'v10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'V1'     , ''
+   sn_qsr      = 'drowned_radsw_DFS5.2'  ,        24         , 'radsw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_qlw      = 'drowned_radlw_DFS5.2'  ,        24         , 'radlw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_tair     = 'drowned_t2_DFS5.2'     ,         3         , 't2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_humi     = 'drowned_q2_DFS5.2'     ,         3         , 'q2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_prec     = 'drowned_precip_DFS5.2' ,        24         , 'precip' ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_snow     = 'drowned_snow_DFS5.2'   ,        24         , 'snow'   ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+
+   rn_zqt      = 2.        !  Air temperature and humidity reference height (m)
+/
+!-----------------------------------------------------------------------
+&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_qsr    !   penetrative solar radiation
+!-----------------------------------------------------------------------
+   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf    !   runoffs namelist surface boundary condition
+!-----------------------------------------------------------------------
+!              !  file name                                              ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !                                                         !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_rnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',        -1         , 'sorunoff' , .true.       , .true. , 'yearly'  , ''       , ''       , ''
+   sn_cnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',         0         , 'socoefr'  , .false.      , .true. , 'yearly'  , ''       , ''       , ''
+
+   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_depth_ini = .true.   ! compute depth at initialisation from runoff file
+   rn_rnf_max   = 0.05      !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+/
+!-----------------------------------------------------------------------
+&namsbc_isf    !  Top boundary layer (ISF)
+!-----------------------------------------------------------------------
+!                ! file name                                                ! frequency (hours) ! variable     ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
+!                !                                                          !  (if <0  months)  !   name       !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
+   sn_rnfisf     = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sornfisf'    ,    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmax_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmax_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmin_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmin_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr    !   surface boundary condition : sea surface restoring
+!-----------------------------------------------------------------------
+!              !  file name                                          ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!              !                                                     !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_sss      = 'sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc' ,        -1         , 'sosaline',    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_2D.nc', ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_alb    !   albedo parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
+                           !  free slip  !   partial slip  !   no slip   ! strong slip
+/
+!-----------------------------------------------------------------------
+&namcla        !   cross land advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namagrif      !  AGRIF zoom                                            ("key_agrif")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_tide      !   tide parameters (#ifdef key_tide)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy        !  unstructured open boundaries                          ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_dta      !  open boundaries - external data           ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_tide     ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambfr        !   bottom friction
+!-----------------------------------------------------------------------
+   nn_bfr      =    2      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
+                           !                              = 2 : nonlinear friction
+   rn_bfeb2    =    0      !  bottom turbulent kinetic energy background  (m2/s2)
+/
+!-----------------------------------------------------------------------
+&nambbc        !   bottom temperature boundary condition
+!-----------------------------------------------------------------------
+   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
+                           !     = 1 constant flux
+                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
+/
+!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nameos        !   ocean physical parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv    !   advection scheme for tracer
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
+!-----------------------------------------------------------------------
+/
+!----------------------------------------------------------------------------------
+&namtra_ldf    !   lateral diffusion scheme for tracers
+!----------------------------------------------------------------------------------
+   rn_aht_0         =  1000.     !  horizontal eddy diffusivity for tracers [m2/s]
+   rn_aeiv_0        =  1000.     !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
+/
+!-----------------------------------------------------------------------
+&namtra_dmp    !   tracer: T & S newtonian damping
+!-----------------------------------------------------------------------
+   ln_tradmp   =  .false.  !  add a damping termn (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv    !   formulation of the momentum advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_vvl    !   vertical coordinate options
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg    !   Hydrostatic pressure gradient option
+!-----------------------------------------------------------------------
+   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .true.    !  s-coordinate (standard jacobian formulation)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf    !   lateral diffusion on momentum
+!-----------------------------------------------------------------------
+   rn_ahm_0_lap     = 20000.    !  horizontal laplacian eddy viscosity   [m2/s]
+/
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!-----------------------------------------------------------------------
+/
+!------------------------------------------------------------------------
+&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
+!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsol        !   elliptic solver / island / free surface
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
+!-----------------------------------------------------------------------
+   jpni        =   4      !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   8      !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =  32      !  jpnij  number of local domains (set automatically if < 1)
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints & Benchmark
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto       ! Stochastic parametrization of EOS
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namflo       !   float parameters                                      ("key_float")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namptr       !   Poleward Transport Diagnostic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namhsb       !  Heat and salt budgets
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_diaharm   !   Harmonic analysis of tidal constituents ('key_diaharm')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdct        ! transports through sections
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namobs       !  observation usage switch                               ('key_diaobs')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_asminc   !   assimilation increments                               ('key_asminc')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_wave   ! External fields from wave model
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
+!-----------------------------------------------------------------------
+/
+EOF

+ 36 - 0
templates/lemaitre2_xios-2.0/namelists/namelist_ice_cfg

@@ -0,0 +1,36 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/LIM3 : ice configuration namelist, will overwrite SHARED/namelist_ice_lim3_ref
+!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!-----------------------------------------------------------------------
+&namicerun     !   Share parameters for dynamics/advection/thermo
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceini     !   ice initialisation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitd     !   Ice discretization
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicedyn     !   ice dynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicehdf     !   Ice horizontal diffusion
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicethd     !   ice thermodynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicesal     !   ice salinity
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitdme   !   parameters for mechanical redistribution of ice 
+!-----------------------------------------------------------------------
+/

+ 19 - 0
templates/lemaitre2_xios-2.0/programs.cfg

@@ -0,0 +1,19 @@
+module_list="netCDF-Fortran/4.4.3-foss-2016a"
+extralibs_list=""
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nemo_src_dir=${HOME}/modeles/NEMO/
+shared_dir=${nemo_src_dir}/CONFIG/SHARED
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+nem_numproc=32
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-2.0/bin/xios_server.exe
+xio_numproc=2
+

+ 125 - 0
templates/lemaitre2_xios-2.0/xios_config/context.xml

@@ -0,0 +1,125 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-opa.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-lim.xml"/>   <!--  NEMO ocean sea ice                      -->
+    <!-- <field_definition src="./field_def_nemo-pisces.xml"/> -->  <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-opa.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-lim.xml"/>     <!--  NEMO ocean sea ice                      -->
+    <!-- <file_definition src="./file_def_nemo-pisces.xml"/> -->    <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+      <axis id="nfloat" long_name="Float number"      unit="-"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+      <axis id="ncatice" long_name="Ice category"       unit="1"               />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition>    
+
+        <!--  -->
+       <grid id="grid_T_2D" >
+         <domain id="grid_T" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D_ncatice" >
+         <domain id="grid_T" />
+         <axis id="ncatice" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D" >
+         <domain id="grid_T" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_2D" >
+         <domain id="grid_U" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_3D" >
+         <domain id="grid_U" />
+         <axis id="depthu" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_2D" >
+         <domain id="grid_V" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_3D" >
+         <domain id="grid_V" />
+         <axis id="depthv" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_2D" >
+         <domain id="grid_W" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_3D" >
+         <domain id="grid_W" />
+         <axis id="depthw" />
+       </grid>
+        <!--  -->
+       <grid id="grid_1point" >
+         <domain domain_ref="1point"/>
+       </grid>
+        <!--  -->
+       <grid id="grid_T_nfloat" >
+         <domain id="grid_T" />
+         <axis id="nfloat" />
+       </grid>
+        <!--  -->
+       <grid id="grid_EqT" >
+         <domain domain_ref="EqT" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_2D">
+         <domain id="gznl" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_3D">
+         <domain id="gznl" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_W_3D">
+         <domain id="gznl" />
+         <axis id="depthw" />
+       </grid>
+
+      <grid id="grid_ptr_T_2D">
+       <domain id="ptr" />
+      </grid>
+
+      <grid id="grid_ptr_T_3D">
+       <domain id="ptr" />
+         <axis id="deptht" />
+       </grid>
+
+      <grid id="grid_ptr_W_3D">
+       <domain id="ptr" />
+         <axis id="depthw" />
+      </grid>
+
+    </grid_definition>   
+
+</context>

+ 180 - 0
templates/lemaitre2_xios-2.0/xios_config/file_def_nemo-lim.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files for lim3                                =
+=                                         put the variables you want...                                    =
+============================================================================================================
+  -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file10" name_suffix="_icemod" description="ice variables" enabled=".TRUE." >
+        <field field_ref="isst"             name="sst" />
+        <field field_ref="isss"             name="sss" />
+
+        <field field_ref="snowthic_cea"     name="snthic"     long_name="surface_snow_thickness"   />
+        <field field_ref="snowvol"          name="snvolu" />
+        <field field_ref="isnowhc"          name="snheco" />
+
+        <field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        />
+        <field field_ref="icevolu"          name="sivolu" />
+        <field field_ref="iceconc"          name="siconc"  />
+        <field field_ref="micesalt"         name="sisali" />
+        <field field_ref="micet"            name="sitemp" />
+        <field field_ref="icest"            name="sistem" />
+        <field field_ref="icehc"            name="siheco" />
+        <field field_ref="uice_ipa"         name="sivelu" />
+        <field field_ref="vice_ipa"         name="sivelv" />
+        <field field_ref="icevel"           name="sivelo" />
+        <field field_ref="idive"            name="sidive" />
+        <field field_ref="ishear"           name="sishea" />
+        <field field_ref="icestr"           name="sistre" />
+
+        <!--
+    <field field_ref="tau_icebfr"       name="sibfri"    long_name="sea_ice_friction_at_ocean_bottom" />
+
+    <field field_ref="miceage"          name="siages" />
+    <field field_ref="ibrinv"           name="sibrin" />
+    <field field_ref="icecolf"          name="sicolf" />
+
+    <field field_ref="vfxice"           name="vfxice" />
+    <field field_ref="vfxsnw"           name="vfxsnw" />
+    <field field_ref="vfxsub"           name="vfxsub" />
+    <field field_ref="vfxsub_err"       name="vfxsub_err" />
+    <field field_ref="vfxspr"           name="vfxspr" />
+    <field field_ref="vfxbog"           name="vfxbog" />
+    <field field_ref="vfxdyn"           name="vfxdyn" />
+    <field field_ref="vfxopw"           name="vfxopw" />
+    <field field_ref="vfxsni"           name="vfxsni" />
+    <field field_ref="vfxsum"           name="vfxsum" />
+    <field field_ref="vfxbom"           name="vfxbom" />
+    <field field_ref="vfxres"           name="vfxres" />
+    <field field_ref="vfxthin"          name="vfxthin" />           
+    <field field_ref="vfxlam"           name="vfxlam" />
+
+    <field field_ref="sfx"              name="sfx" />
+    <field field_ref="sfxbri"           name="sfxbri" />
+    <field field_ref="sfxdyn"           name="sfxdyn" />
+    <field field_ref="sfxres"           name="sfxres" />
+    <field field_ref="sfxbog"           name="sfxbog" />
+    <field field_ref="sfxbom"           name="sfxbom" />
+    <field field_ref="sfxsum"           name="sfxsum" />
+    <field field_ref="sfxsni"           name="sfxsni" />
+    <field field_ref="sfxopw"           name="sfxopw" />
+    <field field_ref="sfxsub"           name="sfxsub" />
+    <field field_ref="sfxlam"           name="sfxlam" />
+
+    <field field_ref="hfxsum"          name="hfxsum"    />
+    <field field_ref="hfxbom"          name="hfxbom"    />
+    <field field_ref="hfxbog"          name="hfxbog"    />
+    <field field_ref="hfxdif"          name="hfxdif"    />
+    <field field_ref="hfxopw"          name="hfxopw"    />
+    <field field_ref="hfxout"          name="hfxout"    />
+    <field field_ref="hfxin"           name="hfxin"    />
+    <field field_ref="hfxsnw"          name="hfxsnw"    />
+    <field field_ref="hfxerr"          name="hfxerr"    />
+    -->
+
+    <!-- ice-ocean heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxdyn"          name="hfxdyn"    />
+    <field field_ref="hfxres"          name="hfxres"    />
+    <field field_ref="hfxthd"          name="hfxthd"    />
+    -->
+    <!-- ice-atm. heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxsub"          name="hfxsub"    />
+    <field field_ref="hfxspr"          name="hfxspr"    />
+    -->
+    <!-- diags -->
+    <!--
+    <field field_ref="hfxdhc"          name="hfxdhc"    />
+    <field field_ref="hfxtur"          name="hfxtur"    />
+    <field field_ref="afxthd"          name="afxthd"    />
+    <field field_ref="afxdyn"          name="afxdyn"    />
+    -->
+    <!-- transported fields -->
+    <!--
+    <field field_ref="icetrp"          name="sivtrp" />
+    <field field_ref="snwtrp"          name="snvtrp" />
+    <field field_ref="saltrp"          name="saltrp" />
+    <field field_ref="deitrp"          name="deitrp" />
+    <field field_ref="destrp"          name="destrp" />
+          -->
+    <!-- categories -->
+    <field field_ref="snowthic_cat"     name="snthicat"/>
+    <field field_ref="iceconc_cat"      name="siconcat"/>
+    <field field_ref="icethic_cat"      name="sithicat"/>
+    <field field_ref="salinity_cat"     name="salincat"/>
+    <field field_ref="iceage_cat"       name="siagecat"/>
+    <field field_ref="brinevol_cat"     name="sibricat"/>
+    <field field_ref="icetemp_cat"      name="sitemcat"/>
+    <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+  </file>
+
+  <file id="file11" name_suffix="_SBC_scalar" description="scalar variables" >
+    <!-- global contents -->
+    <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
+    <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
+    <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
+    <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
+    <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
+    <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
+
+    <!-- global drifts (conservation checks) -->
+    <field field_ref="ibgvolume"        name="ibgvolume"    />
+    <field field_ref="ibgsaltco"        name="ibgsaltco"    />
+    <field field_ref="ibgheatco"        name="ibgheatco"    />
+    <field field_ref="ibgheatfx"        name="ibgheatfx"    />
+
+    <!-- global forcings  -->
+    <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
+    <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
+    <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
+    <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
+    <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
+    <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
+    <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
+  </file>
+
+</file_group>
+
+<file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+<file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+<file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+<file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+<file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+<file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->       
+
+<file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   	
+  <file id="file12" name_suffix="_icemod" >
+    <field field_ref="snowthic_cea"   name="snthic"  />
+    <field field_ref="icethic_cea"    name="sithic"  />
+    <field field_ref="iceconc"        name="siconc"  />
+
+    <field field_ref="uice_ipa"       name="sivelu"  />
+    <field field_ref="vice_ipa"       name="sivelv"  />
+    <field field_ref="icevel"         name="sivelo"  />
+    <field field_ref="idive"          name="sidive"  />
+    <field field_ref="ishear"         name="sishea"  />
+  </file>
+
+</file_group>
+
+<file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   	
+<file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+<file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+<file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+<file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+<file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+<file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+<file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+<file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>

+ 153 - 0
templates/lemaitre2_xios-2.0/xios_config/file_def_nemo-opa.xml

@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="e3t"      name="e3t"         long_name="vertical scale factor"                     />
+        <field field_ref="eken"     name="eke"         long_name="kinetic energy"                            />
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="ssh"      name="zos"         long_name="sea_surface_height_above_geoid"            />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+        <field field_ref="sbt"      name="tob"                                                               />
+        <field field_ref="sbs"      name="sob"                                                               />
+        <field field_ref="heatc"    name="heatc"       long_name="Heat content vertically integrated"        />
+        <field field_ref="saltc"    name="saltc"       long_name="Salt content vertically integrated"        />
+
+        <field field_ref="toce"     name="to"          long_name="sea_water_potential_temperature"                    operation="instant" freq_op="1d" > @toce_e3t / @e3t </field>
+        <field field_ref="soce"     name="so"          long_name="sea_water_salinity"                                 operation="instant" freq_op="1d" > @soce_e3t / @e3t </field>
+        <field field_ref="sst"      name="tosstd"      long_name="sea_surface_temperature_standard_deviation"         operation="instant" freq_op="1d" > sqrt( @sst2 - @sst * @sst ) </field>
+        <field field_ref="ssh"      name="zosstd"      long_name="sea_surface_height_above_geoid_standard_deviation"  operation="instant" freq_op="1d" > sqrt( @ssh2 - @ssh * @ssh ) </field>
+        <field field_ref="sst"      name="tosdcy"      long_name="amplitude of sst diurnal cycle"                     operation="average" freq_op="1d" > @sstmax - @sstmin </field>
+        <field field_ref="mldr10_1" name="mldr10_1dcy" long_name="amplitude of mldr10_1 diurnal cycle"                operation="average" freq_op="1d" > @mldr10_1max - @mldr10_1min </field>
+      </file>
+
+      <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
+        <field field_ref="e3u"          name="e3u"      long_name="vertical scale factor"       />
+        <field field_ref="ubar"         name="ubar"     long_name="ocean_barotropic_x_velocity" />
+        <field field_ref="ssu"          name="uos"      long_name="sea_surface_x_velocity"      />
+        <field field_ref="sbu"          name="uob"      long_name="sea_bottom_x_velocity"       />
+        <field field_ref="utau"         name="tauu"     long_name="surface_downward_x_stress"   />
+        <field field_ref="uocetr_eff"   name="uotr_eff" long_name="effective ocean transport along i-axis"      />
+        <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity" operation="instant" freq_op="1d" > @uoce_e3u / @e3u </field>
+      </file>
+
+      <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
+        <field field_ref="e3v"          name="e3v"      long_name="vertical scale factor"      />
+        <field field_ref="vbar"         name="vbar"     long_name="ocean_barotropic_y_velocity" />
+        <field field_ref="ssv"          name="vos"      long_name="sea_surface_y_velocity"     />
+        <field field_ref="sbv"          name="vob"      long_name="sea_bottom_y_velocity"      />
+        <field field_ref="vtau"         name="tauv"     long_name="surface_downward_y_stress"  />
+        <field field_ref="vocetr_eff"   name="votr_eff" long_name="effective ocean transport along j-axis"      />
+        <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity" operation="instant" freq_op="1d" > @voce_e3v / @e3v </field>
+      </file>
+
+      <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
+        <field field_ref="e3w"          name="e3w"     long_name="vertical scale factor"           />
+        <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         />
+        <field field_ref="avt"          name="avt"     long_name="ocean_vertical_heat_diffusivity" />
+        <field field_ref="avs"          name="avs"     long_name="ocean_vertical_salt_diffusivity" />
+        <field field_ref="avm"          name="avm"     long_name="ocean_vertical_momentum_diffusivity" />
+      </file>
+
+      <file id="file5" name_suffix="_SBC" description="surface fluxes variables" > 
+        <field field_ref="erp"          name="erp"      long_name="Surface Water Flux: Damping"                 />
+        <field field_ref="qrp"          name="qrp"      long_name="Surface Heat Flux: Damping"                 />
+        <field field_ref="empmr"        name="empmr"    long_name="water_flux_into_sea_water"                 />
+        <field field_ref="qsr_oce"      name="qsr_oce"  long_name="downward shortwave flux at ocean surface"  />
+        <field field_ref="qns_oce"      name="qns_oce"  long_name="downward non solar flux at ocean surface"  />
+        <field field_ref="qt_oce"       name="qt_oce"   long_name="downward total flux at ocean surface"      />
+        <field field_ref="qemp_oce"     name="qemp_oce" long_name="downward heat flux from E-P over ocean"    />
+        <field field_ref="qsr_ice"      name="qsr_ice"  long_name="downward shortwave flux at ice surface"    />
+        <field field_ref="qns_ice"      name="qns_ice"  long_name="downward non solar flux at ice surface"    />
+        <field field_ref="qtr_ice"      name="qtr_ice"  long_name="shortwave flux transmitted thru the ice"   />
+        <field field_ref="qt_ice"       name="qt_ice"   long_name="downward total flux at ice surface"        />
+        <field field_ref="qemp_ice"     name="qemp_ice" long_name="downward heat flux from E-P over ice"      />
+        <field field_ref="emp_oce"      name="emp_oce"  long_name="Evap minus Precip over ocean"              />
+        <field field_ref="emp_ice"      name="emp_ice"  long_name="Evap minus Precip over ice"                />
+        <field field_ref="taum"         name="taum"                                                           />
+        <field field_ref="taum_oce"     name="taum_oce"                                                       />
+        <field field_ref="wspd"         name="windsp"                                                         />
+        <field field_ref="precip"       name="precip"                                                         />
+        <field field_ref="snowpre"      name="sprecip"                                                        />
+        <field field_ref="utau_ice"     name="tauu_ice"                                                       />
+        <field field_ref="vtau_ice"     name="tauv_ice"                                                       />
+        <field field_ref="alb_ice"      name="alb_ice"                                                        />
+        <field field_ref="albedo"       name="albedo"                                                         />
+      </file>
+
+      <file id="file6" name_suffix="_scalar" description="scalar variables" >
+        <!-- global contents -->
+        <field field_ref="voltot"       name="scvoltot"  />
+        <field field_ref="sshtot"       name="scsshtot"  />
+        <field field_ref="sshsteric"    name="scsshste"  />
+        <field field_ref="sshthster"    name="scsshtst"  />
+        <field field_ref="masstot"      name="scmastot"  />
+        <field field_ref="temptot"      name="sctemtot"  />
+        <field field_ref="saltot"       name="scsaltot"  />
+
+        <!-- global drifts (conservation checks) -->
+        <field field_ref="bgtemper"     name="bgtemper"    />
+        <field field_ref="bgsaline"     name="bgsaline"    />
+        <field field_ref="bgheatco"     name="bgheatco"    />
+        <field field_ref="bgheatfx"     name="bgheatfx"    />
+        <field field_ref="bgsaltco"     name="bgsaltco"    />
+        <field field_ref="bgvolssh"     name="bgvolssh"    />
+        <field field_ref="bgvole3t"     name="bgvole3t"    />
+
+        <!-- global surface forcings  -->
+        <field field_ref="bgfrcvol"     name="bgfrcvol"    />
+        <field field_ref="bgfrctem"     name="bgfrctem"    />
+        <field field_ref="bgfrchfx"     name="bgfrchfx"    />
+        <field field_ref="bgfrcsal"     name="bgfrcsal"    />
+      </file>
+
+    </file_group> 
+
+
+    <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+    <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+    <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+    <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+    <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+    <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->    
+
+    <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   
+
+      <file id="file7" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+      </file>
+
+    </file_group>
+
+
+    <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   
+    <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+    <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+    <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+    <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+    <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+    <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+    <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+    <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>
+
+
+
+

+ 30 - 0
templates/lemaitre2_xios-2.0/xios_config/iodef.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+
+          <!--
+          <variable id="optimal_buffer_size"       type="string">memory</variable>
+          <variable id="buffer_size_factor"        type="double">1.0</variable>
+          -->
+	  <variable id="info_level"                type="int">10</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context.xml"/>       <!--  NEMO       -->
+
+</simulation>

+ 90 - 0
templates/scripts/rebuild.sh

@@ -0,0 +1,90 @@
+#!/bin/bash
+# Submission script for Zenobe
+#PBS -N ECEC_post
+#PBS -r y
+#PBS -W group_list=ecearth
+#
+#PBS -l walltime=23:59:00
+#PBS -l select=1:ncpus=5:ompthreads=5:vmem=20480mb
+#PBS -l pvmem=4096mb
+#
+#PBS -M francois.klein@uclouvain.be
+#PBS -m abe
+
+exec > ${PBS_O_WORKDIR}/${PBS_JOBNAME}.${PBS_JOBID}.log
+echo "------------------ Work dir --------------------"
+cd ${PBS_O_WORKDIR} && echo ${PBS_O_WORKDIR}
+echo "------------------ Job Info --------------------"
+echo "jobid : $PBS_JOBID"
+echo "jobname : $PBS_JOBNAME"
+echo "job type : $PBS_ENVIRONMENT"
+echo "submit dir : $PBS_O_WORKDIR"
+echo "queue : $PBS_O_QUEUE"
+echo "user : $PBS_O_LOGNAME"
+echo "threads : $OMP_NUM_THREADS"
+
+set -ue
+set +x
+# =============================================================================
+# *** BEGIN User configuration
+# =============================================================================
+
+# -----------------------------------------------------------------------------
+# *** General configuration
+# -----------------------------------------------------------------------------
+# Experiment name (exactly 4 letters!)
+exp_name=ECEC
+
+# Directories
+start_dir=${PBS_O_WORKDIR}
+#start_dir=${PWD}
+
+# Architecture
+build_arch=ecconf
+nem_numproc=96
+
+# -----------------------------------------------------------------------------
+# *** Read platform dependent configuration
+# -----------------------------------------------------------------------------
+. ${PBS_O_WORKDIR}/ecconf.cfg
+
+configure
+
+# -----------------------------------------------------------------------------
+# *** Post NEMO
+# -----------------------------------------------------------------------------
+
+rebuild_nemo=${ecearth_src_dir}/util/rebuild_nemo/rebuild_nemo
+path=${run_dir}/output/nemo
+
+for dir in ${path}/*
+do
+  cd ${dir}
+  count=0
+  for i in $(echo `ls | head -n 1` | tr "_" "\n")
+  do
+    count=$(( $count + 1 ))
+    [[ $count -eq 3 ]] && expdate=${i}
+    [[ $count -eq 4 ]] && expdate=${expdate}_${i}
+  done
+  basename="${exp_name}_1m_${expdate}_"
+  $rebuild_nemo -t 5 ${basename}grid_T ${nem_numproc}
+  $rebuild_nemo -t 5 ${basename}grid_U ${nem_numproc}
+
+  $rebuild_nemo -t 5 ${basename}grid_V ${nem_numproc}
+  $rebuild_nemo -t 5 ${basename}grid_W ${nem_numproc}
+  #$rebuild_nemo -t 5 ${basename}icemoa ${nem_numproc}
+  #$rebuild_nemo -t 5 ${basename}icemod ${nem_numproc}
+
+  mv ${basename}??????.nc ..
+  cd ..
+done
+
+if [ ! -d ${stdout_dir}/nemo ]
+        then
+                                                                                                                                                                                                               mkdir -p ${stdout_dir}/nemo
+                                                                                                                                                                                                                  fi
+                                                                                                                                                                                                                     cd ${path}
+                                                                                                                                                                                                                        mv -f *.nc ${stdout_dir}/nemo
+
+# -----------------------------------------------------------------------------

+ 10 - 0
templates/scripts/repomaster.txt

@@ -0,0 +1,10 @@
+Dear Coral Maintainer,
+
+user $USER wants to publish their template "$1".
+
+run hg incoming --patch ssh://$FQDN/$CORAL_HOME to review the template
+and then hg pull ssh://$FQDN/$CORAL_HOME to pull it in the official repository.
+
+Sincerly
+
+coral on $HOSTNAME

+ 264 - 0
templates/scripts/skeleton.sh

@@ -0,0 +1,264 @@
+# Function leap days calculates the number of leap days (29th of Februrary) in
+# a time intervall between two dates.
+#
+# Usage leap_days START_DATE END_DATE
+#TODO: simplify this
+function leap_days()
+{
+    local ld=0
+    local frstYYYY=$(date -ud "$1" +%Y)
+    local lastYYYY=$(date -ud "$2" +%Y)
+
+    set +e
+
+    # Check first year for leap day between start and end date
+    $(date -ud "${frstYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    # Check intermediate years for leap day
+    for (( y=(( ${frstYYYY}+1 )); y<=(( ${lastYYYY}-1 )); y++ ))
+    do
+        $(date -ud "$y-02-29" > /dev/null 2>&1) && (( ld++ ))
+    done
+
+    # Check last year (if different from first year) for leap day between start
+    # and end date
+    (( $lastYYYY > $frstYYYY )) \
+    && $(date -ud "${lastYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    set -e
+
+    echo "$ld"
+}
+
+
+
+[[ $@ == *verbose* ]] && set -x
+
+module load "${module_list:?}"
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}"${extralibs_list}"
+
+#
+# Create run directory
+# Copy executables
+# Copy XIOS XML files into run directory
+# Copy namelist files into run directory
+#
+mkdir -p "${run_dir:?}"
+cp -u xios_config/*xml "${run_dir}"
+cp -u namelists/* "${run_dir}"
+cd "${run_dir}"
+cp -u "${nem_exe_file:?}" .
+cp -u "${xio_exe_file:?}" .
+
+# Write fake file for previous fresh water budget adjustment (nn_fwb==2 in namelist)
+[[ ! -f EMPave_old.dat ]] && echo "                               0  0.0000000000000000E+00  0.0000000000000000E+00" > EMPave_old.dat
+#TODO: Enquiry about this
+#
+# Link data files into run directory
+# Attention: no space in filenames allowed!
+# (No protection against word splitting by design)
+#
+for file in "${ic_files[@]}"; do 
+    [[ ! -e ${file#*> } ]] && ln -sf $(sed 's/ *=> */ /' <<< "${ini_data_dir}/${ic_subdir}/${nem_grid}/$file") 
+done
+for file in "${forcing_files[@]}"; do 
+    [[ ! -e ${file#*> } ||  "$file" == \** ]] && ln -sf $(sed 's/ *=> */ /' <<< "${ini_data_dir}/${forcing_subdir}/${nem_forcing_set}/$file")
+done
+for file in "${shared_files[@]}"; do
+    [[ ! -e ${file#*> } ]] && ln -sf $(sed 's/ *=> */ /' <<< "${shared_dir}/$file")
+done
+
+
+#
+# Normalize date formats
+#
+run_start_date=$(date -uR -d "${run_start_date}")
+run_end_date="${run_start_date} + ${run_duration:?}"
+run_end_date=$(date -uR -d "${run_end_date}")
+
+run_start_epoch=$(date -u -d"${run_start_date}" +%s)
+run_end_epoch=$(date -u -d"${run_end_date}" +%s)
+
+for (( ; run_num_legs>0 ; run_num_legs-- ))
+do
+
+    #
+    # Initialize variables (using restart file if it exists)
+    # Variables ending in '_date' are in RFC2822
+    # Variables ending in '_epoch' are in nb of seconds since 1970-01-01
+    #
+    [[ -r "${info_file:?}" ]] && source "${info_file:?}"
+    leg_start_date=${leg_end_date:-$run_start_date}
+    leg_number=$((${leg_number:=0}+1))
+    leg_start_epoch=$(date -u -d "${leg_start_date}" +%s)
+    leg_end_epoch=$(date -u -d "${leg_start_date:?} + ${rst_freq:=$run_duration}" +%s)
+    leg_end_date=$(date -uR -d@"${leg_end_epoch}")
+    leg_length_sec=$(( leg_end_epoch - leg_start_epoch ))
+    leg_start_sec=$(( leg_start_epoch - run_start_epoch ))
+    leg_end_sec=$(( leg_end_epoch - run_start_epoch ))
+    leg_start_date_yyyymmdd=$(date -u -d "${leg_start_date}" +%Y%m%d) # FIXME appears unused
+    # Correct for leap days because NEMO standalone uses no-leap calendar
+    leg_length_sec=$(( leg_length_sec - $(leap_days "${leg_start_date}" "${leg_end_date}")*24*3600 ))
+    leg_start_sec=$(( leg_start_sec - $(leap_days "${run_start_date}" "${leg_start_date}")*24*3600 ))
+    leg_end_sec=$(( leg_end_sec - $(leap_days "${run_start_date}" "${leg_end_date}")*24*3600 ))
+    (( leg_number > 1 )) && leg_is_restart=true || leg_is_restart=false
+
+    #
+    # Compute leg end-date and trim if necessary
+    #
+    (( leg_end_epoch > run_end_epoch )) && leg_end_date=${run_end_epoch}
+
+    #
+    # Check whether there is some work left to do
+    #
+    if (( leg_start_epoch >= run_end_epoch ))
+    then
+        echo "Leg start date equal to or after end of simulation."
+        echo "Nothing left to do. Cleaning and exiting."
+	for (( n=0 ; n<nem_numproc ; n++ ))
+	do
+            np=$(printf %04d ${n})
+	    rm -f "restart_oce_${np}.nc"
+	    rm -f "restart_ice_${np}.nc"
+	done
+        exit 0
+    fi
+
+    #
+    # Update namelist
+    #
+    source build_namelist_cfg.sh > namelist_cfg
+
+    #
+    # Link the restart files
+    #
+    ns=$(printf %08d $(( leg_start_sec / nem_time_step_sec - nem_restart_offset )))
+    if ((leg_start_sec > 0 )); then
+    for (( n=0 ; n<nem_numproc ; n++ ))
+    do
+        np=$(printf %04d ${n})
+        [[ -f "${exp_name:?}_${ns}_restart_oce_${np}.nc" ]] || { echo "Error: restart file not found." ; exit 2 ; }
+        ln -fs "${exp_name:?}_${ns}_restart_oce_${np}.nc" "restart_oce_${np}.nc"
+        [[ -f "${exp_name:?}_${ns}_restart_ice_${np}.nc" ]] || { echo "Error: restart file not found." ; exit 2 ; }
+        ln -fs "${exp_name:?}_${ns}_restart_ice_${np}.nc" "restart_ice_${np}.nc"
+    done
+    fi
+
+    # Stop here is preponly was specified
+    [[ $@ == *preponly* ]] && exit 0
+
+    #
+    # Run nemo
+    #
+    time_begin=$(date +%s)
+    mpirun -np "${xio_numproc:?}" "${xio_exe_file:?}" : -np "${nem_numproc:?}" "${nem_exe_file:?}"
+    time_end=$(date +%s)
+
+#############################
+
+    formatted_leg_number=$(printf %03d $((leg_number)))
+    #
+    # Move NEMO output files to archive directory
+    # 
+    outdir="${archive_dir:?}/output/${formatted_leg_number}"
+    mkdir -p "${outdir}"
+
+    shopt -s nullglob
+    for v in grid_U grid_V grid_W grid_T icemod icemoa SBC SBC_scalar scalar
+    do
+        for f in ${exp_name}_??_????????_????????_${v}_????.nc
+        do
+             mv "$f" "$outdir/"
+        done
+        for f in ${exp_name}_??_????????_????????_${v}.nc
+        do
+             mv "$f" "$outdir/"
+        done
+        for f in ${exp_name}_??_${v}.nc
+        do
+            mv "$f" "$outdir/"
+        done
+    done
+
+    #
+    # Move NEMO restart files from previous run to archive directory
+    #
+        outdir="$archive_dir/restart/${formatted_leg_number}"
+        mkdir -p "${outdir}"
+
+        for f in ${exp_name}_${ns}_restart_???_????.nc
+        do
+               [ -f "$f" ] && mv "$f" "${outdir}"
+        done
+
+    #
+    # Move log files to archive directory
+    #
+    outdir="$archive_dir/log/${formatted_leg_number}"
+    mkdir -p "${outdir}"
+    for f in ocean.output time.step solver.stat ; do mv "${f}" "${outdir}"; done
+#
+#
+##############################
+
+    shopt -u nullglob
+
+    # 
+    # Write checkpoint control file
+    # TODO: enquiry why 0 -1 +2 rather than 2- 1
+    #
+    tr=$(date -d "0 -$time_begin sec + $time_end sec" +%T) 
+    current_date=$(date +'%F %T')
+    {
+      echo "#"
+      echo "# Finished leg at ${current_date} after ${tr} (hh:mm:ss)" 
+      echo "leg_number=${leg_number}"
+      echo "leg_start_date=\"${leg_start_date}\""
+      echo "leg_end_date=\"${leg_end_date}\""
+    } | tee -a "${info_file}"
+
+done
+#
+# Move back to submission directory
+#
+cd - >/dev/null
+#
+# Check whether there is some work left to do in a further job
+#
+[[ $@ == *noresubmit* ]] && exit 0
+if (( leg_end_epoch < run_end_epoch )) ;
+then
+    echo "Leg end earlier than end of simulation."
+    echo "Submitting another job."
+    #[[ $@ == *local* ]] && exec $0 $@ || scontrol requeue $SLURM_JOB_ID #TODO: factorize this
+    if [[ "$@" == *local* ]] 
+    then
+        exec "$0" "$@"
+    elif [[ "${submit_command}" == *sbatch* ]]
+    then
+        "${submit_command}" "$0" "$@" | awk '{print $4}' >> "${run_dir}"/.coral_jobs
+    else
+        "${submit_command}" -v PBS_OPTIONS="$@" "$0" | tee -a coral_jobs
+        sleep 2
+        jobid=`cat coral_jobs`
+        rm -f coral_jobs
+        jobid=${jobid%.*}
+        echo "${jobid}" >> "${run_dir}"/.coral_jobs
+    fi
+else
+    echo "Nothing left to do. Cleaning and exiting." # FIXME Factorize this (we have two exit points)
+    for (( n=0 ; n<nem_numproc ; n++ ))
+    do
+        np=$(printf %04d ${n})
+        rm -f "restart_oce_${np}.nc"
+        rm -f "restart_ice_${np}.nc"
+    done
+fi
+
+exit 0

+ 1 - 0
templates/storm/.coral_template

@@ -0,0 +1 @@
+pingo_py

+ 31 - 0
templates/storm/data.cfg

@@ -0,0 +1,31 @@
+ini_data_dir=/nas02/barthele/NEMO
+ic_subdir=CONFIG_FILES
+nem_grid=ORCA1
+ic_files=(
+    "clipped_eORCA_R1_coordinates_v1.0.nc => coordinates.nc" 
+    "clipped_eORCA1_R1_bathy_meter_v2.1.nc => bathy_meter.nc" 
+    "clipped_eORCA_R1_ahmcoef_v1.0.nc => ahmcoef.nc" 
+    "clipped_eORCA_R1_maskITF_v1.0.nc => mask_itf.nc" 
+    "clipped_eORCA_R1_K1_v1.0.nc => K1rowdrg.nc" 
+    "clipped_eORCA_R1_M2_v1.0.nc => M2rowdrg.nc"
+    "clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc"
+    "conservative_temperature_WOA13_decav_Reg1L75_clim.nc"
+    "absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_2D.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_3D.nc"
+)
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+#
+forcing_subdir=FORCINGS
+nem_forcing_set=DFS5.2
+forcing_files=(
+    "* => ."
+)
+#
+shared_files=(
+    "namelist_ice_lim3_ref => namelist_ice_ref"
+    "namelist_ref"
+    "domain_def.xml"
+    "field_def.xml"
+)

+ 22 - 0
templates/storm/experiment.cfg

@@ -0,0 +1,22 @@
+# Experience name
+exp_name=EXP0
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1958-01-01"
+run_duration="1 month"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 month"
+
+# Number of restart legs to be run in one go
+run_num_legs=1
+
+# Parameters
+nem_time_step_sec=3600
+lim_time_step_sec=21600
+nem_restart_offset=0
+nem_config_name=ORCA1_LIM3_REF
+
+# This file is used to store information about restarts
+info_file="nemo.info"

+ 7 - 0
templates/storm/job.cfg

@@ -0,0 +1,7 @@
+#
+start_dir=${PWD}
+run_dir="/pfast/$USER/nemo/run/${exp_name}"
+archive_dir="/pfast/$USER/nemo/archive/${exp_name}"
+
+# Cancel job on error
+set -ueo pipefail

+ 406 - 0
templates/storm/namelists/build_namelist_cfg.sh

@@ -0,0 +1,406 @@
+# This configuration namelist will overwrite SHARED/namelist_ref
+#
+if $leg_is_restart
+then
+    nemo_restart=".TRUE."
+else
+    nemo_restart=".FALSE."
+fi
+
+cat << EOF
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OPA  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp        =  "${exp_name}" !  experience name
+   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
+   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
+   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
+                                  !    used if ln_rstart=F or
+                                  !    (ln_rstart=T and nn_rstctl=0 or 1)
+   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
+   nn_rstctl     =  1             !  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  = "restart_oce"  !  suffix of ocean restart name (input)
+   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
+   nn_stock      =  0             !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_write      = -1             !  frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration
+!-----------------------------------------------------------------------
+   cp_cfg      =  "orca"               !  name of the configuration
+   jp_cfg      =       1               !  resolution of the configuration
+   jpidta      =     362               !  1st lateral dimension ( >= jpi )
+   jpjdta      =     292               !  2nd    "         "    ( >= jpj )
+   jpkdta      =      75               !  number of levels      ( >= jpk )
+   jpiglo      =     362               !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     292               !  2nd    -                  -    --> j  =jpjdta
+   jperio      =       6               !  6 cyclic East-West AND North fold F-point pivot
+/
+!-----------------------------------------------------------------------
+&namzgr        !   vertical coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdom        !   space and time domain (bathymetry, mesh, timestep)
+!-----------------------------------------------------------------------
+   nn_msh      =    0                  !  create (=1) a mesh file or not (=0)
+   rn_hmin     =    20.                !  min depth of the ocean (>0) or min number of ocean level (<0)
+   rn_rdt      = ${nem_time_step_sec} !  time step for the dynamics (and tracer if nn_acc=0)
+   jphgr_msh   =       0               !  type of horizontal mesh
+   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
+   ppgphi0     =  999999.0             ! latitude  of first raw and column T-point (jphgr_msh = 1)
+   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
+   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
+   ppsur       =   -3958.951371276829  !  ORCA r4, r2 and r05 coefficients
+   ppa0        =     103.9530096000000 ! (default coefficients)
+   ppa1        =       2.415951269000000   !   
+   ppkth       =      15.35101370000000    !   
+   ppacr       =       7.0             !
+   ppdzmin     =  999999.0             !  Minimum vertical spacing
+   pphmax      =  999999.0             !  Maximum depth
+   ldbletanh   =   .TRUE.              !  Use/do not use double tanf function for vertical coordinates
+   ppa2        =     100.7609285000000 !  Double tanh function parameters
+   ppkth2      =      48.02989372000000    !   
+   ppacr2      =      13.00000000000   !
+/
+!-----------------------------------------------------------------------
+&namsplit      !   time splitting parameters  ("key_dynspg_ts")
+!-----------------------------------------------------------------------
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options                             ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtsd    !   data : Temperature  & Salinity
+!-----------------------------------------------------------------------
+!          !  file name                                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!          !                                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_tem  = 'conservative_temperature_WOA13_decav_Reg1L75_clim.nc',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   sn_sal  = 'absolute_salinity_WOA13_decav_Reg1L75_clim.nc'       ,         -1        ,'vosaline' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   !
+   ln_tsd_tradmp = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition (surface module)
+!-----------------------------------------------------------------------
+   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of surface boundary condition computation
+                           !     (also = the frequency of sea-ice model call)
+   nn_isf      = 3         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf)
+                           !  0 =no isf                  1 = presence of ISF
+                           !  2 = bg03 parametrisation   3 = rnf file for isf
+                           !  4 = ISF fwf specified
+                           !  option 1 and 4 need ln_isfcav = .true. (domzgr)
+   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
+                           !     =1 global mean of e-p-r set to zero at each time step
+                           !     =2 annual global mean of e-p-r set to zero
+/
+!-----------------------------------------------------------------------
+&namsbc_ana    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_flx    !   surface boundary condition : flux formulation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_utau     = 'uwnd_10m'  ,       24          , 'uwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_vtau     = 'vwnd_10m'  ,       24          , 'vwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_wndm     = 'ncep_bulk' ,       24          , 'wspd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_tair     = 'ncep_bulk' ,       24          , 'air'     ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_humi     = 'flx_correc',       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_ccov     = 'flx_correc',       -1          , 'socliocl',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_prec     = 'flx_correc',       -1          , 'socliopl',   .true.     , .true. , 'yearly'  , ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_core   !   namsbc_core  CORE bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name              ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights                                     ! rotation ! land/sea mask !
+!              !                         !  (if <0  months)  !   name   !   (logical)  !  (T/F)  ! 'monthly' ! filename                                    ! pairing  ! filename      !
+
+   sn_wndi     = 'drowned_u10_DFS5.2'    ,         3         , 'u10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'U1'     , ''
+   sn_wndj     = 'drowned_v10_DFS5.2'    ,         3         , 'v10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'V1'     , ''
+   sn_qsr      = 'drowned_radsw_DFS5.2'  ,        24         , 'radsw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_qlw      = 'drowned_radlw_DFS5.2'  ,        24         , 'radlw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_tair     = 'drowned_t2_DFS5.2'     ,         3         , 't2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_humi     = 'drowned_q2_DFS5.2'     ,         3         , 'q2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_prec     = 'drowned_precip_DFS5.2' ,        24         , 'precip' ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_snow     = 'drowned_snow_DFS5.2'   ,        24         , 'snow'   ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+
+   rn_zqt      = 2.        !  Air temperature and humidity reference height (m)
+/
+!-----------------------------------------------------------------------
+&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_qsr    !   penetrative solar radiation
+!-----------------------------------------------------------------------
+   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf    !   runoffs namelist surface boundary condition
+!-----------------------------------------------------------------------
+!              !  file name                                              ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !                                                         !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_rnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',        -1         , 'sorunoff' , .true.       , .true. , 'yearly'  , ''       , ''       , ''
+   sn_cnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',         0         , 'socoefr'  , .false.      , .true. , 'yearly'  , ''       , ''       , ''
+
+   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_depth_ini = .true.   ! compute depth at initialisation from runoff file
+   rn_rnf_max   = 0.05      !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+/
+!-----------------------------------------------------------------------
+&namsbc_isf    !  Top boundary layer (ISF)
+!-----------------------------------------------------------------------
+!                ! file name                                                ! frequency (hours) ! variable     ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
+!                !                                                          !  (if <0  months)  !   name       !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
+   sn_rnfisf     = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sornfisf'    ,    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmax_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmax_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmin_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmin_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr    !   surface boundary condition : sea surface restoring
+!-----------------------------------------------------------------------
+!              !  file name                                          ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!              !                                                     !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_sss      = 'sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc' ,        -1         , 'sosaline',    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_2D.nc', ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_alb    !   albedo parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
+                           !  free slip  !   partial slip  !   no slip   ! strong slip
+/
+!-----------------------------------------------------------------------
+&namcla        !   cross land advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namagrif      !  AGRIF zoom                                            ("key_agrif")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_tide      !   tide parameters (#ifdef key_tide)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy        !  unstructured open boundaries                          ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_dta      !  open boundaries - external data           ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_tide     ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambfr        !   bottom friction
+!-----------------------------------------------------------------------
+   nn_bfr      =    2      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
+                           !                              = 2 : nonlinear friction
+/
+!-----------------------------------------------------------------------
+&nambbc        !   bottom temperature boundary condition
+!-----------------------------------------------------------------------
+   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
+                           !     = 1 constant flux
+                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
+/
+!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nameos        !   ocean physical parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv    !   advection scheme for tracer
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
+!-----------------------------------------------------------------------
+/
+!----------------------------------------------------------------------------------
+&namtra_ldf    !   lateral diffusion scheme for tracers
+!----------------------------------------------------------------------------------
+   rn_aht_0         =  1000.     !  horizontal eddy diffusivity for tracers [m2/s]
+   rn_aeiv_0        =  1000.     !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
+/
+!-----------------------------------------------------------------------
+&namtra_dmp    !   tracer: T & S newtonian damping
+!-----------------------------------------------------------------------
+   ln_tradmp   =  .false.  !  add a damping termn (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv    !   formulation of the momentum advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_vvl    !   vertical coordinate options
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg    !   Hydrostatic pressure gradient option
+!-----------------------------------------------------------------------
+   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .true.    !  s-coordinate (standard jacobian formulation)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf    !   lateral diffusion on momentum
+!-----------------------------------------------------------------------
+   rn_ahm_0_lap     = 20000.    !  horizontal laplacian eddy viscosity   [m2/s]
+/
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!-----------------------------------------------------------------------
+/
+!------------------------------------------------------------------------
+&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
+!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsol        !   elliptic solver / island / free surface
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
+!-----------------------------------------------------------------------
+   jpni        =   2      !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   4      !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =   8     !  jpnij  number of local domains (set automatically if < 1)
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints & Benchmark
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto       ! Stochastic parametrization of EOS
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namflo       !   float parameters                                      ("key_float")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namptr       !   Poleward Transport Diagnostic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namhsb       !  Heat and salt budgets
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_diaharm   !   Harmonic analysis of tidal constituents ('key_diaharm')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdct        ! transports through sections
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namobs       !  observation usage switch                               ('key_diaobs')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_asminc   !   assimilation increments                               ('key_asminc')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_wave   ! External fields from wave model
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
+!-----------------------------------------------------------------------
+/
+EOF

+ 36 - 0
templates/storm/namelists/namelist_ice_cfg

@@ -0,0 +1,36 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/LIM-3 : Ice configuration namelist. Overwrites SHARED/namelist_ice_lim3_ref
+!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!-----------------------------------------------------------------------
+&namicerun     !   Share parameters for dynamics/advection/thermo
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceini     !   ice initialisation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitd     !   Ice discretization
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicedyn     !   ice dynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicehdf     !   Ice horizontal diffusion
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicethd     !   ice thermodynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicesal     !   ice salinity
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitdme   !   parameters for mechanical redistribution of ice 
+!-----------------------------------------------------------------------
+/

+ 19 - 0
templates/storm/programs.cfg

@@ -0,0 +1,19 @@
+module_list="null"
+extralibs_list=""
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nemo_src_dir=${HOME}/modeles/NEMO/3.6
+shared_dir=${nemo_src_dir}/CONFIG/SHARED
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+nem_numproc=8
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-2.0_gcc/bin/xios_server.exe
+xio_numproc=1
+

+ 125 - 0
templates/storm/xios_config/context_nemo.xml

@@ -0,0 +1,125 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-opa.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-lim.xml"/>   <!--  NEMO ocean sea ice                      -->
+    <!-- <field_definition src="./field_def_nemo-pisces.xml"/> -->  <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-opa.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-lim.xml"/>     <!--  NEMO ocean sea ice                      -->
+    <!-- <file_definition src="./file_def_nemo-pisces.xml"/> -->    <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+      <axis id="nfloat" long_name="Float number"      unit="-"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+      <axis id="ncatice" long_name="Ice category"       unit="1"               />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition>    
+
+        <!--  -->
+       <grid id="grid_T_2D" >
+         <domain id="grid_T" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D_ncatice" >
+         <domain id="grid_T" />
+         <axis id="ncatice" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D" >
+         <domain id="grid_T" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_2D" >
+         <domain id="grid_U" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_3D" >
+         <domain id="grid_U" />
+         <axis id="depthu" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_2D" >
+         <domain id="grid_V" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_3D" >
+         <domain id="grid_V" />
+         <axis id="depthv" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_2D" >
+         <domain id="grid_W" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_3D" >
+         <domain id="grid_W" />
+         <axis id="depthw" />
+       </grid>
+        <!--  -->
+       <grid id="grid_1point" >
+         <domain domain_ref="1point"/>
+       </grid>
+        <!--  -->
+       <grid id="grid_T_nfloat" >
+         <domain id="grid_T" />
+         <axis id="nfloat" />
+       </grid>
+        <!--  -->
+       <grid id="grid_EqT" >
+         <domain domain_ref="EqT" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_2D">
+         <domain id="gznl" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_3D">
+         <domain id="gznl" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_W_3D">
+         <domain id="gznl" />
+         <axis id="depthw" />
+       </grid>
+
+      <grid id="grid_ptr_T_2D">
+       <domain id="ptr" />
+      </grid>
+
+      <grid id="grid_ptr_T_3D">
+       <domain id="ptr" />
+         <axis id="deptht" />
+       </grid>
+
+      <grid id="grid_ptr_W_3D">
+       <domain id="ptr" />
+         <axis id="depthw" />
+      </grid>
+
+    </grid_definition>   
+
+</context>

+ 194 - 0
templates/storm/xios_config/domain_def_nemo.xml

@@ -0,0 +1,194 @@
+
+   <domain_definition>
+     <domain_group id="grid_T">
+       <domain id="grid_T" long_name="grid T"/>
+       <!--   My zoom: example of hand defined zoom   -->
+       <domain id="myzoom" domain_ref="grid_T" >
+          <zoom_domain id="myzoom"  ibegin="139" jbegin="119" ni="5" nj="5" />
+       </domain>
+       <domain id="1point" domain_ref="grid_T" >
+          <zoom_domain id="1point" ibegin="139" jbegin="119" ni="1" nj="1" />
+       </domain>
+         <!--   Eq section -->
+       <domain id="EqT" domain_ref="grid_T" >
+	      <zoom_domain id="EqT" ibegin="0" jbegin="0000" ni="0000" nj="1" />
+	   </domain>
+         <!--   TAO : see example above   -->
+         <!--   137e   -->
+         <!-- <domain id="2n137eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n137eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n137eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   147e   -\-> -->
+         <!-- <domain id="0n147eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n147eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n147eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   156e   -\-> -->
+         <!-- <domain id="5s156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n156eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   165e   -\-> -->
+         <!-- <domain id="8s165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n165eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   180w   -\-> -->
+         <!-- <domain id="8s180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n180wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   170w   -\-> -->
+         <!-- <domain id="8s170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n170wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   155w   -\-> -->
+         <!-- <domain id="8s155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n155wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   140w   -\-> -->
+         <!-- <domain id="8s140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n140wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   125w   -\-> -->
+         <!-- <domain id="8s125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n125wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   110w   -\-> -->
+         <!-- <domain id="8s110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n110wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   95w   -\-> -->
+         <!-- <domain id="8s95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2s95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="2n95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5n95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n95wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   RAMA   -\-> -->
+         <!-- <\!--   55e   -\-> -->
+         <!-- <domain id="16s55eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12s55eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8s55eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4s55eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5s55eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n55eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5n55eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n55eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!--    <\!--   65e   -\-> -->
+         <!-- <domain id="15n65eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!--    <\!--   67e   -\-> -->
+         <!-- <domain id="16s67eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12s67eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8s67eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4s67eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5s67eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n67eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5n67eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n67eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n67eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   80.5e   -\-> -->
+         <!-- <domain id="16s80.5eT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12s80.5eT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8s80.5eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4s80.5eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5s80.5eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n80.5eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5n80.5eT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n80.5eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   90e   -\-> -->
+         <!-- <domain id="1.5s90eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n90eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="1.5n90eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n90eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n90eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12n90eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="15n90eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   95e   -\-> -->
+         <!-- <domain id="16s95eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12s95eT"    domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8s95eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="5s95eT"     domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   PIRATA   -\-> -->
+         <!-- <\!--   38w-30w   -\-> -->
+         <!-- <domain id="19s34wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="14s32wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8s30wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n35wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n38wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="8n38wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12n38wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="15n38wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="20n38wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   23w   -\-> -->
+         <!-- <domain id="0n23wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="4n23wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="12n23wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="21n23wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   10w   -\-> -->
+         <!-- <domain id="10s10wT" domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="6s10wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <domain id="0n10wT"  domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+         <!-- <\!--   0e   -\-> -->
+         <!-- <domain id="0n0eT"   domain_ref="grid_T" zoom_ibegin="0000" zoom_jbegin="0000" zoom_ni="1" zoom_nj="1" /> -->
+      </domain_group>
+
+      <domain_group id="grid_U">
+         <domain id="grid_U" long_name="grid U"/>
+         <!--   Eq section   -->
+         <domain id="EqU" domain_ref="grid_U" >
+	   <zoom_domain id="EqU" ibegin="1" jbegin="0000" ni="0000" nj="1" /> 
+	 </domain>    
+      </domain_group>
+
+      <domain id="grid_V" long_name="grid V"/>
+
+      <domain_group id="grid_W">
+         <domain id="grid_W" long_name="grid W"/>
+         <!--   Eq section   -->
+         <domain id="EqW" domain_ref="grid_W" >
+	   <zoom_domain id="EqW" ibegin="1" jbegin="0000" ni="0000" nj="1" />
+	 </domain>   
+      </domain_group>
+
+      <domain_group id="scalarpoint">
+         <domain id="scalarpoint" long_name="scalar"/>
+      </domain_group>
+
+        <domain_group id="gznl">
+         <domain id="gznl" long_name="gznl"/>
+         <domain id="ptr" domain_ref="gznl" >
+	   <zoom_domain id="ptr" ibegin="0000" jbegin="0" ni="1" nj="0000" />
+	</domain>  
+        </domain_group>
+
+   </domain_definition>    
+ 

+ 199 - 0
templates/storm/xios_config/field_def_nemo-lim.xml

@@ -0,0 +1,199 @@
+<?xml version="1.0"?> 
+    <!-- $id$ -->
+    
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+   <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+
+      <field_group id="SBC" grid_ref="grid_T_2D" > <!-- time step automaticaly defined based on nn_fsbc -->
+         <!-- ice LIM fields -->
+         <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            />
+
+         <field id="qsr_ai_cea"   long_name="Air-Ice downward solar heat flux (cell average)"              standard_name="surface_downwelling_shortwave_flux_in_air"          unit="W/m2"         />
+         <field id="qns_ai_cea"   long_name="Air-Ice downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         />
+         <field id="qla_ai_cea"   long_name="Air-Ice downward Latent heat flux (cell average)"             standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"         />
+         
+         <field id="qsr_io_cea"   long_name="Ice-Oce downward solar heat flux (cell average)"              standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         />
+         <field id="qns_io_cea"   long_name="Ice-Oce downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         />
+         
+         <field id="snowthic_cea" long_name="Snow thickness (cell average)"                                standard_name="surface_snow_thickness"                             unit="m"            />
+         <field id="icethic_cea"  long_name="Ice thickness (cell average)"                                 standard_name="sea_ice_thickness"                                  unit="m"            />
+         <field id="iceprod_cea"  long_name="Ice production (cell average)"                                                                                                   unit="m/s"          />
+         <field id="iiceconc"     long_name="Ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="1"            />
+         
+         <field id="ice_pres"     long_name="Ice presence"                                                                                                                    unit=""             />
+         <field id="ist_cea"      long_name="Ice surface temperature (cell average)"                       standard_name="surface_temperature"                                unit="degC"         />
+         <field id="ist_ipa"      long_name="Ice surface temperature (ice presence average)"               standard_name="surface_temperature"                                unit="degC"         />      
+         <field id="uice_ipa"     long_name="Ice velocity along i-axis at I-point (ice presence average)"  standard_name="sea_ice_x_velocity"                                 unit="m/s"          />      
+         <field id="vice_ipa"     long_name="Ice velocity along j-axis at I-point (ice presence average)"  standard_name="sea_ice_y_velocity"                                 unit="m/s"          />      
+         
+         <field id="utau_ice"     long_name="Wind stress along i-axis over the ice at i-point"             standard_name="surface_downward_x_stress"                          unit="N/m2"         />
+         <field id="vtau_ice"     long_name="Wind stress along j-axis over the ice at i-point"             standard_name="surface_downward_y_stress"                          unit="N/m2"         />
+         
+         <field id="u_imasstr"    long_name="Sea-ice mass transport along i-axis"                          standard_name="sea_ice_x_transport"                                unit="kg/s"         />
+         <field id="v_imasstr"    long_name="Sea-ice mass transport along j-axis"                          standard_name="sea_ice_y_transport"                                unit="kg/s"         />
+         <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" />
+         <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />        
+       
+         <field id="iceconc"      long_name="ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="%"            />
+       	 <field id="isst"         long_name="sea surface temperature"                                      standard_name="sea_surface_temperature"                            unit="degC"         />
+         <field id="isss"         long_name="sea surface salinity"                                         standard_name="sea_surface_salinity"                               unit="1e-3"         /> 
+         <field id="qt_oce"       long_name="total flux at ocean surface"                                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"         />
+         <field id="qsr_oce"      long_name="solar heat flux at ocean surface"                             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         />
+         <field id="qns_oce"      long_name="non-solar heat flux at ocean surface"                                                                                            unit="W/m2"         />
+         <field id="qt_ice"       long_name="total heat flux at ice surface: sum over categories"          standard_name="surface_downward_heat_flux_in_air"                  unit="W/m2"         />
+         <field id="qsr_ice"      long_name="solar heat flux at ice surface: sum over categories"          standard_name="surface_downwelling_shortwave_flux_in_air"          unit="W/m2"         />
+         <field id="qns_ice"      long_name="non-solar heat flux at ice surface: sum over categories"                                                                         unit="W/m2"         />
+         <field id="qtr_ice"      long_name="solar heat flux transmitted through ice: sum over categories"                                                                    unit="W/m2"         />
+         <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                                            unit="W/m2"         />
+         <field id="micesalt"     long_name="Mean ice salinity"                                                                                                               unit="1e-3"         />
+         <field id="miceage"      long_name="Mean ice age"                                                                                                                    unit="years"        />
+         <field id="alb_ice"      long_name="Mean albedo over sea ice"                                                                                                        unit=""             />
+         <field id="albedo"       long_name="Mean albedo over sea ice and ocean"                                                                                              unit=""             />
+
+         <field id="iceage_cat"   long_name="Ice age for categories"                                       unit="days"   grid_ref="grid_T_3D_ncatice" />
+         <field id="iceconc_cat"  long_name="Ice concentration for categories"                             unit="%"      grid_ref="grid_T_3D_ncatice" />
+         <field id="icethic_cat"  long_name="Ice thickness for categories"                                 unit="m"      grid_ref="grid_T_3D_ncatice" />
+         <field id="snowthic_cat" long_name="Snow thicknessi for categories"                               unit="m"      grid_ref="grid_T_3D_ncatice" />
+         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="g/kg"   grid_ref="grid_T_3D_ncatice" />
+         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      grid_ref="grid_T_3D_ncatice" />
+         <field id="icetemp_cat"  long_name="Ice temperature for categories"                               unit="degC"   grid_ref="grid_T_3D_ncatice" />
+         <field id="snwtemp_cat"  long_name="Snow temperature for categories"                              unit="degC"   grid_ref="grid_T_3D_ncatice" />
+
+         <field id="micet"        long_name="Mean ice temperature"                                         unit="degC"     />
+         <field id="icehc"        long_name="ice total heat content"                                       unit="10^9J"    /> 
+         <field id="isnowhc"      long_name="snow total heat content"                                      unit="10^9J"    />
+         <field id="icest"        long_name="ice surface temperature"                                      unit="degC"     />
+         <field id="ibrinv"       long_name="brine volume"                                                 unit="%"        />
+         <field id="icecolf"      long_name="frazil ice collection thickness"                              unit="m"        />
+         <field id="icestr"       long_name="ice strength"                                                 unit="N/m"      />
+         <field id="icevel"       long_name="ice velocity"                                                 unit="m/s"      />
+         <field id="idive"        long_name="divergence"                                                   unit="1e-8s-1"  />
+         <field id="ishear"       long_name="shear"                                                        unit="1e-8s-1"  />
+         <field id="icevolu"      long_name="ice volume"                                                   unit="m"        />
+         <field id="snowvol"      long_name="snow volume"                                                  unit="m"        />
+         <field id="tau_icebfr"   long_name="ice friction on ocean bottom for landfast ice"                unit="N/2"      />
+
+         <field id="icetrp"       long_name="ice volume transport"                                         unit="m/day"          />
+         <field id="snwtrp"       long_name="snw volume transport"                                         unit="m/day"          />
+         <field id="saltrp"       long_name="salt content transport"                                       unit="1e-3*kg/m2/day" />
+         <field id="deitrp"       long_name="advected ice enthalpy"                                        unit="W/m2"           />
+         <field id="destrp"       long_name="advected snw enthalpy"                                        unit="W/m2"           />
+
+         <field id="sfxbri"       long_name="brine salt flux"                                              unit="1e-3*kg/m2/day" />
+         <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="1e-3*kg/m2/day" />
+         <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="1e-3*kg/m2/day" />
+         <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="1e-3*kg/m2/day" />
+         <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="1e-3*kg/m2/day" />
+         <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="1e-3*kg/m2/day" />
+         <field id="sfxlam"       long_name="salt flux from lateral melt"                                  unit="1e-3*kg/m2/day" />
+         <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/day" />
+         <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/day" />
+         <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/day" />
+         <field id="sfx"          long_name="salt flux total"                                              unit="1e-3*kg/m2/day" />
+
+         <field id="vfxbog"       long_name="daily bottom thermo ice prod."                                unit="m/day"   />
+         <field id="vfxdyn"       long_name="daily  dynamic ice prod."                                     unit="m/day"   />
+         <field id="vfxopw"       long_name="daily lateral thermo ice prod."                               unit="m/day"   />
+         <field id="vfxsni"       long_name="daily snowice ice prod."                                      unit="m/day"   />
+         <field id="vfxsum"       long_name="surface melt"                                                 unit="m/day"   />
+         <field id="vfxlam"       long_name="lateral melt"                                                 unit="m/day"   />
+         <field id="vfxbom"       long_name="bottom melt"                                                  unit="m/day"   />
+         <field id="vfxres"       long_name="daily resultant ice prod./melting from limupdate"             unit="m/day"   />
+         <field id="vfxice"       long_name="ice melt/growth"                                              unit="m/day"   />
+         <field id="vfxsnw"       long_name="snw melt/growth"                                              unit="m/day"   />
+         <field id="vfxsub"       long_name="snw sublimation"                                              unit="m/day"   />
+         <field id="vfxsub_err"   long_name="excess of snw sublimation sent to ocean"                      unit="m/day"   />
+         <field id="vfxspr"       long_name="snw precipitation on ice"                                     unit="m/day"   />
+         <field id="vfxthin"      long_name="daily thermo ice prod. for thin ice(20cm) + open water"       unit="m/day"   />
+
+         <field id="afxtot"       long_name="area tendency (total)"                                        unit="day-1"   />
+         <field id="afxdyn"       long_name="area tendency (dynamics)"                                     unit="day-1"   />
+         <field id="afxthd"       long_name="area tendency (thermo)"                                       unit="day-1"   />
+
+         <field id="hfxsum"       long_name="heat fluxes causing surface ice melt"                         unit="W/m2"  />
+         <field id="hfxbom"       long_name="heat fluxes causing bottom ice melt"                          unit="W/m2"  />
+         <field id="hfxbog"       long_name="heat fluxes causing bottom ice growth"                        unit="W/m2"  />
+         <field id="hfxdif"       long_name="heat fluxes causing ice temperature change"                   unit="W/m2"  />
+         <field id="hfxopw"       long_name="heat fluxes causing open water ice formation"                 unit="W/m2"  />
+         <field id="hfxsnw"       long_name="heat fluxes causing snow melt"                                unit="W/m2"  />
+         <field id="hfxerr"       long_name="heat fluxes error after heat diffusion"                       unit="W/m2"  />
+         <field id="hfxerr_rem"   long_name="heat fluxes error after remapping"                            unit="W/m2"  />
+         <field id="hfxout"       long_name="total heat fluxes received by the ocean"                      unit="W/m2"  />
+         <field id="hfxin"        long_name="total heat fluxes at the ice/ocean surface"                   unit="W/m2"  />
+
+         <!-- heat flux associated with mass exchange -->
+         <field id="hfxthd"       long_name="heat fluxes from ice-ocean mass exchange during thermo"       unit="W/m2"  />
+         <field id="hfxdyn"       long_name="heat fluxes from ice-ocean mass exchange during dynamic"      unit="W/m2"  />
+         <field id="hfxres"       long_name="heat fluxes from ice-ocean mass exchange during resultant"    unit="W/m2"  />
+         <field id="hfxsub"       long_name="heat fluxes from ice-atm. mass exchange during sublimation"   unit="W/m2"  />
+         <field id="hfxspr"       long_name="heat fluxes from ice-atm. mass exchange during snow precip"   unit="W/m2"  />
+
+         <!-- diags -->
+         <field id="hfxdhc"       long_name="Heat content variation in snow and ice"                       unit="W/m2" />
+         <field id="hfxtur"       long_name="turbulent heat flux at the ice base"                          unit="W/m2" />
+	 <!-- sbcssm variables -->
+         <field id="sst_m"    unit="degC" />
+         <field id="sss_m"    unit="psu"  />
+         <field id="ssu_m"    unit="m/s"  />
+         <field id="ssv_m"    unit="m/s"  />
+         <field id="ssh_m"    unit="m"    />
+         <field id="e3t_m"    unit="m"    />
+         <field id="frq_m"    unit="-"    />
+
+      </field_group>
+
+      <!-- LIM3 scalar variables -->
+
+      <field_group id="SBC_scalar"  grid_ref="grid_T_2D" >
+         <!-- available with ln_limdiaout -->
+         <field id="ibgfrcvoltop"    long_name="global mean ice/snow forcing at interface ice/snow-atm (volume equivalent ocean volume)"   unit="km3"       />
+         <field id="ibgfrcvolbot"    long_name="global mean ice/snow forcing at interface ice/snow-ocean (volume equivalent ocean volume)" unit="km3"       />
+         <field id="ibgfrctemtop"    long_name="global mean heat on top of ice/snw/ocean-atm "                                             unit="1e20J"     />
+         <field id="ibgfrctembot"    long_name="global mean heat below ice (on top of ocean) "                                             unit="1e20J"     />
+         <field id="ibgfrcsal"       long_name="global mean ice/snow forcing (salt equivalent ocean volume)"                               unit="pss*km3"   />
+         <field id="ibgfrchfxtop"    long_name="global mean heat flux on top of ice/snw/ocean-atm "                                        unit="W/m2"      />
+         <field id="ibgfrchfxbot"    long_name="global mean heat flux below ice (on top of ocean) "                                        unit="W/m2"      />
+ 
+         <field id="ibgvolume"       long_name="drift in ice/snow volume (equivalent ocean volume)"            unit="km3"        />
+         <field id="ibgsaltco"       long_name="drift in ice salt content (equivalent ocean volume)"           unit="pss*km3"    />
+         <field id="ibgheatco"       long_name="drift in ice/snow heat content"                                unit="1e20J"      />
+         <field id="ibgheatfx"       long_name="drift in ice/snow heat flux"                                   unit="W/m2"       />
+
+         <field id="ibgvol_tot"      long_name="global mean ice volume"                                        unit="km3"        />
+         <field id="sbgvol_tot"      long_name="global mean snow volume"                                       unit="km3"        />
+         <field id="ibgarea_tot"     long_name="global mean ice area"                                          unit="km2"        />
+         <field id="ibgsalt_tot"     long_name="global mean ice salt content"                                  unit="1e-3*km3"   />
+         <field id="ibgheat_tot"     long_name="global mean ice heat content"                                  unit="1e20J"      />
+         <field id="sbgheat_tot"     long_name="global mean snow heat content"                                 unit="1e20J"      />
+      </field_group>
+  
+      <!-- 
+============================================================================================================
+	-->
+      <!-- output variables for my configuration --> 
+      
+      <!--
+      <field_group id="myvarICE" >
+
+	<field field_ref="snowthic_cea"     name="snthic"     long_name="surface_snow_thickness"   />
+	<field field_ref="snowvol"          name="snvolu" />
+	<field field_ref="isnowhc"          name="snheco" />
+	<field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        />
+	<field field_ref="icevolu"          name="sivolu" />
+	<field field_ref="iceconc"          name="siconc"  />
+	<field field_ref="micesalt"         name="sisali" />
+	<field field_ref="micet"            name="sitemp" />
+	<field field_ref="icest"            name="sistem" />
+	<field field_ref="uice_ipa"         name="sivelu" />
+	<field field_ref="vice_ipa"         name="sivelv" />
+	<field field_ref="icevel"           name="sivelo" />
+		
+      </field_group>
+      -->
+      
+   </field_definition>

+ 826 - 0
templates/storm/xios_config/field_def_nemo-opa.xml

@@ -0,0 +1,826 @@
+<?xml version="1.0"?> 
+    <!-- $id$ -->
+    
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+   <field_definition level="1" prec="4" operation="average" enabled=".TRUE." default_value="1.e20" > <!-- time step automaticaly defined -->
+
+    <!-- 
+============================================================================================================
+                                  Dynamical ocean model variables
+============================================================================================================
+    -->
+
+      <!-- T grid -->
+      
+      <field_group id="grid_T" grid_ref="grid_T_2D" >
+         <field id="e3t"          long_name="T-cell thickness"   standard_name="cell_thickness"   unit="m"   grid_ref="grid_T_3D"/>
+         <field id="e3t_0"        long_name="Initial T-cell thickness"   standard_name="ref_cell_thickness"   unit="m"   grid_ref="grid_T_3D"/>
+
+         <field id="toce"         long_name="temperature"         standard_name="sea_water_potential_temperature"   unit="degC"     grid_ref="grid_T_3D"/>
+         <field id="toce_e3t"     long_name="temperature * e3t"                                                     unit="degC*m"   grid_ref="grid_T_3D" > toce * e3t </field >
+         <field id="soce"         long_name="salinity"            standard_name="sea_water_practical_salinity"      unit="1e-3"     grid_ref="grid_T_3D"/>
+         <field id="soce_e3t"     long_name="salinity * e3t"                                                        unit="1e-3*m"   grid_ref="grid_T_3D" > soce * e3t </field >
+
+         <field id="sst"          long_name="sea surface temperature"             standard_name="sea_surface_temperature"             unit="degC"     />
+         <field id="sst2"         long_name="square of sea surface temperature"   standard_name="square_of_sea_surface_temperature"   unit="degC2"     > sst * sst </field >
+         <field id="sstmax"       long_name="max of sea surface temperature"   field_ref="sst"   operation="maximum"                                  />
+         <field id="sstmin"       long_name="min of sea surface temperature"   field_ref="sst"   operation="minimum"                                  />
+         <field id="sstgrad"      long_name="module of sst gradient"                                                                  unit="degC/m"   />
+         <field id="sstgrad2"     long_name="square of module of sst gradient"                                                        unit="degC2/m2" />
+         <field id="sbt"          long_name="sea bottom temperature"                                                                  unit="degC"     />
+	 
+         <field id="sss"          long_name="sea surface salinity"             standard_name="sea_surface_salinity"   unit="1e-3" />
+         <field id="sss2"         long_name="square of sea surface salinity"                                          unit="1e-6"  > sss * sss </field >
+         <field id="sssmax"       long_name="max of sea surface salinity"   field_ref="sss"   operation="maximum"                 />
+         <field id="sssmin"       long_name="min of sea surface salinity"   field_ref="sss"   operation="minimum"                 />
+         <field id="sbs"          long_name="sea bottom salinity"                                                     unit="1e-3" />
+         <field id="taubot"       long_name="bottom stress module"                                                    unit="N/m2" />  
+
+         <field id="taubot"       long_name="bottom stress module"                                                    unit="N/m2" /> 
+
+         <field id="ssh"          long_name="sea surface height"             standard_name="sea_surface_height_above_geoid"             unit="m" />
+         <field id="ssh2"         long_name="square of sea surface height"   standard_name="square_of_sea_surface_height_above_geoid"   unit="m2" > ssh * ssh </field >
+         <field id="sshmax"       long_name="max of sea surface height"   field_ref="ssh"   operation="maximum"                                  />
+
+         <field id="mldkz5"       long_name="Turbocline depth (Kz = 5e-4)"                       standard_name="ocean_mixed_layer_thickness_defined_by_vertical_tracer_diffusivity"                unit="m"          />
+         <field id="mldr10_1"     long_name="Mixed Layer Depth (dsigma = 0.01 wrt 10m)"          standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"          />
+         <field id="mldr10_1max"  long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="maximum"                                                                          />
+         <field id="mldr10_1min"  long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)"   field_ref="mldr10_1"   operation="minimum"                                                                          />
+         <field id="heatc"        long_name="Heat content vertically integrated"                 standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"       />
+         <field id="saltc"        long_name="Salt content vertically integrated"                                                                                                                   unit="1e-3*kg/m2" />
+
+         <!-- EOS -->
+         <field id="alpha"        long_name="thermal expansion"                                                         unit="degC-1" grid_ref="grid_T_3D" />
+         <field id="beta"         long_name="haline contraction"                                                        unit="1e3"    grid_ref="grid_T_3D" />
+         <field id="rhop"         long_name="potential density (sigma0)"        standard_name="sea_water_sigma_theta"   unit="kg/m3"  grid_ref="grid_T_3D" />
+
+         <!-- Energy - horizontal divergence -->
+         <field id="eken"         long_name="kinetic energy"          standard_name="specific_kinetic_energy_of_sea_water"   unit="m2/s2"  grid_ref="grid_T_3D" />
+         <field id="hdiv"         long_name="horizontal divergence"                                                          unit="s-1"    grid_ref="grid_T_3D" />
+
+         <!-- variables available with MLE -->
+         <field id="Lf_NHpf"      long_name="MLE: Lf = N H / f"   unit="m" />
+
+         <!-- next variables available with key_diahth -->
+         <field id="mlddzt"       long_name="Thermocline Depth (depth of max dT/dz)"         standard_name="depth_at_maximum_upward_derivative_of_sea_water_potential_temperature"             unit="m"                         />
+         <field id="mldr10_3"     long_name="Mixed Layer Depth (dsigma = 0.03 wrt 10m)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+         <field id="mldr0_1"      long_name="Mixed Layer Depth (dsigma = 0.01 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+         <field id="mldr0_3"      long_name="Mixed Layer Depth (dsigma = 0.03 wrt sfc)"      standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+         <field id="mld_dt02"     long_name="Mixed Layer Depth (|dT| = 0.2 wrt 10m)"         standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
+         <field id="topthdep"     long_name="Top of Thermocline Depth (dT = -0.2 wrt 10m)"   standard_name="ocean_mixed_layer_thickness_defined_by_temperature"                                unit="m"                         />
+         <field id="pycndep"      long_name="Pycnocline Depth (dsigma[dT=-0.2] wrt 10m)"     standard_name="ocean_mixed_layer_thickness_defined_by_sigma_theta"                                unit="m"                         />
+         <field id="BLT"          long_name="Barrier Layer Thickness"                                                                                                                          unit="m"                          > topthdep - pycndep </field>
+         <field id="tinv"         long_name="Max of vertical invertion of temperature"                                                                                                         unit="degC"                      />
+         <field id="depti"        long_name="Depth of max. vert. inv. of temperature"                                                                                                          unit="m"                         />
+         <field id="20d"          long_name="Depth of 20C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_20C" />
+         <field id="28d"          long_name="Depth of 28C isotherm"                          standard_name="depth_of_isosurface_of_sea_water_potential_temperature"                            unit="m"      axis_ref="iax_28C" />
+         <field id="hc300"        long_name="Heat content 0-300m"                            standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content"   unit="J/m2"                      />
+
+         <!-- variables available with key_diaar5 -->
+         <field id="botpres"      long_name="Pressure at sea floor"   standard_name="sea_water_pressure_at_sea_floor"   unit="dbar" />
+
+         <!-- variables available with key_vvl -->
+         <field id="tpt_dep"      long_name="T-point depth"                  standard_name="depth_below_geoid"   unit="m"   grid_ref="grid_T_3D" />
+         <field id="e3tdef"       long_name="T-cell thickness deformation"                                       unit="%"   grid_ref="grid_T_3D" />
+      </field_group>
+
+      <!-- Tides -->
+
+      <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" >
+         <!-- tidal composante -->
+         <field id="M2x"          long_name="M2 Elevation harmonic real part "                             unit="m"        />
+         <field id="M2y"          long_name="M2 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="S2x"          long_name="S2 Elevation harmonic real part "                             unit="m"        />
+         <field id="S2y"          long_name="S2 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="N2x"          long_name="N2 Elevation harmonic real part "                             unit="m"        />
+         <field id="N2y"          long_name="N2 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="K1x"          long_name="K1 Elevation harmonic real part "                             unit="m"        />
+         <field id="K1y"          long_name="K1 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="O1x"          long_name="O1 Elevation harmonic real part "                             unit="m"        />
+         <field id="O1y"          long_name="O1 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="Q1x"          long_name="Q1 Elevation harmonic real part "                             unit="m"        />
+         <field id="Q1y"          long_name="Q1 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="M4x"          long_name="M4 Elevation harmonic real part "                             unit="m"        />
+         <field id="M4y"          long_name="M4 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="K2x"          long_name="K2 Elevation harmonic real part "                             unit="m"        />
+         <field id="K2y"          long_name="K2 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="P1x"          long_name="P1 Elevation harmonic real part "                             unit="m"        />
+         <field id="P1y"          long_name="P1 Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="Mfx"          long_name="Mf Elevation harmonic real part "                             unit="m"        />
+         <field id="Mfy"          long_name="Mf Elevation harmonic imaginary part"                         unit="m"        />
+         <field id="Mmx"          long_name="Mm Elevation harmonic real part "                             unit="m"        />
+         <field id="Mmy"          long_name="Mm Elevation harmonic imaginary part"                         unit="m"        />
+      </field_group>
+	 
+      <field_group id="Tides_U" grid_ref="grid_U_2D" operation="once" >
+         <field id="M2x_u"        long_name="M2 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="M2y_u"        long_name="M2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="S2x_u"        long_name="S2 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="S2y_u"        long_name="S2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="N2x_u"        long_name="N2 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="N2y_u"        long_name="N2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="K1x_u"        long_name="K1 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="K1y_u"        long_name="K1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="O1x_u"        long_name="O1 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="O1y_u"        long_name="O1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Q1x_u"        long_name="Q1 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="Q1y_u"        long_name="Q1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="M4x_u"        long_name="M4 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="M4y_u"        long_name="M4 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="K2x_u"        long_name="K2 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="K2y_u"        long_name="K2 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="P1x_u"        long_name="P1 current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="P1y_u"        long_name="P1 current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Mfx_u"        long_name="Mf current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="Mfy_u"        long_name="Mf current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Mmx_u"        long_name="Mm current barotrope along i-axis harmonic real part "        unit="m/s"      />
+         <field id="Mmy_u"        long_name="Mm current barotrope along i-axis harmonic imaginary part "   unit="m/s"      />
+      </field_group>
+	 
+      <field_group id="Tides_V" grid_ref="grid_V_2D" operation="once" >
+         <field id="M2x_v"        long_name="M2 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="M2y_v"        long_name="M2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="S2x_v"        long_name="S2 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="S2y_v"        long_name="S2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="N2x_v"        long_name="N2 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="N2y_v"        long_name="N2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="K1x_v"        long_name="K1 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="K1y_v"        long_name="K1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="O1x_v"        long_name="O1 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="O1y_v"        long_name="O1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Q1x_v"        long_name="Q1 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="Q1y_v"        long_name="Q1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="M4x_v"        long_name="M4 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="M4y_v"        long_name="M4 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="K2x_v"        long_name="K2 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="K2y_v"        long_name="K2 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="P1x_v"        long_name="P1 current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="P1y_v"        long_name="P1 current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Mfx_v"        long_name="Mf current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="Mfy_v"        long_name="Mf current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />
+         <field id="Mmx_v"        long_name="Mm current barotrope along j-axis harmonic real part "        unit="m/s"      />
+         <field id="Mmy_v"        long_name="Mm current barotrope along j-axis harmonic imaginary part "   unit="m/s"      />	 
+      </field_group>
+
+      <!-- SBC -->
+      
+      <field_group id="SBC" grid_ref="grid_T_2D" > <!-- time step automaticaly defined based on nn_fsbc -->
+         <field id="empmr"        long_name="Net Upward Water Flux"                standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
+         <field id="empbmr"       long_name="Net Upward Water Flux at pre. tstep"  standard_name="water_flux_out_of_sea_ice_and_sea_water"                              unit="kg/m2/s"   />
+         <field id="emp_oce"      long_name="Evap minus Precip over ocean"         standard_name="evap_minus_precip_over_sea_water"                                     unit="kg/m2/s"   />
+         <field id="emp_ice"      long_name="Evap minus Precip over ice"           standard_name="evap_minus_precip_over_sea_ice"                                       unit="kg/m2/s"   />
+         <field id="saltflx"      long_name="Downward salt flux"                                                                                                        unit="1e-3/m2/s" />
+         <field id="fmmflx"       long_name="Water flux due to freezing/melting"                                                                                        unit="kg/m2/s"   />
+         <field id="snowpre"      long_name="Snow precipitation"                   standard_name="snowfall_flux"                                                        unit="kg/m2/s"   />
+         <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   />
+         <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   />
+ 
+         <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           />
+         <field id="qns"          long_name="non solar Downward Heat Flux"                                                                                               unit="W/m2"                           />
+         <field id="qsr"          long_name="Shortwave Radiation"                   standard_name="net_downward_shortwave_flux_at_sea_water_surface"                     unit="W/m2"                           />
+         <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" />
+         <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           />
+         <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        />
+         <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           />
+         <field id="wspd"         long_name="wind speed module"                     standard_name="wind_speed"                                                           unit="m/s"                            />
+         
+         <!-- * variable relative to atmospheric pressure forcing : available with ln_apr_dyn -->
+         <field id="ssh_ib"       long_name="Inverse barometer sea surface height"  standard_name="sea_surface_height_correction_due_to_air_pressure_at_low_frequency"   unit="m"        />
+
+         <!-- * variable related to ice shelf forcing * -->
+         <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  />
+         <field id="qisf"         long_name="Ice Shelf Heat Flux"                           unit="W/m2"     />
+         <field id="isfgammat"    long_name="transfert coefficient for isf (temperature)"   unit="m/s"      />
+         <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)"      unit="m/s"      />
+         <field id="stbl"         long_name="salinity in the Losh tbl"                      unit="1e-3"     />
+         <field id="ttbl"         long_name="temperature in the Losh tbl"                   unit="degC"     />
+
+         <!-- *_oce variables available with ln_blk_clio or ln_blk_core -->
+         <field id="qlw_oce"      long_name="Longwave Downward Heat Flux over open ocean"  standard_name="surface_net_downward_longwave_flux"   unit="W/m2"  />
+         <field id="qsb_oce"      long_name="Sensible Downward Heat Flux over open ocean"  standard_name="surface_downward_sensible_heat_flux"  unit="W/m2"  />
+         <field id="qla_oce"      long_name="Latent Downward Heat Flux over open ocean"    standard_name="surface_downward_latent_heat_flux"    unit="W/m2"  />
+         <field id="qemp_oce"     long_name="Downward Heat Flux from E-P over open ocean"                                                       unit="W/m2"  />
+         <field id="taum_oce"     long_name="wind stress module over open ocean"           standard_name="magnitude_of_surface_downward_stress" unit="N/m2"  />
+
+         <!-- available key_oasis3 -->
+         <field id="snow_ao_cea"  long_name="Snow over ice-free ocean (cell average)"   standard_name="snowfall_flux"                             unit="kg/m2/s"  />
+         <field id="snow_ai_cea"  long_name="Snow over sea-ice (cell average)"          standard_name="snowfall_flux"                             unit="kg/m2/s"  />
+         <field id="subl_ai_cea"  long_name="Sublimation over sea-ice (cell average)"   standard_name="surface_snow_and_ice_sublimation_flux"     unit="kg/m2/s"  />
+         <field id="icealb_cea"   long_name="Ice albedo (cell average)"                 standard_name="sea_ice_albedo"                            unit="1"        />
+         <field id="calving_cea"  long_name="Calving"                                   standard_name="water_flux_into_sea_water_from_icebergs"   unit="kg/m2/s"  />
+
+         <!-- available if key_oasis3 + conservative method -->
+         <field id="rain"          long_name="Liquid precipitation"                                     standard_name="rainfall_flux"                                                                 unit="kg/m2/s"  />
+         <field id="evap_ao_cea"   long_name="Evaporation over ice-free ocean (cell average)"           standard_name="water_evaporation_flux"                                                        unit="kg/m2/s"  />
+         <field id="isnwmlt_cea"   long_name="Snow over Ice melting (cell average)"                     standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
+         <field id="fsal_virt_cea" long_name="Virtual salt flux due to ice formation (cell average)"    standard_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics"                unit="kg/m2/s"  />
+         <field id="fsal_real_cea" long_name="Real salt flux due to ice formation (cell average)"       standard_name="downward_sea_ice_basal_salt_flux"                                              unit="kg/m2/s"  />
+         <field id="hflx_rain_cea" long_name="heat flux due to rainfall"                                standard_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"        unit="W/m2"     />
+         <field id="hflx_evap_cea" long_name="heat flux due to evaporation"                             standard_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water"   unit="W/m2"     />
+         <field id="hflx_snow_cea" long_name="heat flux due to snow falling"                            standard_name="heat_flux_onto_ocean_and_ice_due_to_snow_thermodynamics"                       unit="W/m2"     />
+         <field id="hflx_snow_ai_cea" long_name="heat flux due to snow falling over ice"                standard_name="heat_flux_onto_ice_due_to_snow_thermodynamics"                                 unit="W/m2"     />
+         <field id="hflx_snow_ao_cea" long_name="heat flux due to snow falling over ice-free ocean"     standard_name="heat_flux_onto_sea_water_due_to_snow_thermodynamics"                           unit="W/m2"     />
+         <field id="hflx_ice_cea"  long_name="heat flux due to ice thermodynamics"                      standard_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                        unit="W/m2"     />
+         <field id="hflx_rnf_cea"  long_name="heat flux due to runoffs"                                 standard_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"          unit="W/m2"     />
+         <field id="hflx_cal_cea"  long_name="heat flux due to calving"                                 standard_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                        unit="W/m2"     />
+         <field id="bicemel_cea"   long_name="Rate of Melt at Sea Ice Base (cell average)"              standard_name="tendency_of_sea_ice_amount_due_to_basal_melting"                               unit="kg/m2/s"  />
+         <field id="licepro_cea"   long_name="Lateral Sea Ice Growth Rate (cell average)"               standard_name="tendency_of_sea_ice_amount_due_to_lateral_growth_of_ice_floes"                 unit="kg/m2/s"  />
+         <field id="snowmel_cea"   long_name="Snow Melt Rate (cell average)"                            standard_name="surface_snow_melt_flux"                                                        unit="kg/m2/s"  />
+         <field id="sntoice_cea"   long_name="Snow-Ice Formation Rate (cell average)"                   standard_name="tendency_of_sea_ice_amount_due_to_snow_conversion"                             unit="kg/m2/s"  />
+         <field id="ticemel_cea"   long_name="Rate of Melt at Upper Surface of Sea Ice (cell average)"  standard_name="tendency_of_sea_ice_amount_due_to_surface_melting"                             unit="kg/m2/s"  />
+
+         <!-- ice fields -->
+         <field id="ice_cover"    long_name="Ice fraction"                                                 standard_name="sea_ice_area_fraction"                              unit="1"            />
+
+         <field id="qsr_ai_cea"   long_name="Air-Ice downward solar heat flux (cell average)"              standard_name="surface_downwelling_shortwave_flux_in_air"          unit="W/m2"         />
+         <field id="qns_ai_cea"   long_name="Air-Ice downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         />
+         <field id="qla_ai_cea"   long_name="Air-Ice downward Latent heat flux (cell average)"             standard_name="surface_downward_latent_heat_flux"                  unit="W/m2"         />
+         
+         <field id="qsr_io_cea"   long_name="Ice-Oce downward solar heat flux (cell average)"              standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         />
+         <field id="qns_io_cea"   long_name="Ice-Oce downward non-solar heat flux (cell average)"                                                                             unit="W/m2"         />
+         
+         <field id="snowthic_cea" long_name="Snow thickness (cell average)"                                standard_name="surface_snow_thickness"                             unit="m"            />
+         <field id="icethic_cea"  long_name="Ice thickness (cell average)"                                 standard_name="sea_ice_thickness"                                  unit="m"            />
+         <field id="iceprod_cea"  long_name="Ice production (cell average)"                                                                                                   unit="m/s"          />
+         <field id="iiceconc"     long_name="Ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="1"            />
+         
+         <field id="ice_pres"     long_name="Ice presence"                                                                                                                    unit=""             />
+         <field id="ist_cea"      long_name="Ice surface temperature (cell average)"                       standard_name="surface_temperature"                                unit="degC"         />
+         <field id="ist_ipa"      long_name="Ice surface temperature (ice presence average)"               standard_name="surface_temperature"                                unit="degC"         />      
+         <field id="uice_ipa"     long_name="Ice velocity along i-axis at I-point (ice presence average)"  standard_name="sea_ice_x_velocity"                                 unit="m/s"          />      
+         <field id="vice_ipa"     long_name="Ice velocity along j-axis at I-point (ice presence average)"  standard_name="sea_ice_y_velocity"                                 unit="m/s"          />      
+         
+         <field id="utau_ice"     long_name="Wind stress along i-axis over the ice at i-point"             standard_name="surface_downward_x_stress"                          unit="N/m2"         />
+         <field id="vtau_ice"     long_name="Wind stress along j-axis over the ice at i-point"             standard_name="surface_downward_y_stress"                          unit="N/m2"         />
+         
+         <field id="u_imasstr"    long_name="Sea-ice mass transport along i-axis"                          standard_name="sea_ice_x_transport"                                unit="kg/s"         />
+         <field id="v_imasstr"    long_name="Sea-ice mass transport along j-axis"                          standard_name="sea_ice_y_transport"                                unit="kg/s"         />
+         <field id="emp_x_sst"    long_name="Concentration/Dilution term on SST"                                                                                              unit="kg*degC/m2/s" />
+         <field id="emp_x_sss"    long_name="Concentration/Dilution term on SSS"                                                                                              unit="kg*1e-3/m2/s" />        
+         <field id="rnf_x_sst"    long_name="Runoff term on SST"                                                                                                              unit="kg*degC/m2/s" />
+         <field id="rnf_x_sss"    long_name="Runoff term on SSS"                                                                                                              unit="kg*1e-3/m2/s" />
+       
+         <field id="iceconc"      long_name="ice concentration"                                            standard_name="sea_ice_area_fraction"                              unit="%"            />
+       	 <field id="isst"         long_name="sea surface temperature"                                      standard_name="sea_surface_temperature"                            unit="degC"         />
+         <field id="isss"         long_name="sea surface salinity"                                         standard_name="sea_surface_salinity"                               unit="1e-3"         /> 
+         <field id="qt_oce"       long_name="total flux at ocean surface"                                  standard_name="surface_downward_heat_flux_in_sea_water"            unit="W/m2"         />
+         <field id="qsr_oce"      long_name="solar heat flux at ocean surface"                             standard_name="net_downward_shortwave_flux_at_sea_water_surface"   unit="W/m2"         />
+         <field id="qns_oce"      long_name="non-solar heat flux at ocean surface"                                                                                            unit="W/m2"         />
+         <field id="qt_ice"       long_name="total heat flux at ice surface: sum over categories"          standard_name="surface_downward_heat_flux_in_air"                  unit="W/m2"         />
+         <field id="qsr_ice"      long_name="solar heat flux at ice surface: sum over categories"          standard_name="surface_downwelling_shortwave_flux_in_air"          unit="W/m2"         />
+         <field id="qns_ice"      long_name="non-solar heat flux at ice surface: sum over categories"                                                                         unit="W/m2"         />
+         <field id="qtr_ice"      long_name="solar heat flux transmitted through ice: sum over categories"                                                                    unit="W/m2"         />
+         <field id="qemp_ice"     long_name="Downward Heat Flux from E-P over ice"                                                                                            unit="W/m2"         />
+         <field id="micesalt"     long_name="Mean ice salinity"                                                                                                               unit="1e-3"         />
+         <field id="miceage"      long_name="Mean ice age"                                                                                                                    unit="years"        />
+         <field id="alb_ice"      long_name="Mean albedo over sea ice"                                                                                                        unit=""             />
+         <field id="albedo"       long_name="Mean albedo over sea ice and ocean"                                                                                              unit=""             />
+
+         <field id="iceage_cat"   long_name="Ice age for categories"                                       unit="days"   grid_ref="grid_T_3D_ncatice" />
+         <field id="iceconc_cat"  long_name="Ice concentration for categories"                             unit="%"      grid_ref="grid_T_3D_ncatice" />
+         <field id="icethic_cat"  long_name="Ice thickness for categories"                                 unit="m"      grid_ref="grid_T_3D_ncatice" />
+         <field id="snowthic_cat" long_name="Snow thicknessi for categories"                               unit="m"      grid_ref="grid_T_3D_ncatice" />
+         <field id="salinity_cat" long_name="Sea-Ice Bulk salinity for categories"                         unit="g/kg"   grid_ref="grid_T_3D_ncatice" />
+         <field id="brinevol_cat" long_name="Brine volume for categories"                                  unit="%"      grid_ref="grid_T_3D_ncatice" />
+         <field id="icetemp_cat"  long_name="Ice temperature for categories"                               unit="degC"   grid_ref="grid_T_3D_ncatice" />
+         <field id="snwtemp_cat"  long_name="Snow temperature for categories"                              unit="degC"   grid_ref="grid_T_3D_ncatice" />
+
+         <field id="micet"        long_name="Mean ice temperature"                                         unit="degC"     />
+         <field id="icehc"        long_name="ice total heat content"                                       unit="10^9J"    /> 
+         <field id="isnowhc"      long_name="snow total heat content"                                      unit="10^9J"    />
+         <field id="icest"        long_name="ice surface temperature"                                      unit="degC"     />
+         <field id="ibrinv"       long_name="brine volume"                                                 unit="%"        />
+         <field id="icecolf"      long_name="frazil ice collection thickness"                              unit="m"        />
+         <field id="icestr"       long_name="ice strength"                                                 unit="N/m"      />
+         <field id="icevel"       long_name="ice velocity"                                                 unit="m/s"      />
+         <field id="idive"        long_name="divergence"                                                   unit="1e-8s-1"  />
+         <field id="ishear"       long_name="shear"                                                        unit="1e-8s-1"  />
+         <field id="icevolu"      long_name="ice volume"                                                   unit="m"        />
+         <field id="snowvol"      long_name="snow volume"                                                  unit="m"        />
+         <field id="tau_icebfr"   long_name="ice friction on ocean bottom for landfast ice"                unit="N/2"      />
+
+         <field id="icetrp"       long_name="ice volume transport"                                         unit="m/day"          />
+         <field id="snwtrp"       long_name="snw volume transport"                                         unit="m/day"          />
+         <field id="saltrp"       long_name="salt content transport"                                       unit="1e-3*kg/m2/day" />
+         <field id="deitrp"       long_name="advected ice enthalpy"                                        unit="W/m2"           />
+         <field id="destrp"       long_name="advected snw enthalpy"                                        unit="W/m2"           />
+
+         <field id="sfxbri"       long_name="brine salt flux"                                              unit="1e-3*kg/m2/day" />
+         <field id="sfxdyn"       long_name="salt flux from ridging rafting"                               unit="1e-3*kg/m2/day" />
+         <field id="sfxres"       long_name="salt flux from lipupdate (resultant)"                         unit="1e-3*kg/m2/day" />
+         <field id="sfxbog"       long_name="salt flux from bot growth"                                    unit="1e-3*kg/m2/day" />
+         <field id="sfxbom"       long_name="salt flux from bot melt"                                      unit="1e-3*kg/m2/day" />
+         <field id="sfxsum"       long_name="salt flux from surf melt"                                     unit="1e-3*kg/m2/day" />
+         <field id="sfxlam"       long_name="salt flux from lateral melt"                                  unit="1e-3*kg/m2/day" />
+         <field id="sfxsni"       long_name="salt flux from snow-ice formation"                            unit="1e-3*kg/m2/day" />
+         <field id="sfxopw"       long_name="salt flux from open water ice formation"                      unit="1e-3*kg/m2/day" />
+         <field id="sfxsub"       long_name="salt flux from sublimation"                                   unit="1e-3*kg/m2/day" />
+         <field id="sfx"          long_name="salt flux total"                                              unit="1e-3*kg/m2/day" />
+
+         <field id="vfxbog"       long_name="daily bottom thermo ice prod."                                unit="m/day"   />
+         <field id="vfxdyn"       long_name="daily  dynamic ice prod."                                     unit="m/day"   />
+         <field id="vfxopw"       long_name="daily lateral thermo ice prod."                               unit="m/day"   />
+         <field id="vfxsni"       long_name="daily snowice ice prod."                                      unit="m/day"   />
+         <field id="vfxsum"       long_name="surface melt"                                                 unit="m/day"   />
+         <field id="vfxlam"       long_name="lateral melt"                                                 unit="m/day"   />
+         <field id="vfxbom"       long_name="bottom melt"                                                  unit="m/day"   />
+         <field id="vfxres"       long_name="daily resultant ice prod./melting from limupdate"             unit="m/day"   />
+         <field id="vfxice"       long_name="ice melt/growth"                                              unit="m/day"   />
+         <field id="vfxsnw"       long_name="snw melt/growth"                                              unit="m/day"   />
+         <field id="vfxsub"       long_name="snw sublimation"                                              unit="m/day"   />
+         <field id="vfxspr"       long_name="snw precipitation on ice"                                     unit="m/day"   />
+         <field id="vfxthin"      long_name="daily thermo ice prod. for thin ice(<20cm) + open water"      unit="m/day"   />
+
+         <field id="afxtot"       long_name="area tendency (total)"                                        unit="day-1"   />
+         <field id="afxdyn"       long_name="area tendency (dynamics)"                                     unit="day-1"   />
+         <field id="afxthd"       long_name="area tendency (thermo)"                                       unit="day-1"   />
+
+         <field id="hfxsum"       long_name="heat fluxes causing surface ice melt"                         unit="W/m2"  />
+         <field id="hfxbom"       long_name="heat fluxes causing bottom ice melt"                          unit="W/m2"  />
+         <field id="hfxbog"       long_name="heat fluxes causing bottom ice growth"                        unit="W/m2"  />
+         <field id="hfxdif"       long_name="heat fluxes causing ice temperature change"                   unit="W/m2"  />
+         <field id="hfxopw"       long_name="heat fluxes causing open water ice formation"                 unit="W/m2"  />
+         <field id="hfxsnw"       long_name="heat fluxes causing snow melt"                                unit="W/m2"  />
+         <field id="hfxerr"       long_name="heat fluxes error after heat diffusion"                       unit="W/m2"  />
+         <field id="hfxerr_rem"   long_name="heat fluxes error after remapping"                            unit="W/m2"  />
+         <field id="hfxout"       long_name="total heat fluxes received by the ocean"                      unit="W/m2"  />
+         <field id="hfxin"        long_name="total heat fluxes at the ice/ocean surface"                   unit="W/m2"  />
+
+         <!-- heat flux associated with mass exchange -->
+         <field id="hfxthd"       long_name="heat fluxes from ice-ocean mass exchange during thermo"       unit="W/m2"  />
+         <field id="hfxdyn"       long_name="heat fluxes from ice-ocean mass exchange during dynamic"      unit="W/m2"  />
+         <field id="hfxres"       long_name="heat fluxes from ice-ocean mass exchange during resultant"    unit="W/m2"  />
+         <field id="hfxsub"       long_name="heat fluxes from ice-atm. mass exchange during sublimation"   unit="W/m2"  />
+         <field id="hfxspr"       long_name="heat fluxes from ice-atm. mass exchange during snow precip"   unit="W/m2"  />
+
+         <!-- diags -->
+         <field id="hfxdhc"       long_name="Heat content variation in snow and ice"                       unit="W/m2" />
+         <field id="hfxtur"       long_name="turbulent heat flux at the ice base"                          unit="W/m2" />
+	 <!-- sbcssm variables -->
+         <field id="sst_m"    unit="degC" />
+         <field id="sss_m"    unit="psu"  />
+         <field id="ssu_m"    unit="m/s"  />
+         <field id="ssv_m"    unit="m/s"  />
+         <field id="ssh_m"    unit="m"    />
+         <field id="e3t_m"    unit="m"    />
+         <field id="frq_m"    unit="-"    />
+
+      </field_group>
+
+      <!-- U grid -->
+      
+      <field_group id="grid_U"   grid_ref="grid_U_2D">
+         <field id="e3u"          long_name="U-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_U_3D" />
+         <field id="e3u_0"        long_name="Initial U-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_U_3D"/>
+         <field id="utau"         long_name="Wind Stress along i-axis"                               standard_name="surface_downward_x_stress"   unit="N/m2"                            />
+         <field id="uoce"         long_name="ocean current along i-axis"                             standard_name="sea_water_x_velocity"        unit="m/s"        grid_ref="grid_U_3D" />
+         <field id="uoce_e3u"     long_name="ocean current along i-axis * e3u"                                                                   unit="m2/s"       grid_ref="grid_U_3D"  > uoce * e3u </field>
+         <field id="ssu"          long_name="ocean surface current along i-axis"                                                                 unit="m/s"                             />
+         <field id="sbu"          long_name="ocean bottom current along i-axis"                                                                  unit="m/s"                             />
+         <field id="ubar"         long_name="ocean barotropic current along i-axis"                                                              unit="m/s"                             />
+         <field id="uocetr_eff"   long_name="Effective ocean transport along i-axis"                 standard_name="ocean_volume_x_transport"    unit="m3/s"       grid_ref="grid_U_3D" />
+         <field id="uocet"        long_name="ocean transport along i-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_U_3D" />
+         <field id="uoces"        long_name="ocean transport along i-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_U_3D" />
+
+         <!-- variables available with MLE -->
+         <field id="psiu_mle"     long_name="MLE streamfunction along i-axis"   unit="m3/s"   grid_ref="grid_U_3D" />
+
+         <!-- uoce_eiv: available with key_traldf_eiv and key_diaeiv -->
+         <field id="uoce_eiv"     long_name="EIV ocean current along i-axis"   standard_name="bolus_sea_water_x_velocity"   unit="m/s"   grid_ref="grid_U_3D" />
+
+         <!-- uoce_eiv: available with key_trabbl -->
+         <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  />
+         <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" />
+
+         <!-- variable for ice shelves -->
+         <field id="utbl"         long_name="zonal current in the Losh tbl"     unit="m/s" />
+
+         <!-- variables available with key_diaar5 -->
+         <field id="u_masstr"     long_name="ocean eulerian mass transport along i-axis"    standard_name="ocean_mass_x_transport"                          unit="kg/s"        grid_ref="grid_U_3D" />
+         <field id="u_heattr"     long_name="ocean eulerian heat transport along i-axis"    standard_name="ocean_heat_x_transport"                          unit="W"                                />
+         <field id="u_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_x_transport"                          unit="1e-3*kg/s"                        />
+         <field id="ueiv_heattr"  long_name="ocean bolus heat transport along i-axis"       standard_name="ocean_heat_x_transport_due_to_bolus_advection"   unit="W"                                />
+         <field id="udiff_heattr" long_name="ocean diffusion heat transport along i-axis"   standard_name="ocean_heat_x_transport_due_to_diffusion"         unit="W"                                />
+      </field_group>
+      
+      <!-- V grid -->
+      
+      <field_group id="grid_V"   grid_ref="grid_V_2D">
+         <field id="e3v"          long_name="V-cell thickness"                                       standard_name="cell_thickness"              unit="m"          grid_ref="grid_V_3D" />
+         <field id="e3v_0"        long_name="Initial V-cell thickness"                               standard_name="ref_cell_thickness"          unit="m"          grid_ref="grid_V_3D"/>
+         <field id="vtau"         long_name="Wind Stress along j-axis"                               standard_name="surface_downward_y_stress"   unit="N/m2"                            />
+         <field id="voce"         long_name="ocean current along j-axis"                             standard_name="sea_water_y_velocity"        unit="m/s"        grid_ref="grid_V_3D" />
+         <field id="voce_e3v"     long_name="ocean current along j-axis * e3v"                                                                   unit="m2/s"       grid_ref="grid_V_3D"  > voce * e3v </field>
+         <field id="ssv"          long_name="ocean surface current along j-axis"                                                                 unit="m/s"                             />
+         <field id="sbv"          long_name="ocean bottom current along j-axis"                                                                  unit="m/s"                             />
+         <field id="vbar"         long_name="ocean barotropic current along j-axis"                                                              unit="m/s"                             />
+         <field id="vocetr_eff"   long_name="Effective ocean transport along j-axis"                 standard_name="ocean_volume_y_transport"    unit="m3/s"       grid_ref="grid_V_3D" />
+         <field id="vocet"        long_name="ocean transport along j-axis times temperature (CRS)"                                               unit="degC*m/s"   grid_ref="grid_V_3D" />
+         <field id="voces"        long_name="ocean transport along j-axis times salinity (CRS)"                                                  unit="1e-3*m/s"   grid_ref="grid_V_3D" />
+
+         <!-- variables available with MLE -->
+         <field id="psiv_mle"     long_name="MLE streamfunction along j-axis"   unit="m3/s"   grid_ref="grid_V_3D" />
+
+         <!-- voce_eiv: available with key_traldf_eiv and key_diaeiv -->
+         <field id="voce_eiv"     long_name="EIV ocean current along j-axis"   standard_name="bolus_sea_water_y_velocity"   unit="m/s"   grid_ref="grid_V_3D" />
+
+         <!-- voce_eiv: available with key_trabbl -->
+         <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  />
+         <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" />
+
+         <!-- variable for ice shelves -->
+         <field id="vtbl"         long_name="meridional current in the Losh tbl"   unit="m/s" />
+
+         <!-- variables available with key_diaar5 -->
+         <field id="v_masstr"     long_name="ocean eulerian mass transport along j-axis"    standard_name="ocean_mass_y_transport"                          unit="kg/s"        grid_ref="grid_V_3D" />
+         <field id="v_heattr"     long_name="ocean eulerian heat transport along j-axis"    standard_name="ocean_heat_y_transport"                          unit="W"                                />
+         <field id="v_salttr"     long_name="ocean eulerian salt transport along i-axis"    standard_name="ocean_salt_y_transport"                          unit="1e-3*kg/s"                        />
+         <field id="veiv_heattr"  long_name="ocean bolus heat transport along j-axis"       standard_name="ocean_heat_y_transport_due_to_bolus_advection"   unit="W"                                />
+         <field id="vdiff_heattr" long_name="ocean diffusion heat transport along j-axis"   standard_name="ocean_heat_y_transport_due_to_diffusion"         unit="W"                                />
+      </field_group>
+      
+      <!-- W grid -->
+      
+      <field_group id="grid_W" grid_ref="grid_W_3D">
+        <field id="e3w"          long_name="W-cell thickness"                     standard_name="cell_thickness"              unit="m"    />
+        <field id="woce"         long_name="ocean vertical velocity"              standard_name="upward_sea_water_velocity"   unit="m/s"  />
+        <field id="wocetr_eff"   long_name="effective ocean vertical transport"                                               unit="m3/s" />
+
+        <!-- woce_eiv: available with key_traldf_eiv and key_diaeiv -->
+        <field id="woce_eiv"     long_name="EIV ocean vertical velocity"   standard_name="bolus_upward_sea_water_velocity"   unit="m/s" />
+
+        <field id="avt"          long_name="vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+        <field id="logavt"       long_name="logarithm of vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+        <field id="avm"          long_name="vertical eddy viscosity"     standard_name="ocean_vertical_momentum_diffusivity"   unit="m2/s" />
+
+        <!-- avs: available with key_zdfddm -->
+        <field id="avs"          long_name="salt vertical eddy diffusivity"   standard_name="ocean_vertical_salt_diffusivity"   unit="m2/s" />
+        <field id="logavs"       long_name="logarithm of salt vertical eddy diffusivity"   standard_name="ocean_vertical_heat_diffusivity"       unit="m2/s" />
+
+        <!-- avt_evd and avm_evd: available with ln_zdfevd -->
+        <field id="avt_evd"      long_name="convective enhancement to vertical diffusivity"   standard_name="ocean_vertical_tracer_diffusivity_due_to_convection"     unit="m2/s" />
+        <field id="avm_evd"      long_name="convective enhancement to vertical viscosity"     standard_name="ocean_vertical_momentum_diffusivity_due_to_convection"   unit="m2/s" />
+
+        <!-- avt_tide: available with key_zdftmx -->
+        <field id="av_tide"      long_name="tidal vertical diffusivity"   standard_name="ocean_vertical_tracer_diffusivity_due_to_tides"   unit="m2/s" />
+
+       <!-- variables available with key_zdftmx_new -->
+        <field id="av_ratio"     long_name="S over T diffusivity ratio"            standard_name="salinity_over_temperature_diffusivity_ratio"                     unit="1"    />
+        <field id="av_wave"      long_name="wave-induced vertical diffusivity"     standard_name="ocean_vertical_tracer_diffusivity_due_to_internal_waves"         unit="m2/s" />
+        <field id="bn2"          long_name="squared Brunt-Vaisala frequency"       standard_name="squared_brunt_vaisala_frequency"                                 unit="s-1"  />
+        <field id="bflx_tmx"     long_name="wave-induced buoyancy flux"            standard_name="buoyancy_flux_due_to_internal_waves"                             unit="W/kg" />
+        <field id="pcmap_tmx"    long_name="power consumed by wave-driven mixing"  standard_name="vertically_integrated_power_consumption_by_wave_driven_mixing"   unit="W/m2"      grid_ref="grid_W_2D" />
+        <field id="emix_tmx"     long_name="power density available for mixing"    standard_name="power_available_for_mixing_from_breaking_internal_waves"         unit="W/kg" />
+
+        <!-- variables available with key_diaar5 -->   
+        <field id="w_masstr"     long_name="vertical mass transport"             standard_name="upward_ocean_mass_transport"             unit="kg/s"   />
+        <field id="w_masstr2"    long_name="square of vertical mass transport"   standard_name="square_of_upward_ocean_mass_transport"   unit="kg2/s2" />
+
+        <!-- aht2d and  aht2d_eiv: available with key_traldf_eiv and key_traldf_c2d -->
+        <field id="aht2d"        long_name="lateral eddy diffusivity"       standard_name="ocean_tracer_xy_laplacian_diffusivity"      unit="m2/s"   grid_ref="grid_W_2D" />
+        <field id="aht2d_eiv"    long_name="EIV lateral eddy diffusivity"   standard_name="ocean_tracer_bolus_laplacian_diffusivity"   unit="m2/s"   grid_ref="grid_W_2D" />
+
+      </field_group>
+          
+      <!-- scalar variables available with key_diaar5 -->
+
+      <field_group id="scalar"  grid_ref="grid_T_2D" >
+         <field id="voltot"     long_name="global total volume"                          standard_name="sea_water_volume"                               unit="m3"   />
+         <field id="sshtot"     long_name="global mean ssh"                              standard_name="global_average_sea_level_change"                unit="m"    />
+         <field id="sshsteric"  long_name="global mean ssh steric"                       standard_name="global_average_steric_sea_level_change"         unit="m"    />
+         <field id="sshthster"  long_name="global mean ssh thermosteric"                 standard_name="global_average_thermosteric_sea_level_change"   unit="m"    />
+         <field id="masstot"    long_name="global total mass"                            standard_name="sea_water_mass"                                 unit="kg"   />
+         <field id="temptot"    long_name="global mean temperature"                      standard_name="sea_water_potential_temperature"                unit="degC" />
+         <field id="saltot"     long_name="global mean salinity"                         standard_name="sea_water_salinity"                             unit="1e-3" />
+         <field id="fram_trans" long_name="Sea Ice Mass Transport Through Fram Strait"   standard_name="sea_ice_transport_across_line"                  unit="kg/s" />
+
+      	 <!-- available with ln_diahsb -->
+         <field id="bgtemper"     long_name="drift in global mean temperature wrt timestep 1"                 standard_name="change_over_time_in_sea_water_potential_temperature"   unit="degC"     />
+         <field id="bgsaline"     long_name="drift in global mean salinity wrt timestep 1"                    standard_name="change_over_time_in_sea_water_practical_salinity"      unit="1e-3"     />
+         <field id="bgheatco"     long_name="drift in global mean heat content wrt timestep 1"                                                                                      unit="1.e20J"   />
+         <field id="bgheatfx"     long_name="drift in global mean heat flux    wrt timestep 1"                                                                                      unit="W/m2"     />
+         <field id="bgsaltco"     long_name="drift in global mean salt content wrt timestep 1"                                                                                      unit="1e-3*km3" />
+         <field id="bgvolssh"     long_name="drift in global mean ssh volume wrt timestep 1"                                                                                        unit="km3"      />
+         <field id="bgvole3t"     long_name="drift in global mean volume variation (e3t) wrt timestep 1"                                                                            unit="km3"      />
+         <field id="bgfrcvol"     long_name="global mean volume from forcing"                                                                                                       unit="km3"      />
+         <field id="bgfrctem"     long_name="global mean heat content from forcing"                                                                                                 unit="1.e20J"   />
+         <field id="bgfrchfx"     long_name="global mean heat flux from forcing"                                                                                                    unit="W/m2"     />
+         <field id="bgfrcsal"     long_name="global mean salt content from forcing"                                                                                                 unit="1e-3*km3" />
+         <field id="bgmistem"     long_name="global mean temperature error due to free surface (no vvl)"                                                                            unit="degC"     />
+         <field id="bgmissal"     long_name="global mean salinity error due to free surface (no vvl)"                                                                               unit="1e-3"     />
+      </field_group>
+  
+      <!-- variables available with key_float -->
+
+      <field_group id="floatvar" grid_ref="grid_T_nfloat" operation="instant" >
+        <field id="traj_lon"      long_name="floats longitude"                                                           unit="degrees_east"  />
+        <field id="traj_lat"      long_name="floats latitude"                                                            unit="degrees_north" />
+        <field id="traj_dep"      long_name="floats depth"                                                               unit="m"             />
+        <field id="traj_temp"     long_name="floats temperature"       standard_name="sea_water_potential_temperature"   unit="degC"          />
+        <field id="traj_salt"     long_name="floats salinity"          standard_name="sea_water_practical_salinity"      unit="1e-3"          />
+        <field id="traj_dens"     long_name="floats in-situ density"   standard_name="sea_water_density"                 unit="kg/m3"         />
+        <field id="traj_group"    long_name="floats group"                                                               unit="1"             />
+      </field_group>
+
+      <!-- variables available with iceberg trajectories -->
+
+      <field_group id="icbvar" domain_ref="grid_T"  > 
+        <field id="berg_melt"          long_name="icb melt rate of icebergs"                       unit="kg/m2/s"                    />
+        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"     unit="kg/m2/s"                    />
+        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"      unit="kg/m2/s"                    />
+        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate"   unit="kg/m2/s"                    />
+        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"                unit="m2"                         />
+        <field id="bits_src"           long_name="icb mass source of bergy bits"                   unit="kg/m2/s"                    />
+        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                     unit="kg/m2/s"                    />
+        <field id="bits_mass"          long_name="icb bergy bit density field"                     unit="kg/m2"                      />
+        <field id="berg_mass"          long_name="icb iceberg density field"                       unit="kg/m2"                      />
+        <field id="calving"            long_name="icb calving mass input"                          unit="kg/s"                       />
+        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"                unit="kg/m2/s"                    />
+        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                  unit="kg/s"     axis_ref="icbcla" />
+        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"               unit="kg"       axis_ref="icbcla" />
+      </field_group>
+
+      <!-- Poleward transport : ptr -->     
+      <field_group id="diaptr"  > 
+        <field id="zomsfglo"          long_name="Meridional Stream-Function: Global"           unit="Sv"       grid_ref="grid_znl_W_3D" />
+        <field id="zomsfatl"          long_name="Meridional Stream-Function: Atlantic"         unit="Sv"       grid_ref="grid_znl_W_3D" />
+        <field id="zomsfpac"          long_name="Meridional Stream-Function: Pacific"          unit="Sv"       grid_ref="grid_znl_W_3D" />
+        <field id="zomsfind"          long_name="Meridional Stream-Function: Indian"           unit="Sv"       grid_ref="grid_znl_W_3D" />
+        <field id="zomsfipc"          long_name="Meridional Stream-Function: Pacific+Indian"   unit="Sv"       grid_ref="grid_znl_W_3D" />
+        <field id="zotemglo"          long_name="Zonal Mean Temperature : Global"              unit="degC"     grid_ref="grid_znl_T_3D" />
+        <field id="zotematl"          long_name="Zonal Mean Temperature : Atlantic"            unit="degC"     grid_ref="grid_znl_T_3D" />
+        <field id="zotempac"          long_name="Zonal Mean Temperature : Pacific"             unit="degC"     grid_ref="grid_znl_T_3D" />
+        <field id="zotemind"          long_name="Zonal Mean Temperature : Indian"              unit="degC"     grid_ref="grid_znl_T_3D" />
+        <field id="zotemipc"          long_name="Zonal Mean Temperature : Pacific+Indian"      unit="degC"     grid_ref="grid_znl_T_3D" />
+        <field id="zosalglo"          long_name="Zonal Mean Salinity : Global"                 unit="1e-3"     grid_ref="grid_znl_T_3D" />
+        <field id="zosalatl"          long_name="Zonal Mean Salinity : Atlantic"               unit="1e-3"     grid_ref="grid_znl_T_3D" />
+        <field id="zosalpac"          long_name="Zonal Mean Salinity : Pacific"                unit="1e-3"     grid_ref="grid_znl_T_3D" />
+        <field id="zosalind"          long_name="Zonal Mean Salinity : Indian"                 unit="1e-3"     grid_ref="grid_znl_T_3D" />
+        <field id="zosalipc"          long_name="Zonal Mean Salinity : Pacific+Indian"         unit="1e-3"     grid_ref="grid_znl_T_3D" />
+        <field id="zosrfglo"          long_name="Zonal Mean Surface"                           unit="m2"       grid_ref="grid_znl_T_3D" />
+        <field id="zosrfatl"          long_name="Zonal Mean Surface : Atlantic"                unit="m2"       grid_ref="grid_znl_T_3D" />
+        <field id="zosrfpac"          long_name="Zonal Mean Surface : Pacific"                 unit="m2"       grid_ref="grid_znl_T_3D" />
+        <field id="zosrfind"          long_name="Zonal Mean Surface : Indian"                  unit="m2"       grid_ref="grid_znl_T_3D" />
+        <field id="zosrfipc"          long_name="Zonal Mean Surface : Pacific+Indian"          unit="m2"       grid_ref="grid_znl_T_3D" />
+        <field id="sophtadv"          long_name="Advective Heat Transport"                     unit="PW"       grid_ref="grid_znl_T_2D" />
+        <field id="sophtldf"          long_name="Diffusive Heat Transport"                     unit="PW"       grid_ref="grid_znl_T_2D" />
+        <field id="sopstadv"          long_name="Advective Salt Transport"                     unit="Giga g/s" grid_ref="grid_znl_T_2D" />
+        <field id="sopstldf"          long_name="Diffusive Salt Transport"                     unit="Giga g/s" grid_ref="grid_znl_T_2D" />
+      </field_group>
+
+    <!-- 
+============================================================================================================
+                  Physical ocean model trend diagnostics : temperature, KE, PE, momentum
+============================================================================================================
+    -->
+
+    <field_group id="trendT" grid_ref="grid_T_3D">
+      <!-- variables available with ln_tra_trd -->
+      <field id="ttrd_xad"      long_name="temperature-trend: i-advection"                                                                                          unit="degC/s"                        />
+      <field id="strd_xad"      long_name="salinity   -trend: i-advection"                                                                                          unit="1e-3/s"                        />
+      <field id="ttrd_yad"      long_name="temperature-trend: j-advection"                                                                                          unit="degC/s"                        />
+      <field id="strd_yad"      long_name="salinity   -trend: j-advection"                                                                                          unit="1e-3/s"                        />
+      <field id="ttrd_zad"      long_name="temperature-trend: k-advection"                                                                                          unit="degC/s"                        />
+      <field id="strd_zad"      long_name="salinity   -trend: k-advection"                                                                                          unit="1e-3/s"                        />
+      <field id="ttrd_ad"       long_name="temperature-trend: advection"               standard_name="tendency_of_sea_water_temperature_due_to_advection"           unit="degC/s"                         > sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 ) </field>
+      <field id="strd_ad"       long_name="salinity   -trend: advection"               standard_name="tendency_of_sea_water_salinity_due_to_advection"              unit="1e-3/s"                         > sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 ) </field>
+      <field id="ttrd_sad"      long_name="temperature-trend: surface adv. (no-vvl)"                                                                                unit="degC/s"   grid_ref="grid_T_2D" />
+      <field id="strd_sad"      long_name="salinity   -trend: surface adv. (no-vvl)"                                                                                unit="1e-3/s"   grid_ref="grid_T_2D" />
+      <field id="ttrd_ldf"      long_name="temperature-trend: lateral  diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_horizontal_mixing"   unit="degC/s"                        />
+      <field id="strd_ldf"      long_name="salinity   -trend: lateral  diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_horizontal_mixing"      unit="1e-3/s"                        />
+      <field id="ttrd_zdf"      long_name="temperature-trend: vertical diffusion"      standard_name="tendency_of_sea_water_temperature_due_to_vertical_mixing"     unit="degC/s"                        />
+      <field id="strd_zdf"      long_name="salinity   -trend: vertical diffusion"      standard_name="tendency_of_sea_water_salinity_due_to_vertical_mixing"        unit="1e-3/s"                        />
+
+      <!-- ln_traldf_iso=T only (iso-neutral diffusion) -->
+      <field id="ttrd_zdfp"     long_name="temperature-trend: pure vert. diffusion"   unit="degC/s" />
+      <field id="strd_zdfp"     long_name="salinity   -trend: pure vert. diffusion"   unit="1e-3/s" />
+
+      <!-- -->
+      <field id="ttrd_dmp"      long_name="temperature-trend: interior restoring"        unit="degC/s" />
+      <field id="strd_dmp"      long_name="salinity   -trend: interior restoring"        unit="1e-3/s" />
+      <field id="ttrd_bbl"      long_name="temperature-trend: bottom boundary layer"     unit="degC/s" />
+      <field id="strd_bbl"      long_name="salinity   -trend: bottom boundary layer"     unit="1e-3/s" />
+      <field id="ttrd_npc"      long_name="temperature-trend: non-penetrative conv."     unit="degC/s" />
+      <field id="strd_npc"      long_name="salinity   -trend: non-penetrative conv."     unit="1e-3/s" />
+      <field id="ttrd_qns"      long_name="temperature-trend: non-solar flux + runoff"   unit="degC/s" />
+      <field id="strd_cdt"      long_name="salinity   -trend: C/D term       + runoff"   unit="degC/s" />
+      <field id="ttrd_qsr"      long_name="temperature-trend: solar penetr. heating"     unit="degC/s" />
+      <field id="ttrd_bbc"      long_name="temperature-trend: geothermal heating"        unit="degC/s" />
+      <field id="ttrd_atf"      long_name="temperature-trend: asselin time filter"       unit="degC/s" />
+      <field id="strd_atf"      long_name="salinity   -trend: asselin time filter"       unit="1e-3/s" />
+
+      <!-- variables available with ln_KE_trd -->
+      <field id="ketrd_hpg"     long_name="ke-trend: hydrostatic pressure gradient"          unit="W/s^3"                        />
+      <field id="ketrd_spg"     long_name="ke-trend: surface     pressure gradient"          unit="W/s^3"                        />
+      <field id="ketrd_spgexp"  long_name="ke-trend: surface pressure gradient (explicit)"   unit="W/s^3"                        />
+      <field id="ketrd_spgflt"  long_name="ke-trend: surface pressure gradient (filter)"     unit="W/s^3"                        />
+      <field id="ssh_flt"       long_name="filtered contribution to ssh (dynspg_flt)"        unit="m"       grid_ref="grid_T_2D" />
+      <field id="w0"            long_name="surface vertical velocity"                        unit="m/s"     grid_ref="grid_T_2D" />
+      <field id="pw0_exp"       long_name="surface pressure flux due to ssh"                 unit="W/s^2"   grid_ref="grid_T_2D" />
+      <field id="pw0_flt"       long_name="surface pressure flux due to filtered ssh"        unit="W/s^2"   grid_ref="grid_T_2D" />
+      <field id="ketrd_keg"     long_name="ke-trend: KE gradient         or hor. adv."       unit="W/s^3"                        />
+      <field id="ketrd_rvo"     long_name="ke-trend: relative  vorticity or metric term"     unit="W/s^3"                        />
+      <field id="ketrd_pvo"     long_name="ke-trend: planetary vorticity"                    unit="W/s^3"                        />
+      <field id="ketrd_zad"     long_name="ke-trend: vertical  advection"                    unit="W/s^3"                        />
+      <field id="ketrd_udx"     long_name="ke-trend: U.dx[U]"                                unit="W/s^3"                        />
+      <field id="ketrd_ldf"     long_name="ke-trend: lateral   diffusion"                    unit="W/s^3"                        />
+      <field id="ketrd_zdf"     long_name="ke-trend: vertical  diffusion"                    unit="W/s^3"                        />
+      <field id="ketrd_tau"     long_name="ke-trend: wind stress "                           unit="W/s^3"   grid_ref="grid_T_2D" />
+      <field id="ketrd_bfr"     long_name="ke-trend: bottom friction (explicit)"             unit="W/s^3"                        />   
+      <field id="ketrd_bfri"    long_name="ke-trend: bottom friction (implicit)"             unit="W/s^3"                        />   
+      <field id="ketrd_atf"     long_name="ke-trend: asselin time filter trend"              unit="W/s^3"                        />  
+      <field id="ketrd_convP2K" long_name="ke-trend: conversion (potential to kinetic)"      unit="W/s^3"                        />
+      <field id="KE"            long_name="kinetic energy: u(n)*u(n+1)/2"                    unit="W/s^2"                        />   
+
+      <!-- variables available with ln_PE_trd -->
+      <field id="petrd_xad"     long_name="pe-trend: i-advection"                unit="W/m^3"                        />
+      <field id="petrd_yad"     long_name="pe-trend: j-advection"                unit="W/m^3"                        />
+      <field id="petrd_zad"     long_name="pe-trend: k-advection"                unit="W/m^3"                        />
+      <field id="petrd_sad"     long_name="pe-trend: surface adv. (no-vvl)"      unit="W/m^3"   grid_ref="grid_T_2D" />
+      <field id="petrd_ldf"     long_name="pe-trend: lateral  diffusion"         unit="W/m^3"                        />
+      <field id="petrd_zdf"     long_name="pe-trend: vertical diffusion"         unit="W/m^3"                        />
+      <field id="petrd_zdfp"    long_name="pe-trend: pure vert. diffusion"       unit="W/m^3"                        />
+      <field id="petrd_dmp"     long_name="pe-trend: interior restoring"         unit="W/m^3"                        />
+      <field id="petrd_bbl"     long_name="pe-trend: bottom boundary layer"      unit="W/m^3"                        />
+      <field id="petrd_npc"     long_name="pe-trend: non-penetrative conv."      unit="W/m^3"                        />
+      <field id="petrd_nsr"     long_name="pe-trend: surface forcing + runoff"   unit="W/m^3"                        />
+      <field id="petrd_qsr"     long_name="pe-trend: solar penetr. heating"      unit="W/m^3"                        />
+      <field id="petrd_bbc"     long_name="pe-trend: geothermal heating"         unit="W/m^3"                        />
+      <field id="petrd_atf"     long_name="pe-trend: asselin time filter"        unit="W/m^3"                        />
+      <field id="PEanom"        long_name="potential energy anomaly"             unit="1"                            />   
+      <field id="alphaPE"       long_name="partial deriv. of PEanom wrt T"       unit="degC-1"                       />   
+      <field id="betaPE"        long_name="partial deriv. of PEanom wrt S"       unit="1e3"                          />   
+    </field_group>
+
+    <field_group id="trendU" grid_ref="grid_U_3D">
+     <!-- variables available with ln_dyn_trd -->
+     <field id="utrd_hpg"       long_name="i-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
+     <field id="utrd_spg"       long_name="i-trend: surface     pressure gradient"          unit="m/s^2"                        />
+     <field id="utrd_spgexp"    long_name="i-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
+     <field id="utrd_spgflt"    long_name="i-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
+     <field id="utrd_keg"       long_name="i-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
+     <field id="utrd_rvo"       long_name="i-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
+     <field id="utrd_pvo"       long_name="i-trend: planetary vorticity"                    unit="m/s^2"                        />
+     <field id="utrd_zad"       long_name="i-trend: vertical  advection"                    unit="m/s^2"                        />
+     <field id="utrd_udx"       long_name="i-trend: U.dx[U]"                                unit="m/s^2"                        />
+     <field id="utrd_ldf"       long_name="i-trend: lateral   diffusion"                    unit="m/s^2"                        />
+     <field id="utrd_zdf"       long_name="i-trend: vertical  diffusion"                    unit="m/s^2"                        />
+     <field id="utrd_tau"       long_name="i-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_U_2D" />
+     <field id="utrd_bfr"       long_name="i-trend: bottom friction (explicit)"             unit="m/s^2"                        />   
+     <field id="utrd_bfri"      long_name="i-trend: bottom friction (implicit)"             unit="m/s^2"                        />   
+     <field id="utrd_tot"       long_name="i-trend: total momentum trend before atf"        unit="m/s^2"                        />   
+     <field id="utrd_atf"       long_name="i-trend: asselin time filter trend"              unit="m/s^2"                        />   
+    </field_group>
+
+    <field_group id="trendV" grid_ref="grid_V_3D">
+     <!-- variables available with ln_dyn_trd -->
+     <field id="vtrd_hpg"       long_name="j-trend: hydrostatic pressure gradient"          unit="m/s^2"                        />
+     <field id="vtrd_spg"       long_name="j-trend: surface     pressure gradient"          unit="m/s^2"                        />
+     <field id="vtrd_spgexp"    long_name="j-trend: surface pressure gradient (explicit)"   unit="m/s^2"                        />
+     <field id="vtrd_spgflt"    long_name="j-trend: surface pressure gradient (filtered)"   unit="m/s^2"                        />
+     <field id="vtrd_keg"       long_name="j-trend: KE gradient         or hor. adv."       unit="m/s^2"                        />
+     <field id="vtrd_rvo"       long_name="j-trend: relative  vorticity or metric term"     unit="m/s^2"                        />
+     <field id="vtrd_pvo"       long_name="j-trend: planetary vorticity"                    unit="m/s^2"                        />
+     <field id="vtrd_zad"       long_name="j-trend: vertical  advection"                    unit="m/s^2"                        />
+     <field id="vtrd_vdy"       long_name="i-trend: V.dx[V]"                                unit="m/s^2"                        />
+     <field id="vtrd_ldf"       long_name="j-trend: lateral   diffusion"                    unit="m/s^2"                        />
+     <field id="vtrd_zdf"       long_name="j-trend: vertical  diffusion"                    unit="m/s^2"                        />
+     <field id="vtrd_tau"       long_name="j-trend: wind stress "                           unit="m/s^2"   grid_ref="grid_V_2D" />
+     <field id="vtrd_bfr"       long_name="j-trend: bottom friction (explicit)"             unit="m/s^2"                        />   
+     <field id="vtrd_bfri"      long_name="j-trend: bottom friction (implicit)"             unit="m/s^2"                        />   
+     <field id="vtrd_tot"       long_name="j-trend: total momentum trend before atf"        unit="m/s^2"                        />   
+     <field id="vtrd_atf"       long_name="j-trend: asselin time filter trend"              unit="m/s^2"                        />   
+    </field_group>
+
+
+    <!-- 
+============================================================================================================
+                                        Definitions for iodef_demo.xml
+============================================================================================================
+    -->
+
+    <field_group id="mooring" >
+      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"      />
+      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                   />
+      <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity"                 />
+      <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity"                 />
+      <field field_ref="woce"         name="wo"       long_name="sea_water_z_velocity"                 />
+      <field field_ref="avt"          name="difvho"   long_name="ocean_vertical_heat_diffusivity"      />
+      <field field_ref="avm"          name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"  />
+   
+      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
+      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
+      <field field_ref="sstgrad"      name="tosgrad"  long_name="module_of_sea_surface_temperature_gradient"    />
+      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
+      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
+      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
+      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
+      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
+      <field field_ref="taum"                                                                                   />
+      <field field_ref="20d"                                                                                    />
+      <field field_ref="mldkz5"                                                                                 />
+      <field field_ref="mldr10_1"                                                                               />
+      <field field_ref="mldr10_3"                                                                               />
+      <field field_ref="mldr0_1"                                                                                />
+      <field field_ref="mldr0_3"                                                                                />
+      <field field_ref="mld_dt02"                                                                               />
+      <field field_ref="topthdep"                                                                               />
+      <field field_ref="pycndep"                                                                                />
+      <field field_ref="tinv"                                                                                   />
+      <field field_ref="depti"                                                                                  />
+      <field field_ref="BLT"          name="blt"      long_name="barrier_layer_thickness"                       />
+      <field field_ref="utau"         name="tauuo"    long_name="surface_downward_x_stress"                     />
+      <field field_ref="vtau"         name="tauvo"    long_name="surface_downward_y_stress"                     />
+    </field_group>
+
+    <field_group id="groupT" >
+      <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               />
+      <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            />
+      <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
+      <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"             />
+      <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
+      <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                />
+      <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                     />
+      <field field_ref="qsr"          name="rsntds"   long_name="surface_net_downward_shortwave_flux"           />
+      <field field_ref="qt"           name="tohfls"   long_name="surface_net_downward_total_heat_flux"          />
+      <field field_ref="taum"                                                                                   />
+      <field field_ref="20d"                                                                                    />
+      <field field_ref="mldkz5"                                                                                 />
+      <field field_ref="mldr10_1"                                                                               />
+      <field field_ref="mldr10_3"                                                                               />
+      <field field_ref="mld_dt02"                                                                               />
+      <field field_ref="topthdep"                                                                               />
+      <field field_ref="pycndep"                                                                                />
+      <field field_ref="tinv"                                                                                   />
+      <field field_ref="depti"                                                                                  />
+      <field field_ref="BLT"          name="blt"      long_name="Barrier Layer Thickness"                       />
+    </field_group>
+    
+    <field_group id="groupU" >
+      <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      />
+      <field field_ref="ssu"          name="uos"     long_name="sea_surface_x_velocity"    />
+      <field field_ref="utau"         name="tauuo"   long_name="surface_downward_x_stress" />
+    </field_group>
+    
+    <field_group id="groupV" >
+      <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      />
+      <field field_ref="ssv"          name="vos"     long_name="sea_surface_y_velocity"    />
+      <field field_ref="vtau"         name="tauvo"   long_name="surface_downward_y_stress" />
+    </field_group>
+    
+    <field_group id="groupW" >
+      <field field_ref="woce"         name="wo"       long_name="ocean vertical velocity"  />
+    </field_group>
+
+     <field_group id="groupPTR"  >
+        <field field_ref="zomsfglo"          name="zomsfglo"  grid_ref="grid_ptr_W_3D" />
+        <field field_ref="zomsfatl"          name="zomsfatl"  grid_ref="grid_ptr_W_3D" />
+        <field field_ref="zomsfpac"          name="zomsfpac"  grid_ref="grid_ptr_W_3D" />
+        <field field_ref="zomsfind"          name="zomsfind"  grid_ref="grid_ptr_W_3D" />
+        <field field_ref="zomsfipc"          name="zomsfipc"  grid_ref="grid_ptr_W_3D" />
+        <field field_ref="zotemglo"          name="zotemglo"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zotematl"          name="zotematl"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zotempac"          name="zotempac"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zotemind"          name="zotemind"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zotemipc"          name="zotemipc"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosalglo"          name="zosalglo"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosalatl"          name="zosalatl"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosalpac"          name="zosalpac"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosalind"          name="zosalind"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosalipc"          name="zosalipc"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosrfglo"          name="zosrfglo"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosrfatl"          name="zosrfatl"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosrfpac"          name="zosrfpac"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosrfind"          name="zosrfind"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="zosrfipc"          name="zosrfipc"  grid_ref="grid_ptr_T_3D" />
+        <field field_ref="sophtadv"          name="sophtadv"  grid_ref="grid_ptr_T_2D" />
+        <field field_ref="sophtldf"          name="sophtldf"  grid_ref="grid_ptr_T_2D" />
+        <field field_ref="sopstadv"          name="sopstadv"  grid_ref="grid_ptr_T_2D" />
+        <field field_ref="sopstldf"          name="sopstldf"  grid_ref="grid_ptr_T_2D" />
+      </field_group>
+
+     <!-- 
+============================================================================================================
+     -->
+     <!-- output variables for my configuration --> 
+     <!--
+     <field_group id="myvarOCE"  >
+       <field field_ref="e3t"          name="e3t"      long_name="vertical scale factor"           />
+       <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"         />
+       <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"            />
+       <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"  />
+       <field field_ref="mldkz5"       name="mldkz5"                                               />
+       <field field_ref="mldr10_1"     name="mldr10_1"                                             />
+       <field field_ref="sbt"          name="tob"                                                  />
+       <field field_ref="sbs"          name="sob"                                                  />
+       <field field_ref="heatc"        name="heatc"    long_name="Heat content vertically integrated"  />
+       <field field_ref="saltc"        name="saltc"    long_name="Salt content vertically integrated"  />
+     </field_group>
+     -->
+    
+   </field_definition>

+ 165 - 0
templates/storm/xios_config/file_def_nemo-lim.xml

@@ -0,0 +1,165 @@
+<?xml version="1.0"?>
+    <!-- $id$ -->
+    
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files for lim3                                =
+=                                         put the variables you want...                                    =
+============================================================================================================
+  -->
+    
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+	<file id="file10" name_suffix="_icemod" description="ice variables" enabled=".TRUE." >
+	  <field field_ref="isst"             name="sst" />
+	  <field field_ref="isss"             name="sss" />
+	  
+	  <field field_ref="snowthic_cea"     name="snthic"     long_name="surface_snow_thickness"   />
+	  <field field_ref="snowvol"          name="snvolu" />
+	  <field field_ref="isnowhc"          name="snheco" />
+	  
+	  <field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        />
+	  <field field_ref="icevolu"          name="sivolu" />
+	  <field field_ref="iceconc"          name="siconc"  />
+	  <field field_ref="micesalt"         name="sisali" />
+	  <field field_ref="micet"            name="sitemp" />
+	  <field field_ref="icest"            name="sistem" />
+	  <field field_ref="icehc"            name="siheco" />
+	  <field field_ref="uice_ipa"         name="sivelu" />
+	  <field field_ref="vice_ipa"         name="sivelv" />
+	  <field field_ref="icevel"           name="sivelo" />
+	  <field field_ref="idive"            name="sidive" />
+	  <field field_ref="ishear"           name="sishea" />
+	  <field field_ref="icestr"           name="sistre" />
+
+	  <!--
+	  <field field_ref="tau_icebfr"       name="sibfri"    long_name="sea_ice_friction_at_ocean_bottom" />
+	  
+	  <field field_ref="miceage"          name="siages" />
+	  <field field_ref="ibrinv"           name="sibrin" />
+	  <field field_ref="icecolf"          name="sicolf" />
+	  
+	  <field field_ref="vfxice"           name="vfxice" />
+	  <field field_ref="vfxsnw"           name="vfxsnw" />
+	  <field field_ref="vfxsub"           name="vfxsub" />
+	  <field field_ref="vfxsub_err"       name="vfxsub_err" />
+	  <field field_ref="vfxspr"           name="vfxspr" />
+	  <field field_ref="vfxbog"           name="vfxbog" />
+	  <field field_ref="vfxdyn"           name="vfxdyn" />
+	  <field field_ref="vfxopw"           name="vfxopw" />
+	  <field field_ref="vfxsni"           name="vfxsni" />
+	  <field field_ref="vfxsum"           name="vfxsum" />
+	  <field field_ref="vfxbom"           name="vfxbom" />
+	  <field field_ref="vfxres"           name="vfxres" />
+	  <field field_ref="vfxthin"          name="vfxthin" />           
+	  <field field_ref="vfxlam"           name="vfxlam" />
+	  
+	  <field field_ref="sfx"              name="sfx" />
+	  <field field_ref="sfxbri"           name="sfxbri" />
+	  <field field_ref="sfxdyn"           name="sfxdyn" />
+	  <field field_ref="sfxres"           name="sfxres" />
+	  <field field_ref="sfxbog"           name="sfxbog" />
+	  <field field_ref="sfxbom"           name="sfxbom" />
+	  <field field_ref="sfxsum"           name="sfxsum" />
+	  <field field_ref="sfxsni"           name="sfxsni" />
+	  <field field_ref="sfxopw"           name="sfxopw" />
+	  <field field_ref="sfxsub"           name="sfxsub" />
+	  <field field_ref="sfxlam"           name="sfxlam" />
+	  
+	  <field field_ref="hfxsum"          name="hfxsum"    />
+	  <field field_ref="hfxbom"          name="hfxbom"    />
+	  <field field_ref="hfxbog"          name="hfxbog"    />
+	  <field field_ref="hfxdif"          name="hfxdif"    />
+	  <field field_ref="hfxopw"          name="hfxopw"    />
+	  <field field_ref="hfxout"          name="hfxout"    />
+	  <field field_ref="hfxin"           name="hfxin"    />
+	  <field field_ref="hfxsnw"          name="hfxsnw"    />
+	  <field field_ref="hfxerr"          name="hfxerr"    />
+	  -->
+
+	  <!-- ice-ocean heat flux from mass exchange -->
+	  <!--
+	  <field field_ref="hfxdyn"          name="hfxdyn"    />
+	  <field field_ref="hfxres"          name="hfxres"    />
+	  <field field_ref="hfxthd"          name="hfxthd"    />
+	  -->
+	  <!-- ice-atm. heat flux from mass exchange -->
+	  <!--
+	  <field field_ref="hfxsub"          name="hfxsub"    />
+	  <field field_ref="hfxspr"          name="hfxspr"    />
+	  -->
+	  <!-- diags -->
+	  <!--
+	  <field field_ref="hfxdhc"          name="hfxdhc"    />
+	  <field field_ref="hfxtur"          name="hfxtur"    />
+	  <field field_ref="afxthd"          name="afxthd"    />
+	  <field field_ref="afxdyn"          name="afxdyn"    />
+	  -->
+	  <!-- transported fields -->
+	  <!--
+	  <field field_ref="icetrp"          name="sivtrp" />
+	  <field field_ref="snwtrp"          name="snvtrp" />
+	  <field field_ref="saltrp"          name="saltrp" />
+	  <field field_ref="deitrp"          name="deitrp" />
+	  <field field_ref="destrp"          name="destrp" />
+          -->
+	  <!-- categories -->
+	  <field field_ref="snowthic_cat"     name="snthicat"/>
+	  <field field_ref="iceconc_cat"      name="siconcat"/>
+	  <field field_ref="icethic_cat"      name="sithicat"/>
+	  <field field_ref="salinity_cat"     name="salincat"/>
+	  <field field_ref="iceage_cat"       name="siagecat"/>
+	  <field field_ref="brinevol_cat"     name="sibricat"/>
+	  <field field_ref="icetemp_cat"      name="sitemcat"/>
+	  <field field_ref="snwtemp_cat"      name="sntemcat"/>
+	  
+        </file>
+
+        <file id="file11" name_suffix="_SBC_scalar" description="scalar variables" >
+ 	  <!-- global contents -->
+          <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
+          <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
+          <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
+          <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
+          <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
+          <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
+	  
+	  <!-- global drifts (conservation checks) -->
+          <field field_ref="ibgvolume"        name="ibgvolume"    />
+          <field field_ref="ibgsaltco"        name="ibgsaltco"    />
+          <field field_ref="ibgheatco"        name="ibgheatco"    />
+          <field field_ref="ibgheatfx"        name="ibgheatfx"    />
+	  
+	  <!-- global forcings  -->
+          <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
+          <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
+          <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
+          <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
+          <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
+          <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
+          <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
+        </file>
+
+      </file_group>
+    
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+      <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+      <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+      <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+      <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->        
+      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."/>  <!-- 1d files -->   	
+      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   	
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+      <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+      <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+      <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+   </file_definition>

+ 141 - 0
templates/storm/xios_config/file_def_nemo-opa.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+   
+    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+    
+
+      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+	  <field field_ref="e3t"      name="e3t"         long_name="vertical scale factor"                     />
+	  <field field_ref="eken"     name="eke"         long_name="kinetic energy"                            />
+	  <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+	  <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+	  <field field_ref="ssh"      name="zos"         long_name="sea_surface_height_above_geoid"            />
+	  <field field_ref="mldkz5"   name="mldkz5"                                                            />
+	  <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+	  <field field_ref="sbt"      name="tob"                                                               />
+	  <field field_ref="sbs"      name="sob"                                                               />
+	  <field field_ref="heatc"    name="heatc"       long_name="Heat content vertically integrated"        />
+	  <field field_ref="saltc"    name="saltc"       long_name="Salt content vertically integrated"        />
+	  
+	  <field field_ref="toce"     name="to"          long_name="sea_water_potential_temperature"                    operation="instant" freq_op="1d" > @toce_e3t / @e3t </field>
+	  <field field_ref="soce"     name="so"          long_name="sea_water_salinity"                                 operation="instant" freq_op="1d" > @soce_e3t / @e3t </field>
+	  <field field_ref="sst"      name="tosstd"      long_name="sea_surface_temperature_standard_deviation"         operation="instant" freq_op="1d" > sqrt( @sst2 - @sst * @sst ) </field>
+	  <field field_ref="ssh"      name="zosstd"      long_name="sea_surface_height_above_geoid_standard_deviation"  operation="instant" freq_op="1d" > sqrt( @ssh2 - @ssh * @ssh ) </field>
+	  <field field_ref="sst"      name="tosdcy"      long_name="amplitude of sst diurnal cycle"                     operation="average" freq_op="1d" > @sstmax - @sstmin </field>
+	  <field field_ref="mldr10_1" name="mldr10_1dcy" long_name="amplitude of mldr10_1 diurnal cycle"                operation="average" freq_op="1d" > @mldr10_1max - @mldr10_1min </field>
+	</file>
+	
+        <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
+	  <field field_ref="e3u"          name="e3u"      long_name="vertical scale factor"       />
+	  <field field_ref="ubar"         name="ubar"     long_name="ocean_barotropic_x_velocity" />
+	  <field field_ref="ssu"          name="uos"      long_name="sea_surface_x_velocity"      />
+	  <field field_ref="sbu"          name="uob"      long_name="sea_bottom_x_velocity"       />
+	  <field field_ref="utau"         name="tauu"     long_name="surface_downward_x_stress"   />
+	  <field field_ref="uocetr_eff"   name="uotr_eff" long_name="effective ocean transport along i-axis"      />
+	  <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity" operation="instant" freq_op="1d" > @uoce_e3u / @e3u </field>
+	</file>
+	
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
+	  <field field_ref="e3v"          name="e3v"      long_name="vertical scale factor"      />
+	  <field field_ref="vbar"         name="vbar"     long_name="ocean_barotropic_y_velocity" />
+	  <field field_ref="ssv"          name="vos"      long_name="sea_surface_y_velocity"     />
+	  <field field_ref="sbv"          name="vob"      long_name="sea_bottom_y_velocity"      />
+	  <field field_ref="vtau"         name="tauv"     long_name="surface_downward_y_stress"  />
+	  <field field_ref="vocetr_eff"   name="votr_eff" long_name="effective ocean transport along j-axis"      />
+	  <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity" operation="instant" freq_op="1d" > @voce_e3v / @e3v </field>
+ 	</file>
+	
+	<file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
+	  <field field_ref="e3w"          name="e3w"     long_name="vertical scale factor"           />
+	  <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         />
+	  <field field_ref="avt"          name="avt"     long_name="ocean_vertical_heat_diffusivity" />
+	  <field field_ref="avs"          name="avs"     long_name="ocean_vertical_salt_diffusivity" />
+	  <field field_ref="avm"          name="avm"     long_name="ocean_vertical_momentum_diffusivity" />
+	</file>
+
+	<file id="file5" name_suffix="_SBC" description="surface fluxes variables" > 
+	  <field field_ref="erp"          name="erp"      long_name="Surface Water Flux: Damping"                 />
+	  <field field_ref="qrp"          name="qrp"      long_name="Surface Heat Flux: Damping"                 />
+	  <field field_ref="empmr"        name="empmr"    long_name="water_flux_into_sea_water"                 />
+	  <field field_ref="qsr_oce"      name="qsr_oce"  long_name="downward shortwave flux at ocean surface"  />
+	  <field field_ref="qns_oce"      name="qns_oce"  long_name="downward non solar flux at ocean surface"  />
+	  <field field_ref="qt_oce"       name="qt_oce"   long_name="downward total flux at ocean surface"      />
+	  <field field_ref="qemp_oce"     name="qemp_oce" long_name="downward heat flux from E-P over ocean"    />
+	  <field field_ref="qsr_ice"      name="qsr_ice"  long_name="downward shortwave flux at ice surface"    />
+	  <field field_ref="qns_ice"      name="qns_ice"  long_name="downward non solar flux at ice surface"    />
+	  <field field_ref="qtr_ice"      name="qtr_ice"  long_name="shortwave flux transmitted thru the ice"   />
+	  <field field_ref="qt_ice"       name="qt_ice"   long_name="downward total flux at ice surface"        />
+	  <field field_ref="qemp_ice"     name="qemp_ice" long_name="downward heat flux from E-P over ice"      />
+	  <field field_ref="emp_oce"      name="emp_oce"  long_name="Evap minus Precip over ocean"              />
+	  <field field_ref="emp_ice"      name="emp_ice"  long_name="Evap minus Precip over ice"                />
+	  <field field_ref="taum"         name="taum"                                                           />
+	  <field field_ref="taum_oce"     name="taum_oce"                                                       />
+	  <field field_ref="wspd"         name="windsp"                                                         />
+	  <field field_ref="precip"       name="precip"                                                         />
+	  <field field_ref="snowpre"      name="sprecip"                                                        />
+	  <field field_ref="utau_ice"     name="tauu_ice"                                                       />
+	  <field field_ref="vtau_ice"     name="tauv_ice"                                                       />
+	  <field field_ref="alb_ice"      name="alb_ice"                                                        />
+	  <field field_ref="albedo"       name="albedo"                                                         />
+	</file>
+
+        <file id="file6" name_suffix="_scalar" description="scalar variables" >
+	  <!-- global contents -->
+	  <field field_ref="voltot"       name="scvoltot"  />
+	  <field field_ref="sshtot"       name="scsshtot"  />
+	  <field field_ref="sshsteric"    name="scsshste"  />
+	  <field field_ref="sshthster"    name="scsshtst"  />
+	  <field field_ref="masstot"      name="scmastot"  />
+	  <field field_ref="temptot"      name="sctemtot"  />
+	  <field field_ref="saltot"       name="scsaltot"  />
+	  
+	  <!-- global drifts (conservation checks) -->
+	  <field field_ref="bgtemper"     name="bgtemper"    />
+	  <field field_ref="bgsaline"     name="bgsaline"    />
+	  <field field_ref="bgheatco"     name="bgheatco"    />
+	  <field field_ref="bgheatfx"     name="bgheatfx"    />
+	  <field field_ref="bgsaltco"     name="bgsaltco"    />
+	  <field field_ref="bgvolssh"     name="bgvolssh"    />
+	  <field field_ref="bgvole3t"     name="bgvole3t"    />
+	  
+	  <!-- global surface forcings  -->
+	  <field field_ref="bgfrcvol"     name="bgfrcvol"    />
+	  <field field_ref="bgfrctem"     name="bgfrctem"    />
+	  <field field_ref="bgfrchfx"     name="bgfrchfx"    />
+	  <field field_ref="bgfrcsal"     name="bgfrcsal"    />
+        </file>
+
+      </file_group> 
+      
+
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+      <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+      <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+      <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+      <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+      <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->     
+      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."/>  <!-- 1d files -->   
+      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+      <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+      <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+      <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+   </file_definition>
+    
+
+
+

+ 30 - 0
templates/storm/xios_config/iodef.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+
+          <!--
+          <variable id="optimal_buffer_size"       type="string">memory</variable>
+          <variable id="buffer_size_factor"        type="double">1.0</variable>
+          -->
+	  <variable id="info_level"                type="int">10</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context_nemo.xml"/>       <!--  NEMO       -->
+
+</simulation>

+ 31 - 0
templates/zenobe_xios-1.0/data.cfg

@@ -0,0 +1,31 @@
+ini_data_dir=/SCRATCH/acad/limhr/DATA
+ic_subdir=CONFIG_FILES
+nem_grid=ORCA1
+ic_files=(
+    "clipped_eORCA_R1_coordinates_v1.0.nc => coordinates.nc" 
+    "clipped_eORCA1_R1_bathy_meter_v2.1.nc => bathy_meter.nc" 
+    "clipped_eORCA_R1_ahmcoef_v1.0.nc => ahmcoef.nc" 
+    "clipped_eORCA_R1_maskITF_v1.0.nc => mask_itf.nc" 
+    "clipped_eORCA_R1_K1_v1.0.nc => K1rowdrg.nc" 
+    "clipped_eORCA_R1_M2_v1.0.nc => M2rowdrg.nc"
+    "clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc"
+    "conservative_temperature_WOA13_decav_Reg1L75_clim.nc"
+    "absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_2D.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_3D.nc"
+)
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+#
+forcing_subdir=FORCINGS
+nem_forcing_set=DFS5.2
+forcing_files=(
+    "* => ."
+)
+#
+shared_files=(
+    "namelist_ice_lim3_ref => namelist_ice_ref"
+    "namelist_ref"
+    "domain_def.xml"
+    "field_def.xml"
+)

+ 22 - 0
templates/zenobe_xios-1.0/experiment.cfg

@@ -0,0 +1,22 @@
+# Experience name
+exp_name=EXP_REF
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1958-01-01"
+run_duration="58 year"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 year"
+
+# Number of restart legs to be run in one go
+run_num_legs=29
+
+# Parameters
+nem_time_step_sec=3600
+lim_time_step_sec=21600
+nem_restart_offset=0
+nem_config_name=ORCA1_LIM3_REF
+
+# This file is used to store information about restarts
+info_file="nemo.info"

+ 30 - 0
templates/zenobe_xios-1.0/job.cfg

@@ -0,0 +1,30 @@
+# PBS job options
+PBS -N ${exp_name}
+PBS -q large
+PBS -r y
+PBS -W group_list=limhr
+PBS -l walltime=17:00:00
+PBS -l select=11:ncpus=24:mem=63000mb:mpiprocs=24:ompthreads=1
+
+#PBS -M ${email}
+#PBS -m abe
+
+exec > ${PBS_O_WORKDIR-$PWD}/${PBS_JOBNAME-"local"}_${PBS_JOBID-"id"}.log
+echo "------------------ Job Info --------------------"
+echo "jobid : $PBS_JOBID"
+echo "jobname : $PBS_JOBNAME"
+echo "job type : $PBS_ENVIRONMENT"
+echo "submit dir : $PBS_O_WORKDIR"
+echo "queue : $PBS_O_QUEUE"
+echo "user : $PBS_O_LOGNAME"
+echo "threads : $OMP_NUM_THREADS"
+
+start_dir=${PBS_O_WORKDIR-$PWD}
+run_dir="/SCRATCH/acad/limhr/$USER/nemo/run/${exp_name}"
+archive_dir="/SCRATCH/acad/limhr/$USER/nemo/archive/${exp_name}"
+
+# Cancel job on error
+set -ueo pipefail
+
+# RESET script arguments
+set -- $PBS_OPTIONS 

+ 406 - 0
templates/zenobe_xios-1.0/namelists/build_namelist_cfg.sh

@@ -0,0 +1,406 @@
+# This configuration namelist will overwrite SHARED/namelist_ref
+#
+if $leg_is_restart
+then
+    nemo_restart=".TRUE."
+else
+    nemo_restart=".FALSE."
+fi
+
+cat << EOF
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OPA  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp        =  "${exp_name}" !  experience name
+   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
+   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
+   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
+                                  !    used if ln_rstart=F or
+                                  !    (ln_rstart=T and nn_rstctl=0 or 1)
+   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
+   nn_rstctl     =  1             !  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  = "restart_oce"  !  suffix of ocean restart name (input)
+   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
+   nn_stock      =  0             !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_write      = -1             !  frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration
+!-----------------------------------------------------------------------
+   cp_cfg      =  "orca"               !  name of the configuration
+   jp_cfg      =       1               !  resolution of the configuration
+   jpidta      =     362               !  1st lateral dimension ( >= jpi )
+   jpjdta      =     292               !  2nd    "         "    ( >= jpj )
+   jpkdta      =      75               !  number of levels      ( >= jpk )
+   jpiglo      =     362               !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     292               !  2nd    -                  -    --> j  =jpjdta
+   jperio      =       6               !  6 cyclic East-West AND North fold F-point pivot
+   ln_use_jattr = .true.               !  use (T) the file attribute: open_ocean_jstart if present
+/
+!-----------------------------------------------------------------------
+&namzgr        !   vertical coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdom        !   space and time domain (bathymetry, mesh, timestep)
+!-----------------------------------------------------------------------
+   nn_msh      =    0                  !  create (=1) a mesh file or not (=0)
+   rn_hmin     =    20.                !  min depth of the ocean (>0) or min number of ocean level (<0)
+   rn_rdt      = ${nem_time_step_sec} !  time step for the dynamics (and tracer if nn_acc=0)
+   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
+   ppgphi0     =  999999.0             !  latitude  of first raw and column T-point (jphgr_msh = 1)
+   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
+   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
+   ppsur       =  -3958.951371276829   !  ORCA r4, r2 and r05 coefficients
+   ppa0        =    103.95300960000000 ! (default coefficients)
+   ppa1        =      2.41595126900000 !
+   ppkth       =     15.35101370000000 !
+   ppacr       =      7.0              !
+   ppdzmin     =  999999.              !  Minimum vertical spacing
+   pphmax      =  999999.              !  Maximum depth
+   ppa2        =  100.7609285000000    !  Double tanh function parameters
+   ppkth2      =  48.02989372000000    !
+   ppacr2      =  13.00000000000       !
+/
+!-----------------------------------------------------------------------
+&namsplit      !   time splitting parameters  ("key_dynspg_ts")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options                             ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtsd    !   data : Temperature  & Salinity
+!-----------------------------------------------------------------------
+!          !  file name                                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!          !                                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_tem  = 'conservative_temperature_WOA13_decav_Reg1L75_clim.nc',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   sn_sal  = 'absolute_salinity_WOA13_decav_Reg1L75_clim.nc'       ,         -1        ,'vosaline' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   !
+   ln_tsd_tradmp = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition (surface module)
+!-----------------------------------------------------------------------
+   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of surface boundary condition computation
+                           !     (also = the frequency of sea-ice model call)
+   nn_isf      = 3         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf)
+                           !  0 =no isf                  1 = presence of ISF
+                           !  2 = bg03 parametrisation   3 = rnf file for isf
+                           !  4 = ISF fwf specified
+                           !  option 1 and 4 need ln_isfcav = .true. (domzgr)
+   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
+                           !     =1 global mean of e-p-r set to zero at each time step
+                           !     =2 annual global mean of e-p-r set to zero
+/
+!-----------------------------------------------------------------------
+&namsbc_ana    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_flx    !   surface boundary condition : flux formulation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_utau     = 'uwnd_10m'  ,       24          , 'uwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_vtau     = 'vwnd_10m'  ,       24          , 'vwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_wndm     = 'ncep_bulk' ,       24          , 'wspd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_tair     = 'ncep_bulk' ,       24          , 'air'     ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_humi     = 'flx_correc',       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_ccov     = 'flx_correc',       -1          , 'socliocl',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_prec     = 'flx_correc',       -1          , 'socliopl',   .true.     , .true. , 'yearly'  , ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_core   !   namsbc_core  CORE bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name              ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights                                     ! rotation ! land/sea mask !
+!              !                         !  (if <0  months)  !   name   !   (logical)  !  (T/F)  ! 'monthly' ! filename                                    ! pairing  ! filename      !
+
+   sn_wndi     = 'drowned_u10_DFS5.2'    ,         3         , 'u10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'U1'     , ''
+   sn_wndj     = 'drowned_v10_DFS5.2'    ,         3         , 'v10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'V1'     , ''
+   sn_qsr      = 'drowned_radsw_DFS5.2'  ,        24         , 'radsw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_qlw      = 'drowned_radlw_DFS5.2'  ,        24         , 'radlw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_tair     = 'drowned_t2_DFS5.2'     ,         3         , 't2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_humi     = 'drowned_q2_DFS5.2'     ,         3         , 'q2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_prec     = 'drowned_precip_DFS5.2' ,        24         , 'precip' ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_snow     = 'drowned_snow_DFS5.2'   ,        24         , 'snow'   ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+
+   rn_zqt      = 2.        !  Air temperature and humidity reference height (m)
+/
+!-----------------------------------------------------------------------
+&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_qsr    !   penetrative solar radiation
+!-----------------------------------------------------------------------
+   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf    !   runoffs namelist surface boundary condition
+!-----------------------------------------------------------------------
+!              !  file name                                              ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !                                                         !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_rnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',        -1         , 'sorunoff' , .true.       , .true. , 'yearly'  , ''       , ''       , ''
+   sn_cnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',         0         , 'socoefr'  , .false.      , .true. , 'yearly'  , ''       , ''       , ''
+
+   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_depth_ini = .true.   ! compute depth at initialisation from runoff file
+   rn_rnf_max   = 0.05      !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+/
+!-----------------------------------------------------------------------
+&namsbc_isf    !  Top boundary layer (ISF)
+!-----------------------------------------------------------------------
+!                ! file name                                                ! frequency (hours) ! variable     ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
+!                !                                                          !  (if <0  months)  !   name       !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
+   sn_rnfisf     = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sornfisf'    ,    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmax_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmax_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmin_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmin_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr    !   surface boundary condition : sea surface restoring
+!-----------------------------------------------------------------------
+!              !  file name                                          ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!              !                                                     !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_sss      = 'sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc' ,        -1         , 'sosaline',    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_2D.nc', ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_alb    !   albedo parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
+                           !  free slip  !   partial slip  !   no slip   ! strong slip
+/
+!-----------------------------------------------------------------------
+&namcla        !   cross land advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namagrif      !  AGRIF zoom                                            ("key_agrif")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_tide      !   tide parameters (#ifdef key_tide)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy        !  unstructured open boundaries                          ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_dta      !  open boundaries - external data           ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_tide     ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambfr        !   bottom friction
+!-----------------------------------------------------------------------
+   nn_bfr      =    2      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
+                           !                              = 2 : nonlinear friction
+/
+!-----------------------------------------------------------------------
+&nambbc        !   bottom temperature boundary condition
+!-----------------------------------------------------------------------
+   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
+                           !     = 1 constant flux
+                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
+/
+!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nameos        !   ocean physical parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv    !   advection scheme for tracer
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
+!-----------------------------------------------------------------------
+/
+!----------------------------------------------------------------------------------
+&namtra_ldf    !   lateral diffusion scheme for tracers
+!----------------------------------------------------------------------------------
+   rn_aht_0         =  1000.     !  horizontal eddy diffusivity for tracers [m2/s]
+   rn_aeiv_0        =  1000.     !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
+/
+!-----------------------------------------------------------------------
+&namtra_dmp    !   tracer: T & S newtonian damping
+!-----------------------------------------------------------------------
+   ln_tradmp   =  .false.  !  add a damping termn (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv    !   formulation of the momentum advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_vvl    !   vertical coordinate options
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg    !   Hydrostatic pressure gradient option
+!-----------------------------------------------------------------------
+   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .true.    !  s-coordinate (standard jacobian formulation)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf    !   lateral diffusion on momentum
+!-----------------------------------------------------------------------
+   rn_ahm_0_lap     = 20000.    !  horizontal laplacian eddy viscosity   [m2/s]
+/
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!-----------------------------------------------------------------------
+/
+!------------------------------------------------------------------------
+&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
+!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsol        !   elliptic solver / island / free surface
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
+!-----------------------------------------------------------------------
+   jpni        =   20      !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   13      !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =   260     !  jpnij  number of local domains (set automatically if < 1)
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints & Benchmark
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto       ! Stochastic parametrization of EOS
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namflo       !   float parameters                                      ("key_float")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namptr       !   Poleward Transport Diagnostic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namhsb       !  Heat and salt budgets
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_diaharm   !   Harmonic analysis of tidal constituents ('key_diaharm')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdct        ! transports through sections
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namobs       !  observation usage switch                               ('key_diaobs')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_asminc   !   assimilation increments                               ('key_asminc')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_wave   ! External fields from wave model
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
+!-----------------------------------------------------------------------
+/
+EOF

+ 38 - 0
templates/zenobe_xios-1.0/namelists/namelist_ice_cfg

@@ -0,0 +1,38 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/LIM3 : ice configuration namelist, will overwrite SHARED/namelist_ice_lim3_ref
+!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!-----------------------------------------------------------------------
+&namicerun     !   Share parameters for dynamics/advection/thermo
+!-----------------------------------------------------------------------
+   ln_limdiahsb  = .false.         !  check the heat and salt budgets (T) or not (F)
+   ln_limdiaout  = .false.         !  output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namiceini     !   ice initialisation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitd     !   Ice discretization
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicedyn     !   ice dynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicehdf     !   Ice horizontal diffusion
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicethd     !   ice thermodynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicesal     !   ice salinity
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitdme   !   parameters for mechanical redistribution of ice 
+!-----------------------------------------------------------------------
+/

+ 19 - 0
templates/zenobe_xios-1.0/programs.cfg

@@ -0,0 +1,19 @@
+module_list="compiler/intel/composerxe/2015.5.223 intelmpi/5.0.3.049/64"
+extralibs_list="/projects/acad/limhr/opt/netcdf/4.4.0_intel_2015.5_impi_5.0.3/lib"
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nemo_src_dir=${HOME}/modeles/nemo/3.6
+shared_dir=${nemo_src_dir}/CONFIG/SHARED
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+nem_numproc=260
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-1.0/bin/xios_server.exe
+xio_numproc=4
+

+ 55 - 0
templates/zenobe_xios-1.0/xios_config/context.xml

@@ -0,0 +1,55 @@
+<!-- =========================================================================================================== -->
+<!-- NEMO context                                                                                                -->
+<!-- =========================================================================================================== -->
+<context id="nemo" time_origin="1950-01-01 00:00:00" >    
+  <!-- $id$ -->
+    
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+
+    <field_definition src="./field_def.xml"/>
+
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+    
+    <file_definition src="./file_def.xml"/>
+    
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+   <axis_definition>  
+      <axis id="deptht"  long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu"  long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv"  long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw"  long_name="Vertical W levels" unit="m" positive="down" />
+      <axis id="nfloat"  long_name="Float number"      unit="-" />
+      <axis id="icbcla"  long_name="Iceberg class"     unit="-" />
+      <axis id="ncatice" long_name="Ice categories"    unit="-" />
+   </axis_definition> 
+    
+   <domain_definition src="./domain_def.xml"/>
+   
+   <grid_definition>    
+      <grid id="grid_T_2D" domain_ref="grid_T"/>
+      <grid id="grid_T_3D" domain_ref="grid_T" axis_ref="deptht"/>
+      <grid id="grid_U_2D" domain_ref="grid_U"/>
+      <grid id="grid_U_3D" domain_ref="grid_U" axis_ref="depthu"/>
+      <grid id="grid_V_2D" domain_ref="grid_V"/>
+      <grid id="grid_V_3D" domain_ref="grid_V" axis_ref="depthv"/>
+      <grid id="grid_W_2D" domain_ref="grid_W"/>
+      <grid id="grid_W_3D" domain_ref="grid_W" axis_ref="depthw"/>
+    </grid_definition>   
+
+</context>

+ 173 - 0
templates/zenobe_xios-1.0/xios_config/file_def.xml

@@ -0,0 +1,173 @@
+<?xml version="1.0"?>
+<!-- 
+     ============================================================================================================
+     =                                           output files definition                                        =
+     =                                            Define your own files                                         =
+     =                                         put the variables you want...                                    =
+     ============================================================================================================
+-->
+
+<file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+  
+  <file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
+  <file_group id="1h" output_freq="1h" output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+  <file_group id="2h" output_freq="2h" output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+  <file_group id="3h" output_freq="3h" output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+  <file_group id="4h" output_freq="4h" output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+  <file_group id="6h" output_freq="6h" output_level="10" enabled=".TRUE."/> <!-- 6h files -->     
+  
+  <file_group id="1d" output_freq="1d" output_level="10" enabled=".TRUE."> <!-- 1d files -->   
+
+    <file id="file1" name_suffix="_grid_T" >
+      <field field_ref="sst"        name="tos"      />
+      <field field_ref="sss"        name="sos"      />
+
+      <field field_ref="mldkz5"     name="mldkz5"   />
+      <field field_ref="mldr10_1"   name="mldr10_1" />
+    </file>
+
+    <file id="file2" name_suffix="_icemod" >
+      <field field_ref="snowthic_cea"   name="snthic"  />
+      <field field_ref="icethic_cea"    name="sithic"  />
+      <field field_ref="iceconc"        name="siconc"  />
+
+      <field field_ref="uice_ipa"       name="sivelu"  />
+      <field field_ref="vice_ipa"       name="sivelv"  />
+      <field field_ref="icevel"         name="sivelo"  />
+      <field field_ref="idive"          name="sidive"  />
+      <field field_ref="ishear"         name="sishea"  />
+    </file>
+
+  </file_group> 
+
+  <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+    <file id="file3" name_suffix="_grid_T" >
+      <field field_ref="e3t"                        />      
+      <field field_ref="toce"       name="thetao"   operation="instant" freq_op="1mo" > @toce_e3t / @e3t </field>     
+      <field field_ref="soce"       name="so"       operation="instant" freq_op="1mo" > @soce_e3t / @e3t </field>    
+  
+      <field field_ref="sst"        name="tos"      />
+      <field field_ref="sss"        name="sos"      />
+      <field field_ref="ssh"        name="zos"      />
+
+      <field field_ref="mldkz5"     name="mldkz5"   />
+      <field field_ref="mldr10_1"   name="mldr10_1" />
+    </file>
+
+    <file id="file4" name_suffix="_SBC" >
+      <field field_ref="precip"    name="precip"  />
+      <field field_ref="snowpre"   name="snowpre" />
+      <field field_ref="empmr"     name="empmr"   />
+      <field field_ref="runoffs"   name="runoffs" />
+      <field field_ref="erp"       name="erp"     /> 
+      <field field_ref="fmmflx"    name="fmmflx"  /> 
+      <field field_ref="saltflx"   name="saltflx" /> 
+
+      <field field_ref="qt"        name="qt"      />
+      <field field_ref="qns"       name="qns"     />
+      <field field_ref="qsr"       name="qsr"     />
+
+      <field field_ref="taum"      name="taum"    />    
+
+      <field field_ref="fwfisf"    name="fwfisf"  />    
+      <field field_ref="qisf"      name="qisf"    />
+    </file>
+
+    <file id="file5" name_suffix="_grid_U" >
+      <field field_ref="ssu"    name="uos"   />
+      <field field_ref="utau"   name="tauuo" />
+      <field field_ref="uoce"   name="uo"    operation="instant" freq_op="1mo" > @uoce_e3u / @e3u </field>
+    </file>
+    
+    <file id="file6" name_suffix="_grid_V" >
+      <field field_ref="ssv"    name="vos"   />
+      <field field_ref="vtau"   name="tauvo" />
+      <field field_ref="voce"   name="vo"    operation="instant" freq_op="1mo" > @voce_e3v / @e3v </field>
+    </file>
+
+    <file id="file7" name_suffix="_icemod" >
+      <field field_ref="snowthic_cea"   name="snthic"  />
+      <field field_ref="icethic_cea"    name="sithic"  />
+      <field field_ref="icevolu"        name="sivolu"  />
+      <field field_ref="snowvol"        name="snvolu"  />
+      <field field_ref="iceconc"        name="siconc"  />
+
+      <field field_ref="utau_ice"       name="sitauu"  />
+      <field field_ref="vtau_ice"       name="sitauv"  />
+      <field field_ref="uice_ipa"       name="sivelu"  />
+      <field field_ref="vice_ipa"       name="sivelv"  />
+      <field field_ref="icevel"         name="sivelo"  />
+      <field field_ref="idive"          name="sidive"  />
+      <field field_ref="ishear"         name="sishea"  />
+      <field field_ref="icestr"         name="sistre"  />
+
+      <field field_ref="iceprod_cea"    name="siprod"  />
+      <field field_ref="afxtot"         name="afxtot"  />
+      <field field_ref="afxdyn"         name="afxdyn"  />
+      <field field_ref="afxthd"         name="afxthd"  />    
+      <field field_ref="miceage"        name="siages"  />
+
+      <field field_ref="micesalt"       name="sisali"  /> 
+      <field field_ref="ibrinv"         name="sibrin"  />
+      <field field_ref="micet"          name="sitemp"  />
+      <field field_ref="icest"          name="sistem"  />
+      <field field_ref="icehc"          name="siheco"  />
+      <field field_ref="isnowhc"        name="snheco"  />
+
+      <field field_ref="alb_ice"        name="alb_ice" />
+      <field field_ref="qt_oce"         name="qt_oce"  />
+      <field field_ref="qsr_oce"        name="qsr_oce" />
+      <field field_ref="qns_oce"        name="qns_oce" />
+      <field field_ref="qt_ice"         name="qt_ice"  />
+      <field field_ref="qsr_ice"        name="qsr_ice" />
+      <field field_ref="qns_ice"        name="qns_ice" />
+      <field field_ref="qtr_ice"        name="qtr_ice" />
+      <field field_ref="hfxtur"         name="hfxtur"  />
+
+      <field field_ref="vfxbog"         name="vfxbog"  />
+      <field field_ref="vfxdyn"         name="vfxdyn"  />
+      <field field_ref="vfxopw"         name="vfxopw"  />
+      <field field_ref="vfxsni"         name="vfxsni"  />
+      <field field_ref="vfxsum"         name="vfxsum"  />
+      <field field_ref="vfxbom"         name="vfxbom"  />
+      <field field_ref="vfxres"         name="vfxres"  />
+      <field field_ref="vfxice"         name="vfxice"  />
+      <field field_ref="vfxsnw"         name="vfxsnw"  />
+      <field field_ref="vfxsub"         name="vfxsub"  />
+      <field field_ref="vfxspr"         name="vfxspr"  />
+      <field field_ref="vfxthin"        name="vfxthin" />
+
+      <field field_ref="sfxbri"         name="sfxbri"  />
+      <field field_ref="sfxdyn"         name="sfxdyn"  />
+      <field field_ref="sfxres"         name="sfxres"  />
+      <field field_ref="sfxbog"         name="sfxbog"  />
+      <field field_ref="sfxbom"         name="sfxbom"  />
+      <field field_ref="sfxsum"         name="sfxsum"  />
+      <field field_ref="sfxsni"         name="sfxsni"  />
+      <field field_ref="sfxopw"         name="sfxopw"  />
+      <field field_ref="sfxsub"         name="sfxsub"  />
+      <field field_ref="sfx"            name="sfx"     />
+    </file>
+
+    <file id="file8" name_suffix="_icemoa" >
+      <field field_ref="iceconc_cat"    name="siconcat" />
+      <field field_ref="icethic_cat"    name="sithicat" />
+      <field field_ref="snowthic_cat"   name="snthicat" />
+    </file>
+
+  </file_group>
+
+  <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+  <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+  <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+  <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+
+  <file_group id="1y"  output_freq="1y"  output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+  <file_group id="2y"  output_freq="2y"  output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+  <file_group id="5y"  output_freq="5y"  output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+  <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+</file_definition>
+

+ 33 - 0
templates/zenobe_xios-1.0/xios_config/iodef.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- =========================================================================================================== -->
+<!-- iodef.xml : Configuration file for production of output files using XIOS                                    -->
+<!--             This file contains the context XIOS.                                                            -->
+<!--             The model components context will be add automatically by the comp.driver                       -->
+<!-- =========================================================================================================== -->
+
+<simulation>
+
+  <!-- =========================================================================================================== -->
+  <!-- XIOS context                                                                                                -->
+  <!-- =========================================================================================================== -->
+  <context id="xios">
+
+    <variable_definition>
+	
+     <!-- We must have buffer_size > jpi*jpj*jpk*8 (with jpi and jpj the subdomain size) -->
+	  <variable id="buffer_size"               type="integer">50000000</variable>
+	  <variable id="buffer_server_factor_size" type="integer">2</variable>
+	  <variable id="info_level"                type="integer">0</variable>
+	  <variable id="using_server"              type="boolean">true</variable>
+	  <variable id="using_oasis"               type="boolean">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >LMDZ,oceanx</variable>
+	
+      </variable_definition>
+               
+  </context>
+
+  <!-- =========================================================================================================== -->
+  <!-- COMPONENT CONTEXT : the model components context will be add automatically by the comp.driver               -->
+  <context id="nemo" src="./context.xml"/>
+  
+</simulation>

+ 32 - 0
templates/zenobe_xios-2.0/data.cfg

@@ -0,0 +1,32 @@
+ini_data_dir=/SCRATCH/acad/limhr/DATA
+ic_subdir=CONFIG_FILES
+nem_grid=ORCA1
+ic_files=(
+    "clipped_eORCA_R1_coordinates_v1.0.nc => coordinates.nc" 
+    "clipped_eORCA1_R1_bathy_meter_v2.1.nc => bathy_meter.nc" 
+    "clipped_eORCA_R1_ahmcoef_v1.0.nc => ahmcoef.nc" 
+    "clipped_eORCA_R1_maskITF_v1.0.nc => mask_itf.nc" 
+    "clipped_eORCA_R1_K1_v1.0.nc => K1rowdrg.nc" 
+    "clipped_eORCA_R1_M2_v1.0.nc => M2rowdrg.nc"
+    "clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc"
+    "conservative_temperature_WOA13_decav_Reg1L75_clim.nc"
+    "absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_2D.nc"
+    "weight_bilinear_360x180-clipped_eORCA1L75_3D.nc"
+)
+nem_res_hor=$(echo ${nem_grid} | sed 's:ORCA\([0-9]\+\)L[0-9]\+:\1:')
+#
+forcing_subdir=FORCINGS
+nem_forcing_set=DFS5.2
+forcing_files=(
+    "* => ."
+)
+#
+shared_files=(
+    "namelist_ice_lim3_ref => namelist_ice_ref"
+    "namelist_ref"
+    "ForXIOS2/domain_def_nemo.xml"
+    "ForXIOS2/field_def_nemo-opa.xml"
+    "ForXIOS2/field_def_nemo-lim.xml"
+)

+ 22 - 0
templates/zenobe_xios-2.0/experiment.cfg

@@ -0,0 +1,22 @@
+# Experience name
+exp_name=EXP_REF
+
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1958-01-01"
+run_duration="58 year"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 year"
+
+# Number of restart legs to be run in one go
+run_num_legs=29
+
+# Parameters
+nem_time_step_sec=3600
+lim_time_step_sec=21600
+nem_restart_offset=0
+nem_config_name=ORCA1_LIM3_REF
+
+# This file is used to store information about restarts
+info_file="nemo.info"

+ 30 - 0
templates/zenobe_xios-2.0/job.cfg

@@ -0,0 +1,30 @@
+# PBS job options
+PBS -N ${exp_name}
+PBS -q large
+PBS -r y
+PBS -W group_list=limhr
+PBS -l walltime=17:00:00
+PBS -l select=11:ncpus=24:mem=63000mb:mpiprocs=24:ompthreads=1
+
+#PBS -M ${email}
+#PBS -m abe
+
+exec > ${PBS_O_WORKDIR-$PWD}/${PBS_JOBNAME-"local"}_${PBS_JOBID-"id"}.log
+echo "------------------ Job Info --------------------"
+echo "jobid : $PBS_JOBID"
+echo "jobname : $PBS_JOBNAME"
+echo "job type : $PBS_ENVIRONMENT"
+echo "submit dir : $PBS_O_WORKDIR"
+echo "queue : $PBS_O_QUEUE"
+echo "user : $PBS_O_LOGNAME"
+echo "threads : $OMP_NUM_THREADS"
+
+start_dir=${PBS_O_WORKDIR-$PWD}
+run_dir="/SCRATCH/acad/limhr/$USER/nemo/run/${exp_name}"
+archive_dir="/SCRATCH/acad/limhr/$USER/nemo/archive/${exp_name}"
+
+# Cancel job on error
+set -ueo pipefail
+
+# RESET script arguments
+set -- $PBS_OPTIONS 

+ 407 - 0
templates/zenobe_xios-2.0/namelists/build_namelist_cfg.sh

@@ -0,0 +1,407 @@
+# This configuration namelist will overwrite SHARED/namelist_ref
+#
+if $leg_is_restart
+then
+    nemo_restart=".TRUE."
+else
+    nemo_restart=".FALSE."
+fi
+
+cat << EOF
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OPA  Configuration namelist : used to overwrite defaults values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!
+!-----------------------------------------------------------------------
+&namrun        !   parameters of the run
+!-----------------------------------------------------------------------
+   cn_exp        =  "${exp_name}" !  experience name
+   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
+   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
+   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
+                                  !    used if ln_rstart=F or
+                                  !    (ln_rstart=T and nn_rstctl=0 or 1)
+   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
+   nn_rstctl     =  1             !  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  = "restart_oce"  !  suffix of ocean restart name (input)
+   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
+   nn_stock      =  0             !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_write      = -1             !  frequency of write in the output file   (modulo referenced to nn_it000)
+/
+!-----------------------------------------------------------------------
+&namcfg        !   parameters of the configuration
+!-----------------------------------------------------------------------
+   cp_cfg      =  "orca"               !  name of the configuration
+   jp_cfg      =       1               !  resolution of the configuration
+   jpidta      =     362               !  1st lateral dimension ( >= jpi )
+   jpjdta      =     292               !  2nd    "         "    ( >= jpj )
+   jpkdta      =      75               !  number of levels      ( >= jpk )
+   jpiglo      =     362               !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     292               !  2nd    -                  -    --> j  =jpjdta
+   jperio      =       6               !  6 cyclic East-West AND North fold F-point pivot
+   ln_use_jattr = .true.               !  use (T) the file attribute: open_ocean_jstart if present
+/
+!-----------------------------------------------------------------------
+&namzgr        !   vertical coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdom        !   space and time domain (bathymetry, mesh, timestep)
+!-----------------------------------------------------------------------
+   nn_msh      =    0                  !  create (=1) a mesh file or not (=0)
+   rn_hmin     =    20.                !  min depth of the ocean (>0) or min number of ocean level (<0)
+   rn_rdt      = ${nem_time_step_sec} !  time step for the dynamics (and tracer if nn_acc=0)
+   ppglam0     =  999999.0             !  longitude of first raw and column T-point (jphgr_msh = 1)
+   ppgphi0     =  999999.0             !  latitude  of first raw and column T-point (jphgr_msh = 1)
+   ppe1_deg    =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_deg    =  999999.0             !  meridional grid-spacing (degrees)
+   ppe1_m      =  999999.0             !  zonal      grid-spacing (degrees)
+   ppe2_m      =  999999.0             !  meridional grid-spacing (degrees)
+   ppsur       =  -3958.951371276829   !  ORCA r4, r2 and r05 coefficients
+   ppa0        =    103.95300960000000 ! (default coefficients)
+   ppa1        =      2.41595126900000 !
+   ppkth       =     15.35101370000000 !
+   ppacr       =      7.0              !
+   ppdzmin     =  999999.              !  Minimum vertical spacing
+   pphmax      =  999999.              !  Maximum depth
+   ppa2        =  100.7609285000000    !  Double tanh function parameters
+   ppkth2      =  48.02989372000000    !
+   ppacr2      =  13.00000000000       !
+/
+!-----------------------------------------------------------------------
+&namsplit      !   time splitting parameters  ("key_dynspg_ts")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d        !   1D configuration options                             ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtsd    !   data : Temperature  & Salinity
+!-----------------------------------------------------------------------
+!          !  file name                                            ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!          !                                                       !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_tem  = 'conservative_temperature_WOA13_decav_Reg1L75_clim.nc',         -1        ,'votemper' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   sn_sal  = 'absolute_salinity_WOA13_decav_Reg1L75_clim.nc'       ,         -1        ,'vosaline' ,    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_3D.nc',   ''     ,    ''
+   !
+   ln_tsd_tradmp = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namsbc        !   Surface Boundary Condition (surface module)
+!-----------------------------------------------------------------------
+   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of surface boundary condition computation
+                           !     (also = the frequency of sea-ice model call)
+   nn_isf      = 3         !  ice shelf melting/freezing                (/=0 => fill namsbc_isf)
+                           !  0 =no isf                  1 = presence of ISF
+                           !  2 = bg03 parametrisation   3 = rnf file for isf
+                           !  4 = ISF fwf specified
+                           !  option 1 and 4 need ln_isfcav = .true. (domzgr)
+   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
+                           !     =1 global mean of e-p-r set to zero at each time step
+                           !     =2 annual global mean of e-p-r set to zero
+/
+!-----------------------------------------------------------------------
+&namsbc_ana    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_flx    !   surface boundary condition : flux formulation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_utau     = 'uwnd_10m'  ,       24          , 'uwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_vtau     = 'vwnd_10m'  ,       24          , 'vwnd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_wndm     = 'ncep_bulk' ,       24          , 'wspd'    ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_tair     = 'ncep_bulk' ,       24          , 'air'     ,   .true.     , .false., 'yearly'  , ''       , ''
+   sn_humi     = 'flx_correc',       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_ccov     = 'flx_correc',       -1          , 'socliocl',   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_prec     = 'flx_correc',       -1          , 'socliopl',   .true.     , .true. , 'yearly'  , ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_core   !   namsbc_core  CORE bulk formulae
+!-----------------------------------------------------------------------
+!              !  file name              ! frequency (hours) ! variable ! time interp. !  clim   ! 'yearly'/ ! weights                                     ! rotation ! land/sea mask !
+!              !                         !  (if <0  months)  !   name   !   (logical)  !  (T/F)  ! 'monthly' ! filename                                    ! pairing  ! filename      !
+
+   sn_wndi     = 'drowned_u10_DFS5.2'    ,         3         , 'u10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'U1'     , ''
+   sn_wndj     = 'drowned_v10_DFS5.2'    ,         3         , 'v10'    ,   .true.     , .false. , 'yearly'  , 'weights_bicub_DFS5.2_to_clipped_eORCA1.nc' , 'V1'     , ''
+   sn_qsr      = 'drowned_radsw_DFS5.2'  ,        24         , 'radsw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_qlw      = 'drowned_radlw_DFS5.2'  ,        24         , 'radlw'  ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_tair     = 'drowned_t2_DFS5.2'     ,         3         , 't2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_humi     = 'drowned_q2_DFS5.2'     ,         3         , 'q2'     ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_prec     = 'drowned_precip_DFS5.2' ,        24         , 'precip' ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+   sn_snow     = 'drowned_snow_DFS5.2'   ,        24         , 'snow'   ,   .true.     , .false. , 'yearly'  , 'weights_bilin_DFS5.2_to_clipped_eORCA1.nc' , ''       , ''
+
+   rn_zqt      = 2.        !  Air temperature and humidity reference height (m)
+/
+!-----------------------------------------------------------------------
+&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_coupled")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_sas    !   analytical surface boundary condition
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_qsr    !   penetrative solar radiation
+!-----------------------------------------------------------------------
+   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf    !   runoffs namelist surface boundary condition
+!-----------------------------------------------------------------------
+!              !  file name                                              ! frequency (hours) ! variable   ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
+!              !                                                         !  (if <0  months)  !   name     !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  ! filename      !
+   sn_rnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',        -1         , 'sorunoff' , .true.       , .true. , 'yearly'  , ''       , ''       , ''
+   sn_cnf      = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc',         0         , 'socoefr'  , .false.      , .true. , 'yearly'  , ''       , ''       , ''
+
+   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
+   ln_rnf_depth_ini = .true.   ! compute depth at initialisation from runoff file
+   rn_rnf_max   = 0.05      !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+/
+!-----------------------------------------------------------------------
+&namsbc_isf    !  Top boundary layer (ISF)
+!-----------------------------------------------------------------------
+!                ! file name                                                ! frequency (hours) ! variable     ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
+!                !                                                          !  (if <0  months)  !   name       !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
+   sn_rnfisf     = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sornfisf'    ,    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmax_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmax_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+   sn_depmin_isf = 'clipped_runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ,       -12         ,'sodepmin_isf',    .false.     , .true.  , 'yearly'  ,  ''      ,   ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr    !   surface boundary condition : sea surface restoring
+!-----------------------------------------------------------------------
+!              !  file name                                          ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights                                         ! rotation ! land/sea mask !
+!              !                                                     !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename                                        ! pairing  ! filename      !
+   sn_sss      = 'sss_absolute_salinity_WOA13_decav_Reg1L75_clim.nc' ,        -1         , 'sosaline',    .true.    , .true. , 'yearly'  ,'weight_bilinear_360x180-clipped_eORCA1L75_2D.nc', ''       , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_alb    !   albedo parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namlbc        !   lateral momentum boundary condition
+!-----------------------------------------------------------------------
+   rn_shlat    =    0.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
+                           !  free slip  !   partial slip  !   no slip   ! strong slip
+/
+!-----------------------------------------------------------------------
+&namcla        !   cross land advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namagrif      !  AGRIF zoom                                            ("key_agrif")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_tide      !   tide parameters (#ifdef key_tide)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy        !  unstructured open boundaries                          ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_dta      !  open boundaries - external data           ("key_bdy")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambdy_tide     ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nambfr        !   bottom friction
+!-----------------------------------------------------------------------
+   nn_bfr      =    2      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
+
+   rn_bfeb2    =    0      !  bottom turbulent kinetic energy background  (m2/s2)
+/
+!-----------------------------------------------------------------------
+&nambbc        !   bottom temperature boundary condition
+!-----------------------------------------------------------------------
+   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
+                           !     = 1 constant flux
+                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
+/
+!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nameos        !   ocean physical parameters
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv    !   advection scheme for tracer
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
+!-----------------------------------------------------------------------
+/
+!----------------------------------------------------------------------------------
+&namtra_ldf    !   lateral diffusion scheme for tracers
+!----------------------------------------------------------------------------------
+   rn_aht_0         =  1000.     !  horizontal eddy diffusivity for tracers [m2/s]
+   rn_aeiv_0        =  1000.     !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
+/
+!-----------------------------------------------------------------------
+&namtra_dmp    !   tracer: T & S newtonian damping
+!-----------------------------------------------------------------------
+   ln_tradmp   =  .false.  !  add a damping termn (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv    !   formulation of the momentum advection
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_vvl    !   vertical coordinate options
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg    !   Hydrostatic pressure gradient option
+!-----------------------------------------------------------------------
+   ln_hpg_zps  = .false.   !  z-coordinate - partial steps (interpolation)
+   ln_hpg_sco  = .true.    !  s-coordinate (standard jacobian formulation)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf    !   lateral diffusion on momentum
+!-----------------------------------------------------------------------
+   rn_ahm_0_lap     = 20000.    !  horizontal laplacian eddy viscosity   [m2/s]
+/
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!-----------------------------------------------------------------------
+/
+!------------------------------------------------------------------------
+&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
+!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx_new    !   new tidal mixing parameterization                ("key_zdftmx_new")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsol        !   elliptic solver / island / free surface
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
+!-----------------------------------------------------------------------
+   jpni        =   20      !  jpni   number of processors following i (set automatically if < 1)
+   jpnj        =   13      !  jpnj   number of processors following j (set automatically if < 1)
+   jpnij       =   260     !  jpnij  number of local domains (set automatically if < 1)
+/
+!-----------------------------------------------------------------------
+&namctl        !   Control prints & Benchmark
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd    !   data: U & V currents                                 ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsto       ! Stochastic parametrization of EOS
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namflo       !   float parameters                                      ("key_float")
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namptr       !   Poleward Transport Diagnostic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namhsb       !  Heat and salt budgets
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_diaharm   !   Harmonic analysis of tidal constituents ('key_diaharm')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdct        ! transports through sections
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namobs       !  observation usage switch                               ('key_diaobs')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nam_asminc   !   assimilation increments                               ('key_asminc')
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namsbc_wave   ! External fields from wave model
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_nept  !   Neptune effect (simplified: lateral and vertical diffusions removed)
+!-----------------------------------------------------------------------
+/
+EOF

+ 36 - 0
templates/zenobe_xios-2.0/namelists/namelist_ice_cfg

@@ -0,0 +1,36 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/LIM3 : ice configuration namelist, will overwrite SHARED/namelist_ice_lim3_ref
+!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!-----------------------------------------------------------------------
+&namicerun     !   Share parameters for dynamics/advection/thermo
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceini     !   ice initialisation
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitd     !   Ice discretization
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicedyn     !   ice dynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicehdf     !   Ice horizontal diffusion
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicethd     !   ice thermodynamic
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namicesal     !   ice salinity
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namiceitdme   !   parameters for mechanical redistribution of ice 
+!-----------------------------------------------------------------------
+/

+ 19 - 0
templates/zenobe_xios-2.0/programs.cfg

@@ -0,0 +1,19 @@
+module_list="compiler/intel/composerxe/2015.5.223 intelmpi/5.0.3.049/64"
+extralibs_list="/projects/acad/limhr/opt/netcdf/4.4.0_intel_2015.5_impi_5.0.3/lib"
+
+# -----------------------------------------------------------------------------
+# *** NEMO/LIM configuration
+# -----------------------------------------------------------------------------
+
+nemo_src_dir=${HOME}/modeles/nemo/3.6
+shared_dir=${nemo_src_dir}/CONFIG/SHARED
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+nem_numproc=260
+
+# -----------------------------------------------------------------------------
+# *** XIOS configuration
+# -----------------------------------------------------------------------------
+
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-2.0/bin/xios_server.exe
+xio_numproc=4
+

+ 125 - 0
templates/zenobe_xios-2.0/xios_config/context.xml

@@ -0,0 +1,125 @@
+<!--
+ ============================================================================================== 
+    NEMO context
+============================================================================================== 
+-->
+<context id="nemo">
+<!-- $id$ -->
+<!-- Fields definition -->
+    <field_definition src="./field_def_nemo-opa.xml"/>   <!--  NEMO ocean dynamics                     -->
+    <field_definition src="./field_def_nemo-lim.xml"/>   <!--  NEMO ocean sea ice                      -->
+    <!-- <field_definition src="./field_def_nemo-pisces.xml"/> -->  <!--  NEMO ocean biogeochemistry with PISCES  -->
+
+
+<!-- Files definition -->
+    <file_definition src="./file_def_nemo-opa.xml"/>     <!--  NEMO ocean dynamics                     -->
+    <file_definition src="./file_def_nemo-lim.xml"/>     <!--  NEMO ocean sea ice                      -->
+    <!-- <file_definition src="./file_def_nemo-pisces.xml"/> -->    <!--  NEMO ocean biogeochemistry with PISCES  -->
+    <!-- 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+    <axis_definition>
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
+      <axis id="nfloat" long_name="Float number"      unit="-"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"               />
+      <axis id="ncatice" long_name="Ice category"       unit="1"               />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"            />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"            />
+    </axis_definition>
+ 
+    <domain_definition src="./domain_def_nemo.xml"/>
+  
+    <grid_definition>    
+
+        <!--  -->
+       <grid id="grid_T_2D" >
+         <domain id="grid_T" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D_ncatice" >
+         <domain id="grid_T" />
+         <axis id="ncatice" />
+       </grid>
+        <!--  -->
+       <grid id="grid_T_3D" >
+         <domain id="grid_T" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_2D" >
+         <domain id="grid_U" />
+       </grid>
+        <!--  -->
+       <grid id="grid_U_3D" >
+         <domain id="grid_U" />
+         <axis id="depthu" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_2D" >
+         <domain id="grid_V" />
+       </grid>
+        <!--  -->
+       <grid id="grid_V_3D" >
+         <domain id="grid_V" />
+         <axis id="depthv" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_2D" >
+         <domain id="grid_W" />
+       </grid>
+        <!--  -->
+       <grid id="grid_W_3D" >
+         <domain id="grid_W" />
+         <axis id="depthw" />
+       </grid>
+        <!--  -->
+       <grid id="grid_1point" >
+         <domain domain_ref="1point"/>
+       </grid>
+        <!--  -->
+       <grid id="grid_T_nfloat" >
+         <domain id="grid_T" />
+         <axis id="nfloat" />
+       </grid>
+        <!--  -->
+       <grid id="grid_EqT" >
+         <domain domain_ref="EqT" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_2D">
+         <domain id="gznl" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_T_3D">
+         <domain id="gznl" />
+         <axis id="deptht" />
+       </grid>
+        <!--  -->
+       <grid id="grid_znl_W_3D">
+         <domain id="gznl" />
+         <axis id="depthw" />
+       </grid>
+
+      <grid id="grid_ptr_T_2D">
+       <domain id="ptr" />
+      </grid>
+
+      <grid id="grid_ptr_T_3D">
+       <domain id="ptr" />
+         <axis id="deptht" />
+       </grid>
+
+      <grid id="grid_ptr_W_3D">
+       <domain id="ptr" />
+         <axis id="depthw" />
+      </grid>
+
+    </grid_definition>   
+
+</context>

+ 180 - 0
templates/zenobe_xios-2.0/xios_config/file_def_nemo-lim.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0"?>
+<!-- $id$ -->
+
+ <!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files for lim3                                =
+=                                         put the variables you want...                                    =
+============================================================================================================
+  -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file10" name_suffix="_icemod" description="ice variables" enabled=".TRUE." >
+        <field field_ref="isst"             name="sst" />
+        <field field_ref="isss"             name="sss" />
+
+        <field field_ref="snowthic_cea"     name="snthic"     long_name="surface_snow_thickness"   />
+        <field field_ref="snowvol"          name="snvolu" />
+        <field field_ref="isnowhc"          name="snheco" />
+
+        <field field_ref="icethic_cea"      name="sithic"     long_name="sea_ice_thickness"        />
+        <field field_ref="icevolu"          name="sivolu" />
+        <field field_ref="iceconc"          name="siconc"  />
+        <field field_ref="micesalt"         name="sisali" />
+        <field field_ref="micet"            name="sitemp" />
+        <field field_ref="icest"            name="sistem" />
+        <field field_ref="icehc"            name="siheco" />
+        <field field_ref="uice_ipa"         name="sivelu" />
+        <field field_ref="vice_ipa"         name="sivelv" />
+        <field field_ref="icevel"           name="sivelo" />
+        <field field_ref="idive"            name="sidive" />
+        <field field_ref="ishear"           name="sishea" />
+        <field field_ref="icestr"           name="sistre" />
+
+        <!--
+    <field field_ref="tau_icebfr"       name="sibfri"    long_name="sea_ice_friction_at_ocean_bottom" />
+
+    <field field_ref="miceage"          name="siages" />
+    <field field_ref="ibrinv"           name="sibrin" />
+    <field field_ref="icecolf"          name="sicolf" />
+
+    <field field_ref="vfxice"           name="vfxice" />
+    <field field_ref="vfxsnw"           name="vfxsnw" />
+    <field field_ref="vfxsub"           name="vfxsub" />
+    <field field_ref="vfxsub_err"       name="vfxsub_err" />
+    <field field_ref="vfxspr"           name="vfxspr" />
+    <field field_ref="vfxbog"           name="vfxbog" />
+    <field field_ref="vfxdyn"           name="vfxdyn" />
+    <field field_ref="vfxopw"           name="vfxopw" />
+    <field field_ref="vfxsni"           name="vfxsni" />
+    <field field_ref="vfxsum"           name="vfxsum" />
+    <field field_ref="vfxbom"           name="vfxbom" />
+    <field field_ref="vfxres"           name="vfxres" />
+    <field field_ref="vfxthin"          name="vfxthin" />           
+    <field field_ref="vfxlam"           name="vfxlam" />
+
+    <field field_ref="sfx"              name="sfx" />
+    <field field_ref="sfxbri"           name="sfxbri" />
+    <field field_ref="sfxdyn"           name="sfxdyn" />
+    <field field_ref="sfxres"           name="sfxres" />
+    <field field_ref="sfxbog"           name="sfxbog" />
+    <field field_ref="sfxbom"           name="sfxbom" />
+    <field field_ref="sfxsum"           name="sfxsum" />
+    <field field_ref="sfxsni"           name="sfxsni" />
+    <field field_ref="sfxopw"           name="sfxopw" />
+    <field field_ref="sfxsub"           name="sfxsub" />
+    <field field_ref="sfxlam"           name="sfxlam" />
+
+    <field field_ref="hfxsum"          name="hfxsum"    />
+    <field field_ref="hfxbom"          name="hfxbom"    />
+    <field field_ref="hfxbog"          name="hfxbog"    />
+    <field field_ref="hfxdif"          name="hfxdif"    />
+    <field field_ref="hfxopw"          name="hfxopw"    />
+    <field field_ref="hfxout"          name="hfxout"    />
+    <field field_ref="hfxin"           name="hfxin"    />
+    <field field_ref="hfxsnw"          name="hfxsnw"    />
+    <field field_ref="hfxerr"          name="hfxerr"    />
+    -->
+
+    <!-- ice-ocean heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxdyn"          name="hfxdyn"    />
+    <field field_ref="hfxres"          name="hfxres"    />
+    <field field_ref="hfxthd"          name="hfxthd"    />
+    -->
+    <!-- ice-atm. heat flux from mass exchange -->
+    <!--
+    <field field_ref="hfxsub"          name="hfxsub"    />
+    <field field_ref="hfxspr"          name="hfxspr"    />
+    -->
+    <!-- diags -->
+    <!--
+    <field field_ref="hfxdhc"          name="hfxdhc"    />
+    <field field_ref="hfxtur"          name="hfxtur"    />
+    <field field_ref="afxthd"          name="afxthd"    />
+    <field field_ref="afxdyn"          name="afxdyn"    />
+    -->
+    <!-- transported fields -->
+    <!--
+    <field field_ref="icetrp"          name="sivtrp" />
+    <field field_ref="snwtrp"          name="snvtrp" />
+    <field field_ref="saltrp"          name="saltrp" />
+    <field field_ref="deitrp"          name="deitrp" />
+    <field field_ref="destrp"          name="destrp" />
+          -->
+    <!-- categories -->
+    <field field_ref="snowthic_cat"     name="snthicat"/>
+    <field field_ref="iceconc_cat"      name="siconcat"/>
+    <field field_ref="icethic_cat"      name="sithicat"/>
+    <field field_ref="salinity_cat"     name="salincat"/>
+    <field field_ref="iceage_cat"       name="siagecat"/>
+    <field field_ref="brinevol_cat"     name="sibricat"/>
+    <field field_ref="icetemp_cat"      name="sitemcat"/>
+    <field field_ref="snwtemp_cat"      name="sntemcat"/>
+
+  </file>
+
+  <file id="file11" name_suffix="_SBC_scalar" description="scalar variables" >
+    <!-- global contents -->
+    <field field_ref="ibgvol_tot"       name="ibgvol_tot"   />
+    <field field_ref="sbgvol_tot"       name="sbgvol_tot"   />
+    <field field_ref="ibgarea_tot"      name="ibgarea_tot"  />
+    <field field_ref="ibgsalt_tot"      name="ibgsalt_tot"  />
+    <field field_ref="ibgheat_tot"      name="ibgheat_tot"  />
+    <field field_ref="sbgheat_tot"      name="sbgheat_tot"  />
+
+    <!-- global drifts (conservation checks) -->
+    <field field_ref="ibgvolume"        name="ibgvolume"    />
+    <field field_ref="ibgsaltco"        name="ibgsaltco"    />
+    <field field_ref="ibgheatco"        name="ibgheatco"    />
+    <field field_ref="ibgheatfx"        name="ibgheatfx"    />
+
+    <!-- global forcings  -->
+    <field field_ref="ibgfrcvoltop"     name="ibgfrcvoltop" />
+    <field field_ref="ibgfrcvolbot"     name="ibgfrcvolbot" />
+    <field field_ref="ibgfrctemtop"     name="ibgfrctemtop" />
+    <field field_ref="ibgfrctembot"     name="ibgfrctembot" />
+    <field field_ref="ibgfrcsal"        name="ibgfrcsal"    />
+    <field field_ref="ibgfrchfxtop"     name="ibgfrchfxtop" />
+    <field field_ref="ibgfrchfxbot"     name="ibgfrchfxbot" />
+  </file>
+
+</file_group>
+
+<file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+<file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+<file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+<file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+<file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+<file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->       
+
+<file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   	
+  <file id="file12" name_suffix="_icemod" >
+    <field field_ref="snowthic_cea"   name="snthic"  />
+    <field field_ref="icethic_cea"    name="sithic"  />
+    <field field_ref="iceconc"        name="siconc"  />
+
+    <field field_ref="uice_ipa"       name="sivelu"  />
+    <field field_ref="vice_ipa"       name="sivelv"  />
+    <field field_ref="icevel"         name="sivelo"  />
+    <field field_ref="idive"          name="sidive"  />
+    <field field_ref="ishear"         name="sishea"  />
+  </file>
+
+</file_group>
+
+<file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   	
+<file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+<file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+<file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+<file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+<file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+<file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+<file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+<file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>

+ 153 - 0
templates/zenobe_xios-2.0/xios_config/file_def_nemo-opa.xml

@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+
+<!--
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own filesfor ocean dynamics context                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+
+  <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
+
+
+    <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
+
+      <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="e3t"      name="e3t"         long_name="vertical scale factor"                     />
+        <field field_ref="eken"     name="eke"         long_name="kinetic energy"                            />
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="ssh"      name="zos"         long_name="sea_surface_height_above_geoid"            />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+        <field field_ref="sbt"      name="tob"                                                               />
+        <field field_ref="sbs"      name="sob"                                                               />
+        <field field_ref="heatc"    name="heatc"       long_name="Heat content vertically integrated"        />
+        <field field_ref="saltc"    name="saltc"       long_name="Salt content vertically integrated"        />
+
+        <field field_ref="toce"     name="to"          long_name="sea_water_potential_temperature"                    operation="instant" freq_op="1d" > @toce_e3t / @e3t </field>
+        <field field_ref="soce"     name="so"          long_name="sea_water_salinity"                                 operation="instant" freq_op="1d" > @soce_e3t / @e3t </field>
+        <field field_ref="sst"      name="tosstd"      long_name="sea_surface_temperature_standard_deviation"         operation="instant" freq_op="1d" > sqrt( @sst2 - @sst * @sst ) </field>
+        <field field_ref="ssh"      name="zosstd"      long_name="sea_surface_height_above_geoid_standard_deviation"  operation="instant" freq_op="1d" > sqrt( @ssh2 - @ssh * @ssh ) </field>
+        <field field_ref="sst"      name="tosdcy"      long_name="amplitude of sst diurnal cycle"                     operation="average" freq_op="1d" > @sstmax - @sstmin </field>
+        <field field_ref="mldr10_1" name="mldr10_1dcy" long_name="amplitude of mldr10_1 diurnal cycle"                operation="average" freq_op="1d" > @mldr10_1max - @mldr10_1min </field>
+      </file>
+
+      <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
+        <field field_ref="e3u"          name="e3u"      long_name="vertical scale factor"       />
+        <field field_ref="ubar"         name="ubar"     long_name="ocean_barotropic_x_velocity" />
+        <field field_ref="ssu"          name="uos"      long_name="sea_surface_x_velocity"      />
+        <field field_ref="sbu"          name="uob"      long_name="sea_bottom_x_velocity"       />
+        <field field_ref="utau"         name="tauu"     long_name="surface_downward_x_stress"   />
+        <field field_ref="uocetr_eff"   name="uotr_eff" long_name="effective ocean transport along i-axis"      />
+        <field field_ref="uoce"         name="uo"       long_name="sea_water_x_velocity" operation="instant" freq_op="1d" > @uoce_e3u / @e3u </field>
+      </file>
+
+      <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
+        <field field_ref="e3v"          name="e3v"      long_name="vertical scale factor"      />
+        <field field_ref="vbar"         name="vbar"     long_name="ocean_barotropic_y_velocity" />
+        <field field_ref="ssv"          name="vos"      long_name="sea_surface_y_velocity"     />
+        <field field_ref="sbv"          name="vob"      long_name="sea_bottom_y_velocity"      />
+        <field field_ref="vtau"         name="tauv"     long_name="surface_downward_y_stress"  />
+        <field field_ref="vocetr_eff"   name="votr_eff" long_name="effective ocean transport along j-axis"      />
+        <field field_ref="voce"         name="vo"       long_name="sea_water_y_velocity" operation="instant" freq_op="1d" > @voce_e3v / @e3v </field>
+      </file>
+
+      <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
+        <field field_ref="e3w"          name="e3w"     long_name="vertical scale factor"           />
+        <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         />
+        <field field_ref="avt"          name="avt"     long_name="ocean_vertical_heat_diffusivity" />
+        <field field_ref="avs"          name="avs"     long_name="ocean_vertical_salt_diffusivity" />
+        <field field_ref="avm"          name="avm"     long_name="ocean_vertical_momentum_diffusivity" />
+      </file>
+
+      <file id="file5" name_suffix="_SBC" description="surface fluxes variables" > 
+        <field field_ref="erp"          name="erp"      long_name="Surface Water Flux: Damping"                 />
+        <field field_ref="qrp"          name="qrp"      long_name="Surface Heat Flux: Damping"                 />
+        <field field_ref="empmr"        name="empmr"    long_name="water_flux_into_sea_water"                 />
+        <field field_ref="qsr_oce"      name="qsr_oce"  long_name="downward shortwave flux at ocean surface"  />
+        <field field_ref="qns_oce"      name="qns_oce"  long_name="downward non solar flux at ocean surface"  />
+        <field field_ref="qt_oce"       name="qt_oce"   long_name="downward total flux at ocean surface"      />
+        <field field_ref="qemp_oce"     name="qemp_oce" long_name="downward heat flux from E-P over ocean"    />
+        <field field_ref="qsr_ice"      name="qsr_ice"  long_name="downward shortwave flux at ice surface"    />
+        <field field_ref="qns_ice"      name="qns_ice"  long_name="downward non solar flux at ice surface"    />
+        <field field_ref="qtr_ice"      name="qtr_ice"  long_name="shortwave flux transmitted thru the ice"   />
+        <field field_ref="qt_ice"       name="qt_ice"   long_name="downward total flux at ice surface"        />
+        <field field_ref="qemp_ice"     name="qemp_ice" long_name="downward heat flux from E-P over ice"      />
+        <field field_ref="emp_oce"      name="emp_oce"  long_name="Evap minus Precip over ocean"              />
+        <field field_ref="emp_ice"      name="emp_ice"  long_name="Evap minus Precip over ice"                />
+        <field field_ref="taum"         name="taum"                                                           />
+        <field field_ref="taum_oce"     name="taum_oce"                                                       />
+        <field field_ref="wspd"         name="windsp"                                                         />
+        <field field_ref="precip"       name="precip"                                                         />
+        <field field_ref="snowpre"      name="sprecip"                                                        />
+        <field field_ref="utau_ice"     name="tauu_ice"                                                       />
+        <field field_ref="vtau_ice"     name="tauv_ice"                                                       />
+        <field field_ref="alb_ice"      name="alb_ice"                                                        />
+        <field field_ref="albedo"       name="albedo"                                                         />
+      </file>
+
+      <file id="file6" name_suffix="_scalar" description="scalar variables" >
+        <!-- global contents -->
+        <field field_ref="voltot"       name="scvoltot"  />
+        <field field_ref="sshtot"       name="scsshtot"  />
+        <field field_ref="sshsteric"    name="scsshste"  />
+        <field field_ref="sshthster"    name="scsshtst"  />
+        <field field_ref="masstot"      name="scmastot"  />
+        <field field_ref="temptot"      name="sctemtot"  />
+        <field field_ref="saltot"       name="scsaltot"  />
+
+        <!-- global drifts (conservation checks) -->
+        <field field_ref="bgtemper"     name="bgtemper"    />
+        <field field_ref="bgsaline"     name="bgsaline"    />
+        <field field_ref="bgheatco"     name="bgheatco"    />
+        <field field_ref="bgheatfx"     name="bgheatfx"    />
+        <field field_ref="bgsaltco"     name="bgsaltco"    />
+        <field field_ref="bgvolssh"     name="bgvolssh"    />
+        <field field_ref="bgvole3t"     name="bgvole3t"    />
+
+        <!-- global surface forcings  -->
+        <field field_ref="bgfrcvol"     name="bgfrcvol"    />
+        <field field_ref="bgfrctem"     name="bgfrctem"    />
+        <field field_ref="bgfrchfx"     name="bgfrchfx"    />
+        <field field_ref="bgfrcsal"     name="bgfrcsal"    />
+      </file>
+
+    </file_group> 
+
+
+    <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+    <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
+    <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
+    <file_group id="3h" output_freq="3h"  output_level="10" enabled=".TRUE."/> <!-- 3h files -->     
+    <file_group id="4h" output_freq="4h"  output_level="10" enabled=".TRUE."/> <!-- 4h files -->
+    <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files -->    
+
+    <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE.">  <!-- 1d files -->   
+
+      <file id="file7" name_suffix="_grid_T" description="ocean T grid variables" >
+        <field field_ref="sst"      name="tos"         long_name="sea_surface_temperature"                   />
+        <field field_ref="sss"      name="sos"         long_name="sea_surface_salinity"                      />
+        <field field_ref="mldkz5"   name="mldkz5"                                                            />
+        <field field_ref="mldr10_1" name="mldr10_1"                                                          />
+      </file>
+
+    </file_group>
+
+
+    <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->   
+    <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+    <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+    <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+    <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+    <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+    <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+    <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+    <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+  </file_definition>
+
+
+
+

+ 30 - 0
templates/zenobe_xios-2.0/xios_config/iodef.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<simulation> 
+
+<!-- ============================================================================================ -->
+<!-- XIOS context                                                                                 -->
+<!-- ============================================================================================ -->
+
+  <context id="xios" >
+
+      <variable_definition>
+
+          <!--
+          <variable id="optimal_buffer_size"       type="string">memory</variable>
+          <variable id="buffer_size_factor"        type="double">1.0</variable>
+          -->
+	  <variable id="info_level"                type="int">10</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+  </context>
+
+<!-- ============================================================================================ -->
+<!-- NEMO  CONTEXT add and suppress the components you need                                       -->
+<!-- ============================================================================================ -->
+
+  <context id="nemo" src="./context.xml"/>       <!--  NEMO       -->
+
+</simulation>

+ 15 - 0
utils/tools.inc

@@ -0,0 +1,15 @@
+
+warn () {
+    echo "$(basename $0):" "$@" >&2
+}
+
+die () {
+    rc=$1
+    shift
+    warn "$@"
+    exit "$rc"
+}
+
+doc () {
+  [[ $1 == -h ]] && { cat ; exit ; }
+}

+ 8 - 0
zone/iterdate.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+cur="$1"
+end="$2"
+while [ $cur != $end ] 
+do
+  echo php update_cron.php $cur 
+  cur=$(date -d "$cur + 1 day"  +%Y-%m-%d)
+done

+ 159 - 0
zone/run.dates.sh

@@ -0,0 +1,159 @@
+#!/bin/bash 
+
+# Function leap days calculates the number of leap days (29th of Februrary) in
+# a time intervall between two dates.
+#
+# Usage leap_days START_DATE END_DATE
+function leap_days()
+{
+    local ld=0
+    local frstYYYY=$(date -ud "$1" +%Y)
+    local lastYYYY=$(date -ud "$2" +%Y)
+
+    set +e
+
+    # Check first year for leap day between start and end date
+    $(date -ud "${frstYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    # Check intermediate years for leap day
+    for (( y=(( ${frstYYYY}+1 )); y<=(( ${lastYYYY}-1 )); y++ ))
+    do
+        $(date -ud "$y-02-29" > /dev/null 2>&1) && (( ld++ ))
+    done
+
+    # Check last year (if different from first year) for leap day between start
+    # and end date
+    (( $lastYYYY > $frstYYYY )) \
+    && $(date -ud "${lastYYYY}-02-29" > /dev/null 2>&1) \
+    && (( $(date -ud "$1" +%s) < $(date -ud "${frstYYYY}-03-01" +%s) )) \
+    && (( $(date -ud "$2" +%s) > $(date -ud "${lastYYYY}-02-28" +%s) )) \
+    && (( ld++ ))
+
+    set -e
+
+    echo "$ld"
+}
+
+set -ueo pipefail
+
+
+nemo_src_dir=${HOME}/modeles/NEMO/3.6
+ini_data_dir=/scratch/pbarriat/DATA/nemo
+nem_grid=ORCA2L31
+# Simulation start and end date. Use any (reasonable) syntax you want.
+run_start_date="1990-01-01"
+run_duration="4 years"
+
+# Restart frequency. Use any (reasonable) number and time unit you want.
+# For runs without restart, leave this variable empty or set to 0
+rst_freq="1 year"
+
+# Number of restart legs to be run in one go
+run_num_legs=2
+
+# Directories
+#start_dir=${SLURM_SUBMIT_DIR}
+start_dir=${PWD}
+ctrl_file_dir=${start_dir}/ctrl
+
+# This file is used to store information about restarts
+run_dir="./rundir"
+ece_info_file="ece.info"
+
+nemo_src_dir=$HOME/modeles/NEMO/3.6
+nem_config_name="ORCA2_LIM3"
+nem_exe_file=${nemo_src_dir}/CONFIG/${nem_config_name}/BLD/bin/nemo.exe
+xio_exe_file=${nemo_src_dir}/EXTERNAL/xios-1.0/bin/xios_server.exe
+
+# Make sure run directory exists with the necessary stuff and move there
+mkdir -p $run_dir && cd $_
+cp ${nem_exe_file} .
+cp ${xio_exe_file} .
+# Configure paths for NEMO IC /!\ filenames cannot contain white spaces
+ic_files=("coordinates.nc" 
+          "bathy_meter.nc" 
+          "runoff_core_monthly.nc runoffs_depth"
+          "ahmcoef.nc" 
+          "mask_itf.nc" 
+          "K1rowdrg.nc" 
+          "M2rowdrg.nc" 
+          "data_1m_potential_temperature_nomask.nc temperature.nc"
+          "data_1m_salinity_nomask.nc salinity" 
+          "subbasins.nc" 
+          "resto.nc" 
+          "chlorophyll.nc" 
+          "geothermal_heating.nc")
+for file in "${ic_files[@]}"
+do 
+ln -sf ${ini_data_dir}/INIT/${nem_grid}/$file
+done
+
+
+# Normalize date formats
+run_start_date=$(date -uR -d "${run_start_date}")
+run_end_date="${run_start_date} + ${run_duration}"
+run_end_date=$(date -uR -d "${run_end_date}")
+
+for (( ; run_num_legs>0 ; run_num_legs-- ))
+do
+
+# Initialize variables  using restart file if it exists
+[[ -r ${ece_info_file} ]] && source ${ece_info_file}
+leg_start_date=${leg_end_date:-$run_start_date}
+leg_number=$((${leg_number:=0}+1))
+
+# Compute leg end-date and trim if necessary
+leg_end_date=$(date -uR -d "${leg_start_date} + ${rst_freq:=$run_duration}")
+(( $(date -d "${leg_end_date}" +%s) > $(date -d "${run_end_date}" +%s) )) && leg_end_date=${run_end_date}
+
+# Check whether there is some work left to do
+if (( $(date -d "${leg_start_date}" +%s) >= $(date -d "${run_end_date}" +%s) )) ;
+then
+	echo "Leg start date equal to or after end of simulation."
+	echo "Nothing left to do. Exiting."
+	exit 0
+fi
+
+    # Some time variables needed later
+    leg_length_sec=$(( $(date -d "${leg_end_date}" +%s) - $(date -d "${leg_start_date}" +%s) ))
+    leg_start_sec=$(( $(date -d "${leg_start_date}" +%s) - $(date -d "${run_start_date}" +%s) ))
+    leg_end_sec=$(( $(date -d "${leg_end_date}" +%s) - $(date -d "${run_start_date}" +%s) ))
+    leg_start_date_yyyymmdd=$(date -u -d "${leg_start_date}" +%Y%m%d)
+    leg_start_date_yyyy=$(date -u -d "${leg_start_date}" +%Y)
+    leg_end_date_yyyy=$(date -u -d "${leg_end_date}" +%Y)
+
+    # Correct for leap days because NEMO standalone uses no-leap calendar
+    leg_length_sec=$(( leg_length_sec - $(leap_days "${leg_start_date}" "${leg_end_date}")*24*3600 ))
+    leg_start_sec=$(( leg_start_sec - $(leap_days "${run_start_date}" "${leg_start_date}")*24*3600 ))
+    leg_end_sec=$(( leg_end_sec - $(leap_days "${run_start_date}" "${leg_end_date}")*24*3600 ))
+
+        # ---------------------------------------------------------------------
+        # *** Remove all leftover output files from previous legs
+        # ---------------------------------------------------------------------
+
+
+    t1=$(date +%s)
+	sleep 1
+    t2=$(date +%s)
+
+    tr=$(date -d "0 -$t1 sec + $t2 sec" +%T)
+
+    # -------------------------------------------------------------------------
+    # *** Write the restart control file
+    # -------------------------------------------------------------------------
+
+    echo "#"                                             | tee -a ${ece_info_file}
+    echo "# Finished leg at `date '+%F %T'` after ${tr} (hh:mm:ss)" \
+                                                         | tee -a ${ece_info_file}
+    echo "leg_number=${leg_number}"                      | tee -a ${ece_info_file}
+    echo "leg_start_date=\"${leg_start_date}\""          | tee -a ${ece_info_file}
+    echo "leg_end_date=\"${leg_end_date}\""              | tee -a ${ece_info_file}
+
+    # Need to reset force_run_from_scratch in order to avoid destroying the next leg
+
+done # loop over legs
+
+exit 0

+ 9 - 0
zone/t.sh

@@ -0,0 +1,9 @@
+iterdate() {
+	cur="$1"
+	end="$2"
+	while [ $cur != $end ] 
+	do
+	 echo php update_cron.php $cur 
+	 cur=$(date -d "$cur + 1 day"  +%Y-%m-%d)
+	done
+	}