Index: /utils/build/mk_ENHANCE-03_domcfg/Fadd_keys.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fadd_keys.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fadd_keys.sh	(revision 11980)
@@ -0,0 +1,77 @@
+#!/bin/bash
+######################################################
+# Author : Simona Flavoni for NEMO
+# Contact : sflod@locean-ipsl.upmc.fr
+#
+# Some functions called from makenemo
+# Fadd_keys   : add keys in cpp.fcm file  
+######################################################
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ============
+# Fadd_keys.sh
+# ============
+#
+# --------------------
+# Add compilation keys
+# --------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fadd_keys.sh CONFIG_NAME add_key "LIST_KEYS"
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Script to add a set of key when compiling a configuration.
+# The list of key to be added has to be enclosed with " ". 
+# A 'sed' is performed to modify the CONFIG_NAME/cpp.fcm file to    
+# add the new key(s). 
+#
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fadd_keys.sh ORCA2_LIM add_key "key_mpp_rep"
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: Fadd_keys.sh 2158 2010-10-20 17:30:03Z sflod $
+#
+#
+#
+#   * creation
+#
+#-
+ echo "Adding keys in : ${NEW_CONF}" 
+ for i in ${list_add_key} ; do
+	if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "\<$i\>" )" -ne 0 ] ; then
+ 	   echo "key $i already present in cpp_${NEW_CONF}.fcm" 
+	else
+	   sed -e "s/$/ ${i}/"  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
+ 	   mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp   ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
+ 	   echo "added key $i in ${NEW_CONF}" 
+	fi
+ done
+ 
+ unset -v list_add_key
+
Index: /utils/build/mk_ENHANCE-03_domcfg/Fcheck_archfile.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fcheck_archfile.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fcheck_archfile.sh	(revision 11980)
@@ -0,0 +1,215 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ==================
+# Fcheck_archfile.sh
+# ==================
+#
+# --------------------------
+# Check the compilation file
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fcheck_archfile.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Check the choice of the compiler.
+# Three cases :  
+#
+# - There was a previous choice
+# - A new one has be specified, we use this one
+# - No information, exit
+#
+# We use TOOLS/COMPILE/arch.fcm to see if something was chosen. 
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fcheck_archfile.sh ARCHFILE CPPFILE COMPILER
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+cpeval () 
+{
+    cat > $2 << EOF
+
+#==========================================================
+#    Automatically generated by Fcheck_archfile.sh from
+#    $1
+#==========================================================
+
+EOF
+    while read line  
+    do  
+	eval "echo \"$line\" >> $2"
+    done < $1
+}
+# cleaning related to the old version
+rm -f $( find ${COMPIL_DIR} -type l -name $1 -print )
+#
+if [ ${#3} -eq 0 ]; then # arch not specified
+    if [ ! -f ${COMPIL_DIR}/arch.history ]; then
+	echo "Warning !!!"
+	echo "NO compiler chosen"
+	echo "Try makenemo -h for help"
+	echo "EXITING..."
+	exit 1 
+    else # use the arch file defined in arch.history
+	myarch=$( cat ${COMPIL_DIR}/arch.history )	
+	if [ ! -f $myarch ]; then
+	    echo "Warning !!!"
+	    echo "previously used arch file no more found:"
+	    echo $myarch
+	    echo "EXITING..."
+	    exit 1 
+	else
+	    if [ -f ${COMPIL_DIR}/$1 ]; then
+		if [ "$2" != "nocpp" ] 
+		then
+		    # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
+		    mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
+		    if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
+			echo $mycpp > ${COMPIL_DIR}/cpp.history
+			cpeval ${myarch} ${COMPIL_DIR}/$1
+		    fi
+		    # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
+		    mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
+		    [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
+		fi
+		# has myarch file been updated since we copied it in ${COMPIL_DIR}?
+		myarchdir=$( dirname ${myarch} )
+		myarchname=$( basename ${myarch} )
+		myarch=$( find -L $myarchdir -cnewer ${COMPIL_DIR}/$1 -name $myarchname -print )
+		[ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
+	    else
+		cpeval ${myarch} ${COMPIL_DIR}/$1
+	    fi
+	fi
+    fi
+else 
+    nb=$( find ${MAIN_DIR}/arch -name arch-${3}.fcm -print | wc -l )
+    if [ $nb -eq 0 ]; then # no arch file found
+	echo "Warning !!!"
+	echo "Compiler not existing"
+	echo "Try makenemo -h for help"
+	echo "EXITING..."
+	exit 1       
+    fi
+    if [ $nb -gt 1 ]; then # more than 1 arch file found
+	echo "Warning !!!"
+	echo "more than 1 arch file for the same compiler have been found"
+	find ${MAIN_DIR}/arch -name arch-${3}.fcm -print
+	echo "keep only 1"
+	echo "EXITING..."
+	exit 1       
+    fi
+    myarch=$( find ${MAIN_DIR}/arch -name arch-${3}.fcm -print )
+    # we were already using this arch file ?
+    if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then 
+	if [ -f ${COMPIL_DIR}/$1 ]; then
+	    if [ "$2" != "nocpp" ] 
+	    then
+		# has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}?
+		mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" )
+		if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then
+		    echo $mycpp > ${COMPIL_DIR}/cpp.history
+		    cpeval ${myarch} ${COMPIL_DIR}/$1
+		fi
+		# has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}?
+		mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )
+		[ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
+	    fi
+	    # has myarch file been updated since we copied it in ${COMPIL_DIR}?
+	    myarch=$( find -L ${MAIN_DIR}/arch -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print )
+	    [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1
+	else
+	    cpeval ${myarch} ${COMPIL_DIR}/$1
+	fi
+    else
+	if [ "$2" != "nocpp" ] 
+	then
+	    ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history
+	fi
+	echo ${myarch} > ${COMPIL_DIR}/arch.history
+	cpeval ${myarch} ${COMPIL_DIR}/$1
+    fi
+fi
+
+#- do we need xios library?
+#- 2 cases: 
+#- in CONFIG directory looking for key_iomput
+if [ "$1" == "arch_nemo.fcm" ]
+then
+    if [ "$2" != "nocpp" ] 
+    then
+        use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput )
+    else
+        use_iom=0
+    fi
+    have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" )
+    if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]]
+    then 
+        sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$
+        mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1
+    fi
+#- in TOOLS directory looking for USE xios
+else
+    use_iom=$( egrep --exclude-dir=.svn -r USE ${NEW_CONF}/src/* | grep -c xios )
+    have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" )
+    if [[ ( $use_iom -eq 0 ) || ( $have_lxios != 1 ) ]]
+    then 
+        sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$
+        mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1
+    fi
+fi
+
+#- do we need oasis libraries?
+if [ "$2" != "nocpp" ] 
+then
+    use_oasis=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_oasis3 )
+else
+    use_oasis=0
+fi
+#ignore use_oasis if XIOS_OASIS is set  (doesn't matter to what value) 
+if [[ ! -z "$XIOS_OASIS" ]]; then 
+    use_oasis=1 
+fi 
+for liboa in psmile.MPI1 mct mpeu scrip mpp_io
+do
+    have_liboa=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-l${liboa}" )
+    if [[ ( $use_oasis -eq 0 ) && ( $have_liboa -ge 1 ) ]]
+    then 
+	sed -e "s/-l${liboa}//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$
+	mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1
+    fi
+done
+
Index: /utils/build/mk_ENHANCE-03_domcfg/Fcheck_config.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fcheck_config.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fcheck_config.sh	(revision 11980)
@@ -0,0 +1,87 @@
+#!/bin/bash
+######################################################
+# Author : Rachid Benshila for NEMO
+# Contact : rblod@locean-ipsl.upmc.fr
+#
+# Some functions called from makenemo
+# Fcheck_config   : config checking 
+######################################################
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ================
+# Fcheck_config.sh
+# ================
+#
+# --------------------------
+# Check the configuration
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fcheck_config.sh FILENAME CONFNAME
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Check the choice of the configuration:
+#
+# - Two cases
+# - One is explicitely set
+# - Nothing set, use the previous in use 
+#
+# We use TOOLS/cfgs_DIR/cfg.txt to check if the configuration exists.
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fcheck_config.sh
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+declare -a ZTAB
+if [ ${#2} -eq 0 ]; then
+   tail -1  ${CONFIG_DIR}/$1	> ${CONFIG_DIR}/cfg.tmp
+   read -a ZTAB < ${CONFIG_DIR}/cfg.tmp
+   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
+   \rm ${CONFIG_DIR}/cfg.tmp
+   echo "Warning !!!"
+   echo "No configuration specified"
+   echo "Use makenemo -n MYCONFIG"
+   echo "or  makenemo -h for help"
+   echo "Using default configuration : ${NEW_CONF}"
+fi
+if [ "$1" == cfg.txt ]; then
+   cat ${CONFIG_DIR}/$1 | grep "${NEW_CONF} " > ${CONFIG_DIR}/cfg.tmp
+   read -a ZTAB < ${CONFIG_DIR}/cfg.tmp
+   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
+   \rm ${CONFIG_DIR}/cfg.tmp
+fi
+
+unset -v ZTAB
Index: /utils/build/mk_ENHANCE-03_domcfg/Fcheck_script.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fcheck_script.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fcheck_script.sh	(revision 11980)
@@ -0,0 +1,63 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ================
+# Fcheck_script.sh
+# ================
+#
+# --------------------------
+# Check
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fcheck_script.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Check if utilities are in the path, typically fcm.
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fcheck_script.sh fcm
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+myscript=`which $1`
+if [ ${#myscript} -eq 0 ]; then
+echo "WARNING !!!"
+echo "$1 has to be installed first"
+echo "Exiting......................"
+exit 1
+fi
+
+unset -v myscript
Index: /utils/build/mk_ENHANCE-03_domcfg/Fclean_config.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fclean_config.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fclean_config.sh	(revision 11980)
@@ -0,0 +1,98 @@
+#!/bin/bash
+######################################################
+# Author : Simona Flavoni for NEMO
+# Contact : sflod@locean-ipsl.upmc.fr
+#
+# Some functions called from makenemo
+# Fclean_config   : config removing 
+######################################################
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ================
+# Fclean_config.sh
+# ================
+#
+# ------------------------
+# Remove the configuration
+# ------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fclean_config.sh CONFNAME
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Remove the configuration:
+#
+# - remove CONFIG_NAME/WORK
+# - remove CONFIG_NAME/BLD
+# - remove CONFIG_NAME from TOOLS/mk/cfg.txt 
+# 
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fclean_config.sh ORCA2_LIM
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: Fclean_config.sh 2158 2010-10-20 17:30:03Z sflod $
+#
+#
+#
+#   * creation
+#
+#-
+
+NEW_CONF=${x_n}
+
+if [ ${#NEW_CONF} -eq 0 ] ; then
+	echo " "
+	echo "No configuration specified, please use makenemo -n CONFIG clean_config "
+else
+	echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] "
+	read answer
+	answer=`echo $answer | sed 's/^[y].*$/y/'`
+
+	if [  -z "$answer" -o "x$answer" = "xy" ]; then
+
+		## testing if configuration exists
+		if [[ ! $( grep "${NEW_CONF} " */work_cfgs.txt ) ]] ; then
+			echo "The configuration ${NEW_CONF} does not exist in file work_cfgs.txt"     
+			echo "No removing configuration"
+			echo " "
+		else
+			CONFIG_DIR=${MAIN_DIR}/$( grep -l "${NEW_CONF} " */work_cfgs.txt | cut -d/ -f1 )
+			rm -rf ${CONFIG_DIR}/${NEW_CONF}
+			sed -e "/${NEW_CONF} /d"  ${CONFIG_DIR}/work_cfgs.txt >  ${CONFIG_DIR}/work_cfgs.tmp
+			mv  ${CONFIG_DIR}/work_cfgs.tmp  ${CONFIG_DIR}/work_cfgs.txt
+			echo "${NEW_CONF} configuration REMOVED" 
+		fi
+
+	else
+		echo " "
+		echo "nothing to remove"
+	fi
+
+fi 
+
+unset -v answer
Index: /utils/build/mk_ENHANCE-03_domcfg/Fclean_var.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fclean_var.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fclean_var.sh	(revision 11980)
@@ -0,0 +1,68 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# =============
+# Fclean_var.sh
+# =============
+#
+# ----------------------------
+# Clean environment variables
+# ----------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fclean_var.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Clean environment variables
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fclean_var.sh
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+#- Unset variables
+
+unset -v NSTOP
+unset -v TAB
+unset -v NEW_CONF
+unset -v REF_CONF
+unset -v CMP_NAM
+unset -v NBR_PRC
+unset -v NEM_SUBDIR
+unset -v MAIN_DIR
+unset -v CONFIG_DIR
+unset -v TOOLS_DIR
+unset -v COMPIL_DIR
+unset -v NEMO_DIR
+unset -v USEBLD
Index: /utils/build/mk_ENHANCE-03_domcfg/Fcopy_dir.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fcopy_dir.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fcopy_dir.sh	(revision 11980)
@@ -0,0 +1,62 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ============
+# Fcopy_dir.sh
+# ============
+#
+# --------------------------
+# Copy a reference directory
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fcopy_dir.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# When a reference configuration is set, 
+# Copy NEMO sub-directories needed (OCE, TOP ...)
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fcopy_dir.sh ORCA2_LIM
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+declare -a ZTAB
+grep "$1 " ${CONFIG_DIR}/cfg.txt > ${CONFIG_DIR}/cfg.tmp
+read -a ZTAB < ${CONFIG_DIR}/cfg.tmp
+TAB=( ${ZTAB[@]:1} )
+\rm ${CONFIG_DIR}/cfg.tmp
+
+unset -v ZTAB
Index: /utils/build/mk_ENHANCE-03_domcfg/Fcopy_extdir.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fcopy_extdir.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fcopy_extdir.sh	(revision 11980)
@@ -0,0 +1,39 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+# ============
+# Fcopy_extdir.sh
+# ============
+# --------------------------
+# Copy a reference directory
+# --------------------------
+# SYNOPSIS
+# ========
+# ::
+#  $ Fcopy_extdir.sh
+# DESCRIPTION
+# ===========
+# When an unsupported configuration is requested, 
+# Prepare sources for the NEMO sub-directories needed (OCE, TOP ...)
+# EXAMPLES
+# ========
+# ::
+#  $ ./Fcopy_extdir.sh ORCA2_LIM
+# TODO
+# ====
+# option debug
+# EVOLUTIONS
+# ==========
+# $Id: Fcopy_extdir.sh 3294 2012-01-28 16:44:18Z rblod $
+#   * creation
+#-
+grep "$1 " ${CONFIG_DIR}/uspcfg.txt > ${CONFIG_DIR}/cfg.tmp
+#
+LOCAL_REF=$(cat cfg.tmp | awk 'BEGIN {FS = "#" }{print $2}')
+TAB=$(cat cfg.tmp | awk 'BEGIN {FS = "#" }{print $3}')
+REMOTE_CTL=$(cat cfg.tmp | awk 'BEGIN {FS = "#" }{print $4}')
+#
+\rm ${CONFIG_DIR}/cfg.tmp
Index: /utils/build/mk_ENHANCE-03_domcfg/Fdel_keys.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fdel_keys.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fdel_keys.sh	(revision 11980)
@@ -0,0 +1,81 @@
+#!/bin/bash
+######################################################
+# Author : Simona Flavoni for NEMO
+# Contact : sflod@locean-ipsl.upmc.fr
+#
+# Some functions called from makenemo
+# Fdel_keys   : del keys in cpp.fcm file  
+######################################################
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ================
+# Fdel_keys.sh
+# ================
+#
+# --------------------------
+# Add compilation keys
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fdel_keys.sh CONFIG_NAME del_key "LIST_KEYS"
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Add cpp keys when compiling a configuration, key list has to be enclosed with " ".
+# We perform a 'sed' on the CONFIG_NAME/CPP.fcm file, containing the list of keys. 
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fdel_keys.sh CONFIG_NAME del_key "key_agrif"
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: Fdel_keys.sh 2158 2010-10-20 17:30:03Z sflod $
+#
+#
+#
+#   * creation
+#
+#-
+
+echo "Removing keys in : ${NEW_CONF}"
+
+for i in ${list_del_key} ; do
+
+     if [ "$(echo ${i} | grep -c key_nproc )" -ne 0                                      ]; then
+        sed -e "s/key_nproc[ij]=.* //" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \
+	    >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
+        mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
+        echo " "
+     elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ]; then
+         sed -e "s/\b${i}\b//" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \
+	     >  ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp
+         mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
+         echo "deleted key $i in ${NEW_CONF}"
+     fi
+
+done
+
+unset -v list_del_key
Index: /utils/build/mk_ENHANCE-03_domcfg/Ffetch_extdir.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Ffetch_extdir.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Ffetch_extdir.sh	(revision 11980)
@@ -0,0 +1,53 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+# ===============
+# Ffetch_extdir.sh
+# ===============
+# ---------------
+# Make the config 
+# ---------------
+# SYNOPSIS
+# ========
+# ::
+#  $ Ffetch_extdir.sh
+# DESCRIPTION
+# ===========
+# - Make the config directory 
+# - Create repositories needed :
+#  
+#  - EXP00 for namelist
+#  - MY_SRC for user sources
+#  - BLD for compilation 
+# EXAMPLES
+# ========
+# ::
+#  $ ./Ffetch_extdir.sh CONFIG_NAME REMOTE_CTL 
+# TODO
+# ====
+# option debug
+# EVOLUTIONS
+# ==========
+# $Id: Ffetch_extdir.sh 3715 2012-11-28 16:06:02Z acc $
+#   * creation
+#-
+basedir=$(pwd)
+cd ${1}
+wget ${2} -O remote_file.list
+#
+if [ -f remote_file.list ] ; then
+ cat remote_file.list | grep -v '^#' |
+  while
+   read remfile locfile
+   do
+    if [ $remfile == 'create_directory' ] ;then
+      mkdir $locfile
+    else
+      wget $remfile -O $locfile
+    fi
+   done
+fi
+cd $basedir
Index: /utils/build/mk_ENHANCE-03_domcfg/Fgo_to_TOOLS.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fgo_to_TOOLS.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fgo_to_TOOLS.sh	(revision 11980)
@@ -0,0 +1,55 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ===============
+# Fgo_to_tools.sh
+# ===============
+#
+# --------------------------
+# Go to the TOOLS directory
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fgo_to_tools.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Go to the TOOLS directory
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fgo_to_tools.sh
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+cd ${MAIN_DIR}/tools
Index: /utils/build/mk_ENHANCE-03_domcfg/Flist_archfile.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Flist_archfile.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Flist_archfile.sh	(revision 11980)
@@ -0,0 +1,77 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ==================
+# Flist_archfile.sh
+# ==================
+#
+# --------------------------
+# Check the compilation file
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Flist_archfile.sh Institute
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# List arch file available.
+# The first line of each file in NEMO/arch directory is echoed.  
+#
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Flist_archfile.sh 
+#
+#  $ ./Flist_archfile.sh CNRS
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+archfile_loop() {
+
+	for file in $( ls $1/*.fcm ); do
+		zvar1=$( basename $file | sed 's/arch-\(.*\).fcm/\1/' )
+		zvar2=$( head -1  $file | tr -d '#'                   )
+		printf "%-30s %-s\n" ${zvar1} "${zvar2}"
+	done
+
+}
+
+echo -e "\n  ¤ Generic computing architectures"
+
+archfile_loop ${MAIN_DIR}/arch
+
+for dir in $( ls ${MAIN_DIR}/arch | grep -v "fcm$" ); do
+	echo -e "\n  ¤ Specific HPC architectures for "${dir}
+	archfile_loop ${MAIN_DIR}/arch/$dir
+done
+
+echo
Index: /utils/build/mk_ENHANCE-03_domcfg/Flist_cfgs.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Flist_cfgs.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Flist_cfgs.sh	(revision 11980)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+echo -e "\n  ¤ Reference configurations with default sub-components (can be updated by a new set)"
+cat ${MAIN_DIR}/cfgs/ref_cfgs.txt \
+| awk '{printf "%-20s", $1}{$1 = ""; printf "%s\n", $0}'
+
+echo -e "\n  ¤ Demonstrations cases (see https://github.com/sflavoni/NEMO-test-cases for more)"
+cat ${MAIN_DIR}/tests/demo_cfgs.txt \
+| awk '{printf "%-20s", $1}{$1 = ""; printf "%s\n", $0}'
+
+echo -e "\n  ¤ Full scripted remote configurations (CPP file + EXP00 inputs + MY_SRC + ...)"
+cat ${MAIN_DIR}/tests/rmt_cfgs.txt
+
+echo -e "\n  ¤ Available sub-components ('OCE' is mandatory in any set)"
+ls  ${MAIN_DIR}/src | awk -F/ '{ print $NF }' | column
+
+echo
Index: /utils/build/mk_ENHANCE-03_domcfg/Fmake_WORK.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fmake_WORK.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fmake_WORK.sh	(revision 11980)
@@ -0,0 +1,99 @@
+#!/bin/bash
+######################################################
+# Author : Rachid Benshila for NEMO
+# Contact : rblod@locean-ipsl.upmc.fr
+#
+# Some functions called from makenemo
+# Fmake_WORK      : create links in the WORK
+######################################################
+#set -vx
+set -o posix
+#set -u
+#set -e
+#+
+#
+# =============
+# Fmake_WORK.sh
+# =============
+#
+# -----------------------
+# Make the WORK directory
+# -----------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fmake_WORK.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Make the WORK directory:
+#
+# - Create line in NEW_CONF/WORK
+# - Use specified sub-directories previously
+# - OPA has to be done first !!!
+#
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fmake_WORK.sh ORCA2_LIM OCE ICE
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+declare ZSRC=$1 ; shift 
+declare ZCONF=$1 ; shift
+ZTAB=( $@ )
+declare i=0 ; declare NDIR=${#ZTAB[@]}
+
+echo 'Creating '${ZCONF}'/WORK = '${ZTAB[*]}' for '${ZCONF}
+
+[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC
+[   -d ${ZCONF}/WORK   ] || \mkdir ${ZCONF}/WORK
+
+if [ "${ZSRC}" != 'none' ] ; then 
+
+	if [ -d ${ZSRC} ] ; then 
+		ln -sf ${ZSRC}/*.[Ffh]90 ${ZCONF}/MY_SRC/. 
+		echo 'MY_SRC content is linked to '${ZSRC}
+	else
+		echo 'External directory for MY_SRC does not exist. Using default.'
+	fi
+
+else 
+	echo 'MY_SRC directory is : '${ZCONF}'/MY_SRC'
+fi
+
+#\rm -f ../${1}/WORK/*
+
+for comp in ${ZTAB[*]}; do
+	find ${NEMO_DIR}/$comp -name *.[Ffh]90 -exec ln -sf {} ${ZCONF}/WORK \;
+done
+
+for i in `(cd ${ZCONF}/MY_SRC ; \ls *.[Ffh]90 2>/dev/null ) `; do
+	[ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/.
+done
+
+unset -v ZCONF ZTAB i NDIR
Index: /utils/build/mk_ENHANCE-03_domcfg/Fmake_bld.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fmake_bld.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fmake_bld.sh	(revision 11980)
@@ -0,0 +1,64 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ============
+# Fmake_bld.sh
+# ============
+#
+# --------------------
+# Make build directory
+# --------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fmake_bld.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Under CONFIG_NAME :
+# - Make the build directory 
+# - Create repositories needed :
+# - BLD for compilation 
+#
+# A tmpdir can be specified for memory issues.
+#
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fmake_bld.sh NEMOGCM/cfgs GYRE  /usr/tmp
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+[ ! -d ${3}/${2}     ] && \mkdir ${3}/${2}
+[ ! -d ${3}/${2}/BLD ] && \mkdir ${3}/${2}/BLD
+[ ! -d ${1}/${2}/BLD ] && ln -sf ${3}/${2}/BLD ${1}/${2}/BLD
+[ -f ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ] && ln -sf ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ${COMPIL_DIR}/cpp.fcm
+rm -f  ${1}/${NEW_CONF}/BLD/fcm.bld.lock
Index: /utils/build/mk_ENHANCE-03_domcfg/Fmake_config.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fmake_config.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fmake_config.sh	(revision 11980)
@@ -0,0 +1,66 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ===============
+# Fmake_config.sh
+# ===============
+#
+# ---------------
+# Make the config 
+# ---------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fmake_config.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# - Make the config directory 
+# - Create repositories needed :
+#  
+#  - EXP00 for namelist
+#  - MY_SRC for user sources
+#  - BLD for compilation 
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fmake_config.sh CONFIG_NAME REF_CONFIG_NAME 
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+\mkdir -p ${1}
+\mkdir -p ${1}/EXP00
+\mkdir -p ${1}/MY_SRC
+\cp -R -n ${2}/cpp_${2}.fcm ${1}/cpp_${1}.fcm
+\cp -R -n ${2}/EXPREF/*namelist* ${1}/EXP00/.
+\cp -R -n ${2}/EXPREF/*.xml ${1}/EXP00/.
+[ -f ${2}/EXPREF/AGRIF_FixedGrids.in ] &&  \cp -R -n ${2}/EXPREF/AGRIF_FixedGrids.in ${1}/EXP00/.
+[ -d    ${2}/MY_SRC ] && \cp -n ${2}/MY_SRC/* ${1}/MY_SRC/. 2> /dev/null
Index: /utils/build/mk_ENHANCE-03_domcfg/Fprep_agrif.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fprep_agrif.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fprep_agrif.sh	(revision 11980)
@@ -0,0 +1,79 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ==============
+# Fprep_agrif.sh
+# ==============
+#
+# ---------------------
+# Preparation for AGRIF
+# ---------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fprep_agrif.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Prepare directories for AGRIF and copy files needed
+#
+# Compile the conv
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fprep_agrif.sh CONFIG_NAME
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+#- AGRIF conv
+if [ "$AGRIFUSE" == 1 ]; then
+#-MPI for AGRIF
+if [ ! -f ${MAIN_DIR}/ext/AGRIF/nemo_mpi.h ];then
+   echo '#if defined key_mpp_mpi' > ${MAIN_DIR}/ext/AGRIF/nemo_mpi.h
+   echo '#define AGRIF_MPI'      >> ${MAIN_DIR}/ext/AGRIF/nemo_mpi.h
+   echo '#endif'                 >> ${MAIN_DIR}/ext/AGRIF/nemo_mpi.h
+fi
+
+ #- CONV
+fcm build ${COMPIL_DIR}/conv.cfg || exit 1
+#C_COMPILER=${CC-cc}
+#gmake CC=${C_COMPILER} -C ${MAIN_DIR}/ext/AGRIF/LIB
+
+#- AGRIF sources
+[ ! -d $2/$1/NEMOFILES ] && mkdir  $2/$1/NEMOFILES
+[ ! -d $2/$1/NEMOFILES/AGRIF_INC ] && mkdir  $2/$1/NEMOFILES/AGRIF_INC
+[ ! -d $2/$1/NEMOFILES/AGRIF_MODELFILES ] && mkdir  $2/$1/NEMOFILES/AGRIF_MODELFILES
+cp -f -r ${MAIN_DIR}/ext/AGRIF/agrif_oce.in  $2/$1/NEMOFILES/
+#cp -f -r ${MAIN_DIR}/ext/AGRIF/conv  $2/$1/NEMOFILES/
+cp -f -r $2/$1/AGRIFLIB/bin/conv  $2/$1/NEMOFILES/
+
+fi
Index: /utils/build/mk_ENHANCE-03_domcfg/Fread_dir.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/Fread_dir.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/Fread_dir.sh	(revision 11980)
@@ -0,0 +1,83 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ============
+# Fread_dir.sh
+# ============
+#
+# ---------------------
+# Read user directories
+# ---------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ Fread_dir.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Read directoires needed from standard input
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./Fread_dir.sh Directory_NAME YES/NO
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+#
+#   * creation
+#
+#-
+
+if [ "$2" == "YES" ]; then
+   echo -n " $1 [Y/n] "
+   read answer
+   answer=`echo $answer | sed 's/^[yY].*$/y/'`
+   if [  -z "$answer" -o "x$answer" = "xy" ]; then
+      TAB[$ind]="$1"
+      let ind=ind+1
+      echo " $1 selected "
+      echo "  "
+   else
+      echo " $1 Not selected "
+      echo "  "
+   fi
+   unset -v answer
+else
+   echo -n " $1 [y/N] "
+   read answer
+   answer=`echo $answer | sed 's/^[nN].*$/N/'`
+   if [ "x$answer" = "xy" ]; then
+      TAB[$ind]="$1"
+      let ind=ind+1
+      echo " $1 selected "
+      echo "  "
+   else
+      echo " $1 Not selected "
+      echo "  "
+   fi
+   unset -v answer
+fi
Index: /utils/build/mk_ENHANCE-03_domcfg/README
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/README	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/README	(revision 11980)
@@ -0,0 +1,7 @@
+CSHRC :
+setenv PATH ~/NEMOGCM/TOOLS:$PATH
+setenv NEMO_TDIR /users/rblod/tmp
+
+BASH :
+export PATH=$PATH:~/NEMOGCM/TOOLS'
+export NEMO_TDIR=/users/rblod/tmp
Index: /utils/build/mk_ENHANCE-03_domcfg/agrifpp.sh
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/agrifpp.sh	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/agrifpp.sh	(revision 11980)
@@ -0,0 +1,62 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ==========
+# agrifpp.sh
+# ==========
+#
+# ----------------------------
+# Preform AGrif pre-processing
+# ----------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ agrifpp.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# Preprocess file using the conv in NEMOFILES directory
+# Standard preprocessed files are stored in NEMOFILES/ppsrc/nemo
+# Source files are stored under NEMOFILES/obj
+# Include filess  in NEMOFILES/inc
+# Note that agrif2model.F90 should not be preprocess (standard one) 
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./agrifpp.sh FILE_TO_PROCESS
+# 
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: agrifpp.sh 2143 2010-10-04 12:49:55Z rblod $
+#
+#
+#
+#   * creation
+#
+#-
+MYFILE=$(basename "$1")
+if [ "$MYFILE" == "agrif2model.f90" ];then
+   \cp ${NEMO_TDIR}/${NEW_CONF}/WORK/${MYFILE/.f90/.F90} ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/obj/$MYFILE
+else
+cd ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/ppsrc/nemo ; ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/conv ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/agrif_oce.in -rm -incdir ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/inc -comdirout ${NEMO_TDIR}/${NEW_CONF}/NEMOFILES/obj -convfile ${MYFILE} > /dev/null 
+fi
Index: /utils/build/mk_ENHANCE-03_domcfg/bld.cfg
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/bld.cfg	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/bld.cfg	(revision 11980)
@@ -0,0 +1,68 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc $COMPIL_DIR/arch_nemo.fcm
+inc $COMPIL_DIR/cpp.fcm
+
+search_src           1
+
+src::ioipsl               $MAIN_DIR/ext/IOIPSL/src
+src::agrif                $MAIN_DIR/ext/AGRIF/AGRIF_FILES
+src::nemo                 $CONFIG_DIR/$NEW_CONF/NEMOFILES/obj
+
+bld::target  nemo.exe
+bld::exe_dep
+
+
+dir::root            $NEMO_TDIR/$NEW_CONF/BLD
+
+
+bld::tool::cpp       %CPP
+bld::tool::fpp       %CPP
+bld::tool::fc        %FC 
+bld::tool::fflags    %FCFLAGS %USER_INC
+bld::tool::fflags::agrif   %FFLAGS %USER_INC
+bld::tool::ld        %LD
+bld::tool::ldflags   %LDFLAGS %USER_LIB
+bld::tool::ar        %AR
+bld::tool::arflags   %ARFLAGS
+bld::tool::make      %MK
+
+# Pre-process code before analysing dependencies
+bld::pp::ioipsl   1
+bld::pp::nemo     1
+bld::pp::agrif    1
+bld::tool::fppflags::nemo      %FPPFLAGS -I$CONFIG_DIR/$NEW_CONF/NEMOFILES/inc
+bld::tool::fppflags::ioipsl    %FPPFLAGS
+bld::tool::fppflags::agrif     %FPPFLAGS -include ${MAIN_DIR}/ext/AGRIF/nemo_mpi.h
+
+# Ignore the following dependencies
+bld::excl_dep        inc::netcdf.inc
+bld::excl_dep        inc::VT.inc
+bld::excl_dep        use::netcdf
+bld::excl_dep        use::xios
+bld::excl_dep        h::netcdf.inc
+bld::excl_dep        h::mpif.h
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        inc::mpe_logf.h
+bld::excl_dep        use::mpi
+bld::excl_dep        use::mod_oasis
+bld::excl_dep        use::mkl_dfti
+# Don't generate interface files
+bld::tool::geninterface none
+
+# Allow ".h90" as an extension for CPP include files
+bld::infile_ext::h90  CPP::INCLUDE
+bld::infile_ext::f90  FPP::FPP9X::SOURCE
+
+# extension for module output
+bld::outfile_ext::mod .mod
+
+# rename executable to nemo.exe
+bld::exe_name::model  nemo.exe
Index: /utils/build/mk_ENHANCE-03_domcfg/bld_preproagr.cfg
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/bld_preproagr.cfg	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/bld_preproagr.cfg	(revision 11980)
@@ -0,0 +1,82 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc $COMPIL_DIR/arch_nemo.fcm
+inc $COMPIL_DIR/cpp.fcm
+search_src           1
+
+src::nemo                 $CONFIG_DIR/$NEW_CONF/WORK
+
+bld::target  lib_cray.f90 nemo.f90 agrif_user.f90 agrif2model.f90 
+
+dir::root            $NEMO_TDIR/$NEW_CONF/NEMOFILES
+
+bld::tool::fc_output
+bld::tool::fc_compile
+bld::tool::fc_include
+bld::tool::fc        $COMPIL_DIR/agrifpp.sh 
+bld::tool::fflags    
+bld::tool::ld       
+bld::tool::ldflags   
+bld::tool::ar        
+bld::tool::arflags   
+bld::tool::make      %MK
+
+OUTFILE_EXT::obj   .f90
+
+# Pre-process code before analysing dependencies
+bld::pp::nemo     1
+bld::pp::nemo/agrif2model     0
+bld::tool::cpp       %CPP
+bld::tool::fpp       %CPP
+bld::tool::fppflags::nemo  %FPPFLAGS
+
+# Ignore the following dependencies
+bld::excl_dep        inc::netcdf.inc
+bld::excl_dep        inc::VT.inc
+bld::excl_dep        use::netcdf
+bld::excl_dep        h::netcdf.inc
+bld::excl_dep        h::mpif.h
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        inc::mpe_logf.h
+bld::excl_dep        use::mpi
+bld::excl_dep        use::mod_oasis
+bld::excl_dep        use::mkl_dfti
+bld::excl_dep	     use::nc4interface
+bld::excl_dep	     use::ioipsl
+bld::excl_dep	     use::xios
+bld::excl_dep        use::agrif_grids
+bld::excl_dep	     use::agrif_types
+bld::excl_dep	     use::agrif_util
+bld::excl_dep        inc::SetNumberofcells.h
+bld::excl_dep        inc::GetNumberofcells.h
+bld::excl_dep        inc::include_use_Alloc_agrif.h
+bld::excl_dep        inc::allocations_calls_agrif.h
+bld::excl_dep        inc::modtype_agrif.h
+bld::excl_dep        inc::probdim_agrif.h
+bld::excl_dep        inc::keys_agrif.h
+bld::excl_dep        h::SetNumberofcells.h
+bld::excl_dep        h::GetNumberofcells.h
+bld::excl_dep        h::include_use_Alloc_agrif.h
+bld::excl_dep        h::allocations_calls_agrif.h
+bld::excl_dep        h::modtype_agrif.h
+bld::excl_dep        h::probdim_agrif.h
+bld::excl_dep        h::keys_agrif.h
+bld::excl_dep        use::mod_attribut
+bld::excl_dep        use::mod_event_client
+bld::excl_dep        use::mod_ioclient
+#bld::excl_dep        OBJ
+
+# Don't generate interface files
+bld::tool::geninterface none
+
+# Allow ".h90" and ".f90" as an extension for CPP include files
+bld::infile_ext::h90  CPP::INCLUDE
+bld::infile_ext::f90  FPP::FPP9X::SOURCE
+bld::src_type::nemo/agrif2model.F90 FORTRAN::FORTRAN9X::SOURCE
Index: /utils/build/mk_ENHANCE-03_domcfg/bld_tools.cfg
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/bld_tools.cfg	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/bld_tools.cfg	(revision 11980)
@@ -0,0 +1,51 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc $COMPIL_DIR/arch_tools.fcm
+inc $COMPIL_DIR/cpp_tools.fcm
+
+search_src           1
+
+src::nemo            $TOOLS_DIR/$NEW_CONF/src
+
+dir::root            $TOOLS_DIR/$NEW_CONF/BLD
+
+bld::tool::cpp       %CPP
+bld::tool::fpp       %CPP
+bld::tool::fc        %FC 
+bld::tool::fflags    %FCFLAGS %USER_INC
+bld::tool::ld        %LD
+bld::tool::ldflags   %LDFLAGS %USER_LIB
+bld::tool::ar        %AR
+bld::tool::arflags   %ARFLAGS
+bld::tool::make      %MK
+
+# Pre-process code before analysing dependencies
+bld::pp::nemo     1
+bld::tool::fppflags::nemo      %FPPFLAGS -I$TOOLS_DIR/$NEW_CONF/NEMOFILES/inc
+
+# Ignore the following dependencies
+bld::excl_dep        inc::netcdf.inc
+bld::excl_dep        use::netcdf
+bld::excl_dep        use::xios
+bld::excl_dep        h::netcdf.inc
+bld::excl_dep        h::mpif.h
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        use::mpi
+bld::excl_dep        use::mod_oasis
+
+# Don't generate interface files
+bld::tool::geninterface none
+
+# Allow ".h90" as an extension for CPP include files
+bld::infile_ext::h90  CPP::INCLUDE
+bld::infile_ext::f90  FPP::FPP9X::SOURCE
+
+# extension for module output
+bld::outfile_ext::mod .mod
Index: /utils/build/mk_ENHANCE-03_domcfg/bldxag.cfg
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/bldxag.cfg	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/bldxag.cfg	(revision 11980)
@@ -0,0 +1,64 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc $COMPIL_DIR/arch_nemo.fcm
+inc $COMPIL_DIR/cpp.fcm
+
+search_src           1
+
+src::ioipsl               $MAIN_DIR/ext/IOIPSL/src
+src::nemo                 $CONFIG_DIR/$NEW_CONF/WORK
+
+bld::target nemo.exe
+bld::exe_dep
+
+
+dir::root            $NEMO_TDIR/$NEW_CONF/BLD
+
+
+bld::tool::cpp       %CPP
+bld::tool::fpp       %CPP
+bld::tool::fc        %FC 
+bld::tool::fflags    %FCFLAGS %USER_INC
+bld::tool::ld        %LD
+bld::tool::ldflags   %LDFLAGS %USER_LIB
+bld::tool::ar        %AR
+bld::tool::arflags   %ARFLAGS
+bld::tool::make      %MK
+
+# Pre-process code before analysing dependencies
+bld::pp::ioipsl   1
+bld::pp::nemo     1
+bld::tool::fppflags::nemo     %FPPFLAGS
+bld::tool::fppflags::ioipsl   %FPPFLAGS
+
+# Ignore the following dependencies
+bld::excl_dep        inc::netcdf.inc
+bld::excl_dep        inc::VT.inc
+bld::excl_dep        use::netcdf
+bld::excl_dep        use::xios
+bld::excl_dep        h::netcdf.inc
+bld::excl_dep        h::mpif.h
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        inc::mpe_logf.h
+bld::excl_dep        use::mpi
+bld::excl_dep        use::mod_oasis
+bld::excl_dep        use::mkl_dfti
+# Don't generate interface files
+bld::tool::geninterface none
+
+# Allow ".h90" as an extension for CPP include files
+bld::infile_ext::h90  CPP::INCLUDE
+
+# extension for module output
+bld::outfile_ext::mod .mod
+
+# rename executable to nemo.exe
+bld::exe_name::model  nemo.exe
+
Index: /utils/build/mk_ENHANCE-03_domcfg/conv.cfg
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/conv.cfg	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/conv.cfg	(revision 11980)
@@ -0,0 +1,35 @@
+# ----------------------- FCM extract configuration file -----------------------
+# template to compile agrif conv, currently not used
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+inc $COMPIL_DIR/arch_nemo.fcm
+
+bld::tool::cc        %CC
+bld::tool::cflags    %CFLAGS
+bld::tool::make      %MK
+
+src::convsrc   $MAIN_DIR/ext/AGRIF/LIB
+
+ #----------------------------------------------------------------------------
+# Build options (code-specific, machine-independent)
+# ----------------------------------------------------------------------------
+dir::root            $NEMO_TDIR/$NEW_CONF/AGRIFLIB
+
+#bld::tool::cflags::convsrc  -O0  
+#bld::tool::ld::convsrc   cc
+#bld::tool::ldflags::convsrc -O  ../obj/fortran.o ../obj/fortran.o 
+#bld::pp 1
+
+
+
+bld::exe_name::main conv
+bld::target                              libconvsrc.a  fortran.o main.o  conv
+bld::exe_dep::conv      
+
+
+
Index: /utils/build/mk_ENHANCE-03_domcfg/tools.txt
===================================================================
--- /utils/build/mk_ENHANCE-03_domcfg/tools.txt	(revision 11980)
+++ /utils/build/mk_ENHANCE-03_domcfg/tools.txt	(revision 11980)
@@ -0,0 +1,1 @@
+DOMAINcfg 
