Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-IA64_PLATINE.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-IA64_PLATINE.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-IA64_PLATINE.fcm	(revision 1987)
@@ -1,17 +1,26 @@
-%NCDF_INC            -I/usr/include 
-%NCDF_LIB            -L usr/lib -lnetcdf -lnetcdff
-%COMPILER            mpif90
-%LINKER              mpif90
-%AR                  ar
-%MAKE                gmake
-%FPP_FLAGS           -P -traditional 
-%FPP_DEF             _NONE_
-%BASE_FFLAGS         -i4 -r8 -automatic -align all -I/opt/mpi/current/include
-%PROD_FFLAGS         -O3
-%DEV_FFLAGS          -O3 -traceback
-%DEBUG_FFLAGS        -g -traceback
-%MPI_FFLAGS
-%OMP_FFLAGS          -openmp
-%BASE_LD              -r8 -automatic
-%MPI_LD
-%OMP_LD              -openmp
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
+%NCDF_INC        -I/usr/include 
+%NCDF_LIB        -L usr/lib -lnetcdf -lnetcdff
+%FC              mpif90
+%FCFLAGS         -i4 -r8 -automatic -align all -I/opt/mpi/current/include
+%FFLAGS          %FCFLAGS
+%LD              mpif90
+%LDFLAGS
+%AR              ar
+%ARFLAGS         rs
+%MK              gmake
+%USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-PW6_VARGAS.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-PW6_VARGAS.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-PW6_VARGAS.fcm	(revision 1987)
@@ -1,11 +1,26 @@
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make  
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir> 
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
 %NCDF_INC            -I/usr/local/pub/NetCDF/3.6.2/include
 %NCDF_LIB            -L /usr/local/pub/NetCDF/3.6.2/lib -lnetcdf
 %FC                  mpxlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qsave -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 
+%FFLAGS              -qfixed -O3 -qsave -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 
 %LD                  mpxlf90_r
+%LDFLAGS    
 %AR                  ar
-%M_K                 gmake
-%FPP_FLAGS           -P
-%FFLAGS              -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 %NCDF_INC %USER_INC
-%MPI_FFLAGS          -I/usr/lpp/ppe.poe/include/thread64
-%OMP_FFLAGS          
+%ARFLAGS             -rs
+%MK                  gmake 
 %USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_BRODIE.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_BRODIE.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_BRODIE.fcm	(revision 1987)
@@ -1,10 +1,26 @@
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
 %NCDF_INC           -I/SXlocal/pub/netCDF/netCDF-3.6.1/include
 %NCDF_LIB           -L/SXlocal/pub/netCDF/netCDF-3.6.1/lib -lnetcdf
 %FC                 sxmpif90
+%FCFLAGS            -f2003 nocbind -dW -Wf,"-A idbl4",-ptr byte -sx8 -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf,-pvctl noassume loopcnt=10000  -Wf"-init heap=zero"
+%FFLAGS             %FCFLAGS
 %LD                 sxmpif90
+%LDFLAGS
 %AR                 sxar
 %ARFLAGS            -rs 
-%M_K                make
-%FPP_FLAGS          -P -traditional 
-%FFLAGS             -f2003 nocbind -dW -Wf,"-A idbl4",-ptr byte -sx8 -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf,-pvctl noassume loopcnt=10000 %NCDF_INC %USER_INC
+%MK                 sxgmake
 %USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_MERCURE.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_MERCURE.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX8_MERCURE.fcm	(revision 1987)
