Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 912)
@@ -12,5 +12,5 @@
 #**************************************************************
 
-# bypass specific internationalization (for awk)
+# bypass specific internationalization (for gawk)
 export LC_ALL="C"
 
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 912)
@@ -1389,5 +1389,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A dm_liste \${${2}}
     else
@@ -1469,5 +1468,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A buf_liste \${${2}}
     else
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 909)
+++ 	(revision )
@@ -1,2127 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sebastien Denvil, Martial Mancip
-# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Cesium
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# rsync with path
-typeset -r RSYNC=/usr/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-va"
-# ie storage filesystem
-typeset -r RHOST=cesium
-
-#====================================================
-# Source default environment
-#====================================================
-. /etc/profile
-
-#====================================================
-# Set environment tools (ferret, nco, cdo)
-#====================================================
-. /home/cont003/p86ipsl/.atlas_env_cesium_ksh
-
-#====================================================
-# Specific for ocean additionnal diagnostic
-export FER_GO="$FER_GO /home/cont003/p86denv/IGCM_POST_UTIL/JNL /home/cont003/p86denv/GRAF /home/cont003/p86denv/GRAF/GO"
-export FER_PALETTE="$FER_PALETTE /home/cont003/p86denv/GRAF/PALET"
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-# For interactive jobs on cesium
-PBS_O_WORKDIR=${PBS_O_WORKDIR:=$(pwd)}
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
-
-#====================================================
-#- ARCHIVE (dedicated to large files)
-typeset -r ARCHIVE=${CCCSTOREDIR}
-
-#- ARCHIVE (dedicated to small/medium files)
-typeset -r STORAGE=${CCCWORKDIR}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/dmnfs/cont003/p24data}
-
-#====================================================
-#- R_OUT
-typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
-typeset -r R_FIG=${STORAGE}/IGCM_OUT
-
-#====================================================
-#- R_BUF (ONLY FOR double copy an scratch)
-typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-PBS_JOBID=${PBS_JOBID:=TEMPDIR$$}
-typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/${PBS_JOBID}}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=360
-
-#- set PackDefault true on NEC front-end
-PackDefault=true
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Just a fake command to wrapp
-#D-           IGCM_card call in post-treatment
-#D-           Ulam do not see brodie filesystem
-#D-           Cesium do not see all mercure filesystem
-#D-           That's why we need this hack.
-#D-* Examples:
-#D-
-function IGCM_sys_RshMaster {
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=10
-  # time delay between tentative
-  DELAI=10
-  #
-  (( i = 0 ))
-  while [ $i -lt $NB_ESSAI ] ; do
-    ssh ${MASTER} exec /bin/ksh <<-EOF
-    export libIGCM=${libIGCM_SX}
-    export DEBUG_debug=${DEBUG_debug}
-    . ${libIGCM_SX}/libIGCM_debug/libIGCM_debug.ksh
-    . ${libIGCM_SX}/libIGCM_card/libIGCM_card.ksh
-    ${@}
-EOF
-    status=$?
-    if [ ${status} -gt 0 ]; then
-      IGCM_debug_Print 2 "IGCM_sys_RshMaster : ssh failed ${i}/${NB_ESSAI}"
-      IGCM_debug_Print 2 "IGCM_sys_RshMaster : sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Post-process rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-
-  #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL
-  #cat tmp_IGCM_sys_RshPost_$$
-  # keep standard input (stdin) for the loop onto temporary file
-  cat >tmp_IGCM_sys_RshPost_$$
-
-  /bin/ksh <tmp_IGCM_sys_RshPost_$$
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshPost : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshPost"
-    cat tmp_IGCM_sys_RshPost_$$
-  fi
-  # delete temporary file
-  \rm tmp_IGCM_sys_RshPost_$$
-
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-
-  ssh mercure <<-EOF
-    export LOGIN=${LOGIN}
-    export config_UserChoices_JobName=${config_UserChoices_JobName}
-    export config_UserChoices_MailName=${config_UserChoices_MailName}
-    export DateBegin=${DateBegin}
-    export DateEnd=${DateEnd}
-    export R_SAVE=${R_SAVE}
-    export SUBMIT_DIR=${SUBMIT_DIR}
-    export status=${status}
-
-    cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-    if [ ! -z ${config_UserChoices_MailName} ] ; then
-       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
-    elif [ -f ~/.forward ] ; then
-       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-    fi
-    sleep 10
-    rm -f job_end.mail
-EOF
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Mkdir : erreur."
-      IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-  fi
-  # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirArchive : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_IsFileArchived
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_IsFileArchived {
-  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_IsFileArchived :" $@
-  fi
-  typeset IsArchivedFlag
-  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
-
-  return ${IsArchivedFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileBuffer
-#D-* Purpose: Test file that must NOT EXISTS on Buffer
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileBuffer
-#D-* Purpose: Count files on Scratch filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileBuffer : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \tree -f $@
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  \tar cf $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Qsub
-#D-* Purpose: Qsub new job
-#D-* Examples:
-#D-
-function IGCM_sys_Qsub {
-  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Qsub :" $@
-  fi
-  /usr/local/bin/ccc_msub -o ${Script_Output} -e ${Script_Output}.e < $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Qsub : erreur  -o ${Script_Output} -e ${Script_Output}.e $@"
-    IGCM_debug_Exit "IGCM_sys_Qsub"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Qsub"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-  /usr/local/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.e.out -E "-v ${listVarEnv}" ${libIGCM}/$1.job
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  RET=$1
-  if [ ! $RET ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $RET in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $RET in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $RET
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset RET
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  RET=$?
-
-  if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset RET
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  RET=$?
-
-  if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RmRunDir
-#D-* Purpose: rm tmpdir (dummy function most of the time batch
-#D-                      scheduler will do the job)
-#D-* Examples:
-#D-
-function IGCM_sys_RmRunDir {
-  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RmRunDir :" $@
-  fi
-
-  typeset RET
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  RET=$?
-
-  if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_RmRunDir : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_RmRunDir"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset RET
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error in mv."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset RET
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    \cp -r $1 $2 > out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from ${ARCHIVE}
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-#    if [ ! -d ${1} ] ; then
-#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#      return
-#    fi
-
-    typeset RET
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    # USUAL WAY
-    # add dmfind/dmget (to demigrate all offline files) :
-    #dmfind $1 -state MIG -o -state OFL -o -state PAR | dmget
-    \cp -r $1 $2 > out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Master
-#D-* Purpose: Copy a complete directory from MASTER filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Master {
-  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Master :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-
-    typeset TEST NB_ESSAI DELAI status i
-
-    TEST=$( IGCM_sys_RshMaster ( [ -d $1 ] || [ -f $1 ] ) && echo 1 || echo 0 )
-    if [ ${TEST} -ne 1 ] ; then
-      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ON ${MASTER}."
-      IGCM_debug_PopStack "IGCM_sys_Get_Master"
-      return
-    fi
-
-    # number of tentative
-    NB_ESSAI=10
-    # time delay between tentative
-    DELAI=10
-    #
-    (( i = 0 ))
-    while [ $i -lt $NB_ESSAI ] ; do
-            #USUAL WAY
-      scp -r ${MASTER}:$1 $2 > out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : scp failed ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Master : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Master"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Master"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on ${ARCHIVE}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Rest {
-  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    fi
-
-    typeset RET
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    RET=$?
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       RET=$?
-#       IGCM_sys_Rsync_out $RET
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( RET=RET+$? ))
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PrepareTaredRestart
-#D-* Purpose: Prepare tared restart to be access by computing job. Identity here.
-#D-* Examples:
-#D-
-function IGCM_sys_PrepareTaredRestart {
-  IGCM_debug_PushStack "IGCM_sys_PrepareTaredRestart" $@
-  echo $1
-  IGCM_debug_PopStack "IGCM_sys_PrepareTaredRestart"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI RET i exist skip
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    typeset WORKPATH FILEPATH
-    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH}
-    #    FILEPATH=${WORKPATH}/$( basename $2 )
-    #    #
-    #    IGCM_sys_Cp ${1} ${FILEPATH}
-    #fi
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      #dmget $2
-      ccc_hsm get $2
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      (( i = 0 ))
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        RET=$?
-        if [ ${RET} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-#       #RSYNC WITH NETWORK RSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       RET=$?
-#       IGCM_sys_Rsync_out $RET
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( RET=RET+$? ))
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST RET dm_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      eval set +A dm_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    # Is it an R_OUT file (not R_IN) ?
-    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    # Yes  ? then we try to get it in SCRATCHDIR
-    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
-    #    if [ -f ${file_work[0]} ] ; then
-    #	IGCM_sys_Cp ${file_work[*]} ${DEST}
-    #	IGCM_debug_PopStack "IGCM_sys_Get"
-    #	return
-    #    fi
-    #fi
-
-    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    RET=$?
-    if [ ${RET} -gt 0 ] ; then
-      echo "WARNING IGCM_sys_Get : demigration error."
-      cat out_rsync
-      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
-    fi
-
-    #if [ ${RET} -gt 0 ] ; then
-    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
-    #	cat out_rsync
-    #	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
-    #	sleep 30
-    #	echo "We try another time"
-    ##	dmget ${dm_liste[*]} > out_rsync 2>&1
-    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    #	RET=$?
-    #	if [ ${RET} -gt 0 ] ; then
-    #       echo "ERROR IGCM_sys_Get : again demigration error :"
-    #       cat out_rsync
-    #       IGCM_debug_Exit "IGCM_sys_Get"
-    #	fi
-    #    else
-    #	echo "ERROR IGCM_sys_Get : demigration error :"
-    #	cat out_rsync
-    #	IGCM_debug_Exit "IGCM_sys_Get"
-    #    fi
-    #fi
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      (( RET=0 ))
-      for target in ${dm_liste[*]} ; do
-        local_file=$( basename ${target} )
-        (( i = 0 ))
-        # test if the target file is present before the loop
-        IGCM_sys_TestFileArchive ${target}
-        RET=$?
-        if [ ${RET} -gt 0 ] ; then
-          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ."
-          IGCM_debug_Exit "IGCM_sys_Get"
-        else
-          while [ $i -lt $NB_ESSAI ] ; do
-            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-            status=$?
-            if [ ${status} -gt 0 ]; then
-              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed ${i}/${NB_ESSAI}"
-              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-              sleep $DELAI
-            else
-              break
-            fi
-            (( i = i + 1 ))
-          done
-          (( RET = RET + status ))
-        fi
-      done
-    else
-      \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
-      RET=$?
-    fi
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#       RET=$?
-#       IGCM_sys_Rsync_out $RET
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( RET=RET+$? ))
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Get : copy error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetBuffer
-#D-* Purpose: Get a file from ${SCRATCHDIR}
-#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
-function IGCM_sys_GetBuffer {
-  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
-
-  typeset DEST RET buf_liste ifile target file_work
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetBuffer :" $@
-  fi
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A buf_liste \${${2}}
-    else
-      eval set +A buf_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      (( RET=0 ))
-      for target in ${buf_liste[*]} ; do
-        local_file=$( basename ${target} )
-        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-        (( RET = RET + $? ))
-      done
-    else
-      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
-      RET=$?
-    fi
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_GetBuffer : copy error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_GetBuffer"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-  # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Rm
-#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Rm {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Rm :" $@
-  fi
-  typeset RET
-  RET=0
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
-    RET=$?
-
-#	if [ ${RET} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Rm : error."
-#           cat out_dods_rm
-#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
-#	else
-#           rm out_dods_rm
-#	fi
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  return $RET
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Cp
-#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Cp {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Cp :" $@
-  fi
-  typeset RET
-  RET=0
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d ${R_SAVE}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
-    RET=$?
-
-#       if [ ${RET} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Cp : error."
-#           cat out_dods_cp
-#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
-#       else
-#           rm out_dods_cp
-#       fi
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  return $RET
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dods
-#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dods {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dods :" $@
-  fi
-  typeset RET
-  if [ $DRYRUN = 0 ]; then
-    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-
-    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-    #
-    if [ -d ${R_SAVE}/${1} ] ; then
-      cd ${R_SAVE}
-    elif [ -d ${R_FIGR}/${1} ] ; then
-      cd ${R_FIGR}
-    fi
-
-    IGCM_sys_Dods_Rm ${1}
-    IGCM_sys_Dods_Cp ${1}
-    RET=0
-
-    if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dods : error."
-      IGCM_debug_Exit "IGCM_sys_Put_Dods"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-  /home/cont003/p86ipsl/CESIUM/bin/rebuild -f -o $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : erreur ${@}."
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t 
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t 
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
-############################################################
-# Build run file
-
-function IGCM_sys_build_run_file {
-  IGCM_debug_PushStack "IGCM_sys_build_run_file" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_run_file"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_build_run_file"
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-    IGCM_debug_PushStack "IGCM_sys_check_quota"
-    if ( $DEBUG_sys ) ; then
-        echo "IGCM_sys_check_quota"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
-
-##############################################################
-# NCO OPERATOR
-
-function IGCM_sys_ncap2 {
-  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncap2 :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncap2 "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncap2 : ncap2 error"
-      IGCM_debug_Exit "ncap2"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncap2"
-}
-
-function IGCM_sys_ncatted {
-  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncatted :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncatted "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncatted : ncatted error"
-      IGCM_debug_Exit "ncatted"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncatted"
-}
-
-function IGCM_sys_ncbo {
-  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncbo :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncbo $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncbo : ncbo error"
-      IGCM_debug_Exit "ncbo"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncbo"
-}
-
-function IGCM_sys_ncdiff {
-  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncdiff :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncdiff $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncdiff : ncdiff error"
-      IGCM_debug_Exit "ncdiff"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncdiff"
-}
-
-function IGCM_sys_ncea {
-  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncea :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncea $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncea : ncea error"
-      IGCM_debug_Exit "ncea"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncea"
-}
-
-function IGCM_sys_ncecat {
-  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncecat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncecat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncecat : ncecat error"
-      IGCM_debug_Exit "ncecat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncecat"
-}
-
-function IGCM_sys_ncflint {
-  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncflint :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncflint $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncflint : ncflint error"
-      IGCM_debug_Exit "ncflint"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncflint"
-}
-
-function IGCM_sys_ncks {
-  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncks :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncks $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncks : ncks error"
-      IGCM_debug_Exit "ncks"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncks"
-}
-
-function IGCM_sys_ncpdq {
-  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncpdq :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncpdq $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncpdq : ncpdq error"
-      IGCM_debug_Exit "ncpdq"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncpdq"
-}
-
-function IGCM_sys_ncra {
-  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncra :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncra $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncra : ncra error"
-      IGCM_debug_Exit "ncra"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncra"
-}
-
-function IGCM_sys_ncrcat {
-  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrcat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrcat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrcat : ncrcat error"
-      #IGCM_debug_Exit "ncrcat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrcat"
-}
-
-function IGCM_sys_ncrename {
-  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrename :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrename $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrename : ncrename error"
-      IGCM_debug_Exit "ncrename"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrename"
-}
-
-function IGCM_sys_ncwa {
-  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncwa :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncwa $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncwa : ncwa error"
-      IGCM_debug_Exit "ncwa"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncwa"
-}
-
-##############################################################
-# CDO OPERATOR
-
-function IGCM_sys_cdo {
-  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_cdo :" $@
-  fi
-
-  typeset status
-
-  \cdo $@ > out_rsync 2>&1
-  status=$?
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_cdo : error code ${status}"
-    cat out_rsync
-    \rm out_rsync
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 1
-  else
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 0
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_cdo"
-}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 912)
@@ -1465,5 +1465,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A dm_liste \${${2}}
     else
@@ -1614,5 +1613,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A buf_liste \${${2}}
     else
@@ -1887,5 +1885,5 @@
 #D-#==================================================
 #D-function IGCM_sys_rebuild_station
-#D-* Purpose: rebuild parallel files describing station 
+#D-* Purpose: rebuild parallel files describing station
 #D-* Examples:
 #D-
@@ -1950,5 +1948,5 @@
     # Array containing Station as a number
 #    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
+#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | gawk ' {print $2}' )
     # Number of stations produced by processor proc
 #    stationLast=${#proc_stn[*]}
@@ -2181,6 +2179,6 @@
 
   # Check of the volume
-  volume_quota=$(ccc_quota | grep ' scratch' | awk '{print $2}')
-  volume_avail=$(ccc_quota | grep ' scratch' | awk '{print $3}')
+  volume_quota=$(ccc_quota | grep ' scratch' | gawk '{print $2}')
+  volume_avail=$(ccc_quota | grep ' scratch' | gawk '{print $3}')
 
   if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
@@ -2244,6 +2242,6 @@
 # Check of the number of inodes
 
-  inode_quota=$(ccc_quota | grep ' scratch' | awk '{print $6}')
-  inode_avail=$(ccc_quota | grep ' scratch' | awk '{print $7}')
+  inode_quota=$(ccc_quota | grep ' scratch' | gawk '{print $6}')
+  inode_avail=$(ccc_quota | grep ' scratch' | gawk '{print $7}')
 
   if ( [ ! X${inode_quota} = X ] && [ ! ${inode_quota} = "-" ] ) ; then
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 912)
@@ -1222,5 +1222,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A dm_liste \${${2}}
     else
@@ -1275,5 +1274,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A buf_liste \${${2}}
     else
@@ -1519,5 +1517,5 @@
     # Array containing Station as a number
 #    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
+#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | gawk ' {print $2}' )
     # Number of stations produced by processor proc
 #    stationLast=${#proc_stn[*]}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 912)
@@ -1260,5 +1260,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A dm_liste \${${2}}
     else
@@ -1320,5 +1319,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A buf_liste \${${2}}
     else
@@ -1556,5 +1554,5 @@
     # Array containing Station as a number
 #    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
+#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | gawk ' {print $2}' )
     # Number of stations produced by processor proc
 #    stationLast=${#proc_stn[*]}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 909)
+++ 	(revision )
@@ -1,2301 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sebastien Denvil, Martial Mancip
-# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Mercure X64
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# Submit command
-typeset SUBMIT=${SUBMIT:=qsub}
-# rsync with path
-typeset -r RSYNC=/usr/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-va"
-# ie storage filesystem
-typeset -r RHOST=mercure
-
-#====================================================
-# Set environment tools (ferret, nco, cdo)
-#====================================================
-. /home/cont003/p86ipsl/.atlas_env_mercure01_ksh
-
-#====================================================
-# AddNoise PATH
-#====================================================
-export PATH=${PATH}:/ccc/cont003/home/dsm/p86ipsl/AddNoise/src_X86_64/bin
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-# For interactive jobs on mercure
-PBS_O_WORKDIR=${PBS_O_WORKDIR:=$(pwd)}
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/ccc/work/cont003/dsm/p24data}
-
-#====================================================
-#- ARCHIVE (dedicated to large files)
-typeset ARCHIVE=${CCCSTOREDIR}
-
-#====================================================
-#- STORAGE (dedicated to small/medium files)
-typeset STORAGE=${CCCWORKDIR}
-
-#====================================================
-#- R_OUT
-typeset R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
-typeset R_FIG=${STORAGE}/IGCM_OUT
-
-#====================================================
-#- R_BUF (ONLY FOR double copy an scratch)
-typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=360
-
-#- set PackDefault true on NEC front-end
-PackDefault=true
-
-#D-#==================================================
-#D-function IGCM_sys_ChangeArchive
-#D-* Purpose: if SpaceName=TEST everything is stored on SCRATCHDIR
-#D-* Examples:
-#D-
-function IGCM_sys_ChangeArchive {
-  IGCM_debug_PushStack "IGCM_sys_ChangeArchive"
-
-  R_OUT=${SCRATCHDIR}/IGCM_OUT
-  R_FIG=${SCRATCHDIR}/IGCM_OUT
-  IGCM_debug_Print 1 "R_OUT   has been redefined = ${R_OUT}"
-  IGCM_debug_Print 1 "R_FIG   has been redefined = ${R_FIG}"
-
-  IGCM_debug_PopStack "IGCM_sys_ChangeArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Just a fake command to wrapp
-#D-           IGCM_card call in post-treatment
-#D-           Ulam do not see brodie filesystem
-#D-           Cesium do not see all mercure filesystem
-#D-           That's why we need this hack.
-#D-* Examples:
-#D-
-function IGCM_sys_RshMaster {
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  /bin/ksh <<-EOF
-    export libIGCM=${libIGCM}
-    export DEBUG_debug=${DEBUG_debug}
-    . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
-    . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshMaster : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshMaster"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Post-process rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-  /bin/ksh ${@}
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshPost : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-  if  [ X"${config_UserChoices_MailName}" != X ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
-  elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-  else
-    mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail
-  fi
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Mkdir : erreur."
-      IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-  fi
-  # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirArchive : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_IsFileArchived
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_IsFileArchived {
-  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_IsFileArchived :" $@
-  fi
-  typeset IsArchivedFlag
-  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
-
-  return ${IsArchivedFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileBuffer
-#D-* Purpose: Test file that must NOT EXISTS on Buffer
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileBuffer
-#D-* Purpose: Count files on Scratch filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileBuffer : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \tree -f $@
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  \tar cf $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-  /usr/bin/nqsII/qsub -q scalaire -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM}/$1.job -v ${listVarEnv}
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  status=$1
-  if [ ! $status ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $status in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $status in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $status
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset status
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RmRunDir
-#D-* Purpose: rm tmpdir (dummy function most of the time batch
-#D-                      scheduler will do the job)
-#D-           Dummy function on mercure front-end
-#D-* Examples:
-#D-
-function IGCM_sys_RmRunDir {
-    IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-    if ( $DEBUG_sys ) ; then
-        echo "IGCM_sys_RmRunDir :" $@
-        echo "Dummy call, let the scheduler do that."
-    fi
-    IGCM_debug_PopStack "IGCM_sys_RmRunDir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset status
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset status
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    \cp -r $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from ${ARCHIVE}
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-#    if [ ! -d ${1} ] ; then
-#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#      return
-#    fi
-
-    typeset NB_ESSAI DELAI status i
-    # number of tentative
-    NB_ESSAI=3
-    # time delay between tentative
-    DELAI=2
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    # USUAL WAY
-    # add 'ccc_hsm get' (to demigrate all offline files) to reduce time of this command :
-    ccc_hsm get -r $1
-
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \cp -ur $1 $2 >> out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Master
-#D-* Purpose: Copy a complete directory from MASTER filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Master {
-  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Master :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if ( [ ! -d ${1} ] && [ ! -f ${1} ] ) ; then
-      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Get_Master"
-      return
-    fi
-
-    typeset NB_ESSAI DELAI status i
-    # number of tentative
-    NB_ESSAI=3
-    # time delay between tentative
-    DELAI=2
-
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \cp -urL $1 $2 > out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Master : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Master"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Master"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on ${ARCHIVE}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Rest {
-  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Rest
-#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Rest {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Rest : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PrepareTaredRestart
-#D-* Purpose: Prepare tared restart to be access by computing job. Identity here.
-#D-* Examples:
-#D-
-function IGCM_sys_PrepareTaredRestart {
-  IGCM_debug_PushStack "IGCM_sys_PrepareTaredRestart" $@
-  echo $1
-  IGCM_debug_PopStack "IGCM_sys_PrepareTaredRestart"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    typeset WORKPATH FILEPATH
-    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH}
-    #    FILEPATH=${WORKPATH}/$( basename $2 )
-    #    #
-    #    IGCM_sys_Cp ${1} ${FILEPATH}
-    #fi
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      #dmget $2
-      ccc_hsm get $2
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Out
-#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Out {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip 
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_Mkdir $( dirname $2 )
-    #
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        #\cp $1 $2 > out_rsync 2>&1
-        \mv $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST dm_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      eval set +A dm_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    # Is it an R_OUT file (not R_IN) ?
-    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    # Yes  ? then we try to get it in SCRATCHDIR
-    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
-    #    if [ -f ${file_work[0]} ] ; then
-    #	IGCM_sys_Cp ${file_work[*]} ${DEST}
-    #	IGCM_debug_PopStack "IGCM_sys_Get"
-    #	return
-    #    fi
-    #fi
-
-    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      echo "WARNING IGCM_sys_Get : error code ${status}"
-      cat out_rsync
-      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
-    fi
-
-    #if [ ${status} -gt 0 ] ; then
-    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
-    #	cat out_rsync
-    #	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
-    #	sleep 30
-    #	echo "We try another time"
-    ##	dmget ${dm_liste[*]} > out_rsync 2>&1
-    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    #	status=$?
-    #	if [ ${status} -gt 0 ] ; then
-    #       echo "ERROR IGCM_sys_Get : again demigration error :"
-    #       cat out_rsync
-    #       IGCM_debug_Exit "IGCM_sys_Get"
-    #	fi
-    #    else
-    #	echo "ERROR IGCM_sys_Get : demigration error :"
-    #	cat out_rsync
-    #	IGCM_debug_Exit "IGCM_sys_Get"
-    #    fi
-    #fi
-
-    #   #RSYNC WITH NETWORK SSH CALL
-    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   #RSYNC WITH NFS USE
-    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   status=$?
-    #   IGCM_sys_Rsync_out $status
-
-    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-    #   (( status=status+$? ))
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${dm_liste[*]} ; do
-        local_file=$( basename ${target} )
-        # test if the target file is present before the loop
-        IGCM_sys_TestFileArchive ${target}
-        status=$?
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ."
-          IGCM_debug_Exit "IGCM_sys_Get"
-        else
-          i=0
-          while [ $i -lt $NB_ESSAI ] ; do
-            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-            status=$?
-            if [ ${status} -gt 0 ]; then
-              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-              sleep $DELAI
-            else
-              break
-            fi
-            (( i = i + 1 ))
-          done
-          if [ ${status} -gt 0 ] ; then
-            echo "IGCM_sys_Get : error"
-            cat out_rsync
-            \rm out_rsync
-            IGCM_debug_Exit "IGCM_sys_Get"
-          else
-            \rm out_rsync
-          fi
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_Get"
-      else
-        \rm out_rsync
-      fi
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetBuffer
-#D-* Purpose: Get a file from ${SCRATCHDIR}
-#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
-function IGCM_sys_GetBuffer {
-  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
-
-  typeset DEST buf_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetBuffer :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A buf_liste \${${2}}
-    else
-      eval set +A buf_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${buf_liste[*]} ; do
-        local_file=$( basename ${target} )
-        i=0
-        while [ $i -lt $NB_ESSAI ] ; do
-          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-          status=$?
-          if [ ${status} -gt 0 ]; then
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-            sleep $DELAI
-          else
-            break
-          fi
-          (( i = i + 1 ))
-        done
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get : error"
-          cat out_rsync
-          \rm out_rsync
-          IGCM_debug_Exit "IGCM_sys_GetBuffer"
-        else
-          \rm out_rsync
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_GetBuffer"
-      else
-        \rm out_rsync
-      fi
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-  # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Rm
-#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Rm {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Rm :" $@
-  fi
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
-    status=$?
-
-#	if [ ${status} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Rm : error."
-#           cat out_dods_rm
-#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
-#	else
-#           rm out_dods_rm
-#	fi
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  return $status
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Cp
-#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Cp {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Cp :" $@
-  fi
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d ${R_SAVE}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86ipsl/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
-    status=$?
-
-#       if [ ${status} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Cp : error."
-#           cat out_dods_cp
-#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
-#       else
-#           rm out_dods_cp
-#       fi
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  return $status
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dods
-#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dods {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dods :" $@
-  fi
-  #set -vx
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-
-    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-    #
-    if [ -d ${R_SAVE}/${1} ] ; then
-      cd ${R_SAVE}
-    elif [ -d ${R_FIGR}/${1} ] ; then
-      cd ${R_FIGR}
-    fi
-
-    IGCM_sys_Dods_Rm ${1}
-    IGCM_sys_Dods_Cp ${1}
-    status=0
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dods : error."
-      IGCM_debug_Exit "IGCM_sys_Put_Dods"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i firstArg
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      firstArg=${1}
-      \rm ${firstArg}
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : rebuild error"
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t 
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t 
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-    IGCM_debug_PushStack "IGCM_sys_check_quota"
-    if ( $DEBUG_sys ) ; then
-        echo "IGCM_sys_check_quota"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
-
-##############################################################
-# NCO OPERATOR
-
-function IGCM_sys_ncap2 {
-  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncap2 :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncap2 "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncap2 : ncap2 error"
-      IGCM_debug_Exit "ncap2"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncap2"
-}
-
-function IGCM_sys_ncatted {
-  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncatted :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncatted "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncatted : ncatted error"
-      IGCM_debug_Exit "ncatted"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncatted"
-}
-
-function IGCM_sys_ncbo {
-  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncbo :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncbo $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncbo : ncbo error"
-      IGCM_debug_Exit "ncbo"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncbo"
-}
-
-function IGCM_sys_ncdiff {
-  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncdiff :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncdiff $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncdiff : ncdiff error"
-      IGCM_debug_Exit "ncdiff"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncdiff"
-}
-
-function IGCM_sys_ncea {
-  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncea :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncea $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncea : ncea error"
-      IGCM_debug_Exit "ncea"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncea"
-}
-
-function IGCM_sys_ncecat {
-  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncecat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncecat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncecat : ncecat error"
-      IGCM_debug_Exit "ncecat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncecat"
-}
-
-function IGCM_sys_ncflint {
-  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncflint :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncflint $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncflint : ncflint error"
-      IGCM_debug_Exit "ncflint"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncflint"
-}
-
-function IGCM_sys_ncks {
-  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncks :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncks $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncks : ncks error"
-      IGCM_debug_Exit "ncks"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncks"
-}
-
-function IGCM_sys_ncpdq {
-  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncpdq :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncpdq $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncpdq : ncpdq error"
-      IGCM_debug_Exit "ncpdq"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncpdq"
-}
-
-function IGCM_sys_ncra {
-  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncra :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncra $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncra : ncra error"
-      IGCM_debug_Exit "ncra"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncra"
-}
-
-function IGCM_sys_ncrcat {
-  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrcat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrcat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrcat : ncrcat error"
-      #IGCM_debug_Exit "ncrcat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrcat"
-}
-
-function IGCM_sys_ncrename {
-  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrename :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrename $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrename : ncrename error"
-      IGCM_debug_Exit "ncrename"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrename"
-}
-
-function IGCM_sys_ncwa {
-  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncwa :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncwa $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncwa : ncwa error"
-      IGCM_debug_Exit "ncwa"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncwa"
-}
-
-##############################################################
-# CDO OPERATOR
-
-function IGCM_sys_cdo {
-  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_cdo :" $@
-  fi
-
-  typeset status
-
-  \cdo $@ > out_rsync 2>&1
-  status=$?
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_cdo : error code ${status}"
-    cat out_rsync
-    \rm out_rsync
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 1
-  else
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 0
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_cdo"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
-############################################################
-# Build run file
-
-function IGCM_sys_build_run_file {
-  IGCM_debug_PushStack "IGCM_sys_build_run_file"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_run_file"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_build_run_file"
-}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 909)
+++ 	(revision )
@@ -1,2009 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sebastien Denvil, Martial Mancip
-# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Mercure SX9
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-# gawk specific location on SX9
-export PATH=/applications/gawk-3.0.4/bin:${PATH}
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-# $hostname of the MASTER job
-typeset -r MASTER=mercure
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# Submit command
-typeset SUBMIT=${SUBMIT:=qsub}
-# rsync with path
-typeset -r RSYNC=/home/cont003/p86denv/SX_RSYNC/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-va"
-# ie storage filesystem
-typeset -r STOREHOST=${MASTER}
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-# ============ CESIUM START ============ #
-
-#====================================================
-#- Mirror libIGCM from mercure to cesium if needed
-#ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $3}' )
-#if [ ! ${ROOTSYS} = "home" ] ; then
-#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
-#else
-#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
-#fi
-
-#====================================================
-#- libIGCM_POST
-#if ( ${MirrorlibIGCM} ) ; then
-#  PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
-#  typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM
-#else
-#  typeset -r libIGCM_POST=${libIGCM}
-#fi
-
-# ============ CESIUM  END  ============ #
-
-#====================================================
-#- MirrorlibIGCM for frontend
-typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
-
-#====================================================
-#- libIGCM_POST for frontend
-typeset -r libIGCM_POST=${libIGCM}
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/ccc/work/cont003/dsm/p24data}
-
-#====================================================
-#- ARCHIVE (dedicated to large files)
-typeset ARCHIVE=${CCCSTOREDIR}
-
-#====================================================
-#- STORAGE (dedicated to small/medium files)
-typeset STORAGE=${CCCWORKDIR}
-
-#====================================================
-#- R_OUT
-typeset R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
-typeset R_FIG=${STORAGE}/IGCM_OUT
-
-#====================================================
-#- R_BUF (ONLY FOR double copy an scratch)
-typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${LOCALTMPDIR}}
-
-#====================================================
-#- HOST_MPIRUN_COMMAND
-typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="mpirun"}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=360
-
-#====================================================
-#- set PackDefault true on NEC SX9
-PackDefault=true
-
-#====================================================
-#- Default number of MPI task for IPSL coupled model
-#- required for backward compatibility
-#-
-DEFAULT_NUM_PROC_OCE=1
-DEFAULT_NUM_PROC_CPL=1
-(( DEFAULT_NUM_PROC_ATM = BATCH_NUM_PROC_TOT - 1 ))
-DEFAULT_NUM_PROC_TOTAL=${BATCH_NUM_PROC_TOT}
-
-#D-#==================================================
-#D-function IGCM_sys_ChangeArchive
-#D-* Purpose: if SpaceName=TEST everything is stored on SCRATCHDIR
-#D-* Examples:
-#D-
-function IGCM_sys_ChangeArchive {
-  IGCM_debug_PushStack "IGCM_sys_ChangeArchive"
-
-  R_OUT=${SCRATCHDIR}/IGCM_OUT
-  R_FIG=${SCRATCHDIR}/IGCM_OUT
-
-  IGCM_debug_Print 1 "R_OUT   has been redefined = ${R_OUT}"
-  IGCM_debug_Print 1 "R_FIG   has been redefined = ${R_FIG}"
-
-  IGCM_debug_PopStack "IGCM_sys_ChangeArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Connection to frontend machine.
-#D-* Examples:
-#D-
-function IGCM_sys_RshMaster {
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  ssh -t ${MASTER} /bin/ksh <<-EOF
-  export libIGCM=${libIGCM}
-  export DEBUG_debug=${DEBUG_debug}
-  . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
-  . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
-  ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshMaster : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshMaster"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Post-process rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-
-  #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL
-  #cat tmp_IGCM_sys_RshPost_$$
-  # keep standard input (stdin) for the loop onto temporary file
-  cat >tmp_IGCM_sys_RshPost_$$
-
-# ============ FRONTEND START ============ #
-
-  /bin/ksh <tmp_IGCM_sys_RshPost_$$
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshPost : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshPost"
-  fi
-  # delete temporary file
-  \rm tmp_IGCM_sys_RshPost_$$
-
-# ============ FRONTEND  END  ============ #
-
-# ============ CESIUM START ============ #
-#  typeset NB_ESSAI DELAI status i
-#  # number of tentative
-#  NB_ESSAI=10
-#  # time delay between tentative
-#  DELAI=10
-#  (( i = 0 ))
-#  while [ $i -lt $NB_ESSAI ] ; do
-#    ssh -t mercure01 ssh cesium /bin/ksh <tmp_IGCM_sys_RshPost_$$
-#    status=$?
-#    if [ ${status} -gt 0 ]; then
-#      IGCM_debug_Print 2 "IGCM_sys_RshPost : ssh failed ${i}/${NB_ESSAI}"
-#      IGCM_debug_Print 2 "IGCM_sys_RshPost : sleep ${DELAI} seconds and try again."
-#      sleep $DELAI
-#    else
-#      break
-#    fi
-#    (( i = i + 1 ))
-#  done 
-#  # delete temporary file
-#  /bin/rm tmp_IGCM_sys_RshPost_$$
-# ============ CESIUM  END  ============ #
-
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-  if  [ X"${config_UserChoices_MailName}" != X ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
-  elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-  else
-    mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail
-  fi
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ ! -d ${1} ]; then
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \mkdir -p $1
-      status=$?
-      if [ ${status} -gt 0 ] ; then
-        IGCM_debug_Print 2 "IGCM_sys_Mkdir : mkdir failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Mkdir : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-  fi
-  # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ ! -d ${1} ]; then
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \mkdir -p $1
-      status=$?
-      if [ ${status} -gt 0 ] ; then
-        IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-  fi
-
-  # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_MkdirArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_IsFileArchived
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_IsFileArchived {
-  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_IsFileArchived :" $@
-  fi
-  typeset IsArchivedFlag
-  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
-
-  return ${IsArchivedFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileBuffer
-#D-* Purpose: Test file that must NOT EXISTS on Buffer
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileBuffer
-#D-* Purpose: Count files on Scratch filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileBuffer : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \ls -lR ${@}
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  IGCM_sys_RshMaster "\tar $@"
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Qsub
-#D-* Purpose: Qsub new job
-#D-* Examples:
-#D-
-function IGCM_sys_Qsub {
-  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Qsub :" $@
-  fi
-  /usr/bin/nqsII/qsub -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Qsub : erreur -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} $@."
-    IGCM_debug_Exit "IGCM_sys_Qsub"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Qsub"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-
-# ============ FRONTEND START ============ #
-
-  /usr/bin/nqsII/qsub -q scalaire -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM}/$1.job -v ${listVarEnv}
-
-# ============ FRONTEND  END  ============ #
-
-# ============ CESIUM START ============ #
-#  typeset NB_ESSAI DELAI status i
-#  # number of tentative
-#  NB_ESSAI=10
-#  # time delay between tentative
-#  DELAI=10
-#  (( i = 0 ))
-#  while [ $i -lt $NB_ESSAI ] ; do
-#    /usr/local/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.e.out -E "-v ${listVarEnv}" ${libIGCM_POST}/$1.job
-#    status=$?
-#    if [ ${status} -gt 0 ]; then
-#      sleep $DELAI
-#    else
-#      break
-#    fi
-#    (( i = i + 1 ))
-#  done 
-# ============ CESIUM  END  ============ #
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  status=$1
-  if [ ! $status ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $status in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $status in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $status
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Miror_libIGCM
-#D-* Purpose: Mirror libIGCM PATH and lib to cesium
-#D-* Examples:
-#D-
-function IGCM_sys_Mirror_libIGCM {
-  IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mirror_libIGCM"
-  fi
-
-  typeset status DEST
-
-  mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
-
-  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
-  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
-    cat out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset status
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset status
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset status
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    \cp -r $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from ${ARCHIVE}
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-#    if [ ! -d ${1} ] ; then
-#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#      return
-#    fi
-
-    typeset NB_ESSAI DELAI status i
-    # number of tentative
-    NB_ESSAI=3
-    # time delay between tentative
-    DELAI=2
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    # USUAL WAY
-    # add 'ccc_hsm get' (to demigrate all offline files) to reduce time of this command :
-    ccc_hsm get -r $1
-
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \cp -ur $1 $2 >> out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#====================================================
-#- Call IGCM_sys_Mirror_libIGCM now !
-if ( $MirrorlibIGCM ) ; then
-  IGCM_sys_Mirror_libIGCM
-fi
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on ${ARCHIVE}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Rest {
-  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Rest
-#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Rest {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Rest : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PrepareTaredRestart
-#D-* Purpose: Prepare tared restart to be access by computing job. Identity here.
-#D-* Examples:
-#D-
-function IGCM_sys_PrepareTaredRestart {
-  IGCM_debug_PushStack "IGCM_sys_PrepareTaredRestart" $@
-  echo $1
-  IGCM_debug_PopStack "IGCM_sys_PrepareTaredRestart"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    typeset WORKPATH FILEPATH
-    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH}
-    #    FILEPATH=${WORKPATH}/$( basename $2 )
-    #    #
-    #    IGCM_sys_Cp ${1} ${FILEPATH}
-    #fi
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      #dmget $2
-      ccc_hsm get $2
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Out
-#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Out {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip 
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_Mkdir $( dirname $2 )
-    #
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST dm_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      eval set +A dm_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    # Is it an R_OUT file (not R_IN) ?
-    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    # Yes  ? then we try to get it in SCRATCHDIR
-    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
-    #    if [ -f ${file_work[0]} ] ; then
-    #	IGCM_sys_Cp ${file_work[*]} ${DEST}
-    #	IGCM_debug_PopStack "IGCM_sys_Get"
-    #	return
-    #    fi
-    #fi
-
-    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      echo "WARNING IGCM_sys_Get : error code ${status}"
-      cat out_rsync
-      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
-    fi
-
-    #if [ ${status} -gt 0 ] ; then
-    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
-    #	cat out_rsync
-    #	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
-    #	sleep 30
-    #	echo "We try another time"
-    ##	dmget ${dm_liste[*]} > out_rsync 2>&1
-    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    #	status=$?
-    #	if [ ${status} -gt 0 ] ; then
-    #       echo "ERROR IGCM_sys_Get : again demigration error :"
-    #       cat out_rsync
-    #       IGCM_debug_Exit "IGCM_sys_Get"
-    #	fi
-    #    else
-    #	echo "ERROR IGCM_sys_Get : demigration error :"
-    #	cat out_rsync
-    #	IGCM_debug_Exit "IGCM_sys_Get"
-    #    fi
-    #fi
-
-    #   #RSYNC WITH NETWORK SSH CALL
-    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   #RSYNC WITH NFS USE
-    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   status=$?
-    #   IGCM_sys_Rsync_out $status
-
-    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-    #   (( status=status+$? ))
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${dm_liste[*]} ; do
-        local_file=$( basename ${target} )
-        # test if the target file is present before the loop
-        IGCM_sys_TestFileArchive ${target}
-        status=$?
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ."
-          IGCM_debug_Exit "IGCM_sys_Get"
-        else
-          i=0
-          while [ $i -lt $NB_ESSAI ] ; do
-            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-            status=$?
-            if [ ${status} -gt 0 ]; then
-              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-              sleep $DELAI
-            else
-              break
-            fi
-            (( i = i + 1 ))
-          done
-          if [ ${status} -gt 0 ] ; then
-            echo "IGCM_sys_Get : error"
-            cat out_rsync
-            \rm out_rsync
-            IGCM_debug_Exit "IGCM_sys_Get"
-          else
-            \rm out_rsync
-          fi
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_Get"
-      else
-        \rm out_rsync
-      fi
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetBuffer
-#D-* Purpose: Get a file from ${SCRATCHDIR}
-#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
-function IGCM_sys_GetBuffer {
-  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
-
-  typeset DEST buf_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetBuffer :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A buf_liste \${${2}}
-    else
-      eval set +A buf_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${buf_liste[*]} ; do
-        local_file=$( basename ${target} )
-        i=0
-        while [ $i -lt $NB_ESSAI ] ; do
-          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-          status=$?
-          if [ ${status} -gt 0 ]; then
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-            sleep $DELAI
-          else
-            break
-          fi
-          (( i = i + 1 ))
-        done
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get : error"
-          cat out_rsync
-          \rm out_rsync
-          IGCM_debug_Exit "IGCM_sys_GetBuffer"
-        else
-          \rm out_rsync
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_GetBuffer"
-      else
-        \rm out_rsync
-      fi
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( IGCM_sys_RshMaster "ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1}" )
-  eval ${2}=${dateF[5]}
-
-    # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( IGCM_sys_RshMaster "ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1}" )
-  eval ${2}=${dateF[5]}
-
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i firstArg
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-      /home/cont003/p86ipsl/SX8/bin/rebuild -f -o $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      firstArg=${1}
-      \rm ${firstArg}
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : rebuild error"
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t 
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t 
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables"
-  fi
-
-# --------------------------------------------------------------------
-#D- MPI specifications
-# --------------------------------------------------------------------
-
-#D-- MPISUSPEND
-  export MPISUSPEND=${MPISUSPEND:=OFF}
-
-#D-- MPIPROGINF #other choices : ALL_DETAIL2
-  export MPIPROGINF=ALL
-#D- activate ftrace (with -ftrace)
-  export F_FTRACE=YES
-#D- communication information (with -ftrace)
-  export MPICOMMINF=DETAIL
-
-# --------------------------------------------------------------------
-#D- Other specifications
-# --------------------------------------------------------------------
-
-#D- max number of character/line in output job
-  export F_SYSLEN=5000
-#D- number of error that can be admitted on the NEC
-  export F_ERRCNT=0
-#D- global performance
-  export F_PROGINF=DETAIL
-
-#D- I/O performance (FORTRAN I/O only not netCDF)
-  export F_FILEINF=${F_FILEINF:=NO}
-#D- netCDF I/O performance
-  export NC_FILEINF=${NC_FILEINF:=NO}
-
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables"
-  fi
-# --------------------------------------------------------------------
-#D- MPI specifications
-# --------------------------------------------------------------------
-
-#D-- MPIPROGINF
-  export MPIPROGINF=NO
-
-# --------------------------------------------------------------------
-#D- Other specifications
-# --------------------------------------------------------------------
-
-#D- global performance
-  export F_PROGINF=NO  
-
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
-############################################################
-# Build MPI/OMP scripts
-function IGCM_sys_build_execution_scripts
-{
-  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_execution_scripts " $@
-  fi
-
-  typeset NbNodes_Job NbProc_Job comp_proc_mpi_loc comp_proc_omp_loc mpi_count
-  
-  if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ]  ; then
-    IGCM_debug_Exit "IGCM_sys_mercurex9 build_execution_scripts : Job_${config_UserChoices_JobName} don't exist in SUBMIT_DIR : ${SUBMIT_DIR} "
-  fi
-
-  if ( ${OK_PARA_MPMD} ) ; then
-
-    if [ -f run_file ] ; then
-      IGCM_sys_Rm -f run_file
-    fi
-    touch run_file
-
-    if ( ${OK_PARA_OMP} ) ; then
-      IGCM_debug_Print 2 "Error in config.card on SX9 : OpenMP not available"
-      exit 1
-    else
-# OLD :
-#PBS -v BATCH_NUM_PROC_TOT=4
-#PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}
-      echo "Job_${config_UserChoices_JobName} includes BATCH_NUM_PROC_TOT = \c"
-      cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep -- "-v *BATCH_NUM_PROC_TOT" | sed -e "s/.*BATCH_NUM_PROC_TOT *= *//" 
-      NbProc_Job=$( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep -- "-v *BATCH_NUM_PROC_TOT" | sed -e "s/.*BATCH_NUM_PROC_TOT *= *//" )
-      NbProc_Job=${NbProc_Job:=0}
-      if [ ${NbProc_Job} -eq 0 ] ; then
-	IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no BATCH_NUM_PROC_TOT defined with MPI only run."
-	exit 1
-      fi
-    fi
-
-# run_file construction
-
-# Then first loop on the components for the coupler ie oasis
-
-### the coupler ie oasis must be the first one
-    for comp in ${config_ListOfComponents[*]} ; do
-      
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-      
-      # for CPL component only
-      if [ "X${comp}" = "XCPL" ] ; then
-
-	eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-	eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-	
-	if ( ${OK_PARA_MPI} ) ; then 
-	  echo "-p ${comp_proc_mpi_loc} -e ./${ExeNameOut}" >> run_file 
-	fi
-      fi
-    done
-
-# Then second loop on the components
-
-    for comp in ${config_ListOfComponents[*]} ; do
-      
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-      
-      # Only if we really have an executable for the component and not the coupler ie oasis:
-      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
-
-	eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-	eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-	
-	if ( ${OK_PARA_MPI} ) ; then 
-	  echo "-p ${comp_proc_mpi_loc} -e ./${ExeNameOut}" >> run_file 
-	fi
-      fi
-    done
-
-    EXECUTION="${HOST_MPIRUN_COMMAND} -f ./run_file"
-
-    IGCM_sys_Chmod u+x run_file
-    if ( $DEBUG_sys ) ; then
-      echo "run_file contains : "
-      cat run_file
-    fi
-
-  else # Only one executable. launch it.
-
-    for comp in ${config_ListOfComponents[*]} ; do
-
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
-        EXECUTION="time mpirun -np ${BATCH_NUM_PROC_TOT} ./${ExeNameOut}"
-      fi
-    done
-
-  fi
-
-  IGCM_debug_Print 1 "sys mercurex9 : execution command is "
-  IGCM_debug_Print 1 "$EXECUTION"
-
-  IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
-
-}
-
-function IGCM_sys_build_run_file {
-
-IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "
-
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-  IGCM_debug_PushStack "IGCM_sys_check_quota" 
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_check_quota "
-  fi
-  # Limit of quota (in %)
-  limit_quota=95
-
-  # Check of the volume (use of RshMaster waiting for ccc_quota command available on SX9 nodes)
-#  volume_quota=$( IGCM_sys_RshMaster "/applications/ccc-tools/ccc_quota | grep ' scratch' | awk '{print \$2}'" )
-#  volume_avail=$( IGCM_sys_RshMaster "/applications/ccc-tools/ccc_quota | grep ' scratch' | awk '{print \$3}'" )
-
-  volume_quota=$(quota -h | grep 'scratch' | awk '{print $2}')
-  volume_avail=$(quota -h | grep 'scratch' | awk '{print $3}')
-
-  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
-
-    unit_quota=$( echo $volume_quota | awk '{print(substr($0, length($0), length($0)))}' )
-    unit_avail=$( echo $volume_avail | awk '{print(substr($0, length($0), length($0)))}' )
-
-    if [ "${unit_quota}" = "*" ] ; then
-	IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
-	IGCM_debug_Print 1 "More than 100% of your quota is used"
-	IGCM_debug_Print 1 "Use the ccc_quota command to check"
-	IGCM_debug_Print 1 "You must have more than 10% available to run"
-	IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-	IGCM_debug_Verif_Exit
-    fi
-
-    temp_avail=${volume_avail%%${unit_avail}*}
-    temp_quota=${volume_quota%%${unit_quota}*}
-
-    if [ ! ${unit_avail} = ${unit_quota} ] ; then
-
-    # Convertion
-      if [ ${unit_avail} = "T" ] ; then
-	  (( temp_avail = temp_avail * 1000000000000 ))
-      elif [ ${unit_avail} = "G" ] ; then
-	  (( temp_avail = temp_avail * 1000000000 ))
-      elif [ ${unit_avail} = "M" ] ; then
-	  (( temp_avail = temp_avail * 1000000 ))
-      elif [ ${unit_avail} = "k" ] ; then
-	  (( temp_avail = temp_avail * 1000 ))
-      else
-	  (( temp_avail = volume_avail ))
-      fi
-      if [ ${unit_quota} = "T" ] ; then
-	  (( temp_quota = temp_quota * 1000000000000 ))
-      elif [ ${unit_quota} = "G" ] ; then
-	  (( temp_quota = temp_quota * 1000000000 ))
-      elif [ ${unit_quota} = "M" ] ; then
-	  (( temp_quota = temp_quota * 1000000 ))
-      elif [ ${unit_quota} = "k" ] ; then
-	  (( temp_quota = temp_quota * 1000 ))
-      else
-	  (( temp_quota = volume_quota ))
-      fi
-    fi
-
-    quota_volume=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
-#    echo "volume ratio is " $quota_volume
-
-    if [ ${quota_volume} -ge ${limit_quota} ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
-      IGCM_debug_Print 1 "${quota_volume}% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      IGCM_debug_Print 1 "You must have more than 10% available to run"
-      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-      IGCM_debug_Verif_Exit
-    fi
-
-  fi
-  IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 909)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 912)
@@ -1250,5 +1250,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A dm_liste \${${2}}
     else
@@ -1303,5 +1302,4 @@
   if [ $DRYRUN -le 2 ]; then
     if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
       eval set +A buf_liste \${${2}}
     else
@@ -1547,5 +1545,5 @@
     # Array containing Station as a number
 #    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
+#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | gawk ' {print $2}' )
     # Number of stations produced by processor proc
 #    stationLast=${#proc_stn[*]}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 909)
+++ 	(revision )
@@ -1,2968 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sebastien Denvil, Martial Mancip, Arnaud Caubel
-# Contact: Arnaud.Caubel__at__lsce.ipsl.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Titane
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-# $hostname of the MASTER job
-typeset MASTER=titane
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# Submit command
-typeset SUBMIT=${SUBMIT:=ccc_msub}
-# rsync with path
-typeset -r RSYNC=/usr/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-va"
-# ie storage filesystem
-typeset -r STOREHOST=${MASTER}
-
-#====================================================
-# Source default environment
-#====================================================
-. /etc/profile
-
-#====================================================
-# Set environment tools (ferret, nco, cdo)
-#====================================================
-. /home/cont003/p86ipsl/.atlas_env_titane_ksh
-if ( [ X${LSB_QUEUE} = Xmono ] || [ X${LSB_QUEUE} = Xmonoext ] ) ; then
-  module switch nco/3.9.4 nco/3.9.4_netcdf4
-fi
-
-#====================================================
-# Specific for ocean additionnal diagnostic
-export FER_GO="$FER_GO /home/cont003/p86denv/IGCM_POST_UTIL/JNL /home/cont003/p86denv/GRAF /home/cont003/p86denv/GRAF/GO"
-export FER_PALETTE="$FER_PALETTE /home/cont003/p86denv/GRAF/PALET"
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-# ============ CESIUM START ============ #
-
-#====================================================
-#- Mirror libIGCM from titane to cesium if needed
-#ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $3}' )
-#if [ ! ${ROOTSYS} = "home" ] ; then
-#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
-#else
-#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
-#fi
-
-#====================================================
-#- libIGCM_POST
-#if ( ${MirrorlibIGCM} ) ; then
-#  PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
-#  typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM
-#else
-#  typeset -r libIGCM_POST=${libIGCM}
-#fi
-
-# ============ CESIUM  END  ============ #
-
-#====================================================
-#- MirrorlibIGCM for frontend
-typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
-
-#====================================================
-#- libIGCM_POST for frontend
-typeset -r libIGCM_POST=${libIGCM}
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${LS_SUBCWD}}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/ccc/work/cont003/dsm/p24data}
-
-#====================================================
-#- ARCHIVE (dedicated to large files)
-typeset ARCHIVE=${CCCSTOREDIR}
-
-#====================================================
-#- STORAGE (dedicated to small/medium files)
-typeset STORAGE=${CCCWORKDIR}
-
-#====================================================
-#- R_OUT
-typeset R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
-typeset R_FIG=${STORAGE}/IGCM_OUT
-
-#====================================================
-#- R_BUF (ONLY FOR double copy an scratch)
-typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-if ( [ ! X${LSB_QUEUE} = Xmono ] && [ ! X${LSB_QUEUE} = Xmonoext ] ) ; then
-  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/RUN_DIR/${LSB_JOBID}}
-else
-  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/TMPDIR_IGCM/${LSB_JOBID}}
-fi
-
-#====================================================
-#- HOST_MPIRUN_COMMAND
-typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="time mpirun"}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=360
-
-#====================================================
-#- set PackDefault true on titane
-PackDefault=true
-
-#====================================================
-#- Number of core per node (max number of OpenMP task)
-NUM_COREPERNODE=8
-
-#====================================================
-#- Default number of MPI task for IPSL coupled model
-#- required for backward compatibility
-#-
-DEFAULT_NUM_PROC_OCE=5
-DEFAULT_NUM_PROC_CPL=1
-(( DEFAULT_NUM_PROC_ATM = BATCH_NUM_PROC_TOT - DEFAULT_NUM_PROC_OCE - DEFAULT_NUM_PROC_CPL ))
-DEFAULT_NUM_PROC_TOTAL=${BATCH_NUM_PROC_TOT}
-
-#D-#==================================================
-#D-function IGCM_sys_ChangeArchive
-#D-* Purpose: if SpaceName=TEST everything is stored on SCRATCHDIR
-#D-* Examples:
-#D-
-function IGCM_sys_ChangeArchive {
-  IGCM_debug_PushStack "IGCM_sys_ChangeArchive"
-
-  R_OUT=${SCRATCHDIR}/IGCM_OUT
-  R_FIG=${SCRATCHDIR}/IGCM_OUT
-
-  IGCM_debug_Print 1 "R_OUT   has been redefined = ${R_OUT}"
-  IGCM_debug_Print 1 "R_FIG   has been redefined = ${R_FIG}"
-
-  IGCM_debug_PopStack "IGCM_sys_ChangeArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Connection to frontend machine.
-#D-* Examples:
-#D-
-function IGCM_sys_RshMaster {
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  /bin/ksh <<-EOF
-    export libIGCM=${libIGCM}
-    export DEBUG_debug=${DEBUG_debug}
-    . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
-    . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshMaster : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshMaster"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Post-process rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-
-  #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL
-  #cat tmp_IGCM_sys_RshPost_$$
-  # keep standard input (stdin) for the loop onto temporary file
-  cat >tmp_IGCM_sys_RshPost_$$
-
-# ============ FRONTEND START ============ #
-
-  /bin/ksh <tmp_IGCM_sys_RshPost_$$
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshPost : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshPost"
-  fi
-  # delete temporary file
-  \rm tmp_IGCM_sys_RshPost_$$
-
-# ============ FRONTEND  END  ============ #
-
-# ============ CESIUM START ============ #
-#  typeset NB_ESSAI DELAI status i
-#  if [ "X$( grep rebuild_from tmp_IGCM_sys_RshPost_$$ )" != "X" ] ; then
-#    #little hack so that rebuild submission is done on titane not an cesium
-#
-#    libIGCM_POST_sed=$( echo $libIGCM_POST | sed 's/\//\\\//g' )
-#    POST_DIR_sed=$( echo ${POST_DIR} | sed 's/\//\\\//g' )
-#    sed "s/IGCM_sys_QsubPost/IGCM_sys_Qsub/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt
-#    sed "s/ rebuild_fromWorkdir/ ${libIGCM_POST_sed}\/rebuild_fromWorkdir.job/g" tmp.txt > tmp_IGCM_sys_RshPost_$$
-#    sed "s/ rebuild_fromArchive/ ${libIGCM_POST_sed}\/rebuild_fromArchive.job/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt
-#    sed "s/Script_Post_Output=/Script_Output=${POST_DIR_sed}\//g" tmp.txt > tmp_IGCM_sys_RshPost_$$
-#    \mv tmp.txt tmp_IGCM_sys_RshPost_$$
-#
-#    echo cat tmp_IGCM_sys_RshPost_$$ AFTER
-#    cat tmp_IGCM_sys_RshPost_$$
-#
-#    /bin/ksh <tmp_IGCM_sys_RshPost_$$
-#    if [ $? -gt 0 ] ; then
-#      echo "IGCM_sys_RshPost : erreur."
-#      IGCM_debug_Exit "IGCM_sys_RshPost"
-#    fi
-#    # delete temporary file
-#    \rm tmp_IGCM_sys_RshPost_$$
-#
-#  else
-#    # number of tentative
-#    NB_ESSAI=10
-#    # time delay between tentative
-#    DELAI=10
-#    i=0
-#    while [ $i -ne $NB_ESSAI ] ; do
-#      ssh -t titane996 ssh cesium /bin/ksh <tmp_IGCM_sys_RshPost_$$
-#      status=$?
-#      if [ ${status} -ne 0 ];
-#      then
-#	sleep $DELAI
-#      else
-#	break
-#      fi
-#      let i=$i+1
-#    done
-#    # delete temporary file
-#    \rm tmp_IGCM_sys_RshPost_$$
-#
-#    if [ ${status} -gt 0 ] ; then
-#      echo "IGCM_sys_RshPost : erreur."
-#      IGCM_debug_Exit "IGCM_sys_RshPost"
-#    fi
-#  fi
-
-# ============ CESIUM  END  ============ #
-
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-    if [ ! -z ${config_UserChoices_MailName} ] ; then
-        mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
-    elif [ -f ~/.forward ] ; then
-        mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-    fi
-    sleep 10
-    rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Mkdir : erreur."
-      IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-  fi
-  # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirArchive : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_IsFileArchived
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_IsFileArchived {
-  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_IsFileArchived :" $@
-  fi
-  typeset IsArchivedFlag
-  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
-
-  return ${IsArchivedFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileBuffer
-#D-* Purpose: Test file that must NOT EXISTS on Buffer
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileBuffer
-#D-* Purpose: Count files on Scratch filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileBuffer : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \ls -lR ${@}
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  \tar cf $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Qsub
-#D-* Purpose: Qsub new job
-#D-* Examples:
-#D-
-function IGCM_sys_Qsub {
-  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Qsub :" $@
-  fi
-  typeset options
-  if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then
-    options=" -o ${SUBMIT_DIR}/${Script_Output} -e ${SUBMIT_DIR}/${Script_Output}"
-  else
-    options=" -o ${SUBMIT_DIR}/${Script_Output} -e ${SUBMIT_DIR}/${Script_Output} -r ${config_UserChoices_JobName}.${CumulPeriod}"
-  fi
-
-  /usr/local/bin/ccc_msub ${options} < $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Qsub : erreur ${options} $1"
-    IGCM_debug_Exit "IGCM_sys_Qsub"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Qsub"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-
-  # Need to export listVarEnv for cesium
-  # NO Need to export listVarEnv for titane
-# ============ FRONTEND START ============ #
-
-  /usr/local/bin/ccc_msub -p ${BRIDGE_MSUB_PROJECT} -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job
-
-# ============ FRONTEND  END  ============ #
-
-# ============ CESIUM START ============ #
-#  typeset NB_ESSAI DELAI status i
-#  # number of tentative
-#  NB_ESSAI=10
-#  # time delay between tentative
-#  DELAI=10
-#  (( i = 0 ))
-#  while [ $i -lt $NB_ESSAI ] ; do
-#    /usr/local/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.e.out -E "-v ${listVarEnv}" ${libIGCM_POST}/$1.job
-#    status=$?
-#    if [ ${status} -gt 0 ]; then
-#      sleep $DELAI
-#    else
-#      break
-#    fi
-#    (( i = i + 1 ))
-#  done
-# ============ CESIUM  END  ============ #
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  status=$1
-  if [ ! $status ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $status in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $status in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $status
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Miror_libIGCM
-#D-* Purpose: Mirror libIGCM PATH and lib to cesium
-#D-* Examples:
-#D-
-function IGCM_sys_Mirror_libIGCM {
-  IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mirror_libIGCM"
-  fi
-
-  typeset status DEST
-
-  mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
-
-  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
-  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
-    cat out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset status
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RmRunDir
-#D-* Purpose: rm tmpdir (dummy function most of the time batch
-#D-                      scheduler will do the job)
-#D-* Examples:
-#D-
-function IGCM_sys_RmRunDir {
-  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RmRunDir :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_RmRunDir : error code ${status}"
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_RmRunDir"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset status
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset status
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    \cp -r $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from ${ARCHIVE}
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-#    if [ ! -d ${1} ] ; then
-#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#      return
-#    fi
-
-    typeset NB_ESSAI DELAI status i
-    # number of tentative
-    NB_ESSAI=3
-    # time delay between tentative
-    DELAI=2
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    # USUAL WAY
-    # add dmfind/dmget (to demigrate all offline files) :
-    #dmfind $1 -state MIG -o -state OFL -o -state PAR | dmget
-    ccc_hsm get -r $1
-
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \cp -ur $1 $2 >> out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Master
-#D-* Purpose: Copy a complete directory from MASTER filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Master {
-  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Master :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if ( [ ! -d ${1} ] && [ ! -f ${1} ] ) ; then
-      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Get_Master"
-      return
-    fi
-
-    typeset NB_ESSAI DELAI status i
-    # number of tentative
-    NB_ESSAI=3
-    # time delay between tentative
-    DELAI=2
-
-    i=0
-    while [ $i -lt $NB_ESSAI ] ; do
-      \cp -urL $1 $2 > out_rsync 2>&1
-      status=$?
-      if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed error code ${status} ${i}/${NB_ESSAI}"
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again."
-        sleep $DELAI
-      else
-        break
-      fi
-      (( i = i + 1 ))
-    done
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Master : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Master"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Master"
-}
-
-#====================================================
-#- Call IGCM_sys_Mirror_libIGCM now !
-if ( $MirrorlibIGCM ) ; then
-  IGCM_sys_Mirror_libIGCM
-fi
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on ${ARCHIVE}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Rest {
-  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Rest
-#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Rest {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Rest : error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PrepareTaredRestart
-#D-* Purpose: Prepare tared restart to be access by computing job. Identity here.
-#D-* Examples:
-#D-
-function IGCM_sys_PrepareTaredRestart {
-  IGCM_debug_PushStack "IGCM_sys_PrepareTaredRestart" $@
-  echo $1
-  IGCM_debug_PopStack "IGCM_sys_PrepareTaredRestart"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    typeset WORKPATH FILEPATH
-    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH}
-    #    FILEPATH=${WORKPATH}/$( basename $2 )
-    #    #
-    #    IGCM_sys_Cp ${1} ${FILEPATH}
-    #fi
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      #dmget $2
-      ccc_hsm get $2
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
-          if [ -f $2 ] ; then
-            if [ "X$( diff $1 $2 )" = X ] ; then
-              IGCM_debug_Print 2 "$1 and $2 are the same file"
-              IGCM_debug_Print 2 "Cp gave an error but the file has been copied properly!"
-              status=0
-              \rm out_rsync
-              break
-            else
-              IGCM_debug_Print 2 "$1 and $2 are not the same file, we continue to try"
-              \rm $2
-            fi
-          fi
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Out"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Out
-#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Out {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Out :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i exist skip
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_Mkdir $( dirname $2 )
-    #
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-
-    exist=false
-    skip=false
-    if [ -f $2 ] ; then
-      IGCM_debug_Print 1 "$2 already exist"
-      exist=true
-      if [ "X$( diff $1 $2 )" = X ] ; then
-        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
-        skip=true
-      else
-        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
-        skip=false
-      fi
-    fi
-    #
-    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
-      IGCM_sys_Chmod u+w $2
-    fi
-
-    if [ X${skip} = Xfalse ] ; then
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-    fi
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
-    else
-      \rm out_rsync
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST dm_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      eval set +A dm_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    # Is it an R_OUT file (not R_IN) ?
-    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    # Yes  ? then we try to get it in SCRATCHDIR
-    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
-    #    if [ -f ${file_work[0]} ] ; then
-    #	IGCM_sys_Cp ${file_work[*]} ${DEST}
-    #	IGCM_debug_PopStack "IGCM_sys_Get"
-    #	return
-    #    fi
-    #fi
-
-    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      echo "WARNING IGCM_sys_Get : error code ${status}"
-      cat out_rsync
-      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
-    fi
-
-    #if [ ${status} -gt 0 ] ; then
-    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
-    #	cat out_rsync
-    #	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
-    #	sleep 30
-    #	echo "We try another time"
-    ##	dmget ${dm_liste[*]} > out_rsync 2>&1
-    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-    #	status=$?
-    #	if [ ${status} -gt 0 ] ; then
-    #       echo "ERROR IGCM_sys_Get : again demigration error :"
-    #       cat out_rsync
-    #       IGCM_debug_Exit "IGCM_sys_Get"
-    #	fi
-    #    else
-    #	echo "ERROR IGCM_sys_Get : demigration error :"
-    #	cat out_rsync
-    #	IGCM_debug_Exit "IGCM_sys_Get"
-    #    fi
-    #fi
-
-    #   #RSYNC WITH NETWORK SSH CALL
-    #   echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   #RSYNC WITH NFS USE
-    #   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-    #   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-    #   status=$?
-    #   IGCM_sys_Rsync_out $status
-
-    #   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-    #   (( status=status+$? ))
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${dm_liste[*]} ; do
-        local_file=$( basename ${target} )
-        # test if the target file is present before the loop
-        IGCM_sys_TestFileArchive ${target}
-        status=$?
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ."
-          IGCM_debug_Exit "IGCM_sys_Get"
-        else
-          i=0
-          while [ $i -lt $NB_ESSAI ] ; do
-            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-            status=$?
-            if [ ${status} -gt 0 ]; then
-              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-              sleep $DELAI
-            else
-              break
-            fi
-            (( i = i + 1 ))
-          done
-          if [ ${status} -gt 0 ] ; then
-            echo "IGCM_sys_Get : error"
-            cat out_rsync
-            \rm out_rsync
-            IGCM_debug_Exit "IGCM_sys_Get"
-          else
-            \rm out_rsync
-          fi
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_Get"
-      else
-        \rm out_rsync
-      fi
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetBuffer
-#D-* Purpose: Get a file from ${SCRATCHDIR}
-#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
-function IGCM_sys_GetBuffer {
-  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
-
-  typeset DEST buf_liste ifile target file_work
-  typeset NB_ESSAI DELAI status i
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetBuffer :" $@
-  fi
-
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A buf_liste \${${2}}
-    else
-      eval set +A buf_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      for target in ${buf_liste[*]} ; do
-        local_file=$( basename ${target} )
-        i=0
-        while [ $i -lt $NB_ESSAI ] ; do
-          \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-          status=$?
-          if [ ${status} -gt 0 ]; then
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-            IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-            sleep $DELAI
-          else
-            break
-          fi
-          (( i = i + 1 ))
-        done
-        if [ ${status} -gt 0 ] ; then
-          echo "IGCM_sys_Get : error"
-          cat out_rsync
-          \rm out_rsync
-          IGCM_debug_Exit "IGCM_sys_GetBuffer"
-        else
-          \rm out_rsync
-        fi
-      done
-    else
-      i=0
-      while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
-        status=$?
-        if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : cp failed error code ${status} ${i}/${NB_ESSAI}"
-          IGCM_debug_Print 2 "IGCM_sys_GetBuffer : sleep ${DELAI} seconds and try again."
-          sleep $DELAI
-        else
-          break
-        fi
-        (( i = i + 1 ))
-      done
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Get : error"
-        cat out_rsync
-        \rm out_rsync
-        IGCM_debug_Exit "IGCM_sys_GetBuffer"
-      else
-        \rm out_rsync
-      fi
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
-
-    # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
-
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Rm
-#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Rm {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Rm :" $@
-  fi
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
-    status=$?
-
-#	if [ ${status} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Rm : error."
-#           cat out_dods_rm
-#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
-#	else
-#           rm out_dods_rm
-#	fi
-
-  fi
-  return $status
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Dods_Cp
-#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Dods_Cp {
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Dods_Cp :" $@
-  fi
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-
-#    if [ ! -d ${R_SAVE}/${1} ] ; then
-#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-#      echo "Nothing has been done."
-#      return
-#    fi
-
-    /ccc/cont003/home/dsm/p86ipsl/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
-    status=$?
-
-#       if [ ${status} -gt 0 ] ; then
-#           echo "IGCM_sys_Dods_Cp : error."
-#           cat out_dods_cp
-#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
-#       else
-#           rm out_dods_cp
-#       fi
-
-  fi
-  return $status
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dods
-#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dods {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dods :" $@
-  fi
-  #set -vx
-  typeset status
-  if [ $DRYRUN = 0 ]; then
-    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-
-    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
-      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
-      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-    #
-    if [ -d ${R_SAVE}/${1} ] ; then
-      cd ${R_SAVE}
-    elif [ -d ${R_FIGR}/${1} ] ; then
-      cd ${R_FIGR}
-    fi
-
-    IGCM_sys_Dods_Rm ${1}
-    IGCM_sys_Dods_Cp ${1}
-    status=0
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dods : error."
-      IGCM_debug_Exit "IGCM_sys_Put_Dods"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i firstArg
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-      /home/cont003/p86ipsl/X64/bin/rebuild -f -o $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_rebuild : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      firstArg=${1}
-      \rm ${firstArg}
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : rebuild error"
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables"
-  fi
-
-  ulimit -s unlimited
-
-  export KMP_STACKSIZE=3g
-  export KMP_LIBRARY=turnaround
-  export MKL_SERIAL=YES
-  unset MPI_PLACING_MODE
-
-  # add module load nb of threads for core placement
-  (( max_omp = 0 ))
-
-  for comp in ${config_ListOfComponents[*]} ; do
-    eval ExeNameIn=\${config_Executable_${comp}[0]}
-    eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-    # Only if we really have an executable for the component :
-    if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" != "XCPL" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
-      eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-      if [ ${comp_proc_omp_loc} -gt ${max_omp} ] ; then
-        (( max_omp = comp_proc_omp_loc ))
-      fi
-    fi
-  done
-
-  ( [ X${max_omp} = X4 ] || [ X${max_omp} = X8 ] ) &&  { module load openmp/${max_omp}thds ; IGCM_debug_Print 1 "module load openmp/${max_omp}thds" ; }
-
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
-############################################################
-# Build MPI/OMP scripts run file (dummy function)
-
-function IGCM_sys_build_run_file {
-
-IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "
-
-}
-
-############################################################
-# Build MPI/OMP scripts
-function IGCM_sys_build_execution_scripts
-{
-  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_execution_scripts " $@
-  fi
-  typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut
-  typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc
-  typeset num_corempi nombre_restant_node nombre_restant_comp
-  typeset IGCM_OMP
-
-  if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ]  ; then
-    IGCM_debug_Exit "IGCM_sys_titane build_execution_scripts : Job_${config_UserChoices_JobName} doesn't exist in SUBMIT_DIR : ${SUBMIT_DIR} "
-  fi
-
-  if ( ${OK_PARA_MPMD} ) ; then
-
-    if [ -f run_file ] ; then
-      IGCM_sys_Rm -f run_file
-    fi
-    touch run_file
-
-    if ( ${OK_PARA_OMP} ) ; then
-
-      #  Hosts treatment
-
-      ${HOST_MPIRUN_COMMAND} hostname | sort | uniq > hosts.tmp
-
-      i=0
-      rm -f hosts
-      IGCM_debug_Print 1 "sys Titane, Hosts avaible :"
-      for nodes in `cat hosts.tmp` ; do
-        host[$i]=$nodes
-        echo "${host[$i]} slots=8 max_slots=8" >> hosts
-        IGCM_debug_Print 1 ${host[$i]}
-        i=$((i+1))
-      done
-      rm -f hosts.tmp
-
-      listnodes=${host[*]}
-
-      EXECUTION="${HOST_MPIRUN_COMMAND} -hostfile hosts"
-
-      # Initialisation
-
-      init_node=y
-      node_num_current=0
-      start_num=0
-      init_exec=n
-
-      # Test : if oasis is there, we put it at the first position
-
-      for comp in ${config_ListOfComponents[*]} ; do
-
-        if [ "X${comp}" = "XCPL" ]  ; then
-
-          eval ExeNameIn=\${config_Executable_${comp}[0]}
-          eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-          echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
-          echo ""  >> script_${ExeNameOut}.ksh
-          echo "export KMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh
-          echo "export KMP_LIBRARY=turnaround"  >> script_${ExeNameOut}.ksh
-          echo "export MKL_SERIAL=YES"  >> script_${ExeNameOut}.ksh
-          echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err"  >> script_${ExeNameOut}.ksh
-          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-
-          init_node=n
-
-          (( nombre_restant_node = NUM_COREPERNODE - 1 ))
-          node_num_current=0
-          node_current=${host[${node_num_current}]}
-
-          EXECUTION="${EXECUTION} -H ${node_current} -np 1 ./script_${ExeNameOut}.ksh"
-
-          init_exec=y
-          start_num=1
-
-        fi
-
-      done
-
-      # Then loop on the components (except for oasis)
-
-      for comp in ${config_ListOfComponents[*]} ; do
-
-        eval ExeNameIn=\${config_Executable_${comp}[0]}
-        eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-        # Only if we really have an executable for the component :
-        if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" != "XCPL" ] ) ; then
-
-          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-          eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-
-          echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
-          # echo "set -vx" >> script_${ExeNameOut}.ksh
-          echo ""  >> script_${ExeNameOut}.ksh
-          echo "export KMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh
-          echo "export KMP_LIBRARY=turnaround"  >> script_${ExeNameOut}.ksh
-          echo "export MKL_SERIAL=YES"  >> script_${ExeNameOut}.ksh
-          echo "export OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh
-          echo "(( MYMPIRANK = OMPI_COMM_WORLD_RANK - ${start_num})) " >>  script_${ExeNameOut}.ksh
-          echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}"  >> script_${ExeNameOut}.ksh
-          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-
-          node_num=0
-
-          # We define the number of MPI process to be assigned for the component
-
-          nombre_restant_comp=${comp_proc_mpi_loc}
-
-          # Loop on the allocated nodes
-
-          for node in ${listnodes} ; do
-
-            # We go to the current node
-            if [ ${node_num} = ${node_num_current} ] ; then
-
-              node_current=${host[${node_num_current}]}
-
-              # If first time on the node : initialisation
-
-              if [ ${init_node} = y ] ; then
-                nombre_restant_node=${NUM_COREPERNODE}
-              fi
-
-              # Test on the number of OMP threads
-
-              if [ ${comp_proc_omp_loc} -gt ${nombre_restant_node} ] ; then
-                (( node_num = node_num + 1 ))
-                node_num_current=${node_num}
-                init_node=y
-                continue
-              fi
-
-              # Number of MPI process to assign
-
-              (( num_corempi = nombre_restant_node / comp_proc_omp_loc ))
-
-              if [ ${num_corempi} -gt ${nombre_restant_comp} ] ; then
-                num_corempi=${nombre_restant_comp}
-              fi
-
-              (( nombre_restant_node = nombre_restant_node - num_corempi * comp_proc_omp_loc ))
-              (( nombre_restant_comp = nombre_restant_comp - num_corempi ))
-
-              if [ ${init_exec} = y ] ; then
-                EXECUTION="${EXECUTION} : -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh"
-              else
-                EXECUTION="${EXECUTION} -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh"
-                init_exec=y
-              fi
-
-              ((  start_num = num_corempi + start_num ))
-
-            else
-
-              (( node_num = node_num + 1 ))
-              continue
-            fi
-
-            # Test on the number of core/process remaining on the node/component
-
-            if [ ${nombre_restant_node} = 0 ] ; then
-              (( node_num = node_num + 1 ))
-              node_num_current=${node_num}
-              init_node=y
-
-              if [ ${nombre_restant_comp} = 0 ] ; then
-                break 1
-              fi
-            else
-
-              node_num_current=${node_num}
-              init_node=n
-
-              if [ ${nombre_restant_comp} = 0 ] ; then
-                break 1
-              fi
-            fi
-          done
-        fi
-      done
-
-    else
-
-        # Then first loop on the components for the coupler ie oasis
-
-        ## the coupler ie oasis must be the first one
-        for comp in ${config_ListOfComponents[*]} ; do
-
-            eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-        # for CPL component only
-            if [ "X${comp}" = "XCPL" ] ; then
-                eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-                echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file
-            fi
-        done
-
-        # Then second loop on the components
-
-        for comp in ${config_ListOfComponents[*]} ; do
-
-            eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-            # Only if we really have an executable for the component and not the coupler ie oasis:
-            if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
-                eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-                echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
-            fi
-        done
-        IGCM_sys_Chmod u+x run_file
-
-        EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file"
-
-    fi
-
-  else # Only one executable.
-      # Check has to be added with :
-      # Job :
-      # #MSUB -n 8 # reservation des processeurs pour le job
-      # #MSUB -N 4 # reservation des nodes pour le job
-      # BATCH_NUM_PROC_TOT=32
-      #
-      # config.card :
-      # ATM= (gcm.e, lmdz.x, 8MPI, 4OMP)
-      #
-      # tested with :
-      # Job :
-      # #MSUB -n 32
-      # BATCH_NUM_PROC_TOT=32
-      #
-      # config.card :
-      # ATM= (gcm.e, lmdz.x)
-
-
-      for comp in ${config_ListOfComponents[*]} ; do
-
-          # Only if we really have an executable for the component :
-          eval ExeNameOut=\${config_Executable_${comp}[1]}
-###       if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then
-          if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
-
-              IGCM_OMP=1
-
-              if ( ${OK_PARA_OMP} ) ; then
-                  eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-                  export OMP_NUM_THREADS=${comp_proc_omp_loc}
-                  IGCMG_OMP=${comp_proc_omp_loc}
-              fi
-              if  ( ${OK_PARA_MPI} ) ; then
-                  eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-                  # Default : mpirun used if nb_proc gt 1
-                  # pour sortie out/err par process ? more test required
-                  # echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}"  >> script_${ExeNameOut}.ksh
-                  EXECUTION="${HOST_MPIRUN_COMMAND} -np ${comp_proc_mpi_loc} ./${ExeNameOut}"
-              else
-                  # Check if BATCH_NUM_PROC_TOT = IGCMG_OMP
-                  if ( [  ${IGCM_OMP} -ne ${BATCH_NUM_PROC_TOT} ] ) ; then
-                      IGCM_debug_Print 1 "sys Titane : BATCH_NUM_PROC_TOT <> ${comp}_PROC_OMP : ${BATCH_NUM_PROC_TOT} <> ${BRIDGE_MSUB_NPROC} "
-                      IGCM_debug_Print 1 "sys Titane : Check #MSUB -n xx into Job"
-                      IGCM_debug_Exit "IGCM_sys_build_execution_scripts"
-                  fi
-                  # Default : mpirun is NOT used if nb_proc eq 1
-                  # pour sortie out/err par process ? more test required
-                  # echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh
-                  EXECUTION="/usr/bin/time ./${ExeNameOut}"
-              fi
-          fi
-      done
-
-  fi
-
-  IGCM_debug_Print 1 "sys Titane : La commande d execution est "
-  IGCM_debug_Print 1 "$EXECUTION"
-
-  IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-  IGCM_debug_PushStack "IGCM_sys_check_quota"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_check_quota "
-  fi
-  # Limit of quota (in %)
-  limit_quota=90
-
-  # Check of the volume
-  volume_quota=$(ccc_quota | grep ' scratch' | awk '{print $2}')
-  volume_avail=$(ccc_quota | grep ' scratch' | awk '{print $3}')
-
-  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
-
-    unit_avail=${volume_avail: -1}
-    unit_quota=${volume_quota: -1}
-
-    if [ "${unit_quota}" = "*" ] ; then
-        IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
-        IGCM_debug_Print 1 "More than 100% of your quota is used"
-        IGCM_debug_Print 1 "Use the ccc_quota command to check"
-        IGCM_debug_Print 1 "You must have more than 10% available to run"
-        IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-        IGCM_debug_Verif_Exit
-    fi
-
-    temp_avail=${volume_avail%%${volume_avail: -1}*}
-    temp_quota=${volume_quota%%${volume_quota: -1}*}
-
-    if [ ! ${unit_avail} = ${unit_quota} ] ; then
-
-    # Convertion
-      if [ ${volume_avail: -1} = "T" ] ; then
-        (( temp_avail = temp_avail * 1000000000000 ))
-      elif [ ${volume_avail: -1} = "G" ] ; then
-        (( temp_avail = temp_avail * 1000000000 ))
-      elif [ ${volume_avail: -1} = "M" ] ; then
-        (( temp_avail = temp_avail * 1000000 ))
-      elif [ ${volume_avail: -1} = "k" ] ; then
-        (( temp_avail = temp_avail * 1000 ))
-      else
-        (( temp_avail = volume_avail ))
-      fi
-      if [ ${volume_quota: -1} = "T" ] ; then
-        (( temp_quota = temp_quota * 1000000000000 ))
-      elif [ ${volume_quota: -1} = "G" ] ; then
-        (( temp_quota = temp_quota * 1000000000 ))
-      elif [ ${volume_quota: -1} = "M" ] ; then
-        (( temp_quota = temp_quota * 1000000 ))
-      elif [ ${volume_quota: -1} = "k" ] ; then
-        (( temp_quota = temp_quota * 1000 ))
-      else
-        (( temp_quota = volume_quota ))
-      fi
-    fi
-
-    quota_volume=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
-#    echo "volume ratio is " $quota_volume
-
-    if [ ${quota_volume} -ge ${limit_quota} ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
-      IGCM_debug_Print 1 "${quota_volume}% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      IGCM_debug_Print 1 "You must have more than 10% available to run"
-      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-      IGCM_debug_Verif_Exit
-    fi
-
-  fi
-
-# Check of the number of inodes
-
-  inode_quota=$(ccc_quota | grep ' scratch' | awk '{print $6}')
-  inode_avail=$(ccc_quota | grep ' scratch' | awk '{print $7}')
-
-  if ( [ ! X${inode_quota} = X ] && [ ! ${inode_quota} = "-" ] ) ; then
-
-    unit_avail=${inode_avail: -1}
-    unit_quota=${inode_quota: -1}
-
-    if [ "${unit_quota}" = "*" ] ; then
-        IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
-        IGCM_debug_Print 1 "More than 100% of your quota is used"
-        IGCM_debug_Print 1 "Use the ccc_quota command to check"
-        IGCM_debug_Print 1 "You must have more than 10% available to run"
-        IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-        IGCM_debug_Verif_Exit
-    fi
-
-    temp_avail=${inode_avail%%${inode_avail: -1}*}
-    temp_quota=${inode_quota%%${inode_quota: -1}*}
-
-    if [ ! ${unit_avail} = ${unit_quota} ] ; then
-
-    # Convertion
-      if [ ${inode_avail: -1} = "T" ] ; then
-        (( temp_avail = temp_avail * 1000000000000 ))
-      elif [ ${inode_avail: -1} = "G" ] ; then
-        (( temp_avail = temp_avail * 1000000000 ))
-      elif [ ${inode_avail: -1} = "M" ] ; then
-        (( temp_avail = temp_avail * 1000000 ))
-      elif [ ${inode_avail: -1} = "k" ] ; then
-        (( temp_avail = temp_avail * 1000 ))
-      else
-        (( temp_avail = inode_avail ))
-      fi
-
-      if [ ${inode_quota: -1} = "T" ] ; then
-        (( temp_quota = temp_quota * 1000000000000 ))
-      elif [ ${inode_quota: -1} = "G" ] ; then
-        (( temp_quota = temp_quota * 1000000000 ))
-      elif [ ${inode_quota: -1} = "M" ] ; then
-        (( temp_quota = temp_quota * 1000000 ))
-      elif [ ${inode_quota: -1} = "k" ] ; then
-        (( temp_quota = temp_quota * 1000 ))
-      else
-        (( temp_quota = inode_quota ))
-      fi
-    fi
-    quota_inode=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
-#    echo "inode ratio is " $quota_inode
-
-    if [ ${quota_inode} -ge ${limit_quota} ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
-      IGCM_debug_Print 1 "${quota_inode}% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      IGCM_debug_Print 1 "You must have more than 10% available to run"
-      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-      IGCM_debug_Verif_Exit
-    fi
-
-  fi
-  IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
-
-##############################################################
-# NCO OPERATOR
-
-function IGCM_sys_ncap2 {
-  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncap2 :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncap2 "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncap2 : ncap2 error"
-      IGCM_debug_Exit "ncap2"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncap2"
-}
-
-function IGCM_sys_ncatted {
-  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncatted :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncatted "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncatted : ncatted error"
-      IGCM_debug_Exit "ncatted"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncatted"
-}
-
-function IGCM_sys_ncbo {
-  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncbo :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncbo $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncbo : ncbo error"
-      IGCM_debug_Exit "ncbo"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncbo"
-}
-
-function IGCM_sys_ncdiff {
-  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncdiff :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncdiff $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncdiff : ncdiff error"
-      IGCM_debug_Exit "ncdiff"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncdiff"
-}
-
-function IGCM_sys_ncea {
-  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncea :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncea $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncea : ncea error"
-      IGCM_debug_Exit "ncea"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncea"
-}
-
-function IGCM_sys_ncecat {
-  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncecat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncecat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncecat : ncecat error"
-      IGCM_debug_Exit "ncecat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncecat"
-}
-
-function IGCM_sys_ncflint {
-  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncflint :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncflint $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncflint : ncflint error"
-      IGCM_debug_Exit "ncflint"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncflint"
-}
-
-function IGCM_sys_ncks {
-  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncks :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncks $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncks : ncks error"
-      IGCM_debug_Exit "ncks"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncks"
-}
-
-function IGCM_sys_ncpdq {
-  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncpdq :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncpdq $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncpdq : ncpdq error"
-      IGCM_debug_Exit "ncpdq"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncpdq"
-}
-
-function IGCM_sys_ncra {
-  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncra :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncra $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncra : ncra error"
-      IGCM_debug_Exit "ncra"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncra"
-}
-
-function IGCM_sys_ncrcat {
-  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrcat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrcat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrcat : ncrcat error"
-      #IGCM_debug_Exit "ncrcat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrcat"
-}
-
-function IGCM_sys_ncrename {
-  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrename :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrename $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrename : ncrename error"
-      IGCM_debug_Exit "ncrename"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrename"
-}
-
-function IGCM_sys_ncwa {
-  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncwa :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncwa $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-      sleep $DELAI
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncwa : ncwa error"
-      IGCM_debug_Exit "ncwa"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncwa"
-}
-
-##############################################################
-# CDO OPERATOR
-
-function IGCM_sys_cdo {
-  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_cdo :" $@
-  fi
-
-  typeset status
-
-  \cdo $@ > out_rsync 2>&1
-  status=$?
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_cdo : error code ${status}"
-    cat out_rsync
-    \rm out_rsync
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 1
-  else
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 0
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_cdo"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountJobInQueue
-#D-* Purpose: Check if job_name is currently 
-#D-  running or in queue
-#D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun
-#D-
-
-function IGCM_sys_CountJobInQueue {
-  IGCM_debug_PushStack "IGCM_sys_CountJobInQueue"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_CountJobInQueue"
-  fi
-
-  #NbRun=$( ccc_mstat -f | grep -c ${JobName} )
-
-  # With -f option, the full job name is given in the last column
-  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ($NF~String) { x=x+1 } END { print x }' )
-
-  eval ${2}=${NbRun}
-
-  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
-}
-
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh	(revision 909)
+++ 	(revision )
@@ -1,1681 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sebastien Denvil
-# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Ulam
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# rsync with path
-typeset -r RSYNC=/usr/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-Lt -v"
-# RSYNC_opt args to "remote rsync"
-# ie storage filesystem
-typeset -r RHOST=gaya.idris.fr
-typeset -r REMOTE_RSYNC=/u/rech/ces/rces452/RSYNC/bin/rsync
-
-#====================================================
-# Set environment tools (ferret, nco, cdo)
-#====================================================
-. /home/rech/psl/rpsl035/.atlas_env_ulam_bash
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${LOADL_STEP_INITDIR}}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/u/rech/psl/rpsl035/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/u/rech/psl/rpsl376}
-
-#====================================================
-#- ARCHIVE
-# modified 17/10/2011 /u to be used for file stored on gaya
-if (tty -s ) then
-  typeset -r ARCHIVE=${HOMEGAYA}
-else
-  typeset -r ARCHIVE=$(echo ${HOMEGAYA}|sed 's,/homegaya/,/u/',)
-fi
-
-#====================================================
-#- OUT
-typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
-typeset -r R_FIG=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_BUF  Buffer to pack files stored on Master
-typeset -r R_BUF=${WORKDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=120
-
-#D-#==================================================
-#D-function IGCM_sys_ChangeArchive
-#D-* Purpose: Just a dummy call on this machine
-#D-* Examples:
-#D-
-function IGCM_sys_ChangeArchive {
-
-  IGCM_debug_Print 1 " dummy function : IGCM_sys_ChangeArchive "
-
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Master rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshMaster {
-    #set -vx
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  rsh ${MASTER} exec /bin/ksh <<-EOF
-    export libIGCM=${libIGCM_SX}
-    export DEBUG_debug=${DEBUG_debug}
-    . ${libIGCM_SX}/libIGCM_debug/libIGCM_debug.ksh
-    . ${libIGCM_SX}/libIGCM_card/libIGCM_card.ksh
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshMaster : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshMaster"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Master rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-  /bin/ksh ${@}
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshPost : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-  if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
-  elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-  fi
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Mkdir : erreur."
-      IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-  fi
-    # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-    #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirArchive : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-    #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag DirNameToTest
-    # modified 17/10/2011 /u is not known on ulam, use /homegaya instead to test dir locally on ulam
-  DirNameToTest=$(echo $1 | sed 's,/u/,/homegaya/,')
-  ExistFlag=$( [ -d ${DirNameToTest} ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag FileNameToTest
-  # modified 17/10/2011 /u is not known on ulam, use /homegaya instead to test dir locally on ulam
-  FileNameToTest=$(echo $1 | sed 's,/u/,/homegaya/,')
-  ExistFlag=$( IGCM_sys_RshArchive "[ -f ${FileNameToTest} ] && echo 0 || echo 1" )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \mfls -r $@
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  \tar cvf $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  \tar tvf $1
-
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-  cd ${POST_DIR}
-  /opt/ibmll/LoadL/full/bin/llsubmit ${libIGCM}/$1.job
-  cd -
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  status=$1
-  if [ ! $status ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $status in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $status in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $status
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset status
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RmRunDir
-#D-* Purpose: rm tmpdir (dummy function most of the time batch
-#D-                      scheduler will do the job)
-#D-* Examples:
-#D-
-function IGCM_sys_RmRunDir {
-  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RmRunDir :" $@
-    echo "Dummy call, let the scheduler do that."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset status
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error in mv."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset status
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    rcp -r $1 gaya:$2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    fi
-
-    # due to rcommand latency
-    sleep 10
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-
-#	if [ ! -d ${1} ] ; then
-#           echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#           IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#           return
-#	fi
-
-    typeset status
-
-    #USUAL WAY
-    rcp -rp gaya:$1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Master
-#D-* Purpose: Copy a complete directory from MASTER filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Master {
-  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Master :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    TEST=$( IGCM_sys_RshMaster [ -d $1 ] || [ -f $1 ] && echo 1 || echo 0 )
-    if [ ${TEST} -ne 1 ] ; then
-      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ON ${MASTER}."
-      IGCM_debug_PopStack "IGCM_sys_Get_Master"
-      return
-    fi
-
-    typeset status
-
-    #USUAL WAY
-    rcp -r ${MASTER}:$1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Master : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Master"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Master"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-
-    typeset status
-        #
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-    #
-    # USUAL WAY
-    mfput $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK RSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Print 1 "mfput failed. Make a second try :"
-            #
-      mfput $1 $2 > out_rsync 2>&1
-      status=$?
-            #
-      if [ ${status} -gt 0 ] ; then
-        echo "IGCM_sys_Put_Out : error."
-        IGCM_debug_Print 1 "mfput failed twice. You have a problem"
-        cat out_rsync
-        IGCM_debug_Exit "IGCM_sys_Put_Out"
-      fi
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST status dm_liste ifile target
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      dm_liste=${1}
-    fi
-    eval DEST=\${${#}}
-
-    # test if the (first) file is present in the old computation :
-    IGCM_sys_TestFileArchive ${dm_liste[0]}
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Get"
-      #IGCM_debug_PopStack "IGCM_sys_Get"
-      #return
-    fi
-
-    # SD : dm_liste is not suited for computing job
-    #      because we change filename during transfert
-    #      dm_liste is better suited for post-treatment
-    # SD : dm_liste necessary only with RSYNC
-
-    #dm_liste=" "
-    #(( ifile=1 ))
-    #while [ $ifile -lt $# ] ; do
-    #    dm_liste=$( eval echo ${dm_liste[*]} " "\${${ifile}} )
-    #    (( ifile = ifile + 1 ))
-    #done
-    #DEST=$( eval echo \${${#}} )
-
-    #USUAL WAY
-    mfget ${dm_liste[*]} ${DEST} > out_rsync 2>&1
-
-#   #RSYNC WITH NETWORK RSH CALL
-#   echo ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-#   ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#   #RSYNC WITH NFS USE
-#   echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-#   ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#   status=$?
-#   IGCM_sys_Rsync_out $status
-
-#   ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#   (( status=status+$? ))
-
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dods
-#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dods {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dods :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    # We take our time on that
-    sleep 10
-    IGCM_sys_TestDirArchive ${R_SAVE}/${1}
-    if [ $? != 0 ] ; then
-      echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-      return
-    fi
-
-    typeset status
-    #
-    rsh gaya exec /bin/ksh <<EOF
-          cd ${R_SAVE}
-          /usr/local/bin/dods_rm DODS/pub/${LOGIN}/${R_DODS}/${1} > /dev/null 2>&1
-          /bin/chmod -R u+w ${R_SAVE}/${1}
-          /usr/local/bin/dods_cp ${1} DODS/pub/${LOGIN}/${R_DODS} > /dev/null 2>&1
-          /bin/chmod -R +rX ${R_SAVE}/${1}
-          /bin/chmod -R u+w ${R_SAVE}/${1}
-EOF
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dods : error."
-      IGCM_debug_Exit "IGCM_sys_Put_Dods"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
-}
-
-############################################################## A FINIR !!
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-    # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-  /home/rech/psl/rpsl035/bin/rebuild -f -o $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : erreur ${@}."
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t 
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t 
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-##############################################################
-# NCO OPERATOR
-
-function IGCM_sys_ncap2 {
-  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncap2 :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncap2 "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncap2 : ncap2 error"
-      IGCM_debug_Exit "ncap2"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncap2"
-}
-
-function IGCM_sys_ncatted {
-  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncatted :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncatted "$@" > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncatted : ncatted error"
-      IGCM_debug_Exit "ncatted"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncatted"
-}
-
-function IGCM_sys_ncbo {
-  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncbo :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncbo $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncbo : ncbo error"
-      IGCM_debug_Exit "ncbo"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncbo"
-}
-
-function IGCM_sys_ncdiff {
-  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncdiff :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncdiff $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncdiff : ncdiff error"
-      IGCM_debug_Exit "ncdiff"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncdiff"
-}
-
-function IGCM_sys_ncea {
-  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncea :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncea $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncea : ncea error"
-      IGCM_debug_Exit "ncea"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncea"
-}
-
-function IGCM_sys_ncecat {
-  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncecat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncecat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncecat : ncecat error"
-      IGCM_debug_Exit "ncecat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncecat"
-}
-
-function IGCM_sys_ncflint {
-  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncflint :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncflint $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncflint : ncflint error"
-      IGCM_debug_Exit "ncflint"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncflint"
-}
-
-function IGCM_sys_ncks {
-  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncks :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncks $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncks : ncks error"
-      IGCM_debug_Exit "ncks"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncks"
-}
-
-function IGCM_sys_ncpdq {
-  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncpdq :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncpdq $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncpdq : ncpdq error"
-      IGCM_debug_Exit "ncpdq"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncpdq"
-}
-
-function IGCM_sys_ncra {
-  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncra :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncra $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncra : ncra error"
-      IGCM_debug_Exit "ncra"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncra"
-}
-
-function IGCM_sys_ncrcat {
-  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrcat :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrcat $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrcat : ncrcat error"
-      #IGCM_debug_Exit "ncrcat"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrcat"
-}
-
-function IGCM_sys_ncrename {
-  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncrename :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncrename $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncrename : ncrename error"
-      IGCM_debug_Exit "ncrename"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncrename"
-}
-
-function IGCM_sys_ncwa {
-  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_ncwa :" $@
-  fi
-
-  typeset NB_ESSAI DELAI status i
-  # number of tentative
-  NB_ESSAI=3
-  # time delay between tentative
-  DELAI=2
-
-  i=0
-  while [ $i -lt $NB_ESSAI ] ; do
-    ncwa $@ > out_rsync 2>&1
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
-      cat out_rsync
-      \rm out_rsync
-      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
-    else
-      \rm out_rsync
-      break
-    fi
-    (( i = i + 1 ))
-  done
-
-  if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_ncwa : ncwa error"
-      IGCM_debug_Exit "ncwa"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_ncwa"
-}
-
-##############################################################
-# CDO OPERATOR
-
-function IGCM_sys_cdo {
-  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_cdo :" $@
-  fi
-
-  typeset status
-
-  \cdo $@ > out_rsync 2>&1
-  status=$?
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_cdo : error code ${status}"
-    cat out_rsync
-    \rm out_rsync
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 1
-  else
-    IGCM_debug_PopStack "IGCM_sys_cdo"
-    return 0
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_cdo"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
-############################################################
-# Build run file
-
-function IGCM_sys_build_run_file {
-  IGCM_debug_PushStack "IGCM_sys_build_run_file"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_run_file"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_build_run_file"
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-    IGCM_debug_PushStack "IGCM_sys_check_quota"
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_check_quota"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 909)
+++ 	(revision )
@@ -1,1695 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Sébastien Denvil
-# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-#=========================================================
-# The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted.
-# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
-#=========================================================
-
-#D-#==================================================
-#D-LibIGCM_sys for Vargas
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull
-#D-environment variables and shell commands.
-#D-All those definitions depend on host particularities.
-#D-It manages a stack mechanism and test validity of operations.
-#D-All function described bellow must be prefixed by IGCM_sys.
-
-#====================================================
-# libIGCM_sys PARAMETERS
-#====================================================
-
-#====================================================
-# set DEBUG_sys to true to output calls of function
-typeset -r DEBUG_sys=${DEBUG_sys:=true}
-
-#====================================================
-# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
-
-# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
-# -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
-# -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
-# -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
-# -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
-# -------------------------------------------------------------------------------------
-
-#=====================================================
-# Global Variables :
-#=====================================================
-# Language : "fr" or "en"
-typeset -r MYLANG="fr"
-
-#=====================================================
-# Host and user names
-# $hostname ou hostname
-typeset  HOST=${HOST:=$( hostname )}
-# $username ou whoami
-typeset  LOGIN=${LOGIN:=$( whoami )}
-# $hostname of the MASTER job
-typeset -r MASTER=vargas
-
-#D-
-#D-#==================================================
-#D-Program used in libIGCM
-#D-#==================================================
-
-# Submit command
-typeset SUBMIT=${SUBMIT:=llsubmit}
-# rsync with path
-typeset -r RSYNC=/usr/local/bin/rsync
-# RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-va"
-# ie storage filesystem
-typeset -r STOREHOST=gaya.idris.fr
-typeset -r REMOTE_RSYNC=/u/rech/ces/rces452/RSYNC/bin/rsync
-
-#====================================================
-# Host specific DIRECTORIES
-#====================================================
-
-#====================================================
-#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
-typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-#- SUBMIT_DIR : submission dir
-typeset SUBMIT_DIR=${SUBMIT_DIR:=${LOADL_STEP_INITDIR}}
-
-#====================================================
-#- IN
-typeset -r R_IN=${R_IN:=/u/rech/psl/rpsl035/IGCM}
-typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/u/rech/psl/rpsl376}
-
-#====================================================
-#- ARCHIVE
-typeset -r ARCHIVE=$( echo ${HOME} | sed -e "s/homegpfs/u/" )
-
-#====================================================
-#- Mirror libIGCM from vargas to ulam
-typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
-
-#====================================================
-#- libIGCM_POST
-PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
-typeset -r HOME_POST=$( echo ${HOME} | sed -e "s/homegpfs/home/" )
-typeset -r libIGCM_POST=${HOME_POST}/MIRROR/${PATHlibIGCM}/libIGCM
-
-#====================================================
-#- OUT
-typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
-
-#====================================================
-#- R_BUF  Buffer to pack files
-typeset -r R_BUF=${WORKDIR}/IGCM_OUT
-
-#====================================================
-#- RUN_DIR_PATH : Temporary working directory (=> TMP)
-typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
-
-#====================================================
-#- HOST_MPIRUN_COMMAND
-typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="time poe"}
-
-#====================================================
-#- Max number of arguments passed to nco operator or demigration command
-UNIX_MAX_LIMIT=120
-
-#====================================================
-#- Default number of MPI task for IPSL coupled model
-#- required for backward compatibility
-#-
-DEFAULT_NUM_PROC_OCE=5
-DEFAULT_NUM_PROC_CPL=1
-[ X${BATCH_NUM_PROC_TOT} = X ] || (( DEFAULT_NUM_PROC_ATM = BATCH_NUM_PROC_TOT - DEFAULT_NUM_PROC_OCE - DEFAULT_NUM_PROC_CPL ))
-DEFAULT_NUM_PROC_TOTAL=${BATCH_NUM_PROC_TOT}
-
-#D-#==================================================
-#D-function IGCM_sys_ChangeArchive
-#D-* Purpose: Just a dummy call on this machine
-#D-* Examples:
-#D-
-function IGCM_sys_ChangeArchive {
-
-  IGCM_debug_Print 1 " dummy function : IGCM_sys_ChangeArchive "
-
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshMaster
-#D-* Purpose: Connection to frontend machine.
-#D-* Examples:
-#D-
-(( RshMNum = 0 ))
-function IGCM_sys_RshMaster {
-  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-
-  typeset THEFILE OUTFILE ERR
-
-  RshDIR=${WORKDIR}/RUN_DIR/${config_UserChoices_TagName}/${config_UserChoices_JobName}.${$}
-  if [ ! -d ${RshDIR} ] ; then
-    IGCM_sys_Mkdir ${RshDIR}
-  fi
-  THEFILE=${RshDIR}/file_sys_RshMaster_$$_${RshMNum}
-  echo '#!/bin/ksh' > ${THEFILE}
-  echo "export libIGCM=${libIGCM} > /dev/null 2>&1" >> ${THEFILE}
-  echo "export DEBUG_debug=${DEBUG_debug} > /dev/null 2>&1" >> ${THEFILE}
-  echo ". ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh > /dev/null 2>&1" >> ${THEFILE}
-  echo ". ${libIGCM}/libIGCM_card/libIGCM_card.ksh > /dev/null 2>&1" >> ${THEFILE}
-  echo "${@} " >> ${THEFILE}
-
-  # No frontend queue on brodie : just rsh the job on the frontend with submission.
-  sed -e "s@IGCM_sys_Qsub\(.*\)@\1@" ${THEFILE} > ${THEFILE}_
-
-  chmod u+x  ${THEFILE}_
-
-  OUTFILE=${RshDIR}/out_RshMaster.$$.${RshMNum}
-  (( RshMNum = RshMNum + 1 ))
-
-  rsh ${MASTER} 'bash -c "nohup '${THEFILE}'_ > '${OUTFILE}' 2>&1 &"'
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshMaster : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshMaster"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshMaster"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshArchive
-#D-* Purpose: Archive rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshArchive {
-  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-  rsh ${STOREHOST} exec /bin/ksh <<-EOF
-    ${@}
-EOF
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_RshArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_RshArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RshPost
-#D-* Purpose: Post-process rsh command
-#D-* Examples:
-#D-
-function IGCM_sys_RshPost {
-  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RshPost :" $@
-  fi
-
-  # keep standard input to keep it for postpone if ulam don't answer
-  cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
-
-  ## Add submission for old postponed files only if command is a Qsub
-  ##
-  ISITQSUB=0
-  grep Qsub /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} >/dev/null 2>&1 && ISITQSUB=1
-  if  ( [ ${ISITQSUB} -gt 0 ] ) ; then
-    if [ -d ${SUBMIT_DIR}/POSTPONE ] ; then
-      for postponed_file in ${SUBMIT_DIR}/POSTPONE/* ; do
-        if [ -f ${postponed_file} ] ; then
-          IGCM_debug_Print 2 " submit postponed file : " ${postponed_file}
-          rsh ulam exec /bin/ksh <${postponed_file}
-          if [ $? -eq 0 ] ; then
-            IGCM_sys_Rm ${postponed_file}
-          else
-            IGCM_debug_Print 2 "keep postponed file for an other submission :" ${postponed_file}
-          fi
-        fi
-      done
-    fi
-  fi
-
-  RETURN=0
-  # rsh ulam command
-  rsh ulam exec /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
-  RETURN=$?
-
-  # keep standard input for postpone if ulam don't answer
-  if ( [ ${RETURN} -gt 0 ] ) ; then
-    IGCM_debug_Print 2 "Postpone tmp_IGCM_sys_RshPost_$$_${LOGNAME}"
-    [ -d ${SUBMIT_DIR}/POSTPONE ] || mkdir ${SUBMIT_DIR}/POSTPONE
-    mv /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME} ${SUBMIT_DIR}/POSTPONE
-  else
-    IGCM_sys_Rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RshPost"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_SendMail
-#D-* Purpose: Send mail when simulation is over
-#D-* Examples:
-#D-
-function IGCM_sys_SendMail {
-  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_SendMail :" $@
-  fi
-
-  if ( ${ExitFlag} ) ; then
-    status=failed
-  else
-    status=completed
-  fi
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
-
-  if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
-  elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-  else
-    mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
-  fi
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_SendMail"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mkdir
-#D-* Purpose: Master locale mkdir command
-#D-* Examples:
-#D-
-function IGCM_sys_Mkdir {
-  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mkdir :" $@
-  fi
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Mkdir : erreur."
-      IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-  fi
-    # vérification :
-  if [ ! -d ${1} ] ; then
-    echo "IGCM_sys_Mkdir : erreur."
-    IGCM_debug_Exit "IGCM_sys_Mkdir"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mkdir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirArchive
-#D-* Purpose: Mkdir on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirArchive {
-  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirArchive :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  rsh ${STOREHOST} -n mkdir -p $1
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_MkdirArchive : erreur."
-    IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_MkdirWork
-#D-* Purpose: Mkdir on Work
-#D-* Examples:
-#D-
-function IGCM_sys_MkdirWork {
-  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_MkdirWork :" $@
-  fi
-  #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then
-    \mkdir -p $1
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_MkdirWork : erreur."
-      IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
-  fi
-  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cd
-#D-* Purpose: master cd command
-#D-* Examples:
-#D-
-function IGCM_sys_Cd {
-  IGCM_debug_PushStack "IGCM_sys_Cd" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cd :" $@
-  fi
-  \cd $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Cd : erreur."
-    IGCM_debug_Exit "IGCM_sys_Cd"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cd"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Chmod
-#D-* Purpose: Chmod
-#D-* Examples:
-#D-
-function IGCM_sys_Chmod {
-  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Chmod :" $@
-  fi
-  if [ $DRYRUN -le 1 ]; then
-    \chmod $@
-    if [ $? -gt 0 ] ; then
-      echo "IGCM_sys_Chmod : erreur."
-      IGCM_debug_Exit "IGCM_sys_Chmod"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Chmod"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_FileSize
-#D-* Purpose: Filesize
-#D-* Examples:
-#D-
-function IGCM_sys_FileSize {
-  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-  typeset sizeF
-  set +A sizeF -- $( ls -la ${1} )
-  if [ $? -gt 0 ] ; then
-    IGCM_debug_Exit "IGCM_sys_FileSize"
-  fi
-  eval ${2}=${sizeF[4]}
-
-  IGCM_debug_PopStack "IGCM_sys_FileSize"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDir
-#D-* Purpose: Test Directory that must exists
-#D-* Examples:
-#D-
-function IGCM_sys_TestDir {
-  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDir :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestDirArchive
-#D-* Purpose: Test Directory that must exists on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestDirArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_TestDirArchive :" $@
-  fi
-  typeset ExistFlag
-  ExistFlag=$( IGCM_sys_RshArchive "[ -d $1 ] && echo 0 || echo 1" )
-  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_IsFileArchived
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* always true on vargas.
-#D-* Examples:
-#D-
-function IGCM_sys_IsFileArchived {
-  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_IsFileArchived :" $@
-  fi
-  typeset IsArchivedFlag
-  IsArchivedFlag=$( echo 0 )
-  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
-
-  return ${IsArchivedFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag
-  ExistFlag=$( IGCM_sys_RshArchive "[ -f $1 ] && echo 0 || echo 1" )
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileBuffer
-#D-* Purpose: Test file that must NOT EXISTS on Buffer
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
-  typeset ExistFlag
-  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
-
-  return ${ExistFlag}
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileBuffer
-#D-* Purpose: Count files on Scratch filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileBuffer {
-  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
-  ls ${@} 2>/dev/null | wc -l
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_CountFileBuffer : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tree
-#D-* Purpose: Tree directories with files on ${ARCHIVE}
-#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
-#D-
-function IGCM_sys_Tree {
-  IGCM_debug_PushStack "IGCM_sys_Tree" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tree :" $@
-  fi
-
-  \mfls -r $@
-
-  IGCM_debug_PopStack "IGCM_sys_Tree"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Tar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_Tar {
-  IGCM_debug_PushStack "IGCM_sys_Tar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Tar :" $@
-  fi
-  \tar cf $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_Tar : erreur."
-    IGCM_debug_Exit "IGCM_sys_Tar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Tar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_UnTar
-#D-* Purpose: master un-tar command
-#D-* Examples:
-#D-
-function IGCM_sys_UnTar {
-  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_UnTar :" $@
-  fi
-  \tar xvf $1
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_UnTar : erreur."
-    IGCM_debug_Exit "IGCM_sys_UnTar"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_UnTar"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Qsub
-#D-* Purpose: Qsub new job
-#D-* Examples:
-#D-
-function IGCM_sys_Qsub {
-  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
-
-  typeset ERROR
-  ERROR=0
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Qsub :" $@
-  fi
-  # We have to change output/error file
-  [ ${#@} = 1 ] &&  REP_FOR_JOB=$LOADL_STEP_INITDIR
-  [ ${#@} = 2 ] &&  REP_FOR_JOB=$2
-  sed -e "s/\# \@ output *= .*/\# \@ output = ${Script_Output}/" -e "s/\# \@ error *= .*/\# \@ error = ${Script_Output}/" <$1 >${REP_FOR_JOB}/JOB_FOR_IGCM
-  {
-    [ ${#@} = 1 ] &&  ( cd $LOADL_STEP_INITDIR ; /usr/local/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ; )
-    [ ${#@} = 2 ] &&  ( cd $2 ; /usr/local/bin/llsubmit JOB_FOR_IGCM ; ERROR=$? ; cd - ; )
-  }
-  if [ ${ERROR} -gt 0 ] ; then
-    echo "IGCM_sys_Qsub : erreur $@."
-    IGCM_debug_Exit "IGCM_sys_Qsub"
-  fi
-  IGCM_sys_Rm ${REP_FOR_JOB}/JOB_FOR_IGCM
-  IGCM_debug_PopStack "IGCM_sys_Qsub"
-
-}
-
-#D-#==================================================
-#D-function IGCM_sys_QsubPost
-#D-* Purpose: Qsub new job on scalaire
-#D-* Examples:
-#D-
-function IGCM_sys_QsubPost {
-  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_QsubPost :" $@
-  fi
-  cd ${POST_DIR}
-  /opt/ibmll/LoadL/full/bin/llsubmit ${libIGCM_POST}/$1.job
-  cd -
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_QsubPost : erreur " $@
-    IGCM_debug_Exit "IGCM_sys_QsubPost"
-  fi
-  IGCM_debug_PopStack "IGCM_sys_QsubPost"
-}
-
-#D-*************************
-#D- File transfer functions
-#D-*************************
-#D-
-
-#D-#==================================================
-#D-function IGCM_sys_Rsync_out
-#D-* Purpose: treat return val of rsync
-#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
-#D-  Error values and explanations can depend on your system version.
-function IGCM_sys_Rsync_out {
-  status=$1
-  if [ ! $status ] ; then
-    echo "rsync error !"
-  fi
-
-  if [ $MYLANG = "fr" ]; then
-    case $status in
-    0)  return ;;
-    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-      echo "Erreur de syntaxe ou d'utilisation."
-      return;;
-    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-      echo "Incompatibilité de protocole."
-      return;;
-    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-      echo "répertoires"
-      return;;
-    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-      echo "Action demandée non supportée : une tentative de manipulation de"
-      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-      echo "été faite ; ou une option qui est supportée par le  client  mais"
-      echo "pas par le serveur a été spécifiée."
-      return;;
-    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-      echo "Erreur dans le socket d'entrée sortie"
-      return;;
-    11) echo "Erreur de rsync ; RERR_FILEIO"
-      echo "Erreur d'entrée sortie fichier"
-      return;;
-    12) echo "Erreur de rsync ; RERR_STREAMIO"
-      echo "Erreur dans flux de donnée du protocole rsync"
-      return;;
-    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-      echo "Erreur avec les diagnostics du programme"
-      return;;
-    14) echo "Erreur de rsync ; RERR_IPC"
-      echo "Erreur dans le code IPC"
-      return;;
-    20) echo "Erreur de rsync ; RERR_SIGNAL"
-      echo "SIGUSR1 ou SIGINT reçu"
-      return;;
-    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-      echo "Une erreur retournée par waitpid()"
-      return;;
-    22) echo "Erreur de rsync ; RERR_MALLOC"
-      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-      return;;
-    23) echo ""
-      echo "Erreur fichier inexistant"
-      return;;
-    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-      echo "Temps d'attente écoulé dans l'envoi/réception de données"
-      return;;
-    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $status
-      return;;
-    esac
-  elif [ $MYLANG = "en" ] ; then
-    case $status in
-    0)  return;;
-    1)  echo "rsync error : Syntax or usage error "
-      return;;
-    2)  echo "rsync error : Protocol incompatibility "
-      return;;
-    3)  echo "rsync error : Errors selecting input/output files, dirs"
-      return;;
-    4)  echo "rsync error : Requested action not supported: an attempt"
-      echo "was made to manipulate 64-bit files on a platform that cannot support"
-      echo "them; or an option was specified that is supported by the client and"
-      echo "not by the server."
-      return;;
-    5)  echo "rsync error : Error starting client-server protocol"
-      return;;
-    10) echo "rsync error : Error in socket I/O "
-      return;;
-    11) echo "rsync error : Error in file I/O "
-      return;;
-    12) echo "rsync error : Error in rsync protocol data stream "
-      return;;
-    13) echo "rsync error : Errors with program diagnostics "
-      return;;
-    14) echo "rsync error : Error in IPC code "
-      return;;
-    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-      return;;
-    21) echo "rsync error : Some error returned by waitpid() "
-      return;;
-    22) echo "rsync error : Error allocating core memory buffers "
-      return;;
-    23) echo "rsync error : Partial transfer due to error"
-      return;;
-    24) echo "rsync error : Partial transfer due to vanished source files"
-      return;;
-    30) echo "rsync error : Timeout in data send/receive "
-      return;;
-    *)  echo "rsync error : return code of rsync unknown :" $status
-      return;;
-    esac
-  else
-    echo "unknown language $MYLANG."
-    return
-  fi
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Miror_libIGCM
-#D-* Purpose: Mirror libIGCM PATH and lib to ulam
-#D-* Examples:
-#D-
-function IGCM_sys_Mirror_libIGCM {
-  IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mirror_libIGCM"
-  fi
-
-  typeset status
-
-  IGCM_sys_RshPost <<-EOF
-    mkdir -p ${HOME_POST}/MIRROR/${PATHlibIGCM}
-EOF
-  rsh ulam -n hostname > /dev/null 2>&1
-  status=$?
-  if [ $status -eq 0 ] ; then
-    echo ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
-    ${RSYNC} ${RSYNC_opt} -e "rsh " ${libIGCM} ulam:${HOME_POST}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on ulam."
-      cat out_rsync
-    fi
-    IGCM_sys_Rm out_rsync
-  else
-    echo "No POST-TREATMENT avaible because ulam is down."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Cp
-#D-* Purpose: generic cp
-#D-* Examples:
-#D-
-function IGCM_sys_Cp {
-  IGCM_debug_PushStack "IGCM_sys_Cp" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Cp :" $@
-  fi
-
-  typeset status
-
-  echo cp $@ > out_rsync 2>&1
-  \cp $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Cp"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Cp"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Rm
-#D-* Purpose: generic rm
-#D-* Examples:
-#D-
-function IGCM_sys_Rm {
-  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Rm :" $@
-  fi
-
-  typeset status
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_Rm"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Rm"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_RmRunDir
-#D-* Purpose: rm tmpdir (dummy function most of the time batch
-#D-                      scheduler will do the job)
-#D-* Examples:
-#D-
-function IGCM_sys_RmRunDir {
-  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RmRunDir :" $@
-    echo "Dummy call, let the scheduler do that."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Mv
-#D-* Purpose: generic move
-#D-* Examples:
-#D-
-function IGCM_sys_Mv {
-  IGCM_debug_PushStack "IGCM_sys_Mv" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Mv :" $@
-  fi
-
-  if [ $DRYRUN = 0 ]; then
-
-    typeset status
-
-    echo mv $@ > out_rsync 2>&1
-    \mv $@ >> out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error in mv."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Mv"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_Mv"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Dir
-#D-* Purpose: Copy a complete directory on $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-      return
-    fi
-
-    typeset status
-
-    # Only if we use rsync
-    #IGCM_sys_TestDirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    rcp -r $1 ${STOREHOST}:$2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Dir"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from $(ARCHIVE)
-#D-* Examples:
-#D-
-function IGCM_sys_Get_Dir {
-  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get_Dir :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-      return
-    fi
-
-    typeset status
-
-        #USUAL WAY
-    rcp -rp ${STOREHOST}:$1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get_Dir"
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-}
-
-#====================================================
-#- Call IGCM_sys_Mirror_libIGCM now !
-if ( $MirrorlibIGCM ) ; then
-  IGCM_sys_Mirror_libIGCM
-fi
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on $(ARCHIVE).
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Rest {
-  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    fi
-
-    typeset status
-        #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-    #
-    # Only if we use rsync
-    #IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    mfput $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK RSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Rest
-#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Rest {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Rest : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_Put_Out {
-  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Put_Out :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Put_Out"
-      return 1
-    fi
-
-    typeset status
-        #
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-    # Only if we use rsync
-    #IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    mfput $1 $2 > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK RSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Out"
-    else
-      \rm out_rsync
-    fi
-    IGCM_sys_Rm out_rsync
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Out
-#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Out {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Out :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-      return 1
-    fi
-    #
-    IGCM_sys_Mkdir $( dirname $2 )
-    #
-    typeset status
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Out : error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
-  return 0
-}
-
-#D-#==================================================
-#D-function IGCM_sys_Get
-#D-* Purpose: Get a file from ${ARCHIVE}
-#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
-function IGCM_sys_Get {
-  IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-  typeset DEST status dm_liste ifile target
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_Get :" $@
-  fi
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A dm_liste \${${2}}
-    else
-      dm_liste=${1}
-    fi
-    eval DEST=\${${#}}
-
-    # test if the (first) file is present in the old computation :
-    IGCM_sys_TestFileArchive ${dm_liste[0]}
-    status=$?
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_Get"
-      return
-    fi
-
-    # SD : dm_liste is not suited for computing job
-    #      because we change filename during transfert
-    #      dm_liste is better suited for post-treatment
-    #dm_liste=" "
-    #(( ifile=1 ))
-    #while [ $ifile -lt $# ] ; do
-    #    dm_liste=$( eval echo ${dm_liste} " "\${${ifile}} )
-    #    (( ifile = ifile + 1 ))
-    #done
-    #DEST=$( eval echo \${${#}} )
-
-    #USUAL WAY
-    mfget ${dm_liste[*]} ${DEST} > out_rsync 2>&1
-    status=$?
-
-#       #RSYNC WITH NETWORK RSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get : copy error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Get"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetBuffer
-#D-* Purpose: Get a file from ${SCRATCHDIR}
-#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
-#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
-function IGCM_sys_GetBuffer {
-  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
-
-  typeset DEST status buf_liste ifile target file_work
-
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetBuffer :" $@
-  fi
-  if [ $DRYRUN -le 2 ]; then
-    if [ X${1} = X'/l' ] ; then
-      # test if the first file is present in the old computation :
-      eval set +A buf_liste \${${2}}
-    else
-      eval set +A buf_liste ${1}
-    fi
-    eval DEST=\${${#}}
-
-    #USUAL WAY
-    if [ X${1} = X'/l' ] ; then
-      (( status=0 ))
-      for target in ${buf_liste[*]} ; do
-        local_file=$( basename ${target} )
-        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-        (( status = status + $? ))
-      done
-    else
-      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
-      status=$?
-    fi
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_GetBuffer : copy error."
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_GetBuffer"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
-}
-
-############################################################## A FINIR !!
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichWork
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichWork {
-  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichWork :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( rsh ${MASTER} -n /opt/freeware/bin/ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
-
-  # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( rsh ${STOREHOST} -n ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
-
-  IGCM_debug_PopStack "IGCM_sys_FichArchive"
-}
-
-##############################################################
-# REBUILD OPERATOR
-
-function IGCM_sys_rebuild {
-  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild :" $@
-  fi
-  /homegpfs/rech/psl/rpsl035/bin/rebuild -f -o $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : erreur ${@}."
-    IGCM_debug_Exit "rebuild"
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild"
-}
-
-function IGCM_sys_rebuild_station {
-  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
-  typeset i list_opt file_in file_out prefix_invert list_invert
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_rebuild_station :" $@
-  fi
-  list_opt=$@
-
-  # Invert Axis : t,x -> x,t 
-  #               t,pres,x -> x,t,pres
-  # So that we can concatenate along x
-  i=0
-  for file_in in ${list_opt} ; do
-    (( i = i + 1))
-    [ ${i} = 1 ] && file_out=${file_in} && continue
-    prefix_invert=$( basename ${file_in} .nc )
-    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
-    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
-  done
-
-  # Concatenate
-  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
-
-  # Re-ivert file
-  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
-
-  # Station re-ordering is too expansive to be run within libICGM
-  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
-  # This re-ordering must be done "in memory" by the cmorization process
-  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
-  # BEGIN reordering
-
-  # Only LMDZ text output contains the exact ordering of the station.
-  # We isolate this in the code below:
-  #  0  38  -157.5000000000000  70.98591549295774
-  #  0  54  27.49999999999999   67.18309859154928
-  #  0  56  -62.50000000000001  82.39436619718309
-  #  0  79  12.49999999999999   78.59154929577466
-  #  0  116 -165.0000000000000  76.05633802816901
-  #  0  117 130.0000000000000   70.98591549295774
-  #  0  118 110.0000000000000   87.46478873239437
-  #  1  40  4.999999999999995   51.97183098591550
-#  typeset iStation iProc list_opt file_in file_out prefix_invert
-#  typeset -Z4 j4
-#  typeset -Z3 j3
-
-#  unset list_opt
-#  set +A list_opt $@
-
-  # Filename after rebuild
-#  file_out=${list_opt[0]}
-  # Prefix of output files
-#  prefix_invert=$( basename ${file_out} .nc )
-  # Number of procs
-#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
-
-#  iProc=0
-#  while [ ${iProc} -lt ${num_proc} ] ; do
-    # Array containing Station as a number
-#    unset proc_stn
-#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
-    # Number of stations produced by processor proc
-#    stationLast=${#proc_stn[*]}
-    # Proc number on 4 digits
-#    j4=${iProc}
-    # Init
-#    iStation=0
-#    while [ ${iStation} -lt ${stationLast} ] ; do
-      # Station number on 3 digits
-#      j3=${proc_stn[${iStation}]}
-      # Extract station
-      # Invert Axis : t,x -> x,t 
-      #               t,pres,x -> x,t,pres
-      # So that we can concatenate along x
-#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
-#      (( iStation = iStation + 1 ))
-#    done
-#    (( iProc = iProc + 1 ))
-#  done
-
-  # Concatenate all station along x
-#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
-
-  # Re-invert file
-#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
-
-  # END reordering
-
-  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
-}
-
-############################################################
-# Activate Running Environnment Variables
-
-function IGCM_sys_activ_variables {
-  IGCM_debug_PushStack "IGCM_sys_activ_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_activ_variables "
-  fi
-
-# --------------------------------------------------------------------
-#D- OpenMP thread memory specifications : only one time
-# --------------------------------------------------------------------
-echo $XLSMPOPTS | grep stack=524288000 1>/dev/null 2>&1 || export XLSMPOPTS=$XLSMPOPTS:stack=524288000
-
-# --------------------------------------------------------------------
-#D- Other specifications
-# --------------------------------------------------------------------
-
-  IGCM_debug_PopStack "IGCM_sys_activ_variables"
-
-}
-
-############################################################
-# Desactivate Running Environnment Variables
-
-function IGCM_sys_desactiv_variables {
-  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_desactiv_variables "
-  fi
-# --------------------------------------------------------------------
-#D- MPI specifications
-# --------------------------------------------------------------------
-
-# --------------------------------------------------------------------
-#D- Other specifications
-# --------------------------------------------------------------------
-
-  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-
-}
-
-############################################################
-# Build MPI/OMP scripts
-function IGCM_sys_build_execution_scripts
-{
-  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_build_execution_scripts " $@
-  fi
-
-  typeset NbNodes_Job NbProc_Job comp_proc_mpi_loc comp_proc_omp_loc mpi_count
-
-  if [ ! -f ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ]  ; then
-    IGCM_debug_Exit "IGCM_sys_vargas build_execution_scripts : Job_${config_UserChoices_JobName} don't exist in SUBMIT_DIR : ${SUBMIT_DIR} "
-  fi
-
-  if ( ${OK_PARA_MPMD} ) ; then
-
-    if [ -f run_file ] ; then
-      IGCM_sys_Rm -f run_file
-    fi
-    touch run_file
-
-    if ( ${OK_PARA_OMP} ) ; then
-# NEW : 2 Noeuds
-# @ task_geometry={(0)(1,2,3)}
-# Nombre de processus demandes
-      echo "Job_${config_UserChoices_JobName} includes task_geometry = \c"
-      cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g"
-      echo "Job_${config_UserChoices_JobName} includes task_geometry  with NbNodes = \c"
-      cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c
-      NbNodes_Job=$(( $( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c ) - 1 ))
-
-      if [ ${NbNodes_Job} -eq 0 ] ; then
-        IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no task_geometry defined with OpenMP run."
-        exit 1
-      fi
-    else
-
-# OLD :
-# @ total_tasks = 3
-# @ environment = "BATCH_NUM_PROC_TOT=3"
-# Pas d OpenMP
-# @ resources = ConsumableCpus(1)
-
-      echo "Job_${config_UserChoices_JobName} includes total_tasks = \c"
-      cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //"
-      NbProc_Job=$( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //" )
-      NbProc_Job=${NbProc_Job:=0}
-      if [ ${NbProc_Job} -eq 0 ] ; then
-        IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no total_tasks defined with MPI only run."
-        exit 1
-      fi
-      if ( $( egrep '^# *@ *resources *= *ConsumableCpus\(1\)' ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} >/dev/null 2>&1 ) ) ; then
-        IGCM_debug_Print 2 "ressources =  ConsumableCpus(1) line found into Job_${config_UserChoices_JobName}"
-      else
-        IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources = line not found. Job should include resources = ConsumableCpus(1) "
-        exit 1
-      fi
-    fi
-
-# run_file construction
-
-# Then first loop on the components for the coupler ie oasis
-
-### the coupler ie oasis must be the first one
-    for comp in ${config_ListOfComponents[*]} ; do
-
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-      # for CPL component only
-      if [ "X${comp}" = "XCPL" ] ; then
-
-        eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-        eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-
-        if ( ${OK_PARA_MPI} ) ; then
-
-          (( mpi_count = 1 ))
-          until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do
-            if ( ${OK_PARA_OMP} ) ; then
-              echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> run_file
-            else
-              echo "./${ExeNameOut}" >> run_file
-            fi
-            (( mpi_count = mpi_count + 1 ))
-          done
-        else
-          if ( ${OK_PARA_OMP} ) ; then
-            echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> run_file
-          else
-            echo "./${ExeNameOut} " >> run_file
-          fi
-        fi
-      fi
-    done
-
-# Then second loop on the components
-
-    for comp in ${config_ListOfComponents[*]} ; do
-
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-      # Only if we really have an executable for the component and not the coupler ie oasis:
-      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
-
-        eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-        eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-
-        if ( ${OK_PARA_MPI} ) ; then
-
-          (( mpi_count = 1 ))
-          until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do
-            if ( ${OK_PARA_OMP} ) ; then
-              echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> run_file
-            else
-              echo "./${ExeNameOut}" >> run_file
-            fi
-            (( mpi_count = mpi_count + 1 ))
-          done
-        else
-          if ( ${OK_PARA_OMP} ) ; then
-            echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> run_file
-          else
-                    # to be tested : no MPI only OpenMP into MPMD mode
-            echo "./${ExeNameOut} " >> run_file
-          fi
-        fi
-      fi
-    done
-
-    EXECUTION="${HOST_MPIRUN_COMMAND} -pgmmodel mpmd -cmdfile ./run_file"
-
-    IGCM_sys_Chmod u+x run_file
-    if ( $DEBUG_sys ) ; then
-      echo "run_file contains : "
-      cat run_file
-    fi
-
-  else # Only one executable. launch it.
-
-    for comp in ${config_ListOfComponents[*]} ; do
-
-      eval ExeNameIn=\${config_Executable_${comp}[0]}
-      eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
-        EXECUTION="time ./${ExeNameOut}"
-      fi
-
-    done
-
-  fi
-
-  IGCM_debug_Print 1 "sys vargas : execution command is "
-  IGCM_debug_Print 1 "$EXECUTION"
-
-  IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
-}
-
-function IGCM_sys_build_run_file {
-
-  IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "
-
-}
-
-############################################################
-# Check of space available on temporary filesytems
-function IGCM_sys_check_quota {
-  IGCM_debug_PushStack "IGCM_sys_check_quota" 
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_check_quota "
-  fi
-  # Limit of quota (in %)
-  limit_quota=90
-  # Check of the volume
-  volume_quota=$(quota_u -w | grep 'Quota soft' | awk '{print $5}')
-  if [ ! X${volume_quota} = X ] ; then
-    quota_volume=${volume_quota%%\%}
-#    echo $quota_volume
-    if [ ${quota_volume} -ge ${limit_quota} ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of volume on workgpfs"
-      IGCM_debug_Print 1 "${quota_volume}% of your quota is used"
-      IGCM_debug_Print 1 "Use the quota_u -w command to check"
-      IGCM_debug_Print 1 "You must have more than 10% available to run"
-      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
-      IGCM_debug_Verif_Exit
-    fi
-
-  fi
-  IGCM_debug_PopStack "IGCM_sys_check_quota"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_CountJobInQueue
-#D-* Purpose: Check if job_name is currently 
-#D-  running or in queue
-#D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun
-#D-
-
-function IGCM_sys_CountJobInQueue {
-  IGCM_debug_PushStack "IGCM_sys_CountJobInQueue"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_CountJobInQueue"
-  fi
-
-  # Print only the full (-W) JobName (%jn)
-  NbRun=$( llq -W -f %jn | grep -c "$1" )
-
-  eval ${2}=${NbRun}
-
-  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
-}