@@ -1,17 +1,27 @@
-%NCDF_INC            -I/usr/local/SX8/soft/netcdf/include
-%NCDF_LIB            -L/usr/local/SX8/soft/netcdf/lib -lnetcdf
-%COMPILER            sxmpif90
-%LINKER              sxmpif90
-%AR                  sxar
-%MAKE                make
-%FPP_FLAGS           -P -traditional 
-%FPP_DEF             _NONE_
-%BASE_FFLAGS         -f2003 nocbind -P stack -Wf,-pvctl res=whole,-A idbl4,-ptr byte -EP -R5 -float0 -size_t64 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume"
-%PROD_FFLAGS         -C vopt
-%DEV_FFLAGS          -C vsafe -gv -Wf,-init stack=nan,-init heap=nan
-%DEBUG_FFLAGS        -C debug -eC -Wf,-init stack=nan,-init heap=nan
-%MPI_FFLAGS
-%OMP_FFLAGS          -P openmp 
-%BASE_LD             -size_t64
-%MPI_LD
-%OMP_LD              -P openmp
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
+%NCDF_INC        -I/usr/local/SX8/soft/netcdf/include
+%NCDF_LIB        -L/usr/local/SX8/soft/netcdf/lib -lnetcdf
+%FC              sxmpif90
+%FCFLAGS         -f2003 nocbind -P stack -dW -Wf,-pvctl res=whole,-A idbl4,-ptr byte -EP -R5 -float0 -size_t64 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume"  -Wf"-init heap=zero"
+%FFLAGS          %FCFLAGS
+%LD              sxmpif90
+%LDFLAGS
+%AR              sxar
+%ARFLAGS         -rs
+%MK              gmake
+%USER_INC
+%USER_LIB
+
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX9_MERCURE.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX9_MERCURE.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-SX9_MERCURE.fcm	(revision 1987)
@@ -1,17 +1,27 @@
-%NCDF_INC            -I/ccc/applications/sx9/netcdf-3.6.1/include
-%NCDF_LIB            -L/ccc/applications/sx9/netcdf-3.6.1/lib -lnetcdf
-%COMPILER            sxmpif90
-%LINKER              sxmpif90
-%AR                  sxar
-%MAKE                make
-%FPP_FLAGS           -P -traditional 
-%FPP_DEF             _NONE_
-%BASE_FFLAGS         -f2003 nocbind -P stack -Wf,-pvctl res=whole,-A idbl4,-ptr byte -EP -R5 -float0 -size_t64 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume"
-%PROD_FFLAGS         -C vopt
-%DEV_FFLAGS          -C vsafe -gv -Wf,-init stack=nan,-init heap=nan
-%DEBUG_FFLAGS        -C debug -eC -Wf,-init stack=nan,-init heap=nan
-%MPI_FFLAGS
-%OMP_FFLAGS          -P openmp 
-%BASE_LD             -size_t64
-%MPI_LD
-%OMP_LD              -P openmp
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
+%NCDF_INC        -I/usr/local/SX8/soft/netcdf/include
+%NCDF_LIB        -L/usr/local/SX8/soft/netcdf/lib -lnetcdf
+%FC              sxmpif90
+%FCFLAGS         -f2003 nocbind -P stack -dW -Wf,-pvctl res=whole,-A idbl4,-ptr byte -EP -R5 -float0 -size_t64 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume"  -Wf"-init heap=zero"
+%FFLAGS          %FCFLAGS
+%LD              sxmpif90
+%LDFLAGS
+%AR              sxar
+%ARFLAGS         -rs
+%MK              gmake
+%USER_INC
+%USER_LIB
+
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-X64_TITANE.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-X64_TITANE.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-X64_TITANE.fcm	(revision 1987)
@@ -1,17 +1,26 @@
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
 %NCDF_INC            -I$NETCDF_INCLUDEDIR
 %NCDF_LIB            -L$NETCDF_LIBDIR -lnetcdff -lnetcdf
-%COMPILER            mpif90
-%LINKER              mpif90
+%FC                  mpif90
+%FCFLAGS             -i4 -r8 -automatic -align all
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS          
 %AR                  ar
-%MAKE                gmake
-%FPP_FLAGS           -P -traditional 
-%FPP_DEF             _NONE_
-%BASE_FFLAGS         -i4 -r8 -automatic -align all
-%PROD_FFLAGS         -O3
-%DEV_FFLAGS          -O3 -traceback
-%DEBUG_FFLAGS        -g -traceback
-%MPI_FFLAGS
-%OMP_FFLAGS          -openmp
-%BASE_LD              -r8 -automatic
-%MPI_LD
-%OMP_LD              -openmp
+%ARFLAGS
+%MK                  gmake
+%USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-gfortran_osx.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-gfortran_osx.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-gfortran_osx.fcm	(revision 1987)
@@ -1,10 +1,26 @@
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
 %NCDF_INC            -I/usr/local/gfortran_4_3/netcdf3_6_3/include
 %NCDF_LIB            -L/usr/local/gfortran_4_3/netcdf3_6_3/lib -lnetcdf
 %FC	             gfortran
+%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops  
+%FFLAGS              %FCFLAGS
 %LD                  gfortran
-%AR                  ar
-%ARFLAGS             -rs
-%M_K                 make
-%FPP_FLAGS           -P -traditional
-%FFLAGS              -fdefault-real-8 -O3 -funroll-all-loops  
+%AR                  libtool
+%ARFLAGS             -c -s -o
+%MK                  make
 %USER_INC
+%USER_LIB
+
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-ifort_osx.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-ifort_osx.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-ifort_osx.fcm	(revision 1987)
@@ -1,10 +1,27 @@
-%NCDF_INC             -I/usr/local/pub/netcdf/4.0.1-ifort/include 
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
+
+
+%NCDF_INC            -I/usr/local/pub/netcdf/4.0.1-ifort/include 
 %NCDF_LIB            -L /usr/local/pub/netcdf/4.0.1-ifort/lib -lnetcdf   
 %FC                  mpif90
+%FCFLAGS 	     -r8 -O3  -traceback 
+%FFLAGS 	     -r8 -O3  -traceback 
 %LD                  mpif90
+%LDFLAGS
 %AR                  libtool 
 %ARFLAGS             -c -s -o
-%M_K                 make
-%FPP_FLAGS           -P -traditional -I/usr/local/pub/openmpi/1.3.3-ifort/include
+%MK                  make
 %FFLAGS 	     -r8 -O3  -traceback 
 %USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_aix.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_aix.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_aix.fcm	(revision 1987)
@@ -1,20 +1,26 @@
+DF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
 
 
-%NCDF_INC            -I/usr/local/XLF/netcdf/include
-%NCDF_LIB            -L/usr/local/XLF/netcdf/lib -lnetcf
-%COMPILER            xlf90
-%LINK                xlf90
+%NCDF_INC            -I/usr/local/pub/NetCDF/3.6.2/include
+%NCDF_LIB            -L /usr/local/pub/NetCDF/3.6.2/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qsave -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
+%FFLAGS              -qfixed -O3 -qsave -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
+%LD                  mpxlf90_r
+%LDFLAGS
 %AR                  ar
-%MAKE                make
-%FPP_FLAGS           -P -traditional
-%FPP_DEF
-%BASE_FFLAGS         -O3 -qrealsize=8 -qextname -qsuffix=f=f90 -qsuffix=cpp=F90
-%PROD_FFLAGS         -fast
-%DEV_FFLAGS          -g
-%DEBUG_FFLAGS        -g
-%MPI_FFLAGS
-%OMP_FFLAGS
-%BASE_LD             
-%MPI_LD
-%OMP_LD
-
+%ARFLAGS             -rs
+%MK                  gmake
+%USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_osx.fcm
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_osx.fcm	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/ARCH/arch-xlf_osx.fcm	(revision 1987)
@@ -1,20 +1,26 @@
+# NCDF_INC    netcdf include file
+# NCDF_LIB    netcdf library
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    additional include files for the compiler,  e.g. -I<include dir>
+# USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
 
 
-%NCDF_INC            -I/usr/local/XLF/netcdf/include
-%NCDF_LIB            -L/usr/local/XLF/netcdf/lib -lnetcf
-%COMPILER            xlf90
-%LINK                xlf90
-%AR                  ar
-%MAKE                make
-%FPP_FLAGS           -P -traditional
-%FPP_DEF
-%BASE_FFLAGS         -O3 -qrealsize=8 -qextname -qsuffix=f=f90 -qsuffix=cpp=F90
-%PROD_FFLAGS         -fast
-%DEV_FFLAGS          -g
-%DEBUG_FFLAGS        -g
-%MPI_FFLAGS
-%OMP_FFLAGS
-%BASE_LD             
-%MPI_LD
-%OMP_LD
-
+%NCDF_INC      -I/usr/local/XLF/netcdf/include
+%NCDF_LIB      -L/usr/local/XLF/netcdf/lib -lnetcf
+%FC            xlf90
+%FCFLAGS       -O3 -qrealsize=8 -qextname -qsuffix=f=f90 -qsuffix=cpp=F90
+%FFLAGS        %FCFLAGS
+%LD            xlf90
+%LDFLAGS
+%AR            ar
+%ARFLAGS       rs
+%MK            make
+%USER_INC
+%USER_LIB
Index: /branches/DEV_r1879_FCM/NEMOGCM/CONFIG/makenemo
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/CONFIG/makenemo	(revision 1987)
+++ /branches/DEV_r1879_FCM/NEMOGCM/CONFIG/makenemo	(revision 1987)
@@ -0,0 +1,228 @@
+#!/bin/bash
+#set -x
+set -o posix
+#set -u 
+#set -e
+#+
+#
+# ===============
+# makenemo_fcm.sh
+# ===============
+#
+# --------------------------
+# Compile NEMO
+# --------------------------
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ makenemo_fcm.sh
+#
+#
+# DESCRIPTION
+# ===========
+#
+#
+# This script aims :
+#
+# - to choose MYCONFIG
+# - to choose compiler options  
+# - to create the CONFIG/MYCONFIG/WORK directory
+# - to compile this configuration
+#
+#  Variables used :
+#
+#  From user input
+#
+# - NEW_CONF    : configuration to be created
+# - REF_CONF    : reference configuration to build the new one 
+# - CMP_NAM     : compiler name 
+# - NBR_PRC     : number of processes used to compile  
+# - NEM_SUBDIR  : NEMO subdirectory used (specified)
+#
+#  Locally defined :
+#
+# - TAB         : NEMO subdirectory used (read)  
+# - MAIN_DIR : self explaining
+# - CONFIG_DIR  :   "    "    "   
+# - MODELES_DIR :   "    "    " 
+# - TOOLS_DIR   :   "    "    " 
+# - NEMO_DIR    :   "    "    "
+#
+# EXAMPLES
+# ========
+#
+# ::
+#
+#  $ ./makenemo_fcm -t ifort_osx - j3 -n ORCA2_LIM
+#
+#
+# TODO
+# ====
+#
+# option debug
+#
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id$
+#
+#
+# - rblod 2010-06-20T16:11:47Z
+#
+#   * creation
+#
+#-
+
+#- Local variables ---
+b_n=$(basename ${0})
+export MAIN_DIR=${PWD%/NEMOGCM*}/NEMOGCM
+export CONFIG_DIR=${MAIN_DIR}/CONFIG
+export TOOLS_DIR=${MAIN_DIR}/TOOLS
+export NEMO_DIR=${MAIN_DIR}/NEMO
+export AGRIFUSE=0
+declare -a TAB
+#-
+#- FCM and functions location ---
+export PATH=${MAIN_DIR}/EXTERNAL/fcm/bin:$PATH
+
+#-
+#- Choice of the options ---
+x_d="";
+x_n="";
+x_r="";
+x_m="";
+x_t="";
+x_j=1;
+while getopts :hld:n:r:m:j:t: V
+  do
+	 case $V in
+		(h)  echo "Usage	 : "${b_n} \
+					 " [-h] [-l] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-j No]";
+			  echo " -h		: help";
+			  echo " -l		: list existing configurations";
+			  echo " -n name : config name";
+			  echo " -m arch : choose machine";
+			  echo " -d dir  : choose NEMO sub-directories";
+			  echo " -r conf : choose reference configuration";
+			  echo " -j No	 : number of processes used to compile (0=nocompilation)";
+			  echo " -t dir  : remporary directory for compilation"
+			  echo "";
+			  echo "Example to install a new configuration MY_CONFIG";
+			  echo "with OPA_SRC and LIM_SRC_2 ";
+			  echo "makenemo_fcm -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\"";
+			  echo "";
+			  echo "Defaults	  : ";
+			  echo "";
+			  exit 0;;
+		(d)  x_d=${OPTARG};;
+		(n)  x_n=${OPTARG};;
+		(r)  x_r=${OPTARG};;
+		(m)  x_m=${OPTARG};;
+		(j)  x_j=${OPTARG};;
+		(t)  x_t=${OPTARG};;
+		(l)  echo "Available configurations :"; cat ${TOOLS_DIR}/cfg.txt; exit;;
+		(:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
+			  exit 2;;
+		(\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
+			  exit 2;;
+	 esac
+  done
+shift $(($OPTIND-1));
+
+#-
+#- Go to NEMOGCM/config directory ---
+cd ${CONFIG_DIR}
+
+#-
+#- Initialisation from input ---
+export NEW_CONF=${x_n}
+NBR_PRC=${x_j}
+CMP_NAM=${x_m}
+NEM_SUBDIR=${x_d}
+REF_CONF=${x_r}
+NEMO_TDIR=${x_t:-$NEMO_TDIR}
+export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR}
+
+#- When used for the first time, choose a compiler ---
+. ${TOOLS_DIR}/Fcheck_archfile.sh ${CMP_NAM} || exit
+
+#-
+#- Choose a default configuration if needed ---
+#- ORCA2_LIM or last one used ---
+. ${TOOLS_DIR}/Fcheck_config.sh ${NEW_CONF} || exit 
+
+if [ ${#NEW_CONF} -eq 0 ] ; then
+	if [ ${#NEM_SUBDIR} -eq 0 -a ${#REF_CONF} -eq 0 ]; then
+		echo "You are  installing a new configuration"
+		ind=0
+		. ${TOOLS_DIR}/Fread_dir.sh OPA_SRC	YES 
+		. ${TOOLS_DIR}/Fread_dir.sh LIM_SRC_2   YES 
+		. ${TOOLS_DIR}/Fread_dir.sh LIM_SRC_3    NO  
+		. ${TOOLS_DIR}/Fread_dir.sh TOP_SRC	 NO  
+		. ${TOOLS_DIR}/Fread_dir.sh C1D_SRC	YES 
+		. ${TOOLS_DIR}/Fread_dir.sh NST_SRC	YES 
+		. ${TOOLS_DIR}/Fread_dir.sh OFF_SRC	 NO  
+		REF_CONF=ORCA2_LIM
+	elif [ ${#NEM_SUBDIR} -gt 0 ] && [ ${#REF_CONF} -eq 0 ]; then
+		echo "You are  installing a new configuration"
+		TAB=( ${NEM_SUBDIR} )
+		REF_CONF=ORCA2_LIM
+	elif [ ${#NEM_SUBDIR} -eq 0 ] && [ ${#REF_CONF} -gt 0 ]; then
+		echo "You are  installing a new configuration based on ${REF_CONF}"
+		${TOOLS_DIR}/Fcopy_dir.sh ${REF_CONF}  
+	fi
+	NEW_CONF=${x_n}
+    . ${TOOLS_DIR}/Fmake_config.sh ${NEW_CONF} ${REF_CONF}
+else
+	sed -e "/${NEW_CONF} /d"  ${TOOLS_DIR}/cfg.txt >  ${TOOLS_DIR}/cfg.tmp
+	\mv  ${TOOLS_DIR}/cfg.tmp  ${TOOLS_DIR}/cfg.txt
+fi
+
+#-
+#- Save new configuration and directories names ---
+echo ${NEW_CONF} ${TAB[*]} >> ${TOOLS_DIR}/cfg.txt
+
+#-
+#- Create the WORK ---
+#- Clean links and librairies ---
+#- Creating the good links, at first on OPA_SRC ---
+. ${TOOLS_DIR}/Fmake_WORK.sh ${NEW_CONF} ${TAB[*]} || exit
+
+. ${TOOLS_DIR}/Fmake_bld.sh ${NEW_CONF}  ${NEMO_TDIR} || exit
+
+#- At this stage the configuration has beeen chosen
+#- We look after agrif
+grep key_agrif ${TOOLS_DIR}/cpp.fcm && export AGRIFUSE=1
+. ${TOOLS_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit
+
+#-
+#_ END OF CONFIGURATION PHASE
+#_
+
+#-
+#- Compile ---
+
+if [ "${NBR_PRC}" -gt 0 ]; then
+cd ${NEMO_TDIR}/${NEW_CONF} || cd -
+
+#if AGRIF we do a first preprocessing
+[ "$AGRIFUSE" == 1 ] && fcm build --ignore-lock -s 2 ${TOOLS_DIR}/bld.cfg 
+[ "$AGRIFUSE" == 1 ] && rm -rf  ${NEMO_TDIR}/${NEW_CONF}/BLD/*
+fcm build --ignore-lock -v 1 -j ${NBR_PRC} ${TOOLS_DIR}/bld.cfg || cd -
+[ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa
+fi
+
+#-
+#- Come back to original directory ---
+cd -
+
+#-
+#- Unset variables
+${TOOLS_DIR}/Fclean_var.sh
+
+
+exit 0;
Index: /branches/DEV_r1879_FCM/NEMOGCM/NEMO/OPA_SRC/lib_mpp.F90
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/NEMO/OPA_SRC/lib_mpp.F90	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/NEMO/OPA_SRC/lib_mpp.F90	(revision 1987)
@@ -103,5 +103,5 @@
    !! ========================= !!
 !$AGRIF_DO_NOT_TREAT
-#  include <mpif.h>
+   INCLUDE 'mpif.h'
 !$AGRIF_END_DO_NOT_TREAT
    
Index: /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/bld.cfg
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/bld.cfg	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/bld.cfg	(revision 1987)
@@ -30,20 +30,18 @@
 
 bld::tool::fc        %FC 
+bld::tool::fflags    %FCFLAGS %NCDF_INC %USER_INC
+bld::tool::fflags::agrif   %FFLAGS %NCDF_INC %USER_INC
 bld::tool::ld        %LD
+bld::tool::ldflags   %LDFLAGS %NCDF_LIB %USER_LIB
 bld::tool::ar        %AR
 bld::tool::arflags   %ARFLAGS
-bld::tool::make      %M_K
-bld::tool::fflags    %FFLAGS 
-bld::tool::ldflags   %LD_FLAGS 
-
-bld::tool::cppflags  %FPP_FLAGS 
-bld::tool::fppflags  %FPP_FLAGS
-
+bld::tool::make      %MK
 
 # Pre-process code before analysing dependencies
 bld::pp::nemo 1
+bld::pp::agrif 1
 bld::tool::fpp       $TOOLS_DIR/agrifpp.sh
-bld::tool::fppflags  %FPP_FLAGS
 bld::tool::fppflags::nemo $AGRIFUSE
+bld::tool::fppflags::agrif 0
 
 # Ignore the following dependencies
Index: /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/cfg.txt
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/cfg.txt	(revision 1986)
+++ /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/cfg.txt	(revision 1987)
@@ -1,7 +1,6 @@
-ORCA2_OFF_PISCES OFF_SRC TOP_SRC
 GYRE OPA_SRC LIM_SRC_2 C1D_SRC
 ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC C1D_SRC TOP_SRC
-toto OPA_SRC LIM_SRC_2 C1D_SRC NST_SRC
 GYRE_LOBSTER OPA_SRC LIM_SRC_2 NST_SRC C1D_SRC TOP_SRC
-ORCA2_LIM_OFF OPA_SRC LIM_SRC_2 C1D_SRC NST_SRC OFF_SRC
+ORCA2_OFF_PISCES OFF_SRC TOP_SRC
+POMME OPA_SRC LIM_SRC_2 NST_SRC C1D_SRC
 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC C1D_SRC
Index: anches/DEV_r1879_FCM/NEMOGCM/TOOLS/makenemo_fcm.sh
===================================================================
--- /branches/DEV_r1879_FCM/NEMOGCM/TOOLS/makenemo_fcm.sh	(revision 1986)
+++ 	(revision )
@@ -1,228 +1,0 @@
-#!/bin/bash
-#set -x
-set -o posix
-#set -u 
-#set -e
-#+
-#
-# ===============
-# makenemo_fcm.sh
-# ===============
-#
-# --------------------------
-# Compile NEMO
-# --------------------------
-#
-# SYNOPSIS
-# ========
-#
-# ::
-#
-#  $ makenemo_fcm.sh
-#
-#
-# DESCRIPTION
-# ===========
-#
-#
-# This script aims :
-#
-# - to choose MYCONFIG
-# - to choose compiler options  
-# - to create the CONFIG/MYCONFIG/WORK directory
-# - to compile this configuration
-#
-#  Variables used :
-#
-#  From user input
-#
-# - NEW_CONF    : configuration to be created
-# - REF_CONF    : reference configuration to build the new one 
-# - CMP_NAM     : compiler name 
-# - NBR_PRC     : number of processes used to compile  
-# - NEM_SUBDIR  : NEMO subdirectory used (specified)
-#
-#  Locally defined :
-#
-# - TAB         : NEMO subdirectory used (read)  
-# - MAIN_DIR : self explaining
-# - CONFIG_DIR  :   "    "    "   
-# - MODELES_DIR :   "    "    " 
-# - TOOLS_DIR   :   "    "    " 
-# - NEMO_DIR    :   "    "    "
-#
-# EXAMPLES
-# ========
-#
-# ::
-#
-#  $ ./makenemo_fcm -t ifort_osx - j3 -n ORCA2_LIM
-#
-#
-# TODO
-# ====
-#
-# option debug
-#
-#
-# EVOLUTIONS
-# ==========
-#
-# $Id$
-#
-#
-# - rblod 2010-06-20T16:11:47Z
-#
-#   * creation
-#
-#-
-
-#- Local variables ---
-b_n=$(basename ${0})
-export MAIN_DIR=${PWD%/NEMOGCM*}/NEMOGCM
-export CONFIG_DIR=${MAIN_DIR}/CONFIG
-export TOOLS_DIR=${MAIN_DIR}/TOOLS
-export NEMO_DIR=${MAIN_DIR}/NEMO
-export AGRIFUSE=0
-declare -a TAB
-#-
-#- FCM and functions location ---
-export PATH=${MAIN_DIR}/EXTERNAL/fcm/bin:$PATH
-
-#-
-#- Choice of the options ---
-x_d="";
-x_n="";
-x_r="";
-x_m="";
-x_t="";
-x_j=1;
-while getopts :hld:n:r:m:j:t: V
-  do
-	 case $V in
-		(h)  echo "Usage	 : "${b_n} \
-					 " [-h] [-l] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-j No]";
-			  echo " -h		: help";
-			  echo " -l		: list existing configurations";
-			  echo " -n name : config name";
-			  echo " -m arch : choose machine";
-			  echo " -d dir  : choose NEMO sub-directories";
-			  echo " -r conf : choose reference configuration";
-			  echo " -j No	 : number of processes used to compile (0=nocompilation)";
-			  echo " -t dir  : remporary directory for compilation"
-			  echo "";
-			  echo "Example to install a new configuration MY_CONFIG";
-			  echo "with OPA_SRC and LIM_SRC_2 ";
-			  echo "makenemo_fcm -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\"";
-			  echo "";
-			  echo "Defaults	  : ";
-			  echo "";
-			  exit 0;;
-		(d)  x_d=${OPTARG};;
-		(n)  x_n=${OPTARG};;
-		(r)  x_r=${OPTARG};;
-		(m)  x_m=${OPTARG};;
-		(j)  x_j=${OPTARG};;
-		(t)  x_t=${OPTARG};;
-		(l)  echo "Available configurations :"; cat ${TOOLS_DIR}/cfg.txt; exit;;
-		(:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
-			  exit 2;;
-		(\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
-			  exit 2;;
-	 esac
-  done
-shift $(($OPTIND-1));
-
-#-
-#- Go to NEMOGCM/config directory ---
-cd ${CONFIG_DIR}
-
-#-
-#- Initialisation from input ---
-export NEW_CONF=${x_n}
-NBR_PRC=${x_j}
-CMP_NAM=${x_m}
-NEM_SUBDIR=${x_d}
-REF_CONF=${x_r}
-NEMO_TDIR=${x_t:-$NEMO_TDIR}
-export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR}
-
-#- When used for the first time, choose a compiler ---
-. ${TOOLS_DIR}/Fcheck_archfile.sh ${CMP_NAM} || exit
-
-#-
-#- Choose a default configuration if needed ---
-#- ORCA2_LIM or last one used ---
-. ${TOOLS_DIR}/Fcheck_config.sh ${NEW_CONF} || exit 
-
-if [ ${#NEW_CONF} -eq 0 ] ; then
-	if [ ${#NEM_SUBDIR} -eq 0 -a ${#REF_CONF} -eq 0 ]; then
-		echo "You are  installing a new configuration"
-		ind=0
-		. ${TOOLS_DIR}/Fread_dir.sh OPA_SRC	YES 
-		. ${TOOLS_DIR}/Fread_dir.sh LIM_SRC_2   YES 
-		. ${TOOLS_DIR}/Fread_dir.sh LIM_SRC_3    NO  
-		. ${TOOLS_DIR}/Fread_dir.sh TOP_SRC	 NO  
-		. ${TOOLS_DIR}/Fread_dir.sh C1D_SRC	YES 
-		. ${TOOLS_DIR}/Fread_dir.sh NST_SRC	YES 
-		. ${TOOLS_DIR}/Fread_dir.sh OFF_SRC	 NO  
-		REF_CONF=ORCA2_LIM
-	elif [ ${#NEM_SUBDIR} -gt 0 ] && [ ${#REF_CONF} -eq 0 ]; then
-		echo "You are  installing a new configuration"
-		TAB=( ${NEM_SUBDIR} )
-		REF_CONF=ORCA2_LIM
-	elif [ ${#NEM_SUBDIR} -eq 0 ] && [ ${#REF_CONF} -gt 0 ]; then
-		echo "You are  installing a new configuration based on ${REF_CONF}"
-		${TOOLS_DIR}/Fcopy_dir.sh ${REF_CONF}  
-	fi
-	NEW_CONF=${x_n}
-    . ${TOOLS_DIR}/Fmake_config.sh ${NEW_CONF} ${REF_CONF}
-else
-	sed -e "/${NEW_CONF} /d"  ${TOOLS_DIR}/cfg.txt >  ${TOOLS_DIR}/cfg.tmp
-	\mv  ${TOOLS_DIR}/cfg.tmp  ${TOOLS_DIR}/cfg.txt
-fi
-
-#-
-#- Save new configuration and directories names ---
-echo ${NEW_CONF} ${TAB[*]} >> ${TOOLS_DIR}/cfg.txt
-
-#-
-#- Create the WORK ---
-#- Clean links and librairies ---
-#- Creating the good links, at first on OPA_SRC ---
-. ${TOOLS_DIR}/Fmake_WORK.sh ${NEW_CONF} ${TAB[*]} || exit
-
-. ${TOOLS_DIR}/Fmake_bld.sh ${NEW_CONF}  ${NEMO_TDIR} || exit
-
-#- At this stage the configuration has beeen chosen
-#- We look after agrif
-grep key_agrif ${TOOLS_DIR}/cpp.fcm && export AGRIFUSE=1
-. ${TOOLS_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit
-
-#-
-#_ END OF CONFIGURATION PHASE
-#_
-
-#-
-#- Compile ---
-
-if [ "${NBR_PRC}" -gt 0 ]; then
-cd ${NEMO_TDIR}/${NEW_CONF} || cd -
-
-#if AGRIF we do a first preprocessing
-[ "$AGRIFUSE" == 1 ] && fcm build --ignore-lock -s 2 ${TOOLS_DIR}/bld.cfg 
-[ "$AGRIFUSE" == 1 ] && rm -rf  ${NEMO_TDIR}/${NEW_CONF}/BLD/*
-fcm build --ignore-lock -v 1 -j ${NBR_PRC} ${TOOLS_DIR}/bld.cfg || cd -
-[ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa
-fi
-
-#-
-#- Come back to original directory ---
-cd -
-
-#-
-#- Unset variables
-${TOOLS_DIR}/Fclean_var.sh
-
-
-exit 0;
