Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf-3.6.3/include
-%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -O3 -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%FFLAGS              -O3 -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%LD                  mpxlf90_r
-%LDFLAGS             -bloadmap:LinkerErrorMap 
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso_debug.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso_debug.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf-3.6.3/include
-%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -g -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%FFLAGS              -g -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%LD                  mpxlf90_r
-%LDFLAGS             -bloadmap:LinkerErrorMap 
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso_tools.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CMCC/arch-PW6_calypso_tools.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf-3.6.3/include
-%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
-%FC                  xlf90
-%FCFLAGS             -O3 -qsuffix=f=f90  -qstrict -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%FFLAGS              -O3 -qsuffix=f=f90  -qstrict -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
-%LD                  xlf90
-%LDFLAGS             -bloadmap:LinkerErrorMap 
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-ALTIX_JADE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-ALTIX_JADE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# ifort compiler options for CINES SGI-ALTIX Jade, http://www.cines.fr/spip.php?rubrique291
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/opt/software/SGI/netcdf/4.1.3/include
-%NCDF_LIB            -L/opt/software/SGI/netcdf/4.1.3/lib -lnetcdf -lnetcdff 
-%FC                  ifort -lmpi
-%FCFLAGS             -r8 -O3 -xSSE4.2 -automatic -static 
-%FFLAGS              %FCFLAGS   
-%LD                  %FC
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -ruv
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-BG_BABEL.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-BG_BABEL.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# babel IBM BlueGene/P at french IDRIS, http://www.idris.fr/su/Scalaire/babel
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/bglocal/prod/tools_ibm/netcdf-3.6.1/includ
-%NCDF_LIB            -L/bglocal/prod/tools_ibm/netcdf-3.6.1/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -qfree=f90 -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%LD                  mpxlf90_r
-%LDFLAGS    
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-IA64_PLATINE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-IA64_PLATINE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# platine BULL cluster at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/platine.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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
-%FPPFLAGS        -P -C -traditional
-%AR              ar
-%ARFLAGS         rs
-%MK              gmake
-%USER_INC        %NCDF_INC
-%USER_LIB        %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-PW6MONO_VARGAS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-PW6MONO_VARGAS.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# vargas IBM POWER6 (monoprocessor for tools) at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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                  xlf90_r
-%FCFLAGS             -qfree=f90 -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%FFLAGS              -qfixed -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%LD                  xlf90_r
-%LDFLAGS    
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-PW6_VARGAS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-PW6_VARGAS.fcm	(revision 4275)
+++ 	(revision )
@@ -1,32 +1,0 @@
-# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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>
-#
-# module load netcdf/4.1.3-par
-# module load phdf5/1.8.7
-#
-%NCDF_INC            
-%NCDF_LIB    
-%XIOS_ROOT           /workgpfs/rech/eee/reee217/XIOS
-%FC                  mpxlf90_r
-%FCFLAGS             -qfree=f90 -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%FFLAGS              -qfixed -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%LD                  mpCC_r
-%LDFLAGS             -lxlf90
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
-%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX8_BRODIE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX8_BRODIE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# brodie NEC SX-8 at french IDRIS, http://www.idris.fr/su/Vectoriel/brodie/hw-brodie.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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" -R2
-%FFLAGS             %FCFLAGS
-%LD                 sxmpif90
-%LDFLAGS
-%FPPFLAGS           -P -C -traditional
-%AR                 sxar
-%ARFLAGS            rs 
-%MK                 sxgmake
-%USER_INC           %NCDF_INC
-%USER_LIB           %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX8_MERCURE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX8_MERCURE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# mercure NEC SX-8 at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/mercure.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/ccc/applications/sx8/netcdf-3.6.1/include
-%NCDF_LIB        -L/ccc/applications/sx8/netcdf-3.6.1/lib -lnetcdf
-%FC              sxmpif90
-%FCFLAGS         -f2003 nocbind -size_t64 -dW -Wf,"-A idbl4", -sx8 -C vopt -P stack -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 shape=10000000 -Wf"-init heap=zero" -R2
-%FFLAGS          %FCFLAGS
-%LD              sxmpif90
-%LDFLAGS         -size_t64
-%FPPFLAGS        -P -C -traditional
-%AR              sxar
-%ARFLAGS         rs
-%MK              sxgmake
-%USER_INC        %NCDF_INC
-%USER_LIB        %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX9_ES2.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX9_ES2.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# Earth Simulator 2, NEC SX-9, http://www.jamstec.go.jp/esc/index.en.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/SX/usr/include
-%NCDF_LIB        -L/SX/usr/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" -R2
-%FFLAGS          %FCFLAGS
-%LD              sxmpif90
-%LDFLAGS
-%FPPFLAGS        -P -C -traditional
-%AR              sxar
-%ARFLAGS         rs
-%MK              gmake
-%USER_INC        %NCDF_INC
-%USER_LIB        %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX9_MERCURE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-SX9_MERCURE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# mercure NEC SX-9 at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/mercure.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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" -R2
-%FFLAGS          %FCFLAGS
-%LD              sxmpif90
-%LDFLAGS
-%FPPFLAGS        -P -C -traditional
-%AR              sxar
-%ARFLAGS         rs
-%MK              gmake
-%USER_INC        %NCDF_INC
-%USER_LIB        %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-TX7_ULAM.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-TX7_ULAM.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# ulam IBM X3950 M2 at french IDRIS, http://www.idris.fr/su/Scalaire/ulam/hw-ulam.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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.3/include
-%NCDF_LIB            -L/usr/local/pub/NetCDF/3.6.3/lib -lnetcdf_c++ -lnetcdf
-%FC                  ifort
-%FCFLAGS             -r8 -O3  -traceback
-%FFLAGS              %FCFLAGS
-%LD                  %FC
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_CURIE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_CURIE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,34 +1,0 @@
-# Curie BULL at french TGCC, http://www-hpc.cea.fr/en/complexe/tgcc-curie.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf-4.2_hdf5/include
-%NCDF_LIB            -L/usr/local/netcdf-4.2_hdf5/lib -L/usr/local/hdf5-1.8.8/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl -lstdc++
-%XIOS_ROOT           /ccc/work/cont005/ra0542/massons/now/models/xios
-%FC                  mpif90 -c -cpp
-# for Curie Fat Node
-#%FCFLAGS             -i4 -r8 -O3 -fp-model precise -xSSE4.2 
-# for Curie Thin Node
-#%FCFLAGS             -i4 -r8 -O3 -fp-model precise -xAVX
-# for Curie all Node
-%FCFLAGS             -i4 -r8 -O3 -fp-model precise
-%FFLAGS              %FCFLAGS
-%LD                  mpif90
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            -I%XIOS_ROOT/inc %NCDF_INC 
-%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB -lstdc++
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_TITANE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_TITANE.fcm	(revision 4275)
+++ 	(revision )
@@ -1,28 +1,0 @@
-# titane BULL at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/titane.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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_INC_DIR)
-%NCDF_LIB            -L$(NETCDF_LIB_DIR) -lnetcdff -lnetcdf
-%FC                  mpif90 -c -cpp
-%FCFLAGS             -i4 -r8 -DCPP_PARA -O3 -automatic -align all
-%FFLAGS              %FCFLAGS
-%LD                  mpif90
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_VAYU.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X64_VAYU.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# Vayu Sun Constellation at Australian NCI, http://nf.nci.org.au/facilities/vayu/hardware.php
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/short/e14/szm552/util/include
-%NCDF_LIB            -L/short/e14/szm552/util/lib -lnetcdff -lnetcdf  -lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl -lstdc++
-%XIOS_ROOT           /short/e14/szm552/now/models/xios
-%FC                  mpif90 -c -cpp
-%FCFLAGS             -i4 -r8
-%FFLAGS              %FCFLAGS
-%LD                  mpif90
-%LDFLAGS             
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
-%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X86_CESIUM.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-X86_CESIUM.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# cesium pre/post processing HP at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/cesium.htm
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/applications/netcdf-3.6.3/include
-%NCDF_LIB            -L/applications/netcdf-3.6.3/lib -lnetcdff -lnetcdf
-%FC                  ifort
-%FCFLAGS             -i4 -r8 
-%FFLAGS              %FCFLAGS
-%LD                  ifort
-%LDFLAGS              -Vaxlib 
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-ifort_CICLAD.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-ifort_CICLAD.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic ifort compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/opt/netcdf3/ifort/include 
-%NCDF_LIB            -L /opt/netcdf3/ifort/lib -lnetcdf   
-%FC                  /usr/lib64/openmpi/1.4.3-ifort/bin/mpif90 -c -cpp -DCPP_PARA -pg
-%FCFLAGS 	     -i4 -r8 -O3  -traceback 
-%FFLAGS 	     -i4 -r8 -O3  -traceback 
-%LD                  /usr/lib64/openmpi/1.4.3-ifort/bin/mpif90 
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-macport_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-macport_osx.fcm	(revision 4275)
+++ 	(revision )
@@ -1,41 +1,0 @@
-# generic gfortran compiler options for OSX installed with macport
-#
-# port packages needed:
-#    sudo port install openmpi +gcc45
-#    sudo port install hdf5-18 +cxx +fortran +openmpi (I'am not sure cxx is needed)
-#    sudo port install netcdf         +openmpi
-#    sudo port install netcdf-fortran +openmpi
-#    sudo port install netcdf-cxx     +openmpi (I'am not sure it is needed)
-#    sudo port install p5-uri
-# add to your PATH /opt/local/lib/openmpi/bin so that mpif90 is properly known
-#
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/opt/local/include
-%NCDF_LIB            -L/opt/local/lib -lnetcdf -lnetcdff
-%XIOS_ROOT           /Users/smasson/XIOS
-%FC	             mpif90 
-%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
-%FFLAGS              %FCFLAGS
-%LD                  %FC
-%LDFLAGS             -lstdc++ -lmpi_cxx
-%FPPFLAGS            -P -C -traditional
-%AR                  libtool
-%ARFLAGS             -c -s -o
-%MK                  make
-%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
-%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-x3750_ADA.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/CNRS/arch-x3750_ADA.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# Ada  IBM x3750 at french IDRIS, http://www.idris.fr/ada/ada-hw-ada.html
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/smplocal/pub/NetCDF/4.1.3/mpi/include
-%NCDF_LIB            -L/smplocal/pub/NetCDF/4.1.3/mpi/lib -L/smplocal/pub/HDF5/1.8.9/par/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lhdf5 -lz -lstdc++
-%XIOS_ROOT           /smphome/rech/fry/rfry154/XIOS
-%FC                  mpiifort -c -cpp
-%FCFLAGS             -DCPP_PARA -i4 -r8 -O3 -xAVX -fp-model precise
-%FFLAGS              %FCFLAGS
-%LD                  mpiifort
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            -I%XIOS_ROOT/inc %NCDF_INC
-%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB -lstdc++
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-ALTIX_NAUTILUS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-ALTIX_NAUTILUS.fcm	(revision 4275)
+++ 	(revision )
@@ -1,33 +1,0 @@
-# ifort (mpif90) compiler options for NOCS ALTIX cluster nautilus
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/sw/packages/netcdf/3.6.2/x86_64/include
-%NCDF_LIB            -L/sw/packages/netcdf/3.6.2/x86_64/lib -lnetcdf
-%FC                  mpif90
-%FCFLAGS             -r8 -O3 -xT -ip -vec-report0
-%FFLAGS              -r8 -O3 -xT -ip -vec-report0
-%LD                  mpif90
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
-# - if debugging use these flags
-#FCFLAGS             -g -traceback -r8 -O0 -xT -ip -vec-report0
-#FFLAGS              -g -traceback -r8 -O0 -xT -ip -vec-report0
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-ALTIX_NAUTILUS_MPT.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-ALTIX_NAUTILUS_MPT.fcm	(revision 4275)
+++ 	(revision )
@@ -1,43 +1,0 @@
-# ifort compiler options for NOCS ALTIX cluster nautilus using NetCDF4 libraries
-# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
-# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
-# XIOS_HOME   root directory containing lib for XIOS
-# NCDF_INC    netcdf include file
-# NCDF_LIB    netcdf library
-# XIOS_LIB    XIOS 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
-# FPPFLAGS    pre-processing flags
-# 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_HOME           /fibre/omfman/NETCDF_PAR
-%HDF5_HOME           /fibre/omfman/NETCDF_PAR
-%XIOS_HOME           /fibre/omfman/XIOS
-%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
-%XIOS_INC            -I%XIOS_HOME/inc 
-%XIOS_LIB            -L%XIOS_HOME/lib -lxios
-# Note use of -Bstatic because the library root directories may not be accessible to the back-end compute nodes
-%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -Bstatic -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -Bdynamic -lz
-%FC                  ifort
-%FCFLAGS             -r8 -O3 -fp-model precise -xT -ip -vec-report0
-%FFLAGS              -r8 -O3 -fp-model precise -xT -ip -vec-report0
-%LD                  ifort
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS             -lmpi -lstdc++
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC %XIOS_INC
-%USER_LIB            %XIOS_LIB %NCDF_LIB
-
-# - if debugging use these flags
-#FCFLAGS             -g -traceback -r8 -O0 -xT -ip -vec-report0
-#FFLAGS              -g -traceback -r8 -O0 -xT -ip -vec-report0
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-XT6_HECTORcrayftn.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-XT6_HECTORcrayftn.fcm	(revision 4275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-# compiler options for hector CRAY XT6 (using crayftn compiler)
-
-# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
-# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
-# 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
-# FPPFLAGS    pre-processing flags
-# 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>
-
-
-# PrgEnv-cray (default for hector phase 3)
-# use "module load netcdf/4.1.2" to setup netcdf (defines NETCDF_DIR and HDF5_DIR)
-
-%NCDF_HOME           $NETCDF_DIR
-%HDF5_HOME           $HDF5_DIR
-%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
-%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -lz
-%FC                  ftn
-%FCFLAGS             -em -s integer32 -s real64 -O3
-%FFLAGS              -em -s integer32 -s real64 -O3
-%LD                  ftn
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
-# replacement options for GNU prgenv
-
-# %NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-gnu
-# %HDF5_HOME           $CRAY_HDF5_DIR/hdf5-gnu
-# %FCFLAGS             -fdefault-real-8 -O3
-# %FFLAGS              -fdefault-real-8 -O3
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-pgf90_mobius.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/NOC/arch-pgf90_mobius.fcm	(revision 4275)
+++ 	(revision )
@@ -1,32 +1,0 @@
-# mpi compiler options for NOCL's cluster Mobius
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/cm/shared/apps/netcdf/pgi/64/4.1.1/include -I/usr/mpi/qlogic/include
-%NCDF_LIB             -L/cm/shared/apps/pgi/7.1-6/linux86-64/7.1-6/lib -L/usr/mpi/qlogic/lib64  -L/cm/shared/apps/netcdf/pgi/64/4.1.1/lib -lnetcdf
-%FC	             mpif90 -c
-%FCFLAGS             -i4 -r8 -O3 -Mfree  
-## FCFLAGS for debugging
-#%FCFLAGS             -i4 -r8 -Mfree -Ktrp=fp -g -C 
-%FFLAGS              %FCFLAGS
-%LD                  mpif90
-%LDFLAGS                  
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -rs 
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf-3.6.3/include
+%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -O3 -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%FFLAGS              -O3 -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%LD                  mpxlf90_r
+%LDFLAGS             -bloadmap:LinkerErrorMap 
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_debug.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_debug.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_debug.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf-3.6.3/include
+%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -g -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%FFLAGS              -g -qsuffix=f=f90  -qstrict -qalias=intptr -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%LD                  mpxlf90_r
+%LDFLAGS             -bloadmap:LinkerErrorMap 
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_tools.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_tools.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CMCC/arch-PW6_calypso_tools.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf-3.6.3/include
+%NCDF_LIB            -L/usr/local/netcdf-3.6.3/lib -lnetcdf
+%FC                  xlf90
+%FCFLAGS             -O3 -qsuffix=f=f90  -qstrict -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%FFLAGS              -O3 -qsuffix=f=f90  -qstrict -qsuppress=1501-245 -qarch=pwr6 -q64 -qrealsize=8 -qtune=pwr6 -qextname -qlargepage -qmaxmem=-1
+%LD                  xlf90
+%LDFLAGS             -bloadmap:LinkerErrorMap 
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ALTIX_JADE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ALTIX_JADE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ALTIX_JADE.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# ifort compiler options for CINES SGI-ALTIX Jade, http://www.cines.fr/spip.php?rubrique291
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/opt/software/SGI/netcdf/4.1.3/include
+%NCDF_LIB            -L/opt/software/SGI/netcdf/4.1.3/lib -lnetcdf -lnetcdff 
+%FC                  ifort -lmpi
+%FCFLAGS             -r8 -O3 -xSSE4.2 -automatic -static 
+%FFLAGS              %FCFLAGS   
+%LD                  %FC
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -ruv
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-BG_BABEL.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-BG_BABEL.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-BG_BABEL.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# babel IBM BlueGene/P at french IDRIS, http://www.idris.fr/su/Scalaire/babel
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/bglocal/prod/tools_ibm/netcdf-3.6.1/includ
+%NCDF_LIB            -L/bglocal/prod/tools_ibm/netcdf-3.6.1/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%LD                  mpxlf90_r
+%LDFLAGS    
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-IA64_PLATINE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-IA64_PLATINE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-IA64_PLATINE.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# platine BULL cluster at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/platine.htm
+# 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
+# FPPFLAGS    pre-processing flags
+# 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
+%FPPFLAGS        -P -C -traditional
+%AR              ar
+%ARFLAGS         rs
+%MK              gmake
+%USER_INC        %NCDF_INC
+%USER_LIB        %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6MONO_VARGAS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6MONO_VARGAS.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6MONO_VARGAS.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# vargas IBM POWER6 (monoprocessor for tools) at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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                  xlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%FFLAGS              -qfixed -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%LD                  xlf90_r
+%LDFLAGS    
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6_VARGAS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6_VARGAS.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-PW6_VARGAS.fcm	(revision 4276)
@@ -0,0 +1,32 @@
+# vargas IBM POWER6 at french IDRIS, http://www.idris.fr/su/Scalaire/vargas/hw-vargas.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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>
+#
+# module load netcdf/4.1.3-par
+# module load phdf5/1.8.7
+#
+%NCDF_INC            
+%NCDF_LIB    
+%XIOS_ROOT           /workgpfs/rech/eee/reee217/XIOS
+%FC                  mpxlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%FFLAGS              -qfixed -O3 -qstrict -qrealsize=8 -qextname=flush -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%LD                  mpCC_r
+%LDFLAGS             -lxlf90
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
+%USER_LIB            -L%XIOS_ROOT/lib -lxios %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_BRODIE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_BRODIE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_BRODIE.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# brodie NEC SX-8 at french IDRIS, http://www.idris.fr/su/Vectoriel/brodie/hw-brodie.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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" -R2
+%FFLAGS             %FCFLAGS
+%LD                 sxmpif90
+%LDFLAGS
+%FPPFLAGS           -P -C -traditional
+%AR                 sxar
+%ARFLAGS            rs 
+%MK                 sxgmake
+%USER_INC           %NCDF_INC
+%USER_LIB           %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_MERCURE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_MERCURE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX8_MERCURE.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# mercure NEC SX-8 at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/mercure.htm
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/ccc/applications/sx8/netcdf-3.6.1/include
+%NCDF_LIB        -L/ccc/applications/sx8/netcdf-3.6.1/lib -lnetcdf
+%FC              sxmpif90
+%FCFLAGS         -f2003 nocbind -size_t64 -dW -Wf,"-A idbl4", -sx8 -C vopt -P stack -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 shape=10000000 -Wf"-init heap=zero" -R2
+%FFLAGS          %FCFLAGS
+%LD              sxmpif90
+%LDFLAGS         -size_t64
+%FPPFLAGS        -P -C -traditional
+%AR              sxar
+%ARFLAGS         rs
+%MK              sxgmake
+%USER_INC        %NCDF_INC
+%USER_LIB        %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_ES2.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_ES2.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_ES2.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# Earth Simulator 2, NEC SX-9, http://www.jamstec.go.jp/esc/index.en.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/SX/usr/include
+%NCDF_LIB        -L/SX/usr/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" -R2
+%FFLAGS          %FCFLAGS
+%LD              sxmpif90
+%LDFLAGS
+%FPPFLAGS        -P -C -traditional
+%AR              sxar
+%ARFLAGS         rs
+%MK              gmake
+%USER_INC        %NCDF_INC
+%USER_LIB        %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_MERCURE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_MERCURE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-SX9_MERCURE.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# mercure NEC SX-9 at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/mercure.htm
+# 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
+# FPPFLAGS    pre-processing flags
+# 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" -R2
+%FFLAGS          %FCFLAGS
+%LD              sxmpif90
+%LDFLAGS
+%FPPFLAGS        -P -C -traditional
+%AR              sxar
+%ARFLAGS         rs
+%MK              gmake
+%USER_INC        %NCDF_INC
+%USER_LIB        %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-TX7_ULAM.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-TX7_ULAM.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-TX7_ULAM.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# ulam IBM X3950 M2 at french IDRIS, http://www.idris.fr/su/Scalaire/ulam/hw-ulam.html
+# 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
+# FPPFLAGS    pre-processing flags
+# 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.3/include
+%NCDF_LIB            -L/usr/local/pub/NetCDF/3.6.3/lib -lnetcdf_c++ -lnetcdf
+%FC                  ifort
+%FCFLAGS             -r8 -O3  -traceback
+%FFLAGS              %FCFLAGS
+%LD                  %FC
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X64_TITANE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X64_TITANE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X64_TITANE.fcm	(revision 4276)
@@ -0,0 +1,28 @@
+# titane BULL at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/titane.htm
+# 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
+# FPPFLAGS    pre-processing flags
+# 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_INC_DIR
+%NCDF_LIB            -L$NETCDF_LIB_DIR -lnetcdff -lnetcdf
+%FC                  mpif90 -c -cpp
+%FCFLAGS             -i4 -r8 -DCPP_PARA -O3 -automatic -align all
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X86_CESIUM.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X86_CESIUM.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-X86_CESIUM.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# cesium pre/post processing HP at french CCRT, http://www-ccrt.cea.fr/fr/moyen_de_calcul/cesium.htm
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/applications/netcdf-3.6.3/include
+%NCDF_LIB            -L/applications/netcdf-3.6.3/lib -lnetcdff -lnetcdf
+%FC                  ifort
+%FCFLAGS             -i4 -r8 
+%FFLAGS              %FCFLAGS
+%LD                  ifort
+%LDFLAGS              -Vaxlib 
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ifort_CICLAD.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ifort_CICLAD.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/CNRS/arch-ifort_CICLAD.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic ifort compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/opt/netcdf3/ifort/include 
+%NCDF_LIB            -L /opt/netcdf3/ifort/lib -lnetcdf   
+%FC                  /usr/lib64/openmpi/1.4.3-ifort/bin/mpif90 -c -cpp -DCPP_PARA -pg
+%FCFLAGS 	     -i4 -r8 -O3  -traceback 
+%FFLAGS 	     -i4 -r8 -O3  -traceback 
+%LD                  /usr/lib64/openmpi/1.4.3-ifort/bin/mpif90 
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-ALTIX_NAUTILUS.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-ALTIX_NAUTILUS.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-ALTIX_NAUTILUS.fcm	(revision 4276)
@@ -0,0 +1,33 @@
+# ifort (mpif90) compiler options for NOCS ALTIX cluster nautilus
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/sw/packages/netcdf/3.6.2/x86_64/include
+%NCDF_LIB            -L/sw/packages/netcdf/3.6.2/x86_64/lib -lnetcdf
+%FC                  mpif90
+%FCFLAGS             -r8 -O3 -xT -ip -vec-report0
+%FFLAGS              -r8 -O3 -xT -ip -vec-report0
+%LD                  mpif90
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
+# - if debugging use these flags
+#FCFLAGS             -g -traceback -r8 -O0 -xT -ip -vec-report0
+#FFLAGS              -g -traceback -r8 -O0 -xT -ip -vec-report0
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-XT6_HECTORcrayftn.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-XT6_HECTORcrayftn.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-XT6_HECTORcrayftn.fcm	(revision 4276)
@@ -0,0 +1,44 @@
+# compiler options for hector CRAY XT6 (using crayftn compiler)
+
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# 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
+# FPPFLAGS    pre-processing flags
+# 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>
+
+
+# PrgEnv-cray (default for hector phase 3)
+# use "module load netcdf/4.1.2" to setup netcdf (defines NETCDF_DIR and HDF5_DIR)
+
+%NCDF_HOME           $NETCDF_DIR
+%HDF5_HOME           $HDF5_DIR
+%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -lz
+%FC                  ftn
+%FCFLAGS             -em -s integer32 -s real64 -O3
+%FFLAGS              -em -s integer32 -s real64 -O3
+%LD                  ftn
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
+# replacement options for GNU prgenv
+
+# %NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-gnu
+# %HDF5_HOME           $CRAY_HDF5_DIR/hdf5-gnu
+# %FCFLAGS             -fdefault-real-8 -O3
+# %FFLAGS              -fdefault-real-8 -O3
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-pgf90_mobius.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-pgf90_mobius.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/NOC/arch-pgf90_mobius.fcm	(revision 4276)
@@ -0,0 +1,32 @@
+# mpi compiler options for NOCL's cluster Mobius
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/cm/shared/apps/netcdf/pgi/64/4.1.1/include -I/usr/mpi/qlogic/include
+%NCDF_LIB             -L/cm/shared/apps/pgi/7.1-6/linux86-64/7.1-6/lib -L/usr/mpi/qlogic/lib64  -L/cm/shared/apps/netcdf/pgi/64/4.1.1/lib -lnetcdf
+%FC	             mpif90 -c
+%FCFLAGS             -i4 -r8 -O3 -Mfree  
+## FCFLAGS for debugging
+#%FCFLAGS             -i4 -r8 -Mfree -Ktrp=fp -g -C 
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS                  
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -rs 
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_C1A.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_C1A.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_C1A.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# POWER 6 at ECMWF
+# 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
+# FPPFLAGS    pre-processing flags
+# 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>
+#-g -C -qsigtrap 
+
+%NCDF_INC            -I /usr/local/apps/netcdf/3.6.3/LP64/include
+%NCDF_LIB            -L /usr/local/apps/netcdf/3.6.3/LP64/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -qfree=f90 -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
+%LD                  mpxlf90_r
+%LDFLAGS    
+%FPPFLAGS            -P -C
+%AR                  ar  
+%ARFLAGS             rs
+%MK                  gmake 
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_METO.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_METO.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-PW6_METO.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# IBM POWER6  UKMO
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/opt/netcdf/netcdf-3.6.0-p1_ec/include
+%NCDF_LIB            -L /opt/netcdf/netcdf-3.6.0-p1_ec/lib -lnetcdf
+%FC                  mpxlf90_r
+%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr6 -NS32768 -I/opt/netcdf-3.6.0-p1_ex/include -qxflag=p6div:p6divmsg -g -O3 -qnostrict 
+%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr6 -NS32768 -I/opt/netcdf-3.6.0-p1_ex/include -qxflag=p6div:p6divmsg -g -O3 -qnostrict 
+%LD                  mpxlf90_r
+%LDFLAGS             -L /opt/netcdf/netcdf-3.6.0-p1_ec/lib -lnetcdf -O3 -L/projects/um1/lib -lsig -O3 -L MASS
+%FPPFLAGS            -E -P -traditional -I/usr/lpp/ppe.poe/include/thread64
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-XT6_HECTOR.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-XT6_HECTOR.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-XT6_HECTOR.fcm	(revision 4276)
@@ -0,0 +1,44 @@
+# compiler options for hector CRAY XT6
+
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# 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
+# FPPFLAGS    pre-processing flags
+# 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>
+
+
+# PGI prgenv (default for hector)
+# use "module load netcdf" to setup system netcdf
+
+%NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-pgi
+%HDF5_HOME           $CRAY_HDF5_DIR/hdf5-pgi
+%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -lz
+%FC                  ftn
+%FCFLAGS             -i4 -r8 -O3
+%FFLAGS              -i4 -r8 -O3
+%LD                  ftn
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
+# replacement options for GNU prgenv
+
+# %NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-gnu
+# %HDF5_HOME           $CRAY_HDF5_DIR/hdf5-gnu
+# %FCFLAGS             -fdefault-real-8 -O3
+# %FFLAGS              -fdefault-real-8 -O3
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic g95 compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             g95
+%FCFLAGS             -i4 -r8 -O3 -funroll-all-loops -fno-second-underscore 
+%FFLAGS              %FCFLAGS
+%LD                  g95
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_osx.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-g95_osx.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic g95 compiler options for OSX (intel)
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             g95
+%FCFLAGS             -i4 -r8 -O3 -funroll-all-loops  
+%FFLAGS              %FCFLAGS
+%LD                  g95
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  libtool
+%ARFLAGS             -c -s -o
+%MK                  make
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic gfortran compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             gfortran
+%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
+%FFLAGS              %FCFLAGS
+%LD                  gfortran
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_osx.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-gfortran_osx.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic gfortran compiler options for OSX (intel)
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             gfortran
+%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
+%FFLAGS              %FCFLAGS
+%LD                  gfortran
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  libtool
+%ARFLAGS             -c -s -o
+%MK                  make
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_MERCATOR_CLUSTER.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_MERCATOR_CLUSTER.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_MERCATOR_CLUSTER.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic ifort compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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>
+# debug: -g  -check bounds -check uninit -check pointers -traceback 
+
+%NCDF_INC            -I$NETCDF_INC
+%NCDF_LIB            -L $NETCDF_LIB -lnetcdf
+%FC                  mpif90
+%FCFLAGS             -assume byterecl  -convert big_endian -i4 -r8 -automatic -align all -O0
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS             -O2 -shared-intel 
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic ifort compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include 
+%NCDF_LIB            -L /usr/local/netcdf/lib -lnetcdf   
+%FC                  ifort
+%FCFLAGS 	     -r8 -O3  -traceback 
+%FFLAGS 	     -r8 -O3  -traceback 
+%LD                  ifort
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux_omp.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux_omp.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_linux_omp.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic ifort compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include 
+%NCDF_LIB            -L /usr/local/netcdf/lib -lnetcdf   
+%FC                  ifort
+%FCFLAGS 	         -r8 -O3  -traceback -openmp
+%FFLAGS 	            -r8 -O3  -traceback -openmp
+%LD                  ifort
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_osx.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-ifort_osx.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic ifort (with mpi) compiler options for OSX (intel)
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/include 
+%NCDF_LIB            -L /usr/local/lib -lnetcdf   
+%FC                  mpif90
+%FCFLAGS 	     -r8 -O3  -traceback 
+%FFLAGS 	     -r8 -O3  -traceback 
+%LD                  mpif90
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS
+%AR                  libtool 
+%ARFLAGS             -c -s -o
+%MK                  make
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-lahey_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-lahey_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-lahey_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic Lahey/Fujitsu compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             lf95
+%FCFLAGS             -i4 -CcdRR8
+%FFLAGS              %FCFLAGS
+%LD                  lf95
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-mpxlf_aix.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-mpxlf_aix.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-mpxlf_aix.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic IBM SP
+# 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
+# FPPFLAGS    pre-processing flags
+# 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 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
+%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
+%LD                  mpxlf90_r
+%LDFLAGS
+%FPPFLAGS            -P -C
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-nag_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-nag_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-nag_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic NagWare compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             f95
+%FCFLAGS             -i4 -r8 -gline -O3
+%FFLAGS              %FCFLAGS
+%LD                  f95
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pathscale_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pathscale_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pathscale_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic pathscale compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             pathf95
+%FCFLAGS             -r8 -O3 -funroll
+%FFLAGS              %FCFLAGS
+%LD                  pathf95
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pgf90_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pgf90_linux.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-pgf90_linux.fcm	(revision 4276)
@@ -0,0 +1,30 @@
+# generic pgf90 compiler options for linux
+# 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
+# FPPFLAGS    pre-processing flags
+# 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/netcdf/include
+%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
+%FC	             pgf90
+%FCFLAGS             -O3 -i4 -r8 
+%FFLAGS              %FCFLAGS
+%LD                  pgf90
+%LDFLAGS
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             -rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
+
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_aix.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_aix.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_aix.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic IBM SP
+# 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
+# FPPFLAGS    pre-processing flags
+# 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                  xlf90_r
+%FCFLAGS             -qsuffix=f=f90 -qrealsize=8 -qextname -NS32768 -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport
+%FFLAGS              -qrealsize=8 -qextname -NS32768 -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport 
+%LD                  xlf90_r
+%LDFLAGS
+%FPPFLAGS            -P -C
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_osx.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_osx.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic xlf compiler options for OSX (ppc)
+# 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
+# FPPFLAGS    pre-processing flags
+# 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
+%FC            xlf90
+%FCFLAGS       -O3 -qrealsize=8 -qextname -qsuffix=f=f90 -qsuffix=cpp=F90
+%FFLAGS        -O3 -qrealsize=8 -qextname -qsuffix=f=f -qsuffix=cpp=F
+%FPPFLAGS        -P -C -traditional
+%LD            xlf90
+%LDFLAGS
+%AR            ar
+%ARFLAGS       rs
+%MK            make
+%USER_INC      %NCDF_INC
+%USER_LIB      %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_pwr6.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_pwr6.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/OLD/arch-xlf_pwr6.fcm	(revision 4276)
@@ -0,0 +1,29 @@
+# generic IBM SP
+# 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
+# FPPFLAGS    pre-processing flags
+# 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                  xlf90_r
+%FCFLAGS             -qsuffix=f=f90 -qrealsize=8 -qextname -qarch=pwr6 -qtune=pwr6 -NS32768 -qxflag=p6div:p6divmsg -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport
+%FFLAGS              -qrealsize=8 -qextname -qarch=pwr6 -qtune=pwr6 -NS32768 -qxflag=p6div:p6divmsg -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport 
+%LD                  xlf90_r
+%LDFLAGS
+%FPPFLAGS            -P -C
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %NCDF_INC
+%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ALTIX_NAUTILUS_MPT.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ALTIX_NAUTILUS_MPT.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ALTIX_NAUTILUS_MPT.fcm	(revision 4276)
@@ -0,0 +1,58 @@
+# ifort compiler options for NOCS ALTIX cluster nautilus using NetCDF4 libraries
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%HDF5_HOME           /fibre/omfman/NETCDF_PAR
+%NCDF_HOME           /fibre/omfman/NETCDF_PAR
+%XIOS_HOME           /fibre/omfman/XIOS
+%OASIS_HOME          
+
+%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
+# Note use of -Bstatic because the library root directories may not be accessible to the back-end compute nodes
+%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -Bstatic -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -Bdynamic -lz
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  ifort
+%FCFLAGS             -r8 -O3 -fp-model precise -xT -ip -vec-report0
+%FFLAGS              -r8 -O3 -fp-model precise -xT -ip -vec-report0
+%LD                  ifort
+%FPPFLAGS            -P -C -traditional
+%LDFLAGS             -lmpi -lstdc++
+%AR                  ar 
+%ARFLAGS             -r
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+# - if debugging use these flags
+#FCFLAGS             -g -traceback -r8 -O0 -xT -ip -vec-report0
+#FFLAGS              -g -traceback -r8 -O0 -xT -ip -vec-report0
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW6_C1A.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW6_C1A.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# POWER 6 at ECMWF
-# 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
-# FPPFLAGS    pre-processing flags
-# 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>
-#-g -C -qsigtrap 
-
-%NCDF_INC            -I /usr/local/apps/netcdf/3.6.3/LP64/include
-%NCDF_LIB            -L /usr/local/apps/netcdf/3.6.3/LP64/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -qfree=f90 -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -qsource
-%LD                  mpxlf90_r
-%LDFLAGS    
-%FPPFLAGS            -P -C
-%AR                  ar  
-%ARFLAGS             rs
-%MK                  gmake 
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW6_METO.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW6_METO.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# IBM POWER6  UKMO
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/opt/netcdf/netcdf-3.6.0-p1_ec/include
-%NCDF_LIB            -L /opt/netcdf/netcdf-3.6.0-p1_ec/lib -lnetcdf
-%FC                  mpxlf90_r
-%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr6 -NS32768 -I/opt/netcdf-3.6.0-p1_ex/include -qxflag=p6div:p6divmsg -g -O3 -qnostrict 
-%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr6 -NS32768 -I/opt/netcdf-3.6.0-p1_ex/include -qxflag=p6div:p6divmsg -g -O3 -qnostrict 
-%LD                  mpxlf90_r
-%LDFLAGS             -L /opt/netcdf/netcdf-3.6.0-p1_ec/lib -lnetcdf -O3 -L/projects/um1/lib -lsig -O3 -L MASS
-%FPPFLAGS            -E -P -traditional -I/usr/lpp/ppe.poe/include/thread64
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_C2A_XIO.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_C2A_XIO.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_C2A_XIO.fcm	(revision 4276)
@@ -0,0 +1,47 @@
+# POWER 6 at ECMWF
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make  
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+#options:
+#
+#debug   : g -C -qinitauto=7FBFFFFF -qfloat=nans -qflttrap=overflow:underflow:zerodivide:invalid:enable
+#portage : -qsource
+#format  : -qfree=f90 -qfixed -qsuffix=f=f90 -qsuffix=cpp=F90
+#others  : -qmaxmem=-1 -qsave -qlargepage 
+#
+%NCDF_INC            -I${NETCDF_INC1}
+%NCDF_LIB            -L${NETCDF_LIB1} -lnetcdff -lnetcdf -L${HDF5_LIB} -lhdf5_hl -lhdf5 -lz
+%XIOS_INC            -I${XIOS_INC}
+%XIOS_LIB            -L${XIOS_LIB} -lxios
+
+%XLF90_LIB           -lxlf90_r
+%FC                  mpxlf90_r
+%FCFLAGS             -qsuffix=f=f90 -qsuffix=cpp=F90 -qfree=f90 -O3 -qrealsize=8 -qarch=auto -qtune=auto -qinitauto
+%FFLAGS              -qsuffix=f=f90 -qsuffix=cpp=F90 -qfixed    -O3 -qrealsize=8 -qarch=auto -qtune=auto -qinitauto
+%LD                  mpCC_r
+%FPPFLAGS
+%LDFLAGS             -O2
+%AR                  ar  
+%ARFLAGS             -r
+%MK                  gmake 
+%USER_INC            %XIOS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %NCDF_LIB %XLF90_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_METO.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_METO.fcm	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-PW7_METO.fcm	(revision 4276)
@@ -15,15 +15,16 @@
 
 
-%NCDF_INC            -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/include
-%NCDF_LIB            -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf
+%NCDF_INC            -I/home/nwp/nm/frrj/lib/MTOOLS/include
+%NCDF_LIB            -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -lhdf5 -lhdf5_hl -lhdf5_fortran -lz
+%XIOS_ROOT           /home/cr/ocean/hadcv/xios_r445
 %FC                  mpxlf90_r
-%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict 
-%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/ofrd/share/netcdf-3.6.0-p1_ex/include -g -O3 -qnostrict 
-%LD                  mpxlf90_r
-%LDFLAGS             -L /home/nwp/ofrd/share/netcdf-3.6.0-p1_ec/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS
+%FCFLAGS             -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict
+%FFLAGS              -qrealsize=8 -qextname -qsuffix=f=f90 -qarch=pwr7 -qtune=pwr7 -NS32768 -I/home/nwp/nm/frrj/lib/MTOOLS/include -g -O3 -qnostrict
+%LD                  mpCC_r
+%LDFLAGS             -lxlf90 -L/home/nwp/nm/frrj/lib/MTOOLS/lib -lnetcdf -L/projects/um1/lib -lsig -O3 -L MASS
 %FPPFLAGS            -E -P -traditional -I/opt/ibmhpc/pecurrent/ppe.poe/include -I/usr/lpp/ppe.poe/include/thread64
 %AR                  ar
 %ARFLAGS             rs
 %MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
+%USER_INC            %NCDF_INC -I%XIOS_ROOT/inc
+%USER_LIB            %NCDF_LIB -L%XIOS_ROOT/lib -lxios
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_CURIE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_CURIE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_CURIE.fcm	(revision 4276)
@@ -0,0 +1,58 @@
+# Curie BULL at TGCC, http://www-hpc.cea.fr/en/complexe/tgcc-curie.htm
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /usr/local/netcdf-4.2_hdf5_parallel
+%HDF5_HOME           /usr/local/hdf5-1.8.9_parallel
+%XIOS_HOME           $WORKDIR/now/models/xios
+%OASIS_HOME          $WORKDIR/now/models/oa3mct
+
+%NCDF_INC            -I%NCDF_HOME/include 
+%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf -L%HDF5_HOME/lib -lhdf5_hl -lhdf5 -lhdf5
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  mpif90 -c -cpp
+# for Curie Fat Node
+#%FCFLAGS             -i4 -r8 -O3 -fp-model precise -xSSE4.2 
+# for Curie Thin Node
+#%FCFLAGS             -i4 -r8 -O3 -fp-model precise -xAVX
+# for Curie all Node
+%FCFLAGS             -i4 -r8 -O3 -fp-model precise
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS             -lstdc++
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_VAYU.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_VAYU.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_VAYU.fcm	(revision 4276)
@@ -0,0 +1,53 @@
+# Vayu Sun Constellation at Australian NCI, http://nf.nci.org.au/facilities/vayu/hardware.php
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /short/e14/$( whoami )/util
+%HDF5_HOME           /short/e14/$( whoami )/util
+%XIOS_HOME           /short/e14/$( whoami )/now/models/xios
+%OASIS_HOME          /short/e14/$( whoami )/now/models/oa3mct
+
+%NCDF_INC            -I%NCDF_HOME/include 
+%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf -L%HDF5_HOME/lib -lhdf5_hl -lhdf5 -lhdf5 -lz
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  mpif90 -c -cpp
+%FCFLAGS             -i4 -r8
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS             -lstdc++
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm	(revision 4276)
@@ -0,0 +1,53 @@
+# Yellowstone IBM at NCAR, http://www2.cisl.ucar.edu/resources/yellowstone
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /glade/apps/opt/netcdf-mpi/4.2/intel/12.1.4
+%HDF5_HOME           /glade/apps/opt/hdf5-mpi/1.8.9/intel/12.1.4
+%XIOS_HOME           /glade/p/work/$( whoami )/now/models/xios
+%OASIS_HOME          /glade/p/work/$( whoami )/now/models/oa3mct
+
+%NCDF_INC            -I%NCDF_HOME/include 
+%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf -L%HDF5_HOME/lib -lhdf5_hl -lhdf5 -lhdf5
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  mpif90 -c -cpp
+%FCFLAGS            -i4 -r8 -O3 -fp-model precise -xAVX
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS             -lstdc++
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-XT6_HECTOR.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-XT6_HECTOR.fcm	(revision 4275)
+++ 	(revision )
@@ -1,44 +1,0 @@
-# compiler options for hector CRAY XT6
-
-# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
-# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
-# 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
-# FPPFLAGS    pre-processing flags
-# 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>
-
-
-# PGI prgenv (default for hector)
-# use "module load netcdf" to setup system netcdf
-
-%NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-pgi
-%HDF5_HOME           $CRAY_HDF5_DIR/hdf5-pgi
-%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
-%NCDF_LIB            -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdf -lhdf5_fortran -lhdf5_hl -lhdf5 -lz
-%FC                  ftn
-%FCFLAGS             -i4 -r8 -O3
-%FFLAGS              -i4 -r8 -O3
-%LD                  ftn
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
-# replacement options for GNU prgenv
-
-# %NCDF_HOME           $CRAY_NETCDF_DIR/netcdf-gnu
-# %HDF5_HOME           $CRAY_HDF5_DIR/hdf5-gnu
-# %FCFLAGS             -fdefault-real-8 -O3
-# %FFLAGS              -fdefault-real-8 -O3
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-g95_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-g95_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic g95 compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             g95
-%FCFLAGS             -i4 -r8 -O3 -funroll-all-loops -fno-second-underscore 
-%FFLAGS              %FCFLAGS
-%LD                  g95
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-g95_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-g95_osx.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic g95 compiler options for OSX (intel)
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             g95
-%FCFLAGS             -i4 -r8 -O3 -funroll-all-loops  
-%FFLAGS              %FCFLAGS
-%LD                  g95
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  libtool
-%ARFLAGS             -c -s -o
-%MK                  make
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-gfortran_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-gfortran_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic gfortran compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             gfortran
-%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
-%FFLAGS              %FCFLAGS
-%LD                  gfortran
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-gfortran_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-gfortran_osx.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic gfortran compiler options for OSX (intel)
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             gfortran
-%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
-%FFLAGS              %FCFLAGS
-%LD                  gfortran
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  libtool
-%ARFLAGS             -c -s -o
-%MK                  make
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_MERCATOR_CLUSTER.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_MERCATOR_CLUSTER.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic ifort compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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>
-# debug: -g  -check bounds -check uninit -check pointers -traceback 
-
-%NCDF_INC            -I$(NETCDF_INC)
-%NCDF_LIB            -L $(NETCDF_LIB) -lnetcdf
-%FC                  mpif90
-%FCFLAGS             -assume byterecl  -convert big_endian -i4 -r8 -automatic -align all -O0
-%FFLAGS              %FCFLAGS
-%LD                  mpif90
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS             -O2 -shared-intel 
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic ifort compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include 
-%NCDF_LIB            -L /usr/local/netcdf/lib -lnetcdf   
-%FC                  ifort
-%FCFLAGS 	     -r8 -O3  -traceback 
-%FFLAGS 	     -r8 -O3  -traceback 
-%LD                  ifort
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_linux_omp.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_linux_omp.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic ifort compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include 
-%NCDF_LIB            -L /usr/local/netcdf/lib -lnetcdf   
-%FC                  ifort
-%FCFLAGS 	         -r8 -O3  -traceback -openmp
-%FFLAGS 	            -r8 -O3  -traceback -openmp
-%LD                  ifort
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  ar 
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-ifort_osx.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic ifort (with mpi) compiler options for OSX (intel)
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/include 
-%NCDF_LIB            -L /usr/local/lib -lnetcdf   
-%FC                  mpif90
-%FCFLAGS 	     -r8 -O3  -traceback 
-%FFLAGS 	     -r8 -O3  -traceback 
-%LD                  mpif90
-%FPPFLAGS            -P -C -traditional
-%LDFLAGS
-%AR                  libtool 
-%ARFLAGS             -c -s -o
-%MK                  make
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-lahey_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-lahey_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic Lahey/Fujitsu compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             lf95
-%FCFLAGS             -i4 -CcdRR8
-%FFLAGS              %FCFLAGS
-%LD                  lf95
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-macport_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-macport_osx.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-macport_osx.fcm	(revision 4276)
@@ -0,0 +1,62 @@
+# generic gfortran compiler options for OSX installed with macport, http://www.macports.org/
+#
+# port packages needed:
+#    sudo port install openmpi +gcc48
+#    sudo port install hdf5-18 +cxx +fortran +openmpi (I'am not sure cxx is needed)
+#    sudo port install netcdf         +openmpi
+#    sudo port install netcdf-fortran +openmpi
+#    sudo port install netcdf-cxx     +openmpi (I'am not sure it is needed)
+#    sudo port install p5-uri
+# add to your PATH /opt/local/lib/openmpi/bin so that mpif90 is properly known
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /opt/local
+%HDF5_HOME           /opt/local
+%XIOS_HOME           /Users/$( whoami )/XIOS
+%OASIS_HOME          /not/defined
+
+%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC	             mpif90 
+%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer 
+%FFLAGS              %FCFLAGS
+%LD                  %FC
+%LDFLAGS             -lstdc++ -lmpi_cxx
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  make
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-mpxlf_aix.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-mpxlf_aix.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic IBM SP
-# 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
-# FPPFLAGS    pre-processing flags
-# 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 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
-%FFLAGS              -qfixed -O3 -qrealsize=8 -qextname -qsource -q64 -qlargepage -qmaxmem=-1
-%LD                  mpxlf90_r
-%LDFLAGS
-%FPPFLAGS            -P -C
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-nag_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-nag_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic NagWare compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             f95
-%FCFLAGS             -i4 -r8 -gline -O3
-%FFLAGS              %FCFLAGS
-%LD                  f95
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-pathscale_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-pathscale_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic pathscale compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             pathf95
-%FCFLAGS             -r8 -O3 -funroll
-%FFLAGS              %FCFLAGS
-%LD                  pathf95
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -r
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-pgf90_linux.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-pgf90_linux.fcm	(revision 4275)
+++ 	(revision )
@@ -1,30 +1,0 @@
-# generic pgf90 compiler options for linux
-# 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
-# FPPFLAGS    pre-processing flags
-# 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/netcdf/include
-%NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf
-%FC	             pgf90
-%FCFLAGS             -O3 -i4 -r8 
-%FFLAGS              %FCFLAGS
-%LD                  pgf90
-%LDFLAGS
-%FPPFLAGS            -P -C -traditional
-%AR                  ar
-%ARFLAGS             -rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
-
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-x3750_ADA.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-x3750_ADA.fcm	(revision 4276)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-x3750_ADA.fcm	(revision 4276)
@@ -0,0 +1,53 @@
+# Ada  IBM x3750 at french IDRIS, http://www.idris.fr/ada/ada-hw-ada.html
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# 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
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /smplocal/pub/NetCDF/4.1.3/mpi
+%HDF5_HOME           /smplocal/pub/HDF5/1.8.9/par
+%XIOS_HOME           $WORKDIR/XIOS
+%OASIS_HOME          /not/yet/defined
+
+%NCDF_INC            -I%NCDF_HOME/include 
+%NCDF_LIB            -L%NCDF_HOME/lib -Bstatic -lnetcdff -lnetcdf -Bdynamic -L%HDF5_HOME/lib -Bstatic -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -Bdynamic -lz 
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  mpiifort -c -cpp
+%FCFLAGS             -DCPP_PARA -i4 -r8 -O3 -xAVX -fp-model precise
+%FFLAGS              %FCFLAGS
+%LD                  mpiifort
+%LDFLAGS             -lstdc++
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_aix.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_aix.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic IBM SP
-# 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
-# FPPFLAGS    pre-processing flags
-# 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                  xlf90_r
-%FCFLAGS             -qsuffix=f=f90 -qrealsize=8 -qextname -NS32768 -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport
-%FFLAGS              -qrealsize=8 -qextname -NS32768 -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport 
-%LD                  xlf90_r
-%LDFLAGS
-%FPPFLAGS            -P -C
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_osx.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_osx.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic xlf compiler options for OSX (ppc)
-# 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
-# FPPFLAGS    pre-processing flags
-# 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
-%FC            xlf90
-%FCFLAGS       -O3 -qrealsize=8 -qextname -qsuffix=f=f90 -qsuffix=cpp=F90
-%FFLAGS        -O3 -qrealsize=8 -qextname -qsuffix=f=f -qsuffix=cpp=F
-%FPPFLAGS        -P -C -traditional
-%LD            xlf90
-%LDFLAGS
-%AR            ar
-%ARFLAGS       rs
-%MK            make
-%USER_INC      %NCDF_INC
-%USER_LIB      %NCDF_LIB 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_pwr6.fcm
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/ARCH/arch-xlf_pwr6.fcm	(revision 4275)
+++ 	(revision )
@@ -1,29 +1,0 @@
-# generic IBM SP
-# 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
-# FPPFLAGS    pre-processing flags
-# 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                  xlf90_r
-%FCFLAGS             -qsuffix=f=f90 -qrealsize=8 -qextname -qarch=pwr6 -qtune=pwr6 -NS32768 -qxflag=p6div:p6divmsg -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport
-%FFLAGS              -qrealsize=8 -qextname -qarch=pwr6 -qtune=pwr6 -NS32768 -qxflag=p6div:p6divmsg -qnostrict -O5 -d -qsmp=omp -qhot -qessl -qipa -qreport 
-%LD                  xlf90_r
-%LDFLAGS
-%FPPFLAGS            -P -C
-%AR                  ar
-%ARFLAGS             rs
-%MK                  gmake
-%USER_INC            %NCDF_INC
-%USER_LIB            %NCDF_LIB
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -60,4 +62,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/namelist
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/namelist	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/AMM12/EXP00/namelist	(revision 4276)
@@ -35,5 +35,5 @@
                            !    = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
                            !    = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
-   cn_ocerst_in  = "restart"   !  suffix of ocean restart name (input)
+   cn_ocerst_in  = "amm12_restart_oce"   !  suffix of ocean restart name (input)
    cn_ocerst_out = "restart"   !  suffix of ocean restart name (output)
    nn_istate   =       1   !  output the initial state (1) or not (0)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="one_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -33,5 +35,5 @@
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->  
  
-        <file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
@@ -47,15 +49,15 @@
         </file>
 	
-        <file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
           <field field_ref="uoce"         name="vozocrtx"  />
           <field field_ref="utau"         name="sozotaux"  />
         </file>
 	
-        <file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
           <field field_ref="voce"         name="vomecrty"  /> 
           <field field_ref="vtau"         name="sometauy"  /> 
         </file>
 	
-        <file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	<file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
           <field field_ref="woce"         name="vovecrtz" />
           <field field_ref="avt"          name="votkeavt" />
@@ -90,4 +92,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
@@ -118,5 +121,5 @@
 	  <variable id="buffer_server_factor_size" type="integer">2</variable>
 	  <variable id="info_level"                type="integer">0</variable>
-	  <variable id="using_server"              type="boolean">true</variable>
+	  <variable id="using_server"              type="boolean">false</variable>
 	  <variable id="using_oasis"               type="boolean">false</variable>
 	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -60,4 +62,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -33,5 +35,5 @@
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
  
-        <file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+        <file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
@@ -47,15 +49,15 @@
         </file>
 	
-        <file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+        <file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
           <field field_ref="uoce"         name="vozocrtx"  />
           <field field_ref="utau"         name="sozotaux"  />
         </file>
 	
-        <file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+        <file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
           <field field_ref="voce"         name="vomecrty"  /> 
           <field field_ref="vtau"         name="sometauy"  /> 
         </file>
 	
-        <file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+        <file id="file4" name_suffix="_grid_W" description="ocean W grid variables" >
           <field field_ref="woce"         name="vovecrtz" />
           <field field_ref="avt"          name="votkeavt" />
@@ -63,5 +65,5 @@
         </file>
 
-	<file id="5d_ptrc_T" name="auto" description="lobster sms variables" >
+	<file id="file5" name="_ptrc_T" description="lobster sms variables" >
           <field field_ref="DET"      />
           <field field_ref="ZOO"      />
@@ -82,5 +84,5 @@
       <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files -->
 
-	<file id="1y_diad_T" name="auto" description="additional lobster diagnostics" >  
+	<file id="file6" name_suffix="_diad_T" description="additional lobster diagnostics" >  
           <field field_ref="FNO3PHY"   /> 
           <field field_ref="FNH4PHY"   /> 
@@ -126,4 +128,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 4276)
@@ -27,5 +27,5 @@
    cn_exp      = "Agulhas" !  experience name 
    nn_it000    =       1   !  first time step
-   nn_itend    =   10950   !  last  time step
+   nn_itend    =     480   !  last  time step
    nn_date0    =  010101   !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
    nn_leapy    =       0   !  Leap year calendar (1) or not (0)
@@ -114,4 +114,7 @@
    sn_tem  = 'data_1m_potential_temperature_nomask', -1,'votemper',  .true.  , .true., 'yearly'   , ' '      , ' '
    sn_sal  = 'data_1m_salinity_nomask'             , -1,'vosaline',  .true.  , .true., 'yearly'   , ''       , ' '
+   cn_dir        = './'      !  root directory for the location of the runoff files
+   ln_tsd_init   = .true.    !  Initialisation of ocean T & S with T &S input data (T) or not (F)
+   ln_tsd_tradmp = .false.   !  damping of ocean T & S toward T &S input data (T) or not (F)
 /
 !!======================================================================
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 4276)
@@ -26,10 +26,10 @@
     -->
     
-    <file_definition type="multiple_file" output_level="10" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" output_level="10" sync_freq="2mo" min_digits="4">
       <!--
 +++++++++++++++++++++++++++++++++++++++++++++++   daily   ++++++++++++++++++++++++++++++++++++++++++++++++++
         -->
       <file_group id="1d" output_freq="1d"  enabled=".TRUE.">                      <!-- 1d files -->
-	<file id="1d_grid_T" name="auto" name_suffix="_table2.2" >         <!-- grid T  -->
+	<file id="file1" name_suffix="_grid_T_table2.2" >         <!-- grid T  -->
 	  <field field_ref="sst"          name='tos'      long_name="sea_surface_temperature"                              level="2"                      />
 	  <field field_ref="sst2"         name='tossq'    long_name="square_of_sea_surface_temperature"                    level="2"                      />
@@ -43,151 +43,136 @@
 	<!--
 ..............................................    grid T   .................................................
-	  -->
-	<file_group id="1m_grid_T" name="auto" >                                                        <!-- grid T -->
-	  
-	  <file id="1m grid_T table 2.2" name_suffix="_table2.2" >
-	    <field field_ref="botpres"      name="pbo"      long_name="sea_water_pressure_at_sea_floor"                               />
-	    <!-- pso : sea_water_pressure_at_sea_water_surface = 0 -->
-	    <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                                 />
-	    <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"             level="2" />
-	    <!-- masscello : sea_water_mass_per_unit_area = cellthc*rau0                                          no time changes -->
-	    <field field_ref="cellthc"      name="thkcello" long_name="cell_thickness"                                                 /> <!-- no time changes -->
-	    <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"                                />
-	    <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                              level="1" />
-	    <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"                    level="2" />
-	    <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                                             />
-	    <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                                 level="1" />
-	    <field field_ref="rhop"         name="rhopoto"  long_name="sea_water_potential_density"                          level="2" />
-	    <!-- no agessc : sea_water_age_since_surface_contact -->
-	    <!-- no cfc11  : moles_per_unit_mass_of_cfc11_in_sea_water -->
-	    <!-- msftbarot : ocean_barotropic_mass_streamfunction : offline -->
-	    <!-- mlotst    :           ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline -->
-	    <!-- mlotstsq  : square_of_ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline -->
-	    <field field_ref="mldkz5"       name='omlmax'   long_name="ocean_mixed_layer_thickness_defined_by_mixing_scheme" level="2" operation="maximum" />
-	  </file>   
-	  
-	  <file id="1m grid_T table 2.5" name_suffix="_table2.5" >
-	    <field field_ref="rain"         name="pr"       long_name="rainfall_flux"                                           level="1" />
-	    <field field_ref="snow_ao_cea"  name="prsn"     long_name="snowfall_flux"                                           level="1" />
-	    <field field_ref="evap_ao_cea"  name="evs"      long_name="water_evaporation_flux"                                  level="1" />
-	    <field field_ref="runoffs"      name="friver"   long_name="water_flux_into_sea_water_from_rivers"                   level="1" />
-	    <field field_ref="calving"      name="ficeberg" long_name="water_flux_into_sea_water_from_icebergs"                 level="1" />
-	    <field field_ref="isnwmlt_cea"  name="fsitherm" long_name="water_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" />
-	    <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                               level="1" />
-	    <!-- wfonocorr : water_flux_into_sea_water_without_flux_correction : emp - erp -->  
-	    <field field_ref="erp"          name="wfcorr"   long_name="water_flux_correction"                                   level="1" /> <!-- usually = 0 -->
-	  </file>   
-	  
-	  <file id="1m grid_T table 2.6" name_suffix="_table2.6" >
-	    <!-- vsfpr    : virtual_salt_flux_into_sea_water_due_to_rainfall    = 0 --> 
-	    <!-- vsfevap  : virtual_salt_flux_into_sea_water_due_to_evaporation = 0 --> 
-	    <!-- vsfriver : virtual_salt_flux_into_sea_water_from_rivers        = 0 --> 	  
-	    <field field_ref="fsal_virt_cea" name="vsfsit" long_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" />
-	    <!-- vsf      : virtual_salt_flux_into_sea_water = fsal_virtual + fsal_real -->
-	    <!-- wfcorr   : virtual_salt_flux_correction                        = 0 --> 
-	    <field field_ref="fsal_virt_cea" name="sfdsi"  long_name="downward_sea_ice_basal_salt_flux"                               level="1" />
-	    <!-- sfriver  : salt_flux_into_sea_water_from_rivers                = 0 --> 
-	  </file>   
-	  
-	  <file id="1m grid_T table 2.7" name_suffix="_table2.7" >
-	    <!-- hfgeou : upward_geothermal_heat_flux_at_sea_floor : cte, see nambbc and trabbc.F90 -->
-	    <field field_ref="hflx_rain_cea" name="hfrainds"    long_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"      level="1" />
-	    <field field_ref="hflx_evap_cea" name="hfevapds"    long_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" level="1" />
-	    <field field_ref="hflx_rnf_cea"  name="hfrunoffds"  long_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"        level="1" />
-	    <field field_ref="hflx_snow_cea" name="hfsnthermds" long_name="heat_flux_into_sea_water_due_to_snow_thermodynamics"                         level="1" />
-	    <field field_ref="hflx_ice_cea"  name="hfsithermds" long_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                      level="1" />
-	    <field field_ref="hflx_cal_cea"  name="hfibthermds" long_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                      level="1" />
-	    <!-- rlds   : surface_net_downward_longwave_flux : not available -->
-	    <!-- hfls   : surface_downward_latent_heat_flux  : not available -->
-	    <!-- hfss   : surface_downward_sensible_heat_flux: not available -->
-	    <field field_ref="qns"           name="nshfls"      long_name="surface_net_downward_non_solar_flux"                                         level="1" />
-	    <field field_ref="qsr"           name="rsntds"      long_name="surface_net_downward_shortwave_flux"                                         level="1" />
-	    <field field_ref="qsr3d"         name="rsds"        long_name="downwelling_shortwave_flux_in_sea_water"                                     level="1" />
-	    <field field_ref="qrp"           name="hfcorr"      long_name="heat_flux_correction"                                                        level="1" />
-	  </file>   
-	</file_group>
+	  -->	  
+	<file id="file2" name_suffix="_grid_T_table2.2" >
+	  <field field_ref="botpres"      name="pbo"      long_name="sea_water_pressure_at_sea_floor"                               />
+	  <!-- pso : sea_water_pressure_at_sea_water_surface = 0 -->
+	  <field field_ref="ssh"          name="zos"      long_name="sea_surface_height_above_geoid"                                 />
+	  <field field_ref="ssh2"         name="zossq"    long_name="square_of_sea_surface_height_above_geoid"             level="2" />
+	  <!-- masscello : sea_water_mass_per_unit_area = cellthc*rau0                                          no time changes -->
+	  <field field_ref="cellthc"      name="thkcello" long_name="cell_thickness"                                                 /> <!-- no time changes -->
+	  <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"                                />
+	  <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                              level="1" />
+	  <field field_ref="sst2"         name="tossq"    long_name="square_of_sea_surface_temperature"                    level="2" />
+	  <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                                             />
+	  <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                                 level="1" />
+	  <field field_ref="rhop"         name="rhopoto"  long_name="sea_water_potential_density"                          level="2" />
+	  <!-- no agessc : sea_water_age_since_surface_contact -->
+	  <!-- no cfc11  : moles_per_unit_mass_of_cfc11_in_sea_water -->
+	  <!-- msftbarot : ocean_barotropic_mass_streamfunction : offline -->
+	  <!-- mlotst    :           ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline -->
+	  <!-- mlotstsq  : square_of_ocean_mixed_layer_thickness_defined_by_sigma_t : must be done offline -->
+	  <field field_ref="mldkz5"       name='omlmax'   long_name="ocean_mixed_layer_thickness_defined_by_mixing_scheme" level="2" operation="maximum" />
+	</file>   
+	
+	<file id="file3" name_suffix="_grid_T_table2.5" >
+	  <field field_ref="rain"         name="pr"       long_name="rainfall_flux"                                           level="1" />
+	  <field field_ref="snow_ao_cea"  name="prsn"     long_name="snowfall_flux"                                           level="1" />
+	  <field field_ref="evap_ao_cea"  name="evs"      long_name="water_evaporation_flux"                                  level="1" />
+	  <field field_ref="runoffs"      name="friver"   long_name="water_flux_into_sea_water_from_rivers"                   level="1" />
+	  <field field_ref="calving"      name="ficeberg" long_name="water_flux_into_sea_water_from_icebergs"                 level="1" />
+	  <field field_ref="isnwmlt_cea"  name="fsitherm" long_name="water_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" />
+	  <field field_ref="empmr"        name="wfo"      long_name="water_flux_into_sea_water"                               level="1" />
+	  <!-- wfonocorr : water_flux_into_sea_water_without_flux_correction : emp - erp -->  
+	  <field field_ref="erp"          name="wfcorr"   long_name="water_flux_correction"                                   level="1" /> <!-- usually = 0 -->
+	</file>   
+	
+	<file id="file4" name_suffix="_grid_T_table2.6" >
+	  <!-- vsfpr    : virtual_salt_flux_into_sea_water_due_to_rainfall    = 0 --> 
+	  <!-- vsfevap  : virtual_salt_flux_into_sea_water_due_to_evaporation = 0 --> 
+	  <!-- vsfriver : virtual_salt_flux_into_sea_water_from_rivers        = 0 --> 	  
+	  <field field_ref="fsal_virt_cea" name="vsfsit" long_name="virtual_salt_flux_into_sea_water_due_to_sea_ice_thermodynamics" level="1" />
+	  <!-- vsf      : virtual_salt_flux_into_sea_water = fsal_virtual + fsal_real -->
+	  <!-- wfcorr   : virtual_salt_flux_correction                        = 0 --> 
+	  <field field_ref="fsal_virt_cea" name="sfdsi"  long_name="downward_sea_ice_basal_salt_flux"                               level="1" />
+	  <!-- sfriver  : salt_flux_into_sea_water_from_rivers                = 0 --> 
+	</file>   
+	
+	<file id="file5" name_suffix="_grid_T_table2.7" >
+	  <!-- hfgeou : upward_geothermal_heat_flux_at_sea_floor : cte, see nambbc and trabbc.F90 -->
+	  <field field_ref="hflx_rain_cea" name="hfrainds"    long_name="temperature_flux_due_to_rainfall_expressed_as_heat_flux_into_sea_water"      level="1" />
+	  <field field_ref="hflx_evap_cea" name="hfevapds"    long_name="temperature_flux_due_to_evaporation_expressed_as_heat_flux_out_of_sea_water" level="1" />
+	  <field field_ref="hflx_rnf_cea"  name="hfrunoffds"  long_name="temperature_flux_due_to_runoff_expressed_as_heat_flux_into_sea_water"        level="1" />
+	  <field field_ref="hflx_snow_cea" name="hfsnthermds" long_name="heat_flux_into_sea_water_due_to_snow_thermodynamics"                         level="1" />
+	  <field field_ref="hflx_ice_cea"  name="hfsithermds" long_name="heat_flux_into_sea_water_due_to_sea_ice_thermodynamics"                      level="1" />
+	  <field field_ref="hflx_cal_cea"  name="hfibthermds" long_name="heat_flux_into_sea_water_due_to_iceberg_thermodynamics"                      level="1" />
+	  <!-- rlds   : surface_net_downward_longwave_flux : not available -->
+	  <!-- hfls   : surface_downward_latent_heat_flux  : not available -->
+	  <!-- hfss   : surface_downward_sensible_heat_flux: not available -->
+	  <field field_ref="qns"           name="nshfls"      long_name="surface_net_downward_non_solar_flux"                                         level="1" />
+	  <field field_ref="qsr"           name="rsntds"      long_name="surface_net_downward_shortwave_flux"                                         level="1" />
+	  <field field_ref="qsr3d"         name="rsds"        long_name="downwelling_shortwave_flux_in_sea_water"                                     level="1" />
+	  <field field_ref="qrp"           name="hfcorr"      long_name="heat_flux_correction"                                                        level="1" />
+	</file>   
 	<!--
 ..............................................    grid U   .................................................
-	  -->
-	<file_group id="1m_grid_U" name="auto" >                                                        <!-- grid U -->
-
-	  <file id="1m grid_U table 2.3" name_suffix="_table2.3" >
-	    <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"                                       />
-	    <field field_ref="u_masstr"     name="umo"     long_name="ocean_mass_x_transport"                           level="1" />
-	    <field field_ref="u_heattr"     name="hfx"     long_name="ocean_heat_x_transport"                           level="1" />
-	    <field field_ref="ueiv_heattr"  name="hfxba"   long_name="ocean_heat_x_transport_due_to_bolus_advection"    level="2" />
-	    <field field_ref="udiff_heattr" name="hfxdiff" long_name="ocean_heat_x_transport_due_to_diffusion"          level="2" />
-	  </file>   
-
-	  <file id="1m grid_U table 2.8" name_suffix="_table2.8" >
-	    <field field_ref="utau"         name="tauuo" long_name="surface_downward_x_stress"                          level="1" />
-	    <!-- tauucorr : surface_downward_x_stress_correction = 0 -->
-	  </file>   
-
-	</file_group>
+	-->
+	<file id="file6" name_suffix="_grid_U_table2.3" >
+	  <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"                                       />
+	  <field field_ref="u_masstr"     name="umo"     long_name="ocean_mass_x_transport"                           level="1" />
+	  <field field_ref="u_heattr"     name="hfx"     long_name="ocean_heat_x_transport"                           level="1" />
+	  <field field_ref="ueiv_heattr"  name="hfxba"   long_name="ocean_heat_x_transport_due_to_bolus_advection"    level="2" />
+	  <field field_ref="udiff_heattr" name="hfxdiff" long_name="ocean_heat_x_transport_due_to_diffusion"          level="2" />
+	</file>   
+	
+	<file id="file7" name_suffix="_grid_U_table2.8" >
+	  <field field_ref="utau"         name="tauuo" long_name="surface_downward_x_stress"                          level="1" />
+	  <!-- tauucorr : surface_downward_x_stress_correction = 0 -->
+	</file>   
 	<!--
 ..............................................    grid V   .................................................
-	  -->
-	<file_group id="1m_grid_V" name="auto" >                                                        <!-- grid V -->
-
-	  <file id="1m grid_V table 2.3" name_suffix="_table2.3" >
-	    <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"                                       />
-	    <field field_ref="v_masstr"     name="vmo"     long_name="ocean_mass_y_transport"                           level="1" />
-	    <field field_ref="v_heattr"     name="hfy"     long_name="ocean_heat_y_transport"                           level="1" />
-	    <field field_ref="veiv_heattr"  name="hfyba"   long_name="ocean_heat_y_transport_due_to_bolus_advection"    level="2" />
-	    <field field_ref="vdiff_heattr" name="hfydiff" long_name="ocean_heat_y_transport_due_to_diffusion"          level="2" />
-	  </file>   
-
-	  <file id="1m grid_V table 2.8" name_suffix="_table2.8" >
-	    <field field_ref="vtau"         name="tauvo" long_name="surface_downward_y_stress"                          level="1" />
-	    <!-- tauvcorr : surface_downward_y_stress_correction = 0 -->
-	  </file>   
-
-	</file_group>
+	-->
+	<file id="file8" name_suffix="_grid_V_table2.3" >
+	  <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"                                       />
+	  <field field_ref="v_masstr"     name="vmo"     long_name="ocean_mass_y_transport"                           level="1" />
+	  <field field_ref="v_heattr"     name="hfy"     long_name="ocean_heat_y_transport"                           level="1" />
+	  <field field_ref="veiv_heattr"  name="hfyba"   long_name="ocean_heat_y_transport_due_to_bolus_advection"    level="2" />
+	  <field field_ref="vdiff_heattr" name="hfydiff" long_name="ocean_heat_y_transport_due_to_diffusion"          level="2" />
+	</file>   
+	
+	<file id="file9" name_suffix="_grid_V_table2.8" >
+	  <field field_ref="vtau"         name="tauvo" long_name="surface_downward_y_stress"                          level="1" />
+	  <!-- tauvcorr : surface_downward_y_stress_correction = 0 -->
+	</file>   
 	<!--
 ..............................................    grid W   .................................................
-	  -->
-	<file_group id="1m_grid_W" name="auto" >                                                        <!-- grid W -->
-	  
-	  <file id="1m grid_W table 2.3" name_suffix="_table2.3" >
-	    <field field_ref="w_masstr"   name="wmo"   long_name="upward_ocean_mass_transport"                                    />
-	    <field field_ref="w_masstr2"  name="wmosq" long_name="square_pf_upward_ocean_mass_transport"                          />
-	  </file>   
-	  
-	  <file id="1m grid_W table 2.9" name_suffix="_table2.9" >
-	    <field field_ref="avt"     name="difvho"   long_name="ocean_vertical_heat_diffusivity"                  level="2" />
-	    <field field_ref="avs"     name="difvso"   long_name="ocean_vertical_salt_diffusivity"                  level="2" />
-	    <!-- difvtrbo : ocean_vertical_tracer_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb and  nn_havtb -->
-	    <field field_ref="av_tide" name="difvtrto" long_name="ocean_vertical_tracer_diffusivity_due_to_tides"   level="2" />
-	    <!-- tnpeo     : tendency_of_ocean_potential_energy_content                   : not available -->
-	    <!-- tnpeot    : tendency_of_ocean_potential_energy_content_due_to_tides      : not available -->
-	    <!-- tnpeotb   : tendency_of_ocean_potential_energy_content_due_to_background : not available -->
-	    <field field_ref="avm"     name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"              level="2" />
-	    <!-- difvmbo : ocean_vertical_momentum_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb -->
-	    <field field_ref="av_tide" name="difvmto"  long_name="ocean_vertical_momentum_diffusivity_due_to_tides" level="2" /> <!-- same as tracer -->
-	    <!-- difvmfdo : ocean_vertical_momentum_diffusivity_due_to_form_drag : ??? -->
-	    <!-- dispkevfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction : not available -->
-	  </file>
-
-	  <file id="1m grid_W table 2.10" name_suffix="_table2.10" >
-	    <!-- if ln_traldf_lap    =  .true. -->
-	    <field field_ref="aht2d_eiv" name="diftrblo" long_name="ocean_tracer_bolus_laplacian_diffusivity"                     level="2" />
-	    <!-- diftrelo : ocean_tracer_epineutral_laplacian_diffusivity : cte with time, see ln_traldf_iso -->
-	    <!-- diftrxylo : ocean_tracer_xy_laplacian_diffusivity : cte with time -->
-	    <!-- if ln_traldf_bilap  =  .true. -->
-	    <!-- field field_ref="diftrbbo" name="aht2d_eiv" long_name="ocean_tracer_bolus_biharmonic_diffusivity"                    level="2" /-->
-	    <!-- diftrebo : ocean_tracer_epineutral_biharmonic_diffusivity : cte with time, see ln_traldf_iso -->
-	    <!-- diftrxybo : ocean_tracer_xy_biharmonic_diffusivity : cte with time -->
-	    <!-- tnkebto : tendency_of_ocean_eddy_kinetic_energy_content_due_to_bolus_transport : not available -->
-	    <!-- difmxylo : ocean_momentum_xy_laplacian_diffusivity : cte with time, see ln_dynldf_lap -->
-	    <!-- difmxybo : ocean_momentum_xy_biharmonic_diffusivity : cte with time, see ln_dynldf_bilap -->
-	    <!-- dispkexyfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction : not available -->
-	  </file>   
-
-	</file_group>
+	-->
+	<file id="file10" name_suffix="_grid_W_table2.3" >
+	  <field field_ref="w_masstr"   name="wmo"   long_name="upward_ocean_mass_transport"                                    />
+	  <field field_ref="w_masstr2"  name="wmosq" long_name="square_pf_upward_ocean_mass_transport"                          />
+	</file>   
+	
+	<file id="file11" name_suffix="_grid_W_table2.9" >
+	  <field field_ref="avt"     name="difvho"   long_name="ocean_vertical_heat_diffusivity"                  level="2" />
+	  <field field_ref="avs"     name="difvso"   long_name="ocean_vertical_salt_diffusivity"                  level="2" />
+	  <!-- difvtrbo : ocean_vertical_tracer_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb and  nn_havtb -->
+	  <field field_ref="av_tide" name="difvtrto" long_name="ocean_vertical_tracer_diffusivity_due_to_tides"   level="2" />
+	  <!-- tnpeo     : tendency_of_ocean_potential_energy_content                   : not available -->
+	  <!-- tnpeot    : tendency_of_ocean_potential_energy_content_due_to_tides      : not available -->
+	  <!-- tnpeotb   : tendency_of_ocean_potential_energy_content_due_to_background : not available -->
+	  <field field_ref="avm"     name="difvmo"   long_name="ocean_vertical_momentum_diffusivity"              level="2" />
+	  <!-- difvmbo : ocean_vertical_momentum_diffusivity_due_to_background : cte with time, see namelist parameters nn_avb -->
+	  <field field_ref="av_tide" name="difvmto"  long_name="ocean_vertical_momentum_diffusivity_due_to_tides" level="2" /> <!-- same as tracer -->
+	  <!-- difvmfdo : ocean_vertical_momentum_diffusivity_due_to_form_drag : ??? -->
+	  <!-- dispkevfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_vertical_friction : not available -->
+	</file>
+	
+	<file id="file12" name_suffix="_grid_W_table2.10" >
+	  <!-- if ln_traldf_lap    =  .true. -->
+	  <field field_ref="aht2d_eiv" name="diftrblo" long_name="ocean_tracer_bolus_laplacian_diffusivity"                     level="2" />
+	  <!-- diftrelo : ocean_tracer_epineutral_laplacian_diffusivity : cte with time, see ln_traldf_iso -->
+	  <!-- diftrxylo : ocean_tracer_xy_laplacian_diffusivity : cte with time -->
+	  <!-- if ln_traldf_bilap  =  .true. -->
+	  <!-- field field_ref="diftrbbo" name="aht2d_eiv" long_name="ocean_tracer_bolus_biharmonic_diffusivity"                    level="2" /-->
+	  <!-- diftrebo : ocean_tracer_epineutral_biharmonic_diffusivity : cte with time, see ln_traldf_iso -->
+	  <!-- diftrxybo : ocean_tracer_xy_biharmonic_diffusivity : cte with time -->
+	  <!-- tnkebto : tendency_of_ocean_eddy_kinetic_energy_content_due_to_bolus_transport : not available -->
+	  <!-- difmxylo : ocean_momentum_xy_laplacian_diffusivity : cte with time, see ln_dynldf_lap -->
+	  <!-- difmxybo : ocean_momentum_xy_biharmonic_diffusivity : cte with time, see ln_dynldf_bilap -->
+	  <!-- dispkexyfo : ocean_kinetic_energy_dissipation_per_unit_area_due_to_xy_friction : not available -->
+	</file>   
 	<!--
 ..............................................    scalar   .................................................
-	  -->
-	<file id="1m_scalar" name="auto" name_suffix="_table2.2" >         <!-- scalar -->
+	-->
+	<file id="file13" name_suffix="_scalar_table2.2" >         <!-- scalar -->
 	  <field field_ref="masstot"    name="masso"    long_name="sea_water_mass"                                />
 	  <field field_ref="voltot"     name="volo"     long_name="sea_water_volume"                              />
@@ -200,6 +185,6 @@
 	<!--
 ..............................................    icemod   .................................................
-	  -->
-	<file id="1m_icemod" name="auto" name_suffix="_table2.2" >         <!-- scalar -->
+	-->
+	<file id="file14" name_suffix="_icemod_table2.2" >         <!-- scalar -->
 	  <field field_ref="ice_pres"                     />
 	  <field field_ref="ice_cover"    name="sic"        long_name="sea_ice_area_fraction"                            />
@@ -263,4 +248,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -31,5 +33,5 @@
       <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files -->
 
-	<file id="1d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="sst"          name="tos"      long_name="sea_surface_temperature"                       />
 	  <field field_ref="sss"          name="sos"      long_name="sea_surface_salinity"                          />
@@ -37,18 +39,19 @@
 	</file>
 
-	<file id="1d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    />
 	</file>
 	
-	<file id="1d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    />
 	</file>
 	
       </file_group>
+
       <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->    
 
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
 
-	<file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file4" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               />
 	  <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            />
@@ -66,5 +69,5 @@
 	</file>
 	
-	<file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file5" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      />
 	  <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    />
@@ -72,5 +75,5 @@
 	</file>
 	
-	<file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file6" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      />
 	  <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    />
@@ -78,10 +81,10 @@
 	</file>
 	
-	<file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	<file id="file7" name_suffix="_grid_W" description="ocean W grid variables" >
 	  <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         />
 	  <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" />
 	</file>
 	
-	<file id="5d_icemod" name="auto" description="ice variables" >
+	<file id="file8" name_suffix="_icemod" description="ice variables" >
 	  <field field_ref="ice_pres"                     />
 	  <field field_ref="snowthic_cea" name="snd"     long_name="surface_snow_thickness"   />
@@ -126,4 +129,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 4276)
@@ -21,8 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."> <!-- 1h files -->
-	<file id="1h_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="sst"  />
 	  <field field_ref="qsr"  />
@@ -32,44 +32,42 @@
      
       <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files -->
-
-	<file_group id="1d_grid_T" name="auto" description="ocean T grid variables" >
-
-	  <!-- example of "hand made" zoom  -->
-	  <file id="blabla_1" name_suffix="_myzoom" >
-	    <!-- group of variables sharing the same zoom. see zoom definition in domain_def.xml -->
-	    <field_group id="blabla" domain_ref="myzoom" >    
-	      <field field_ref="toce" />
-	      <field field_ref="soce" />
-	    </field_group>
-	  </file>
-
-	  <!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  -->
-	  <!-- include a group of variables. see field_def.xml for mooring variables definition  -->
-	  <file id="0n180wT" name_suffix="auto" >
-	      <field_group group_ref="mooring"/>  
-	  </file>
-
-	  <!-- Equatorial section: automatic definition of the file name suffix based on id="EqT" -->
-	  <!-- Zoom over vertical axis. def of axis_ref in the axis_definition bellow -->
-	  <file id="EqT" name_suffix="auto" >
-	    <field_group id="EqT" domain_ref="EqT" >
-	      <field field_ref="toce" name="votemper" axis_ref="deptht_zoom"  />
-	    </field_group>
-	  </file>
-
-	  <!-- global file with different operations on data   -->
-	  <file id="blabla_2" >
-	    <field field_ref="toce"   default_value="-10" />    <!-- redefine the missing value -->
-	    <field field_ref="sst"    name="sstmooring1" domain_ref="0n180wT"  />   <!-- include a mooring -->
-	    <field field_ref="sst"    name="sst_1d_ave"  />                         <!-- mean -->
-	    <field field_ref="sst"    name="sst_1d_inst" operation="instant" />     <!-- instant value -->
-	    <field field_ref="sst"    name="sst_1d_max"  operation="maximum" />     <!-- max -->
-	    <field field_ref="suoce"  />   <!-- include a U-grid variable in the list -->
-	  </file>
-
-	</file_group>
+	
+	<!-- example of "hand made" zoom  -->
+	<file id="file2" name_suffix="_grid_T_myzoom" >
+	  <!-- group of variables sharing the same zoom. see zoom definition in domain_def.xml -->
+	  <field_group id="blabla" domain_ref="myzoom" >    
+	    <field field_ref="toce" />
+	    <field field_ref="soce" />
+	  </field_group>
+	</file>
+	
+	<!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  -->
+	<!-- include a group of variables. see field_def.xml for mooring variables definition  -->
+	<file id="0n180wT">
+	  <field_group group_ref="mooring" domain_ref="0n180wT" />  
+	</file>
+	
+	<!-- Equatorial section: automatic definition of the file name suffix based on id="EqT" -->
+	<!-- Zoom over vertical axis. def of axis_ref in the axis_definition bellow -->
+	<file id="EqT" >
+	  <field_group id="EqT" domain_ref="EqT" >
+	    <field field_ref="toce" name="votemper" axis_ref="deptht_myzoom"  />
+	    <field field_ref="sss" />
+	  </field_group>
+	</file>
+	
+	<!-- global file with different operations on data   -->
+	<file id="file3" >
+	  <field field_ref="toce"   default_value="-10" />    <!-- redefine the missing value -->
+	  <field field_ref="sst"    name="sstmooring1" domain_ref="0n180wT"  />   <!-- include a mooring -->
+	  <field field_ref="sst"    name="sst_1d_ave"  />                         <!-- mean -->
+	  <field field_ref="sst"    name="sst_1d_inst" operation="instant" />     <!-- instant value -->
+	  <field field_ref="sst"    name="sst_1d_max"  operation="maximum" />     <!-- max -->
+	  <field field_ref="suoce"  />   <!-- include a U-grid variable in the list -->
+	</file>
+	
       </file_group>
-
-   </file_definition>
+      
+    </file_definition>
     
     <!-- 
@@ -82,5 +80,5 @@
      <axis_group id="deptht" long_name="Vertical T levels" unit="m" positive="down" >
        <axis id="deptht" />
-       <axis id="deptht_zoom" zoom_begin="1" zoom_end="10" />
+       <axis id="deptht_myzoom" zoom_begin="1" zoom_end="10" />
      </axis_group>
       <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
@@ -88,4 +86,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 4276)
@@ -21,6 +21,8 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1mo" min_digits="4">
     
+      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
+
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
       <file_group id="2h" output_freq="2h"  output_level="10" enabled=".TRUE."/> <!-- 2h files -->
@@ -33,5 +35,5 @@
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
 
-	<file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
@@ -52,5 +54,5 @@
 	</file>
 	
-	<file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="uoce"         name="vozocrtx"  />
 	  <field field_ref="uoce_eiv"     name="vozoeivu"  />
@@ -58,5 +60,5 @@
 	</file>
 	
-	<file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="voce"         name="vomecrty"  />
 	  <field field_ref="voce_eiv"     name="vomeeivv"  />
@@ -64,5 +66,5 @@
 	</file>
 	
-	<file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	<file id="file4" name_suffix="_grid_W" description="ocean V grid variables" >
 	  <field field_ref="woce"         name="vovecrtz" />
 	  <field field_ref="avt"          name="votkeavt" />
@@ -71,5 +73,5 @@
 	</file>
 	
-	<file id="5d_icemod" name="auto" description="ice variables" >
+	<file id="file5" name_suffix="_icemod" description="ocean V grid variables" >
 	  <field field_ref="ice_pres"                     />
 	  <field field_ref="snowthic_cea" name="isnowthi" />
@@ -114,4 +116,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_ice_lim2
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_ice_lim2	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_ice_lim2	(revision 4276)
@@ -89,5 +89,5 @@
 !              !              !  (if <0  months)  !   name   !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  !
    sn_hicif    = 'ice_damping',  -1.              , 'hicif'  ,   .true.     , .true. , 'yearly'  , ''       , ''
-   sn_cnf      = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_frld     = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , ''
 !
    cn_dir      = './'      !  root directory for the location of the runoff files
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 4276)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -60,4 +60,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist	(revision 4276)
@@ -318,5 +318,38 @@
    rn_alphdi   =    0.72   !  (Pyane, 1972)
 /
-
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+      ln_icebergs              = .false.
+      ln_bergdia               = .true.               ! Calculate budgets
+      nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0
+      nn_verbose_write         = 15                   ! Timesteps between verbose messages
+      nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage
+                                                      ! Initial mass required for an iceberg of each class
+      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11
+                                                      ! Proportion of calving mass to apportion to each class  
+      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02
+                                                      ! Ratio between effective and real iceberg mass (non-dim)
+                                                      ! i.e. number of icebergs represented at a point         
+      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1
+                                                      ! thickness of newly calved bergs (m)
+      rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250.
+      rn_rho_bergs             = 850.                 ! Density of icebergs
+      rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs
+      ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics
+      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits
+      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1)
+      ln_passive_mode          = .false.              ! iceberg - ocean decoupling   
+      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no)
+                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2)
+      rn_test_box              = 108.0,  116.0, -66.0, -58.0
+      rn_speed_limit           = 0.                   ! CFL speed limit for a berg   
+
+               ! filename ! freq (hours) ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
+               !          ! (<0  months) !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
+      sn_icb =  'calving' ,     -1       , 'calvingmask',  .true.      , .true., 'yearly'   , ' '      , ' '
+   
+      cn_dir = './' 
+/
 !!======================================================================
 !!               ***  Lateral boundary condition  ***
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 4276)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -31,5 +31,5 @@
       <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files -->
 
-	<file id="1d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="sst"          name="sosstsst"  />
 	  <field field_ref="sss"          name="sosaline"  />
@@ -37,9 +37,9 @@
 	</file>
 
-	<file id="1d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="suoce"         name="vozocrtx"  />
 	</file>
 	
-	<file id="1d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="svoce"         name="vomecrty"  />
 	</file>
@@ -49,5 +49,5 @@
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
 
-	<file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file4" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
@@ -58,4 +58,5 @@
 	  <field field_ref="qsr"          name="soshfldo"  />
           <field field_ref="saltflx"      name="sosfldow"  />
+          <field field_ref="fmmflx"       name="sofmflup"  />
 	  <field field_ref="qt"           name="sohefldo"  />
 	  <field field_ref="mldr10_1"     name="somxl010"  />
@@ -68,5 +69,5 @@
 	</file>
 	
-	<file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file5" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="uoce"         name="vozocrtx"  />
 	  <field field_ref="uoce_eiv"     name="vozoeivu"  />
@@ -74,5 +75,5 @@
 	</file>
 	
-	<file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file6" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="voce"         name="vomecrty"  />
 	  <field field_ref="voce_eiv"     name="vomeeivv"  />
@@ -80,5 +81,5 @@
 	</file>
 	
-	<file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	<file id="file7" name_suffix="_grid_W" description="ocean W grid variables" >
 	  <field field_ref="woce"         name="vovecrtz" />
 	  <field field_ref="avt"          name="votkeavt" />
@@ -87,5 +88,5 @@
 	</file>
 	
-	<file id="5d_icemod" name="auto" description="ice variables" >
+	<file id="file8" name_suffix="_icemod" description="ice variables" >
 	  <field field_ref="ice_pres"                     />
 	  <field field_ref="snowthic_cea" name="isnowthi" />
@@ -107,5 +108,5 @@
       <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
 
-	<file id="1m_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file9" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -119,5 +120,5 @@
 	</file>
 	
-	<file id="1m_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file10" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="Cflx"     />
           <field field_ref="Dpco2"    />
@@ -132,5 +133,5 @@
       <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files -->
 
-	<file id="1y_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file11" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -159,5 +160,5 @@
 	</file>
 
-	<file id="1y_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file12" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="PH"       />
           <field field_ref="CO3"      />
@@ -229,4 +230,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_pisces	(revision 4276)
@@ -30,5 +30,5 @@
    cn_dir      = './'     !  root directory for the location of the dynamical files
 !
-   ln_presatm  = .true.   ! constant atmopsheric pressure (F) or from a file (T)
+   ln_presatm  = .false.   ! constant atmopsheric pressure (F) or from a file (T)
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -39,5 +39,5 @@
    xkmort     =  2.E-7    ! half saturation constant for mortality
    ferat3     =  10.E-6   ! Fe/C in zooplankton 
-   wsbio2     =  30.      ! Big particles sinking speed
+   wsbio2     =  50.      ! Big particles sinking speed
    niter1max  =  1        ! Maximum number of iterations for POC
    niter2max  =  1        ! Maximum number of iterations for GOC
@@ -47,9 +47,9 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    concnno3   =  1.e-6    ! Nitrate half saturation of nanophytoplankton
-   concdno3   =  3.E-6   ! Phosphate half saturation for diatoms
+   concdno3   =  3.E-6    ! Phosphate half saturation for diatoms
    concnnh4   =  1.E-7    ! NH4 half saturation for phyto
-   concdnh4   =  3.E-7   ! NH4 half saturation for diatoms
-   concnfer   =  1.E-9     ! Iron half saturation for phyto
-   concdfer   =  3.E-9   ! Iron half saturation for diatoms
+   concdnh4   =  3.E-7    ! NH4 half saturation for diatoms
+   concnfer   =  1.E-9    ! Iron half saturation for phyto
+   concdfer   =  3.E-9    ! Iron half saturation for diatoms
    concbfe    =  1.E-11   ! Half-saturation for Fe limitation of Bacteria
    concbnh4   =  2.5E-8   ! NH4 half saturation for phyto
@@ -60,5 +60,5 @@
    xsizerd    =  3.0      ! Size ratio for diatoms
    xksi1      =  2.E-6    ! half saturation constant for Si uptake
-   xksi2      =  20E-6  ! half saturation constant for Si/C
+   xksi2      =  20E-6    ! half saturation constant for Si/C
    xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization
    qnfelim    =  7.E-6    ! Optimal quota of phyto
@@ -84,5 +84,5 @@
    excret2    =  0.05     ! excretion ratio of diatoms
    ln_newprod =  .true.   ! Enable new parame. of production (T/F) 
-   bresp      =  0.00333  ! Basal respiration rate
+   bresp      =  0.0333   ! Basal respiration rate
    chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton
    chlcdm     =  0.05     ! Minimum Chl/C in diatoms
@@ -106,5 +106,5 @@
    part2      =  0.75     ! part of calcite not dissolved in mesozoo guts
    grazrat2   =  0.75     ! maximal mesozoo grazing rate
-   resrat2    =  0.005    ! exsudation rate of mesozooplankton
+   resrat2    =  0.01     ! exsudation rate of mesozooplankton
    mzrat2     =  0.03     ! mesozooplankton mortality rate
    xprefc     =  1.       ! zoo preference for phyto
@@ -118,5 +118,5 @@
    xthresh2   =  3E-7     ! Food threshold for grazing
    xkgraz2    =  20.E-6   ! half sturation constant for meso grazing
-   epsher2    =  0.3      ! Efficicency of Mesozoo growth
+   epsher2    =  0.4      ! Efficicency of Mesozoo growth
    sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM
    unass2     =  0.3      ! non assimilated fraction of P by mesozoo
@@ -128,5 +128,5 @@
    part       =  0.5      ! part of calcite not dissolved in microzoo gutsa
    grazrat    =  3.0      ! maximal zoo grazing rate
-   resrat     =  0.03     ! exsudation rate of zooplankton
+   resrat     =  0.05     ! exsudation rate of zooplankton
    mzrat      =  0.004    ! zooplankton mortality rate
    xpref2c    =  0.1      ! Microzoo preference for POM
@@ -138,5 +138,5 @@
    xthresh    =  3.E-7    ! Food threshold for feeding
    xkgraz     =  20.E-6   ! half sturation constant for grazing
-   epsher     =  0.3      ! Efficiency of microzoo growth
+   epsher     =  0.4      ! Efficiency of microzoo growth
    sigma1     =  0.6      ! Fraction of microzoo excretion as DOM
    unass      =  0.3      ! non assimilated fraction of phyto by zoo
@@ -146,5 +146,5 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    ln_fechem =  .false.   ! complex iron chemistry ( T/F )
-   ln_ligvar =  .true.   ! variable ligand concentration
+   ln_ligvar =  .false.   ! variable ligand concentration
    xlam1     =  0.005     ! scavenging rate of Iron
    xlamdust  =  150.0     ! Scavenging rate of dust
@@ -154,5 +154,5 @@
 &nampisrem     !   parameters for remineralization
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   xremik    =  0.35      ! remineralization rate of DOC
+   xremik    =  0.3       ! remineralization rate of DOC
    xremip    =  0.025     ! remineralisation rate of POC
    nitrif    =  0.05      ! NH4 nitrification rate
@@ -261,4 +261,4 @@
 &nampismass     !  Mass conservation
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   ln_check_mass =  .false.    !  Check mass conservation
-/
+   ln_check_mass =  .true.    !  Check mass conservation
+/
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 4276)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -35,5 +35,5 @@
       <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
 
-	<file id="1m_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file1" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -47,5 +47,5 @@
 	</file>
 	
-	<file id="1m_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file2" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="Cflx"     />
           <field field_ref="Dpco2"    />
@@ -60,5 +60,5 @@
       <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files -->
 
-	<file id="1y_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file3" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -87,5 +87,5 @@
 	</file>
 
-	<file id="1y_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file4" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="PH"       />
           <field field_ref="CO3"      />
@@ -157,4 +157,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 4276)
@@ -665,5 +665,5 @@
    sn_mld  = 'dyna_grid_T' ,    120            , 'somixhgt' ,  .true.    , .true. ,   'yearly'  , ''       , ''
    sn_emp  = 'dyna_grid_T' ,    120            , 'sowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''
-   sn_sfx  = 'dyna_grid_T' ,    120            , 'sowaflcd' ,  .true.    , .true. ,   'yearly'  , ''       , ''
+   sn_fmf  = 'dyna_grid_T' ,    120            , 'iowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''
    sn_ice  = 'dyna_grid_T' ,    120            , 'soicecov' ,  .true.    , .true. ,   'yearly'  , ''       , ''
    sn_qsr  = 'dyna_grid_T' ,    120            , 'soshfldo' ,  .true.    , .true. ,   'yearly'  , ''       , ''
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_pisces	(revision 4276)
@@ -30,5 +30,5 @@
    cn_dir      = './'     !  root directory for the location of the dynamical files
 !
-   ln_presatm  = .true.   ! constant atmopsheric pressure (F) or from a file (T)
+   ln_presatm  = .false.   ! constant atmopsheric pressure (F) or from a file (T)
 /
 !'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
@@ -39,5 +39,5 @@
    xkmort     =  2.E-7    ! half saturation constant for mortality
    ferat3     =  10.E-6   ! Fe/C in zooplankton 
-   wsbio2     =  30.      ! Big particles sinking speed
+   wsbio2     =  50.      ! Big particles sinking speed
    niter1max  =  1        ! Maximum number of iterations for POC
    niter2max  =  1        ! Maximum number of iterations for GOC
@@ -47,9 +47,9 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    concnno3   =  1.e-6    ! Nitrate half saturation of nanophytoplankton
-   concdno3   =  3.E-6   ! Phosphate half saturation for diatoms
+   concdno3   =  3.E-6    ! Phosphate half saturation for diatoms
    concnnh4   =  1.E-7    ! NH4 half saturation for phyto
-   concdnh4   =  3.E-7   ! NH4 half saturation for diatoms
-   concnfer   =  1.E-9     ! Iron half saturation for phyto
-   concdfer   =  3.E-9   ! Iron half saturation for diatoms
+   concdnh4   =  3.E-7    ! NH4 half saturation for diatoms
+   concnfer   =  1.E-9    ! Iron half saturation for phyto
+   concdfer   =  3.E-9    ! Iron half saturation for diatoms
    concbfe    =  1.E-11   ! Half-saturation for Fe limitation of Bacteria
    concbnh4   =  2.5E-8   ! NH4 half saturation for phyto
@@ -60,5 +60,5 @@
    xsizerd    =  3.0      ! Size ratio for diatoms
    xksi1      =  2.E-6    ! half saturation constant for Si uptake
-   xksi2      =  20E-6  ! half saturation constant for Si/C
+   xksi2      =  20E-6    ! half saturation constant for Si/C
    xkdoc      =  417.E-6  ! half-saturation constant of DOC remineralization
    qnfelim    =  7.E-6    ! Optimal quota of phyto
@@ -84,5 +84,5 @@
    excret2    =  0.05     ! excretion ratio of diatoms
    ln_newprod =  .true.   ! Enable new parame. of production (T/F) 
-   bresp      =  0.00333  ! Basal respiration rate
+   bresp      =  0.0333   ! Basal respiration rate
    chlcnm     =  0.033    ! Minimum Chl/C in nanophytoplankton
    chlcdm     =  0.05     ! Minimum Chl/C in diatoms
@@ -106,5 +106,5 @@
    part2      =  0.75     ! part of calcite not dissolved in mesozoo guts
    grazrat2   =  0.75     ! maximal mesozoo grazing rate
-   resrat2    =  0.005    ! exsudation rate of mesozooplankton
+   resrat2    =  0.01     ! exsudation rate of mesozooplankton
    mzrat2     =  0.03     ! mesozooplankton mortality rate
    xprefc     =  1.       ! zoo preference for phyto
@@ -118,5 +118,5 @@
    xthresh2   =  3E-7     ! Food threshold for grazing
    xkgraz2    =  20.E-6   ! half sturation constant for meso grazing
-   epsher2    =  0.3      ! Efficicency of Mesozoo growth
+   epsher2    =  0.4      ! Efficicency of Mesozoo growth
    sigma2     =  0.6      ! Fraction of mesozoo excretion as DOM
    unass2     =  0.3      ! non assimilated fraction of P by mesozoo
@@ -128,5 +128,5 @@
    part       =  0.5      ! part of calcite not dissolved in microzoo gutsa
    grazrat    =  3.0      ! maximal zoo grazing rate
-   resrat     =  0.03     ! exsudation rate of zooplankton
+   resrat     =  0.05     ! exsudation rate of zooplankton
    mzrat      =  0.004    ! zooplankton mortality rate
    xpref2c    =  0.1      ! Microzoo preference for POM
@@ -138,5 +138,5 @@
    xthresh    =  3.E-7    ! Food threshold for feeding
    xkgraz     =  20.E-6   ! half sturation constant for grazing
-   epsher     =  0.3      ! Efficiency of microzoo growth
+   epsher     =  0.4      ! Efficiency of microzoo growth
    sigma1     =  0.6      ! Fraction of microzoo excretion as DOM
    unass      =  0.3      ! non assimilated fraction of phyto by zoo
@@ -146,5 +146,5 @@
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    ln_fechem =  .false.   ! complex iron chemistry ( T/F )
-   ln_ligvar =  .true.   ! variable ligand concentration
+   ln_ligvar =  .false.   ! variable ligand concentration
    xlam1     =  0.005     ! scavenging rate of Iron
    xlamdust  =  150.0     ! Scavenging rate of dust
@@ -154,5 +154,5 @@
 &nampisrem     !   parameters for remineralization
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   xremik    =  0.35      ! remineralization rate of DOC
+   xremik    =  0.3       ! remineralization rate of DOC
    xremip    =  0.025     ! remineralisation rate of POC
    nitrif    =  0.05      ! NH4 nitrification rate
@@ -261,4 +261,4 @@
 &nampismass     !  Mass conservation
 !,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-   ln_check_mass =  .false.    !  Check mass conservation
-/
+   ln_check_mass =  .true.    !  Check mass conservation
+/
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 4276)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -60,4 +60,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_ice_lim2
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_ice_lim2	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_ice_lim2	(revision 4276)
@@ -89,5 +89,5 @@
 !              !              !  (if <0  months)  !   name   !  (logical)   !  (T/F) ! 'monthly' ! filename ! pairing  !
    sn_hicif    = 'ice_damping',  -1.              , 'hicif'  ,   .true.     , .true. , 'yearly'  , ''       , ''
-   sn_cnf      = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , ''
+   sn_frld     = 'ice_damping',  -1.              , 'frld'   ,   .true.     , .true. , 'yearly'  , ''       , ''
 !
    cn_dir      = './'      !  root directory for the location of the runoff files
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/SHARED/field_def.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 4276)
@@ -53,5 +53,6 @@
 
          <field id="empmr"        long_name="Net Upward Water Flux"                                        unit="kg/m2/s"  />
-         <field id="saltflx"      long_name="Downward salt flux"                                          unit="PSU/m2/s"  />
+         <field id="saltflx"      long_name="Downward salt flux"                                           unit="PSU/m2/s"  />
+         <field id="fmmflx"       long_name="Water flux due to freezing/melting"                           unit="kg/m2/s"  />
          <field id="snowpre"      long_name="Snow precipitation"                                           unit="kg/m2/s"  />
          <field id="runoffs"      long_name="River Runoffs"                                                unit="Kg/m2/s"  />
@@ -218,4 +219,21 @@
         <field id="traj_dens"  long_name="floats density"     unit="kg/m3" />
         <field id="traj_group" long_name="floats group"       unit="none"  />
+      </field_group>
+
+      <!-- variables available with iceberg trajectories -->
+      <field_group id="icbvar" domain_ref="grid_T"  > 
+        <field id="berg_melt"          long_name="icb melt rate of icebergs"                     unit="kg/m2/s"   />
+        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"   unit="kg/m2/s"   />
+        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"    unit="kg/m2/s"   />
+        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate" unit="kg/m2/s"   />
+        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"              unit="m2"        />
+        <field id="bits_src"           long_name="icb mass source of bergy bits"                 unit="kg/m2/s"   />
+        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                   unit="kg/m2/s"   />
+        <field id="bits_mass"          long_name="icb bergy bit density field"                   unit="kg/m2"     />
+        <field id="berg_mass"          long_name="icb iceberg density field"                     unit="kg/m2"     />
+        <field id="calving"            long_name="icb calving mass input"                        unit="kg/s"      />
+        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"              unit="kg/m2/s"   />
+        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                unit="kg/s"     axis_ref="icbcla" />
+        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"             unit="kg"       axis_ref="icbcla" />
       </field_group>
 
@@ -248,13 +266,18 @@
        <field id="NH4"      long_name="Ammonium Concentration"                   unit="mmol/m3" />
 
+       <!-- PISCES with Kriest parametisation : variables available with key_kriest -->
+       <field id="Num"      long_name="Number of organic particles"              unit="nbr" />
+
+       <!-- PISCES light : variables available with key_pisces_reduced -->
        <field id="DET"      long_name="Detritus"                                 unit="mmol-N/m3" />
        <field id="DOM"      long_name="Dissolved Organic Matter"                 unit="mmol-N/m3" />
 
+       <!-- CFC11 : variables available with key_cfc -->
        <field id="CFC11"    long_name="CFC-11 Concentration"                     unit="umol/L" />
+       <!-- Bomb C14 : variables available with key_c14b -->
        <field id="C14B"     long_name="Bomb C14 Concentration"                   unit="ration" />
      </field_group>
 
-      <!-- diad on T grid : variables available with key_diatrc -->
-
+      <!-- PISCES additional diagnostics on T grid  -->
      <field_group id="diad_T" grid_ref="grid_T_2D">
        <field id="PH"          long_name="PH"                                      unit="-"          grid_ref="grid_T_3D" />
@@ -310,33 +333,45 @@
        <field id="Heup"        long_name="Euphotic layer depth"                    unit="m"                            />
        <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                     />
-       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D"  />
-
-       <field id="FNO3PHY"  long_name="FNO3PHY"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="FNH4PHY"  long_name="FNH4PHY"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="FNH4NO3"  long_name="FNH4NO3"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="TNO3PHY"  long_name="TNO3PHY"                             unit="-"  /> 
-       <field id="TNH4PHY"  long_name="TNH4PHY"                             unit="-"  /> 
-       <field id="TPHYDOM"  long_name="TPHYDOM"                             unit="-"  /> 
-       <field id="TPHYNH4"  long_name="TPHYNH4"                             unit="-"  /> 
-       <field id="TPHYZOO"  long_name="TPHYZOO"                             unit="-"  /> 
-       <field id="TPHYDET"  long_name="TPHYDET"                             unit="-"  /> 
-       <field id="TDETZOO"  long_name="TDETZOO"                             unit="-"  /> 
-       <field id="TZOODET"  long_name="TZOODET"                             unit="-"  /> 
-       <field id="TZOOBOD"  long_name="TZOOBOD"                             unit="-"  /> 
-       <field id="TZOONH4"  long_name="TZOONH4"                             unit="-"  /> 
-       <field id="TZOODOM"  long_name="TZOODOM"                             unit="-"  /> 
-       <field id="TNH4NO3"  long_name="TNH4NO3"                             unit="-"  /> 
-       <field id="TDOMNH4"  long_name="TDOMNH4"                             unit="-"  /> 
-       <field id="TDETNH4"  long_name="TDETNH4"                             unit="-"  /> 
-       <field id="TPHYTOT"  long_name="TPHYTOT"                             unit="-"  /> 
-       <field id="TZOOTOT"  long_name="TZOOTOT"                             unit="-"  /> 
-       <field id="SEDPOC"   long_name="SEDPOC"                              unit="-"  /> 
-       <field id="TDETSED"  long_name="TDETSED"                             unit="-"  /> 
-
-       <field id="qtrCFC11"     long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
-       <field id="qintCFC11"    long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
-       <field id="qtrC14b"      long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   />
-       <field id="qintC14b"     long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     />
-       <field id="fdecay"       long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  />
+       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D "/>
+
+       <!-- PISCES with Kriest parametisation : variables available with key_kriest -->
+       <field id="POCFlx"      long_name="Particulate organic C flux"              unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="NumFlx"      long_name="Particle number flux"                    unit="nbr/m2/s"   grid_ref="grid_T_3D" />
+       <field id="SiFlx"       long_name="Biogenic Si flux"                        unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="CaCO3Flx"    long_name="CaCO3 flux"                              unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="xnum"        long_name="Number of particles in aggregats"        unit="-"          grid_ref="grid_T_3D" />
+       <field id="W1"          long_name="sinking speed of mass flux"              unit="m2/s"       grid_ref="grid_T_3D" />
+       <field id="W2"          long_name="sinking speed of number flux"            unit="m2/s"       grid_ref="grid_T_3D" />
+
+       <!-- PISCES light : variables available with key_pisces_reduced -->
+       <field id="FNO3PHY"     long_name="FNO3PHY"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="FNH4PHY"     long_name="FNH4PHY"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="FNH4NO3"     long_name="FNH4NO3"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="TNO3PHY"     long_name="TNO3PHY"                                 unit="-"  /> 
+       <field id="TNH4PHY"     long_name="TNH4PHY"                                 unit="-"  /> 
+       <field id="TPHYDOM"     long_name="TPHYDOM"                                 unit="-"  /> 
+       <field id="TPHYNH4"     long_name="TPHYNH4"                                 unit="-"  /> 
+       <field id="TPHYZOO"     long_name="TPHYZOO"                                 unit="-"  /> 
+       <field id="TPHYDET"     long_name="TPHYDET"                                 unit="-"  /> 
+       <field id="TDETZOO"     long_name="TDETZOO"                                 unit="-"  /> 
+       <field id="TZOODET"     long_name="TZOODET"                                 unit="-"  /> 
+       <field id="TZOOBOD"     long_name="TZOOBOD"                                 unit="-"  /> 
+       <field id="TZOONH4"     long_name="TZOONH4"                                 unit="-"  /> 
+       <field id="TZOODOM"     long_name="TZOODOM"                                 unit="-"  /> 
+       <field id="TNH4NO3"     long_name="TNH4NO3"                                 unit="-"  /> 
+       <field id="TDOMNH4"     long_name="TDOMNH4"                                 unit="-"  /> 
+       <field id="TDETNH4"     long_name="TDETNH4"                                 unit="-"  /> 
+       <field id="TPHYTOT"     long_name="TPHYTOT"                                 unit="-"  /> 
+       <field id="TZOOTOT"     long_name="TZOOTOT"                                 unit="-"  /> 
+       <field id="SEDPOC"      long_name="SEDPOC"                                  unit="-"  /> 
+       <field id="TDETSED"     long_name="TDETSED"                                 unit="-"  /> 
+
+       <!-- CFC11 : variables available with key_cfc -->
+       <field id="qtrCFC11"    long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
+       <field id="qintCFC11"   long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
+       <!-- Bomb C14 : variables available with key_c14b -->
+       <field id="qtrC14b"     long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   />
+       <field id="qintC14b"    long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     />
+       <field id="fdecay"      long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  />
      </field_group>
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/cfg.txt	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/cfg.txt	(revision 4276)
@@ -4,7 +4,7 @@
 GYRE_PISCES OPA_SRC TOP_SRC
 ORCA2_LIM3 OPA_SRC LIM_SRC_3
-ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
-ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
 ORCA2_SAS_LIM OPA_SRC SAS_SRC LIM_SRC_2 NST_SRC
 ORCA2_LIM_CFC_C14b OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC
+ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
+ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/makenemo
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/makenemo	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/CONFIG/makenemo	(revision 4276)
@@ -106,4 +106,6 @@
 export AGRIFUSE=10
 declare -a TAB
+list_key=0
+chk_key=1
 #-
 #- FCM and functions location ---
@@ -112,10 +114,10 @@
 #-
 #- Choice of the options ---
-while getopts :hd:n:r:m:j:e:s:v:t: V
+while getopts :hd:n:r:m:j:e:s:v:t:k: V
 do
     case $V in
 	(h) x_h=${OPTARG};
         echo "Usage	 : "${b_n} \
-	    " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No]";
+	    " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No] [-k 0/1]";
 	echo " -h	        : help";
 	echo " -h institute : specific help for consortium members";
@@ -128,4 +130,5 @@
         echo " -j No        : number of processes used to compile (0=nocompilation)";
         echo " -v No        : set verbosity level for compilation [0-3]";
+        echo " -k 0/1       : used cpp keys check (default = 1 -> check activated)";
 	echo " -t dir       : temporary directory for compilation"
 	echo "";
@@ -141,4 +144,7 @@
 	echo "Example to clean ";
 	echo "./makenemo clean";
+	echo "";
+	echo "Example to list the available keys of a CONFIG ";
+	echo "./makenemo list_key";
 	echo "";
 	echo "Example to add and remove keys";
@@ -158,7 +164,8 @@
 	(j)  x_j=${OPTARG};;
 	(t)  x_t=${OPTARG};;
-    (e)  x_e=${OPTARG};;
-    (s)  x_s=${OPTARG};;
-    (v)  x_v=${OPTARG};;
+	(e)  x_e=${OPTARG};;
+	(s)  x_s=${OPTARG};;
+	(v)  x_v=${OPTARG};;
+	(k)  chk_key=${OPTARG};;
 	(:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
 	exit 2;;
@@ -188,4 +195,7 @@
 	    export ${list_del_key}
 	    shift
+	    ;;
+	list_key)
+	    list_key=1
 	    ;;
 	*)
@@ -222,12 +232,8 @@
 [ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit
 
-#- When used for the first time, choose a compiler ---
-. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm ${CMP_NAM} || exit
-
 #-
 #- Choose a default configuration if needed ---
 #- ORCA2_LIM or last one used ---
 . ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit
-
 
 if [ ${#NEW_CONF} -eq 0 ] ; then
@@ -269,4 +275,16 @@
 . ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit
 
+# build the complete list of the cpp keys of this configuration
+if [ $chk_key -eq 1 ] ; then
+    for i in $( grep "^ *#.* key_" ${NEW_CONF}/WORK/* ) 
+    do
+	echo $i | grep key_ | sed -e "s/=.*//"
+    done | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt
+    if [ $list_key -eq 1 ]; then
+	cat ${COMPIL_DIR}/full_key_list.txt
+	exit 0
+    fi
+fi
+
 #- At this stage new configuration has been added,
 #- We add or remove keys
@@ -278,4 +296,26 @@
     . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key}
 fi
+
+#- check that all keys are really existing...
+if [ $chk_key -eq 1 ] ; then
+    for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm )
+    do
+	if [ "$( echo $kk | cut -c 1-4 )" == "key_" ]; then
+	    kk=${kk/=*/}
+	    nb=$( grep -c $kk ${COMPIL_DIR}/full_key_list.txt )
+	    if [ $nb -eq 0 ]; then
+		echo
+		echo "E R R O R : key "$kk" is not found in ${NEW_CONF}/WORK routines..."
+		echo "we stop..."
+		echo
+		exit 1
+	    fi
+	fi
+    done
+fi
+
+#- At this stage cpp keys have been updated. we can check the arch file
+#- When used for the first time, choose a compiler ---
+. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit
 
 #- At this stage the configuration has beeen chosen
@@ -317,4 +357,5 @@
         rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD
         rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/opa
+        rm -f ${COMPIL_DIR}/*history ${COMPIL_DIR}/*fcm ${COMPIL_DIR}/*txt
         echo "cleaning ${NEW_CONF} WORK, BLD"
     fi
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/EXTERNAL/AGRIF/LIB/SubLoopCreation.c	(revision 4276)
@@ -102,8 +102,8 @@
       if ( mark == 1 ) fprintf(fortranout,"!!! aaaaaaaaaaaaaaa \n");
       WriteLocalParamDeclaration();
-      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbbbbbbbbbb \n");
+      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbbbbbbbbbb \n");   
+      WriteArgumentDeclaration_beforecall();
+      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbccccccccc \n");
       if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(1);
-      if ( mark == 1 ) fprintf(fortranout,"!!! bbbbbbccccccccc \n");      
-      WriteArgumentDeclaration_beforecall();
 /*      writesub_loopdeclaration_scalar(List_SubroutineArgument_Var,fortranout);
       writesub_loopdeclaration_tab(List_SubroutineArgument_Var,fortranout);*/
@@ -405,6 +405,6 @@
 
       AddUseAgrifUtilBeforeCall_0(fortranout);
+      WriteArgumentDeclaration_beforecall();
       if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(0);
-      WriteArgumentDeclaration_beforecall();
       if ( !strcasecmp(subofagrifinitgrids,subroutinename) )
                      fprintf(oldfortranout,"      Call Agrif_Init_Grids () \n");
@@ -462,6 +462,6 @@
                                                        "      IMPLICIT NONE\n");
       WriteLocalParamDeclaration();
+      WriteArgumentDeclaration_beforecall();
       if ( functiondeclarationisdone == 0 ) WriteFunctionDeclaration(0);
-      WriteArgumentDeclaration_beforecall();
       WriteSubroutineDeclaration(0);
       if ( !strcasecmp(subofagrifinitgrids,subroutinename) )
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 4276)
@@ -218,4 +218,6 @@
             zemp_snw = rdm_snw(ji,jj) * r1_rdtice                    ! snow melting = pure water that enters the ocean
             zfmm     = rdm_ice(ji,jj) * r1_rdtice                    ! Freezing minus Melting (F-M)
+
+            fmmflx(ji,jj) = zfmm                                     ! F/M mass flux save at least for biogeochemical model
 
             ! salt flux at the ice/ocean interface (sea ice fraction) [PSU*kg/m2/s]
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 4276)
@@ -226,4 +226,6 @@
             zemp_snw = rdm_snw(ji,jj) * r1_rdtice                         ! snow melting = pure water that enters the ocean
             zfmm     = rdm_ice(ji,jj) * r1_rdtice                         ! Freezing minus mesting  
+
+            fmmflx(ji,jj) = zfmm                                     ! F/M mass flux save at least for biogeochemical model
 
             emp(ji,jj) = zemp + zemp_snw + zfmm  ! mass flux + F/M mass flux (always ice/ocean mass exchange)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/NST_SRC/agrif_opa_sponge.F90	(revision 4276)
@@ -185,71 +185,121 @@
       INTEGER  :: ji,jj,jk
       INTEGER  :: ispongearea, ilci, ilcj
-      REAL(wp) :: z1spongearea
-      REAL(wp), POINTER, DIMENSION(:,:) :: zlocalviscsponge
+      LOGICAL  :: ll_spdone
+      REAL(wp) :: z1spongearea, zramp
+      REAL(wp), POINTER, DIMENSION(:,:) :: ztabramp
 
 #if defined SPONGE || defined SPONGE_TOP
-
-      CALL wrk_alloc( jpi, jpj, zlocalviscsponge )
-
-      ispongearea  = 2 + 2 * Agrif_irhox()
-      ilci = nlci - ispongearea
-      ilcj = nlcj - ispongearea 
-      z1spongearea = 1._wp / REAL( ispongearea - 2 )
-      spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) )
+      ll_spdone=.TRUE.
+      IF (( .NOT. spongedoneT ).OR.( .NOT. spongedoneU )) THEN
+         ! Define ramp from boundaries towards domain interior
+         ! at T-points
+         ! Store it in ztabramp
+         ll_spdone=.FALSE.
+
+         CALL wrk_alloc( jpi, jpj, ztabramp )
+
+         ispongearea  = 2 + 2 * Agrif_irhox()
+         ilci = nlci - ispongearea
+         ilcj = nlcj - ispongearea 
+         z1spongearea = 1._wp / REAL( ispongearea - 2 )
+         spbtr2(:,:) = 1. / ( e1t(:,:) * e2t(:,:) )
+
+         ztabramp(:,:) = 0.
+
+         IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN
+            DO jj = 1, jpj
+               IF ( umask(2,jj,1) == 1._wp ) THEN
+                 DO ji = 2, ispongearea                  
+                    ztabramp(ji,jj) = ( ispongearea-ji ) * z1spongearea
+                 END DO
+               ENDIF
+            ENDDO
+         ENDIF
+
+         IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN
+            DO jj = 1, jpj
+               IF ( umask(nlci-2,jj,1) == 1._wp ) THEN
+                  DO ji = ilci+1,nlci-1
+                     zramp = (ji - (ilci+1) ) * z1spongearea
+                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp )
+                  ENDDO
+               ENDIF
+            ENDDO
+         ENDIF
+
+         IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN
+            DO ji = 1, jpi
+               IF ( vmask(ji,2,1) == 1._wp ) THEN
+                  DO jj = 2, ispongearea
+                     zramp = ( ispongearea-jj ) * z1spongearea
+                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp )
+                  END DO
+               ENDIF
+            ENDDO
+         ENDIF
+
+         IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN
+            DO ji = 1, jpi
+               IF ( vmask(ji,nlcj-2,1) == 1._wp ) THEN
+                  DO jj = ilcj+1,nlcj-1
+                     zramp = (jj - (ilcj+1) ) * z1spongearea
+                     ztabramp(ji,jj) = MAX( ztabramp(ji,jj), zramp )
+                  END DO
+               ENDIF
+            ENDDO
+         ENDIF
+
+      ENDIF
 
       ! Tracers
       IF( .NOT. spongedoneT ) THEN
-         zlocalviscsponge(:,:) = 0.
          spe1ur(:,:) = 0.
          spe2vr(:,:) = 0.
 
          IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN
-            DO ji = 2, ispongearea
-               zlocalviscsponge(ji,:) = visc_tra * ( ispongearea-ji ) * z1spongearea
-            ENDDO
-            spe1ur(2:ispongearea-1,:      ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,:      )   &
-               &                         +            zlocalviscsponge(3:ispongearea  ,:      ) ) &
-               &                         * e2u(2:ispongearea-1,:      ) / e1u(2:ispongearea-1,:      )
-            spe2vr(2:ispongearea  ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea  ,1:jpjm1)   &
-               &                         +            zlocalviscsponge(2:ispongearea,2  :jpj  ) ) &
-               &                         * e1v(2:ispongearea  ,1:jpjm1) / e2v(2:ispongearea  ,1:jpjm1)
+            spe1ur(2:ispongearea-1,:       ) = visc_tra                                        &
+               &                             *    0.5 * (  ztabramp(2:ispongearea-1,:      )   &
+               &                                         + ztabramp(3:ispongearea  ,:      ) ) &
+               &                             * e2u(2:ispongearea-1,:) / e1u(2:ispongearea-1,:)
+
+            spe2vr(2:ispongearea  ,1:jpjm1 ) = visc_tra                                        &
+               &                             *    0.5 * (  ztabramp(2:ispongearea  ,1:jpjm1)   &
+               &                                         + ztabramp(2:ispongearea,2  :jpj  ) ) &
+               &                             * e1v(2:ispongearea,1:jpjm1) / e2v(2:ispongearea,1:jpjm1)
          ENDIF
 
          IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN
-            DO ji = ilci+1,nlci-1
-               zlocalviscsponge(ji,:) = visc_tra * (ji - (ilci+1) ) * z1spongearea
-            ENDDO
-  
-            spe1ur(ilci+1:nlci-2,:      ) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-2,:)    & 
-               &                          +          zlocalviscsponge(ilci+2:nlci-1,:) )  &
-               &                          * e2u(ilci+1:nlci-2,:) / e1u(ilci+1:nlci-2,:)
-
-            spe2vr(ilci+1:nlci-1,1:jpjm1) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-1,1:jpjm1)    & 
-               &                            +        zlocalviscsponge(ilci+1:nlci-1,2:jpj  )  ) & 
-               &                                   * e1v(ilci+1:nlci-1,1:jpjm1) / e2v(ilci+1:nlci-1,1:jpjm1)
+            spe1ur(ilci+1:nlci-2,:        ) = visc_tra                                   &
+               &                            * 0.5 * (  ztabramp(ilci+1:nlci-2,:      )   & 
+               &                                     + ztabramp(ilci+2:nlci-1,:      ) ) &
+               &                            * e2u(ilci+1:nlci-2,:) / e1u(ilci+1:nlci-2,:)
+
+            spe2vr(ilci+1:nlci-1,1:jpjm1  )  = visc_tra                                  &
+               &                            * 0.5 * (  ztabramp(ilci+1:nlci-1,1:jpjm1)   & 
+               &                                     + ztabramp(ilci+1:nlci-1,2:jpj  ) ) & 
+               &                            * e1v(ilci+1:nlci-1,1:jpjm1) / e2v(ilci+1:nlci-1,1:jpjm1)
          ENDIF
 
          IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN
-            DO jj = 2, ispongearea
-               zlocalviscsponge(:,jj) = visc_tra * ( ispongearea-jj ) * z1spongearea
-            ENDDO
-            spe1ur(1:jpim1,2:ispongearea  ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea  ) & 
-               &                            +         zlocalviscsponge(2:jpi  ,2:ispongearea) ) &
+            spe1ur(1:jpim1,2:ispongearea  ) = visc_tra                                     &
+               &                            * 0.5 * (  ztabramp(1:jpim1,2:ispongearea  )   & 
+               &                                     + ztabramp(2:jpi  ,2:ispongearea  ) ) &
                &                            * e2u(1:jpim1,2:ispongearea) / e1u(1:jpim1,2:ispongearea)
    
-            spe2vr(:      ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1)       &
-               &                            +         zlocalviscsponge(:,3:ispongearea  )     ) &
+            spe2vr(:      ,2:ispongearea-1) = visc_tra                                     &
+               &                            * 0.5 * (  ztabramp(:      ,2:ispongearea-1)   &
+               &                                     + ztabramp(:      ,3:ispongearea  ) ) &
                &                            * e1v(:,2:ispongearea-1) / e2v(:,2:ispongearea-1)
          ENDIF
 
          IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN
-            DO jj = ilcj+1,nlcj-1
-               zlocalviscsponge(:,jj) = visc_tra * (jj - (ilcj+1) ) * z1spongearea
-            ENDDO
-            spe1ur(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1)   &
-               &                          +         zlocalviscsponge(2:jpi  ,ilcj+1:nlcj-1) ) &
+            spe1ur(1:jpim1,ilcj+1:nlcj-1) = visc_tra                                   &
+               &                          * 0.5 * (  ztabramp(1:jpim1,ilcj+1:nlcj-1)   &
+               &                                   + ztabramp(2:jpi  ,ilcj+1:nlcj-1) ) &
                &                                * e2u(1:jpim1,ilcj+1:nlcj-1) / e1u(1:jpim1,ilcj+1:nlcj-1)
-            spe2vr(:      ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2      )   &
-               &                          +         zlocalviscsponge(:,ilcj+2:nlcj-1)     )   &
+
+            spe2vr(:      ,ilcj+1:nlcj-2) = visc_tra                                   &
+               &                          * 0.5 * (  ztabramp(:      ,ilcj+1:nlcj-2)   &
+               &                                   + ztabramp(:      ,ilcj+2:nlcj-1) ) &
                &                                * e1v(:,ilcj+1:nlcj-2) / e2v(:,ilcj+1:nlcj-2)
          ENDIF
@@ -259,46 +309,41 @@
       ! Dynamics
       IF( .NOT. spongedoneU ) THEN
-         zlocalviscsponge(:,:) = 0.
          spe1ur2(:,:) = 0.
          spe2vr2(:,:) = 0.
 
          IF( (nbondi == -1) .OR. (nbondi == 2) ) THEN
-            DO ji = 2, ispongearea
-               zlocalviscsponge(ji,:) = visc_dyn * ( ispongearea-ji ) * z1spongearea
-            ENDDO
-            spe1ur2(2:ispongearea-1,:      ) = 0.5 * ( zlocalviscsponge(2:ispongearea-1,:      ) &
-                                             &     +   zlocalviscsponge(3:ispongearea,:    ) )
-            spe2vr2(2:ispongearea  ,1:jpjm1) = 0.5 * ( zlocalviscsponge(2:ispongearea  ,1:jpjm1) &
-                                             &     +   zlocalviscsponge(2:ispongearea,2:jpj) ) 
+            spe1ur2(2:ispongearea-1,:      ) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(2:ispongearea-1,:      ) &
+               &                                      + ztabramp(3:ispongearea  ,:      ) )
+            spe2vr2(2:ispongearea  ,1:jpjm1) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(2:ispongearea  ,1:jpjm1) &
+               &                                      + ztabramp(2:ispongearea  ,2:jpj  ) ) 
          ENDIF
 
          IF( (nbondi == 1) .OR. (nbondi == 2) ) THEN
-            DO ji = ilci+1,nlci-1
-               zlocalviscsponge(ji,:) = visc_dyn * (ji - (ilci+1) ) * z1spongearea
-            ENDDO
-            spe1ur2(ilci+1:nlci-2,:      ) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-2,:) &
-                                           &        + zlocalviscsponge(ilci+2:nlci-1,:) )  
-            spe2vr2(ilci+1:nlci-1,1:jpjm1) = 0.5 * (  zlocalviscsponge(ilci+1:nlci-1,1:jpjm1) &
-                                           &        + zlocalviscsponge(ilci+1:nlci-1,2:jpj  )  ) 
+            spe1ur2(ilci+1:nlci-2  ,:      ) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(ilci+1:nlci-2, :       ) &
+               &                                      + ztabramp(ilci+2:nlci-1, :       ) )                      
+            spe2vr2(ilci+1:nlci-1  ,1:jpjm1) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(ilci+1:nlci-1,1:jpjm1  ) &
+               &                                      + ztabramp(ilci+1:nlci-1,2:jpj    ) ) 
          ENDIF
 
          IF( (nbondj == -1) .OR. (nbondj == 2) ) THEN
-            DO jj = 2, ispongearea
-               zlocalviscsponge(:,jj) = visc_dyn * ( ispongearea-jj ) * z1spongearea
-            ENDDO
-            spe1ur2(1:jpim1,2:ispongearea  ) = 0.5 * ( zlocalviscsponge(1:jpim1,2:ispongearea) &
-                                             &      + zlocalviscsponge(2:jpi,2:ispongearea) ) 
-            spe2vr2(:      ,2:ispongearea-1) = 0.5 * ( zlocalviscsponge(:,2:ispongearea-1)     &
-                                             &      + zlocalviscsponge(:,3:ispongearea)     )
+            spe1ur2(1:jpim1,2:ispongearea  ) = visc_dyn                                   &  
+               &                             * 0.5 * (  ztabramp(1:jpim1,2:ispongearea  ) &
+               &                                      + ztabramp(2:jpi  ,2:ispongearea  ) ) 
+            spe2vr2(:      ,2:ispongearea-1) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(:      ,2:ispongearea-1) &
+               &                                      + ztabramp(:      ,3:ispongearea  ) )
          ENDIF
 
          IF( (nbondj == 1) .OR. (nbondj == 2) ) THEN
-            DO jj = ilcj+1,nlcj-1
-               zlocalviscsponge(:,jj) = visc_dyn * (jj - (ilcj+1) ) * z1spongearea
-            ENDDO
-            spe1ur2(1:jpim1,ilcj+1:nlcj-1) = 0.5 * ( zlocalviscsponge(1:jpim1,ilcj+1:nlcj-1) &
-                                           &         + zlocalviscsponge(2:jpi,ilcj+1:nlcj-1) ) 
-            spe2vr2(:      ,ilcj+1:nlcj-2) = 0.5 * ( zlocalviscsponge(:,ilcj+1:nlcj-2      ) &
-                                           &         + zlocalviscsponge(:,ilcj+2:nlcj-1)     )
+            spe1ur2(1:jpim1,ilcj+1:nlcj-1  ) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(1:jpim1,ilcj+1:nlcj-1  ) &
+               &                                      + ztabramp(2:jpi  ,ilcj+1:nlcj-1  ) ) 
+            spe2vr2(:      ,ilcj+1:nlcj-2  ) = visc_dyn                                   &
+               &                             * 0.5 * (  ztabramp(:      ,ilcj+1:nlcj-2  ) &
+               &                                      + ztabramp(:      ,ilcj+2:nlcj-1  ) )
          ENDIF
          spongedoneU = .TRUE.
@@ -306,5 +351,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi, jpj, zlocalviscsponge )
+      IF (.NOT.ll_spdone) CALL wrk_dealloc( jpi, jpj, ztabramp )
       !
 #endif
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 4276)
@@ -72,5 +72,5 @@
    INTEGER  , SAVE      ::   jf_eiv         ! index of v-eiv
    INTEGER  , SAVE      ::   jf_eiw         ! index of w-eiv
-   INTEGER  , SAVE      ::   jf_sfx         ! index of downward salt flux
+   INTEGER  , SAVE      ::   jf_fmf         ! index of downward salt flux
 
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_dyn  ! structure of input fields (file informations, fields read)
@@ -254,6 +254,5 @@
       wndm(:,:)        = sf_dyn(jf_wnd)%fnow(:,:,1) * tmask(:,:,1)    ! wind speed - needed for gas exchange
       emp (:,:)        = sf_dyn(jf_emp)%fnow(:,:,1) * tmask(:,:,1)    ! E-P
-      sfx (:,:)        = 0.0_wp      ! enable testing with old inputs ! downward salt flux 
-!     sfx (:,:)        = sf_dyn(jf_sfx)%fnow(:,:,1) * tmask(:,:,1)    ! downward salt flux (v3.5+)
+      fmmflx(:,:)      = sf_dyn(jf_fmf)%fnow(:,:,1) * tmask(:,:,1)    ! downward salt flux (v3.5+)
       fr_i(:,:)        = sf_dyn(jf_ice)%fnow(:,:,1) * tmask(:,:,1)    ! Sea-ice fraction
       qsr (:,:)        = sf_dyn(jf_qsr)%fnow(:,:,1) * tmask(:,:,1)    ! solar radiation
@@ -302,5 +301,5 @@
          CALL prt_ctl(tab2d_1=fr_i             , clinfo1=' fr_i    - : ', mask1=tmask, ovlap=1 )
          CALL prt_ctl(tab2d_1=hmld             , clinfo1=' hmld    - : ', mask1=tmask, ovlap=1 )
-         CALL prt_ctl(tab2d_1=sfx              , clinfo1=' sfx     - : ', mask1=tmask, ovlap=1 )
+         CALL prt_ctl(tab2d_1=fmmflx           , clinfo1=' fmmflx  - : ', mask1=tmask, ovlap=1 )
          CALL prt_ctl(tab2d_1=emp              , clinfo1=' emp     - : ', mask1=tmask, ovlap=1 )
          CALL prt_ctl(tab2d_1=wndm             , clinfo1=' wspd    - : ', mask1=tmask, ovlap=1 )
@@ -331,10 +330,10 @@
       TYPE(FLD_N) :: sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd  ! informations about the fields to be read
       TYPE(FLD_N) :: sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl          !   "                                 "
-      TYPE(FLD_N) :: sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_sfx  !   "                                 "
+      TYPE(FLD_N) :: sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf  !   "                                 "
       !
       NAMELIST/namdta_dyn/cn_dir, ln_dynwzv, ln_dynbbl, ln_degrad,    &
          &                sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd,  &
          &                sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl,          &
-         &                sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_sfx
+         &                sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf
 
       !!----------------------------------------------------------------------
@@ -349,6 +348,5 @@
       sn_mld  = FLD_N( 'dyna_grid_T' ,    120    , 'somixght' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
       sn_emp  = FLD_N( 'dyna_grid_T' ,    120    , 'sowaflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
-      sn_sfx  = FLD_N( 'dyna_grid_T' ,    120    , 'sowaflcd' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
-!!    sn_sfx  = FLD_N( 'dyna_grid_T' ,    120    , 'sosfldow' ,  .true.    , .true. ,   'yearly'  , ''       , ''         ) ! v3.5+
+      sn_fmf  = FLD_N( 'dyna_grid_T' ,    120    , 'sofmflup' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
       sn_ice  = FLD_N( 'dyna_grid_T' ,    120    , 'soicecov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
       sn_qsr  = FLD_N( 'dyna_grid_T' ,    120    , 'soshfldo' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
@@ -391,9 +389,9 @@
       ENDIF
 
-      jf_tem = 1   ;   jf_sal = 2   ;  jf_mld = 3   ;  jf_emp = 4   ;   jf_sfx  = 5   ;  jf_ice = 6   ;   jf_qsr = 7
+      jf_tem = 1   ;   jf_sal = 2   ;  jf_mld = 3   ;  jf_emp = 4   ;   jf_fmf  = 5   ;  jf_ice = 6   ;   jf_qsr = 7
       jf_wnd = 8   ;   jf_uwd = 9   ;  jf_vwd = 10  ;  jf_wwd = 11  ;   jf_avt  = 12  ;  jfld  = 12
       !
       slf_d(jf_tem) = sn_tem   ;   slf_d(jf_sal)  = sn_sal   ;   slf_d(jf_mld) = sn_mld
-      slf_d(jf_emp) = sn_emp   ;   slf_d(jf_sfx ) = sn_sfx   ;   slf_d(jf_ice) = sn_ice 
+      slf_d(jf_emp) = sn_emp   ;   slf_d(jf_fmf ) = sn_fmf   ;   slf_d(jf_ice) = sn_ice 
       slf_d(jf_qsr) = sn_qsr   ;   slf_d(jf_wnd)  = sn_wnd   ;   slf_d(jf_avt) = sn_avt 
       slf_d(jf_uwd) = sn_uwd   ;   slf_d(jf_vwd)  = sn_vwd   ;   slf_d(jf_wwd) = sn_wwd
@@ -429,7 +427,4 @@
         ENDIF
       ENDIF
-      ! Salt flux and concntration/dilution terms (new from v3.5) !! disabled to allow testing with old input files
-!!    jf_sfx = jfld + 1    ;    jfld = jfld + 1
-!!    slf_d(jf_sfx) = sn_sfx
   
       ALLOCATE( sf_dyn(jfld), STAT=ierr )         ! set sf structure
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 4276)
@@ -682,17 +682,7 @@
       ! used to prevent the applied increments taking the temperature below the local freezing point 
 
-#if defined key_cice 
-        fzptnz(:,:,:) = -1.8_wp
-#else 
-        DO jk = 1, jpk
-           DO jj = 1, jpj
-              DO ji = 1, jpk
-                 fzptnz (ji,jj,jk) = ( -0.0575_wp + 1.710523e-3_wp * SQRT( tsn(ji,jj,jk,jp_sal) )                   & 
-                                                  - 2.154996e-4_wp *       tsn(ji,jj,jk,jp_sal)   ) * tsn(ji,jj,jk,jp_sal)  & 
-                                                  - 7.53e-4_wp * fsdepw(ji,jj,jk)       ! (pressure in dbar) 
-              END DO
-           END DO
-        END DO
-#endif 
+      DO jk=1, jpkm1
+         fzptnz (:,:,jk) = tfreez( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) )
+      ENDDO
 
       IF ( ln_asmiau ) THEN
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 4276)
@@ -476,5 +476,5 @@
             IF( nn_dyn2d(ib_bdy) .gt. 0 .and. ( nn_dyn2d_dta(ib_bdy) .eq. 1 .or. nn_dyn2d_dta(ib_bdy) .eq. 3 ) ) THEN 
 
-               IF( nn_tra(ib_bdy) .ne. 4 ) THEN ! runoff condition : no ssh reading
+               IF( nn_dyn2d(ib_bdy) .ne. jp_frs .and. nn_tra(ib_bdy) .ne. 4 ) THEN ! runoff condition : no ssh reading
                   jfld = jfld + 1
                   blf_i(jfld) = bn_ssh
@@ -572,6 +572,6 @@
             ! Recalculate field counts
             !-------------------------
-            nb_bdy_fld_sum = 0
             IF( ib_bdy .eq. 1 ) THEN 
+               nb_bdy_fld_sum = 0
                nb_bdy_fld(ib_bdy) = jfld
                nb_bdy_fld_sum     = jfld              
@@ -616,5 +616,5 @@
                ALLOCATE( dta_bdy(ib_bdy)%u2d(ilen0(2)) )
                ALLOCATE( dta_bdy(ib_bdy)%v2d(ilen0(3)) )
-               IF (nn_dyn2d_dta(ib_bdy).eq.1.or.nn_dyn2d_dta(ib_bdy).eq.3) THEN
+               IF ( nn_dyn2d(ib_bdy) .ne. jp_frs .and. (nn_dyn2d_dta(ib_bdy).eq.1.or.nn_dyn2d_dta(ib_bdy).eq.3) ) THEN
                   jfld = jfld + 1
                   dta_bdy(ib_bdy)%ssh => bf(jfld)%fnow(:,1,1)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 4276)
@@ -30,4 +30,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  !
+   USE domvvl          ! variable volume
 
    IMPLICIT NONE
@@ -84,13 +85,22 @@
       pu2d(:,:) = 0.e0
       pv2d(:,:) = 0.e0
-      DO jk = 1, jpkm1   !! Vertically integrated momentum trends
-          pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
-          pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
-      END DO
-      pu2d(:,:) = pu2d(:,:) * phur(:,:)
-      pv2d(:,:) = pv2d(:,:) * phvr(:,:)
+      IF (lk_vvl) THEN
+         DO jk = 1, jpkm1   !! Vertically integrated momentum trends
+            pu2d(:,:) = pu2d(:,:) + fse3u_a(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
+            pv2d(:,:) = pv2d(:,:) + fse3v_a(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
+         END DO
+         pu2d(:,:) = pu2d(:,:) / ( hu_0(:,:) + sshu_a(:,:) + 1._wp - umask(:,:,1) )
+         pv2d(:,:) = pv2d(:,:) / ( hv_0(:,:) + sshv_a(:,:) + 1._wp - vmask(:,:,1) )
+      ELSE
+         DO jk = 1, jpkm1   !! Vertically integrated momentum trends
+            pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
+            pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
+         END DO
+         pu2d(:,:) = pu2d(:,:) * phur(:,:)
+         pv2d(:,:) = pv2d(:,:) * phvr(:,:)
+      ENDIF
       DO jk = 1 , jpkm1
-         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:)
-         va(:,:,jk) = va(:,:,jk) - pv2d(:,:)
+         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:) * umask(:,:,jk)
+         va(:,:,jk) = va(:,:,jk) - pv2d(:,:) * vmask(:,:,jk)
       END DO
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90	(revision 4276)
@@ -32,5 +32,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id: bdyice.F90 2715 2011-03-30 15:58:35Z rblod $
+   !! $Id$
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -76,5 +76,5 @@
       INTEGER,         INTENT(in) ::   ib_bdy  ! BDY set index
       !!
-      INTEGER  ::   jb, jk, jgrd   ! dummy loop indices
+      INTEGER  ::   jb, jgrd   ! dummy loop indices
       INTEGER  ::   ii, ij         ! local scalar
       REAL(wp) ::   zwgt, zwgt1    ! local scalar
@@ -86,5 +86,4 @@
       !
       DO jb = 1, idx%nblen(jgrd)
-         DO jk = 1, jpkm1
             ii    = idx%nbi(jb,jgrd)
             ij    = idx%nbj(jb,jgrd)
@@ -94,5 +93,4 @@
             hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + dta%hicif(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth 
             hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + dta%hsnif(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth
-         END DO
       END DO 
       CALL lbc_bdy_lnk( frld, 'T', 1., ib_bdy )                                         ! lateral boundary conditions
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 4276)
@@ -1053,4 +1053,17 @@
       
       bdytmask(:,:) = tmask(:,:,1)
+      IF( .not. ln_mask_file ) THEN
+         ! If .not. ln_mask_file then we need to derive mask on U and V grid 
+         ! from mask on T grid here.
+         bdyumask(:,:) = 0.e0
+         bdyvmask(:,:) = 0.e0
+         DO ij=1, jpjm1
+            DO ii=1, jpim1
+               bdyumask(ii,ij)=bdytmask(ii,ij)*bdytmask(ii+1, ij )
+               bdyvmask(ii,ij)=bdytmask(ii,ij)*bdytmask(ii  ,ij+1)  
+            END DO
+         END DO
+         CALL lbc_lnk( bdyumask(:,:), 'U', 1. )   ;   CALL lbc_lnk( bdyvmask(:,:), 'V', 1. )      ! Lateral boundary cond.
+      ENDIF
 
       ! bdy masks and bmask are now set to zero on boundary points:
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 4276)
@@ -59,6 +59,7 @@
 
                              indic = 0                ! reset to no error condition
+      IF( kstp == nit000 )   CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
       IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
-                             CALL iom_setkt( kstp )   ! say to iom that we are at time step kstp
+                             CALL iom_setkt( kstp - nit000 + 1 )   ! say to iom that we are at time step kstp
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -106,4 +107,6 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL dia_wri( kstp )       ! ocean model: outputs
+      IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C)
+
 
 #if defined key_top
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 4276)
@@ -42,5 +42,6 @@
 #endif
 #if defined key_lim3
-  USE ice_3
+  USE par_ice
+  USE ice
 #endif
   USE domvvl
@@ -484,4 +485,5 @@
                  ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 + njmpp - 1
                  WRITE(numout,*)'         # I J : ',iiglo,ijglo
+                 CALL FLUSH(numout)
               ENDDO
            ENDIF
@@ -606,5 +608,5 @@
     
      !! * Local variables
-     INTEGER             :: jk, jseg, jclass,                    &!loop on level/segment/classes  
+     INTEGER             :: jk, jseg, jclass,jl,                 &!loop on level/segment/classes/ice categories
                             isgnu, isgnv                          ! 
      REAL(wp)            :: zumid, zvmid,                        &!U/V velocity on a cell segment 
@@ -771,5 +773,6 @@
    
               zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J)
-   
+
+#if defined key_lim2   
               transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*   & 
                                    (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J))  & 
@@ -778,4 +781,16 @@
               transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   & 
                                     (1.0 -  frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J))
+#endif
+#if defined key_lim3
+              DO jl=1,jpl
+                 transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*     &
+                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) * &
+                                  ( ht_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) +  &
+                                    ht_s(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) )
+                                   
+                 transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   &
+                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl)
+              ENDDO
+#endif
    
            ENDIF !end of ice case
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 4276)
@@ -21,4 +21,6 @@
    USE bdy_par         ! (for lk_bdy)
    USE timing          ! preformance summary
+   USE lib_fortran
+   USE sbcrnf
 
    IMPLICIT NONE
@@ -33,4 +35,5 @@
    REAL(dp)                                ::   surf_tot   , vol_tot             !
    REAL(dp)                                ::   frc_t      , frc_s     , frc_v   ! global forcing trends
+   REAL(dp)                                ::   frc_wn_t      , frc_wn_s ! global forcing trends
    REAL(dp)                                ::   fact1                            ! conversion factors
    REAL(dp)                                ::   fact21    , fact22               !     -         -
@@ -38,4 +41,5 @@
    REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   surf      , ssh_ini              !
    REAL(dp), DIMENSION(:,:,:), ALLOCATABLE ::   hc_loc_ini, sc_loc_ini, e3t_ini  !
+   REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   ssh_hc_loc_ini, ssh_sc_loc_ini
 
    !! * Substitutions
@@ -67,9 +71,13 @@
       INTEGER    ::   jk                          ! dummy loop indice
       REAL(dp)   ::   zdiff_hc    , zdiff_sc      ! heat and salt content variations
+      REAL(dp)   ::   zdiff_hc1   , zdiff_sc1     ! heat and salt content variations of ssh
       REAL(dp)   ::   zdiff_v1    , zdiff_v2      ! volume variation
+      REAL(dp)   ::   zerr_hc1    , zerr_sc1      ! Non conservation due to free surface
       REAL(dp)   ::   z1_rau0                     ! local scalars
       REAL(dp)   ::   zdeltat                     !    -     -
       REAL(dp)   ::   z_frc_trd_t , z_frc_trd_s   !    -     -
       REAL(dp)   ::   z_frc_trd_v                 !    -     -
+      REAL(dp)   ::   z_wn_trd_t , z_wn_trd_s   !    -     -
+      REAL(dp)   ::   z_ssh_hc , z_ssh_sc   !    -     -
       !!---------------------------------------------------------------------------
       IF( nn_timing == 1 )   CALL timing_start('dia_hsb')
@@ -79,18 +87,27 @@
       ! ------------------------- !
       z1_rau0 = 1.e0 / rau0
-      z_frc_trd_v = z1_rau0 * SUM( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) )     ! volume fluxes
-      z_frc_trd_t =           SUM( sbc_tsc(:,:,jp_tem) * surf(:,:) )     ! heat fluxes
-      z_frc_trd_s =           SUM( sbc_tsc(:,:,jp_sal) * surf(:,:) )     ! salt fluxes
+      z_frc_trd_v = z1_rau0 * glob_sum( - ( emp(:,:) - rnf(:,:) ) * surf(:,:) )     ! volume fluxes
+      z_frc_trd_t =           glob_sum( sbc_tsc(:,:,jp_tem) * surf(:,:) )     ! heat fluxes
+      z_frc_trd_s =           glob_sum( sbc_tsc(:,:,jp_sal) * surf(:,:) )     ! salt fluxes
+      ! Add runoff heat & salt input
+      IF( ln_rnf    )   z_frc_trd_t = z_frc_trd_t + glob_sum( rnf_tsc(:,:,jp_tem) * surf(:,:) )
+      IF( ln_rnf_sal)   z_frc_trd_s = z_frc_trd_s + glob_sum( rnf_tsc(:,:,jp_sal) * surf(:,:) )
       ! Add penetrative solar radiation
-      IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * SUM( qsr     (:,:) * surf(:,:) )
+      IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( qsr     (:,:) * surf(:,:) )
       ! Add geothermal heat flux
-      IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * SUM( qgh_trd0(:,:) * surf(:,:) )
-      IF( lk_mpp ) THEN
-         CALL mpp_sum( z_frc_trd_v )
-         CALL mpp_sum( z_frc_trd_t )
-      ENDIF
+      IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t +  glob_sum( qgh_trd0(:,:) * surf(:,:) )
+      IF( .NOT. lk_vvl ) THEN
+         z_wn_trd_t = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_tem) )
+         z_wn_trd_s = - glob_sum( surf(:,:) * wn(:,:,1) * tsb(:,:,1,jp_sal) )
+      ENDIF
+
       frc_v = frc_v + z_frc_trd_v * rdt
       frc_t = frc_t + z_frc_trd_t * rdt
       frc_s = frc_s + z_frc_trd_s * rdt
+      !                                          ! Advection flux through fixed surface (z=0)
+      IF( .NOT. lk_vvl ) THEN
+         frc_wn_t = frc_wn_t + z_wn_trd_t * rdt
+         frc_wn_s = frc_wn_s + z_wn_trd_s * rdt
+      ENDIF
 
       ! ----------------------- !
@@ -100,33 +117,40 @@
       zdiff_hc = 0.d0
       zdiff_sc = 0.d0
+
       ! volume variation (calculated with ssh)
-      zdiff_v1 = SUM( surf(:,:) * tmask(:,:,1) * ( sshn(:,:) - ssh_ini(:,:) ) )
+      zdiff_v1 = glob_sum( surf(:,:) * ( sshn(:,:) - ssh_ini(:,:) ) )
+
+      ! heat & salt content variation (associated with ssh)
+      IF( .NOT. lk_vvl ) THEN
+         z_ssh_hc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_tem) * sshn(:,:) - ssh_hc_loc_ini(:,:) ) )
+         z_ssh_sc = glob_sum( surf(:,:) * ( tsn(:,:,1,jp_sal) * sshn(:,:) - ssh_sc_loc_ini(:,:) ) )
+      ENDIF
+
       DO jk = 1, jpkm1
-         ! volume variation (calculated with scale factors)
-         zdiff_v2 = zdiff_v2 + SUM( surf(:,:) * tmask(:,:,jk)   &
+        ! volume variation (calculated with scale factors)
+         zdiff_v2 = zdiff_v2 + glob_sum( surf(:,:) * tmask(:,:,jk)   &
             &                       * ( fse3t_n(:,:,jk)         &
             &                           - e3t_ini(:,:,jk) ) )
          ! heat content variation
-         zdiff_hc = zdiff_hc + SUM( surf(:,:) * tmask(:,:,jk)          &
+         zdiff_hc = zdiff_hc + glob_sum( surf(:,:) * tmask(:,:,jk)          &
             &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_tem)   &
             &                           - hc_loc_ini(:,:,jk) ) )
          ! salt content variation
-         zdiff_sc = zdiff_sc + SUM( surf(:,:) * tmask(:,:,jk)          &
+         zdiff_sc = zdiff_sc + glob_sum( surf(:,:) * tmask(:,:,jk)          &
             &                       * ( fse3t_n(:,:,jk) * tsn(:,:,jk,jp_sal)   &
             &                           - sc_loc_ini(:,:,jk) ) )
       ENDDO
 
-      IF( lk_mpp ) THEN
-         CALL mpp_sum( zdiff_hc )
-         CALL mpp_sum( zdiff_sc )
-         CALL mpp_sum( zdiff_v1 )
-         CALL mpp_sum( zdiff_v2 )
-      ENDIF
-
       ! Substract forcing from heat content, salt content and volume variations
       zdiff_v1 = zdiff_v1 - frc_v
-      zdiff_v2 = zdiff_v2 - frc_v
+      IF( lk_vvl )   zdiff_v2 = zdiff_v2 - frc_v
       zdiff_hc = zdiff_hc - frc_t
       zdiff_sc = zdiff_sc - frc_s
+      IF( .NOT. lk_vvl ) THEN
+         zdiff_hc1 = zdiff_hc + z_ssh_hc 
+         zdiff_sc1 = zdiff_sc + z_ssh_sc
+         zerr_hc1  = z_ssh_hc - frc_wn_t
+         zerr_sc1  = z_ssh_sc - frc_wn_s
+      ENDIF
       
       ! ----------------------- !
@@ -134,8 +158,15 @@
       ! ----------------------- !
       zdeltat  = 1.e0 / ( ( kt - nit000 + 1 ) * rdt )
-      WRITE(numhsb , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1  * zdeltat,                                &
-         &                      zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat,   &
-         &                      zdiff_v1           , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat,   &
-         &                      zdiff_v2           , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat
+      IF( lk_vvl ) THEN
+         WRITE(numhsb , 9020) kt , zdiff_hc / vol_tot , zdiff_hc * fact1  * zdeltat,                                &
+            &                      zdiff_sc / vol_tot , zdiff_sc * fact21 * zdeltat, zdiff_sc * fact22 * zdeltat,   &
+            &                      zdiff_v1           , zdiff_v1 * fact31 * zdeltat, zdiff_v1 * fact32 * zdeltat,   &
+            &                      zdiff_v2           , zdiff_v2 * fact31 * zdeltat, zdiff_v2 * fact32 * zdeltat
+      ELSE
+         WRITE(numhsb , 9030) kt , zdiff_hc1 / vol_tot , zdiff_hc1 * fact1  * zdeltat,                                &
+            &                      zdiff_sc1 / vol_tot , zdiff_sc1 * fact21 * zdeltat, zdiff_sc1 * fact22 * zdeltat,   &
+            &                      zdiff_v1            , zdiff_v1  * fact31 * zdeltat, zdiff_v1  * fact32 * zdeltat,   &
+            &                      zerr_hc1 / vol_tot  , zerr_sc1 / vol_tot
+      ENDIF
 
       IF ( kt == nitend ) CLOSE( numhsb )
@@ -144,4 +175,5 @@
 
 9020  FORMAT(I5,11D15.7)
+9030  FORMAT(I5,10D15.7)
       !
    END SUBROUTINE dia_hsb
@@ -179,27 +211,18 @@
 
       IF( .NOT. ln_diahsb )   RETURN
+      IF( .NOT. lk_mpp_rep ) &
+        CALL ctl_stop (' Your global mpp_sum if performed in single precision - 64 bits -', &
+             &         ' whereas the global sum to be precise must be done in double precision ',&
+             &         ' please add key_mpp_rep')
 
       ! ------------------- !
       ! 1 - Allocate memory !
       ! ------------------- !
-      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), STAT=ierror )
+      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), &
+         &      ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj), &
+         &      e3t_ini(jpi,jpj,jpk)                            , &
+         &      surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror )
       IF( ierror > 0 ) THEN
          CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN
-      ENDIF
-      ALLOCATE( sc_loc_ini(jpi,jpj,jpk), STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate sc_loc_ini' )   ;   RETURN
-      ENDIF
-      ALLOCATE( e3t_ini(jpi,jpj,jpk)   , STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate e3t_ini' )      ;   RETURN
-      ENDIF
-      ALLOCATE( surf(jpi,jpj)          , STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate surf' )         ;   RETURN
-      ENDIF
-      ALLOCATE( ssh_ini(jpi,jpj)       , STAT=ierror )
-      IF( ierror > 0 ) THEN
-         CALL ctl_stop( 'dia_hsb: unable to allocate ssh_ini' )      ;   RETURN
       ENDIF
 
@@ -214,26 +237,33 @@
       cl_name    = 'heat_salt_volume_budgets.txt'                         ! name of output file
       surf(:,:) = e1t(:,:) * e2t(:,:) * tmask(:,:,1) * tmask_i(:,:)      ! masked surface grid cell area
-      surf_tot  = SUM( surf(:,:) )                                       ! total ocean surface area
+      surf_tot  = glob_sum( surf(:,:) )                                       ! total ocean surface area
       vol_tot   = 0.d0                                                   ! total ocean volume
       DO jk = 1, jpkm1
-         vol_tot  = vol_tot + SUM( surf(:,:) * tmask(:,:,jk)     &
-            &                      * fse3t_n(:,:,jk)         )
+         vol_tot  = vol_tot + glob_sum( surf(:,:) * tmask(:,:,jk)     &
+            &                         * fse3t_n(:,:,jk)         )
       END DO
-      IF( lk_mpp ) THEN 
-         CALL mpp_sum( vol_tot )
-         CALL mpp_sum( surf_tot )
-      ENDIF
 
       CALL ctl_opn( numhsb , cl_name , 'UNKNOWN' , 'FORMATTED' , 'SEQUENTIAL' , 1 , numout , lwp , 1 )
-      !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80
-      WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   &
-         !                                                   123456789012345678901234567890123456789012345 -> 45
-         &                                                  "|            volume budget (ssh)             ",   &
-         !                                                   678901234567890123456789012345678901234567890 -> 45
-         &                                                  "|            volume budget (e3t)             "
-      WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   &
-         &                                                  "|     [m3]         [mmm/s]          [SV]     ",   &
-         &                                                  "|     [m3]         [mmm/s]          [SV]     "
-
+      IF( lk_vvl ) THEN
+         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80
+         WRITE( numhsb, 9010 ) "kt   |     heat content budget     |            salt content budget             ",   &
+            !                                                   123456789012345678901234567890123456789012345 -> 45
+            &                                                  "|            volume budget (ssh)             ",   &
+            !                                                   678901234567890123456789012345678901234567890 -> 45
+            &                                                  "|            volume budget (e3t)             "
+         WRITE( numhsb, 9010 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   &
+            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   &
+            &                                                  "|     [m3]         [mmm/s]          [SV]     "
+      ELSE
+         !                   12345678901234567890123456789012345678901234567890123456789012345678901234567890 -> 80
+         WRITE( numhsb, 9011 ) "kt   |     heat content budget     |            salt content budget             ",   &
+            !                                                   123456789012345678901234567890123456789012345 -> 45
+            &                                                  "|            volume budget (ssh)             ",   &
+            !                                                   678901234567890123456789012345678901234567890 -> 45
+            &                                                  "|  Non conservation due to free surface      "
+         WRITE( numhsb, 9011 ) "     |      [C]         [W/m2]     |     [psu]        [mmm/s]          [SV]     ",   &
+            &                                                  "|     [m3]         [mmm/s]          [SV]     ",   &
+            &                                                  "|  [heat - C]     [salt - psu]                "
+      ENDIF
       ! --------------- !
       ! 3 - Conversions ! (factors will be multiplied by duration afterwards)
@@ -261,6 +291,13 @@
       frc_t = 0.d0                                           ! heat content   -    -   -    -   
       frc_s = 0.d0                                           ! salt content   -    -   -    -         
+      IF( .NOT. lk_vvl ) THEN
+         ssh_hc_loc_ini(:,:) = tsn(:,:,1,jp_tem) * ssh_ini(:,:)   ! initial heat content associated with ssh
+         ssh_sc_loc_ini(:,:) = tsn(:,:,1,jp_sal) * ssh_ini(:,:)   ! initial salt content associated with ssh
+         frc_wn_t = 0.d0
+         frc_wn_s = 0.d0
+      ENDIF
       !
 9010  FORMAT(A80,A45,A45)
+9011  FORMAT(A80,A45,A45)
       !
    END SUBROUTINE dia_hsb_init
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 4276)
@@ -350,4 +350,5 @@
                DO jn = 1, nptr
                   tn_jk(:,:,jn) = ptr_tjk( tsn(:,:,:,jp_tem), btmsk(:,:,jn) ) * r1_sjk(:,:,jn)
+                  sn_jk(:,:,jn) = ptr_tjk( tsn(:,:,:,jp_sal), btmsk(:,:,jn) ) * r1_sjk(:,:,jn)
                END DO
             ENDIF
@@ -563,6 +564,6 @@
       !!-------------------------------------------------------------------- 
       !
-      CALL wrk_alloc( jpi      , zphi , zfoo )
-      CALL wrk_alloc( jpi , jpk, z_1 )
+      CALL wrk_alloc( jpj      , zphi , zfoo )
+      CALL wrk_alloc( jpj , jpk, z_1 )
 
       ! define time axis
@@ -878,6 +879,6 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi      , zphi , zfoo )
-      CALL wrk_dealloc( jpi , jpk, z_1 )
+      CALL wrk_dealloc( jpj      , zphi , zfoo )
+      CALL wrk_dealloc( jpj , jpk, z_1 )
       !
   END SUBROUTINE dia_ptr_wri
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/closea.F90	(revision 4276)
@@ -108,15 +108,18 @@
             ncsi1(2)   =  97  ;  ncsj1(2)   = 107
             ncsi2(2)   = 103  ;  ncsj2(2)   = 111
-            ncsir(2,1) = 110  ;  ncsjr(2,1) = 111
-            !                                            ! Black Sea 1 : west part of the Black Sea 
-            ncsnr(3)   = 1    ; ncstt(3)   =   2            !            (ie west of the cyclic b.c.)
-            ncsi1(3)   = 174  ; ncsj1(3)   = 107            ! put in Med Sea
-            ncsi2(3)   = 181  ; ncsj2(3)   = 112
-            ncsir(3,1) = 171  ; ncsjr(3,1) = 106 
-            !                                            ! Black Sea 2 : est part of the Black Sea 
-            ncsnr(4)   =   1  ;  ncstt(4)   =   2           !               (ie est of the cyclic b.c.)
-            ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! put in Med Sea
-            ncsi2(4)   =   6  ;  ncsj2(4)   = 112
-            ncsir(4,1) = 171  ;  ncsjr(4,1) = 106 
+            ncsir(2,1) = 110  ;  ncsjr(2,1) = 111           
+            !                                            ! Black Sea (crossed by the cyclic boundary condition)
+            ncsnr(3:4) =   4  ;  ncstt(3:4) =   2           ! put in Med Sea (north of Aegean Sea)
+            ncsir(3:4,1) = 171;  ncsjr(3:4,1) = 106         !
+            ncsir(3:4,2) = 170;  ncsjr(3:4,2) = 106 
+            ncsir(3:4,3) = 171;  ncsjr(3:4,3) = 105 
+            ncsir(3:4,4) = 170;  ncsjr(3:4,4) = 105 
+            ncsi1(3)   = 174  ;  ncsj1(3)   = 107           ! 1 : west part of the Black Sea      
+            ncsi2(3)   = 181  ;  ncsj2(3)   = 112           !            (ie west of the cyclic b.c.)
+            ncsi1(4)   =   2  ;  ncsj1(4)   = 107           ! 2 : east part of the Black Sea 
+            ncsi2(4)   =   6  ;  ncsj2(4)   = 112           !           (ie east of the cyclic b.c.)
+             
+          
+
             !                                        ! =======================
          CASE ( 4 )                                  !  ORCA_R4 configuration
@@ -372,6 +375,5 @@
       REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array)
       !
-      INTEGER  ::   jc, jn      ! dummy loop indices
-      INTEGER  ::   ii, ij      ! temporary integer
+      INTEGER  ::   jc, jn, ji, jj      ! dummy loop indices
       !!----------------------------------------------------------------------
       !
@@ -379,7 +381,9 @@
          IF( ncstt(jc) >= 1 ) THEN            ! runoff mask set to 1 at closed sea outflows
              DO jn = 1, 4
-               ii = mi0( ncsir(jc,jn) )
-               ij = mj0( ncsjr(jc,jn) )
-               p_rnfmsk(ii,ij) = MAX( p_rnfmsk(ii,ij), 1.0_wp )
+                DO jj =    mj0( ncsjr(jc,jn) ), mj1( ncsjr(jc,jn) )
+                   DO ji = mi0( ncsir(jc,jn) ), mi1( ncsir(jc,jn) )
+                      p_rnfmsk(ji,jj) = MAX( p_rnfmsk(ji,jj), 1.0_wp )
+                   END DO
+                END DO
             END DO 
          ENDIF 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90	(revision 4276)
@@ -238,4 +238,9 @@
                nday_year = 1
                nsec_year = ndt05
+               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value
+                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   &
+                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', &
+                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' )
+               ENDIF
                nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1)
                IF( nleapy == 1 )   CALL day_mth
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 4276)
@@ -192,5 +192,5 @@
       INTEGER  ::   iku, ikv     ! local integers    
       INTEGER  ::   ii0, ii1, ij0, ij1   ! temporary integers
-      REAL(wp) ::   zvt          ! local scalars
+      REAL(wp) ::   zvt, zvtip1, zvtjp1  ! local scalars
       !!----------------------------------------------------------------------
       !
@@ -202,5 +202,5 @@
          WRITE(numout,*) '~~~~~~~~~ '
          pe3u_b(:,:,jpk) = fse3u_0(:,:,jpk)
-         pe3v_b(:,:,jpk) = fse3u_0(:,:,jpk)
+         pe3v_b(:,:,jpk) = fse3v_0(:,:,jpk)
       ENDIF
       
@@ -208,7 +208,9 @@
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1
-               zvt = fse3t_b(ji,jj,jk) * e1e2t(ji,jj)
-               pe3u_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji+1,jj,jk) * e1e2t(ji+1,jj) ) / ( e1u(ji,jj) * e2u(ji,jj) )
-               pe3v_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji,jj+1,jk) * e1e2t(ji,jj+1) ) / ( e1v(ji,jj) * e2v(ji,jj) )
+               zvt    = ( fse3t_b(ji  ,jj  ,jk) - fse3t_0(ji  ,jj  ,jk) ) * e1e2t(ji  ,jj  )
+               zvtip1 = ( fse3t_b(ji+1,jj  ,jk) - fse3t_0(ji+1,jj  ,jk) ) * e1e2t(ji+1,jj  )
+               zvtjp1 = ( fse3t_b(ji  ,jj+1,jk) - fse3t_0(ji  ,jj+1,jk) ) * e1e2t(ji  ,jj+1)
+               pe3u_b(ji,jj,jk) = fse3u_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtip1 ) / ( e1u(ji,jj) * e2u(ji,jj) )
+               pe3v_b(ji,jj,jk) = fse3v_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtjp1 ) / ( e1v(ji,jj) * e2v(ji,jj) )
             END DO
          END DO
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4276)
@@ -169,5 +169,5 @@
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE zgr_z  ***
-      !!                   
+      !!                    
       !! ** Purpose :   set the depth of model levels and the resulting 
       !!      vertical scale factors.
@@ -639,4 +639,5 @@
          END DO
       END DO
+      IF( lk_mpp )   CALL mpp_sum( icompt )
       IF( icompt == 0 ) THEN
          IF(lwp) WRITE(numout,*)'     no isolated ocean grid points'
@@ -1252,5 +1253,5 @@
          DO jj = 1, jpj
             DO ji = 1, jpi
-               ztaper = EXP( -(gphit(ji,jj)/8._wp)**2 )
+               ztaper = EXP( -(gphit(ji,jj)/8._wp)**2._wp )
                hbatt(ji,jj) = rn_sbot_max * ztaper + hbatt(ji,jj) * ( 1._wp - ztaper )
             END DO
@@ -1367,12 +1368,34 @@
       fsde3w(:,:,:) = gdep3w(:,:,:)
       !
-      where (e3t   (:,:,:).eq.0.0)  e3t(:,:,:) = 1.0
-      where (e3u   (:,:,:).eq.0.0)  e3u(:,:,:) = 1.0
-      where (e3v   (:,:,:).eq.0.0)  e3v(:,:,:) = 1.0
-      where (e3f   (:,:,:).eq.0.0)  e3f(:,:,:) = 1.0
-      where (e3w   (:,:,:).eq.0.0)  e3w(:,:,:) = 1.0
-      where (e3uw  (:,:,:).eq.0.0)  e3uw(:,:,:) = 1.0
-      where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1.0
-
+      where (e3t   (:,:,:).eq.0.0)  e3t(:,:,:) = 1._wp
+      where (e3u   (:,:,:).eq.0.0)  e3u(:,:,:) = 1._wp
+      where (e3v   (:,:,:).eq.0.0)  e3v(:,:,:) = 1._wp
+      where (e3f   (:,:,:).eq.0.0)  e3f(:,:,:) = 1._wp
+      where (e3w   (:,:,:).eq.0.0)  e3w(:,:,:) = 1._wp
+      where (e3uw  (:,:,:).eq.0.0)  e3uw(:,:,:) = 1._wp
+      where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1._wp
+
+#if defined key_agrif
+      ! Ensure meaningful vertical scale factors in ghost lines/columns
+      IF( .NOT. Agrif_Root() ) THEN
+         !  
+         IF((nbondi == -1).OR.(nbondi == 2)) THEN
+            e3u(1,:,:) = e3u(2,:,:)
+         ENDIF
+         !
+         IF((nbondi ==  1).OR.(nbondi == 2)) THEN
+            e3u(nlci-1,:,:) = e3u(nlci-2,:,:)
+         ENDIF
+         !
+         IF((nbondj == -1).OR.(nbondj == 2)) THEN
+            e3v(:,1,:) = e3v(:,2,:)
+         ENDIF
+         !
+         IF((nbondj ==  1).OR.(nbondj == 2)) THEN
+            e3v(:,nlcj-1,:) = e3v(:,nlcj-2,:)
+         ENDIF
+         !
+      ENDIF
+#endif
 
       fsdept(:,:,:) = gdept (:,:,:)
@@ -1423,8 +1446,11 @@
          WRITE(numout,"(10x,i4,4f9.2)") ( jk, fsdept(1,1,jk), fsdepw(1,1,jk),     &
             &                                 fse3t (1,1,jk), fse3w (1,1,jk), jk=1,jpk )
-         DO jj = mj0(20), mj1(20)
-            DO ji = mi0(20), mi1(20)
+         iip1 = MIN(20, jpiglo-1)  ! for config with i smaller than 20 points
+         ijp1 = MIN(20, jpjglo-1)  ! for config with j smaller than 20 points
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
@@ -1433,8 +1459,11 @@
             END DO
          END DO
-         DO jj = mj0(74), mj1(74)
-            DO ji = mi0(100), mi1(100)
+         iip1 = MIN(  74, jpiglo-1)
+         ijp1 = MIN( 100, jpjglo-1)
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
@@ -1723,9 +1752,4 @@
       ENDDO
       !
-      CALL lbc_lnk(e3t ,'T',1.) ; CALL lbc_lnk(e3u ,'T',1.)
-      CALL lbc_lnk(e3v ,'T',1.) ; CALL lbc_lnk(e3f ,'T',1.)
-      CALL lbc_lnk(e3w ,'T',1.)
-      CALL lbc_lnk(e3uw,'T',1.) ; CALL lbc_lnk(e3vw,'T',1.)
-      !
       !                                               ! =============
 
@@ -1824,5 +1848,5 @@
       !!----------------------------------------------------------------------
       !
-      pf =   (   TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1) + rn_thetb )  )   &
+      pf =   (   TANH( rn_theta * ( -(pk-0.5_wp) / REAL(jpkm1,wp) + rn_thetb )  )   &
          &     - TANH( rn_thetb * rn_theta                                )  )   &
          & * (   COSH( rn_theta                           )                      &
@@ -1850,8 +1874,8 @@
       !
       IF ( rn_theta == 0 ) then      ! uniform sigma
-         pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1 )
+         pf1 = - ( pk1 - 0.5_wp ) / REAL( jpkm1,wp )
       ELSE                        ! stretched sigma
-         pf1 =   ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1)) ) ) / SINH( rn_theta )              &
-            &  + pbb * (  (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta )  )  &
+         pf1 =   ( 1._wp - pbb ) * ( SINH( rn_theta*(-(pk1-0.5_wp)/REAL(jpkm1,wp)) ) ) / SINH( rn_theta )              &
+            &  + pbb * (  (TANH( rn_theta*( (-(pk1-0.5_wp)/REAL(jpkm1,wp)) + 0.5_wp) ) - TANH( 0.5_wp * rn_theta )  )  &
             &        / ( 2._wp * TANH( 0.5_wp * rn_theta ) )  )
       ENDIF
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 4276)
@@ -29,5 +29,5 @@
 
    REAL(wp), PARAMETER :: gamma1 = 1._wp/3._wp  ! =1/4 quick      ; =1/3  3rd order UBS
-   REAL(wp), PARAMETER :: gamma2 = 1._wp/8._wp  ! =0   2nd order  ; =1/8  4th order centred
+   REAL(wp), PARAMETER :: gamma2 = 1._wp/32._wp ! =0   2nd order  ; =1/32 4th order centred
 
    PUBLIC   dyn_adv_ubs   ! routine called by step.F90
@@ -57,5 +57,5 @@
       !!                       = 1/3  3rd order Upstream biased scheme
       !!                gamma2 = 0    2nd order finite differencing 
-      !!                       = 1/8  4th order finite differencing
+      !!                       = 1/32 4th order finite differencing
       !!      For stability reasons, the first term of the fluxes which cor-
       !!      responds to a second order centered scheme is evaluated using  
@@ -64,5 +64,5 @@
       !!      before velocity (forward in time). 
       !!      Default value (hard coded in the begining of the module) are 
-      !!      gamma1=1/3 and gamma2=1/8.
+      !!      gamma1=1/3 and gamma2=1/32.
       !!
       !! ** Action : - (ua,va) updated with the 3D advective momentum trends
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 4276)
@@ -109,10 +109,8 @@
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   z2dt, z2dtg, zgcb, zbtd, ztdgu, ztdgv   ! local scalars
-      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zub, zvb
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('dyn_spg_flt')
       !
-      CALL wrk_alloc( jpi,jpj,jpk, zub, zvb )
       !
       IF( kt == nit000 ) THEN
@@ -213,6 +211,6 @@
          DO jk = 1, jpkm1
             DO ji = 1, jpij
-               spgu(ji,1) = spgu(ji,1) + fse3u(ji,1,jk) * ua(ji,1,jk)
-               spgv(ji,1) = spgv(ji,1) + fse3v(ji,1,jk) * va(ji,1,jk)
+               spgu(ji,1) = spgu(ji,1) + fse3u_a(ji,1,jk) * ua(ji,1,jk)
+               spgv(ji,1) = spgv(ji,1) + fse3v_a(ji,1,jk) * va(ji,1,jk)
             END DO
          END DO
@@ -221,6 +219,6 @@
             DO jj = 2, jpjm1
                DO ji = 2, jpim1
-                  spgu(ji,jj) = spgu(ji,jj) + fse3u(ji,jj,jk) * ua(ji,jj,jk)
-                  spgv(ji,jj) = spgv(ji,jj) + fse3v(ji,jj,jk) * va(ji,jj,jk)
+                  spgu(ji,jj) = spgu(ji,jj) + fse3u_a(ji,jj,jk) * ua(ji,jj,jk)
+                  spgv(ji,jj) = spgv(ji,jj) + fse3v_a(ji,jj,jk) * va(ji,jj,jk)
                END DO
             END DO
@@ -360,5 +358,4 @@
       IF( lrst_oce ) CALL flt_rst( kt, 'WRITE' )
       !
-      CALL wrk_dealloc( jpi,jpj,jpk, zub, zvb )
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_flt')
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 4276)
@@ -37,5 +37,4 @@
    USE par_oce   ! ocean parameters
    USE lib_mpp   ! MPP library
-   USE fldread   ! read input fields (FLD type)
 
    IMPLICIT NONE
@@ -151,6 +150,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   :: griddata                           !: work array for icbrst
 
-   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read
-
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2011)
@@ -168,6 +165,5 @@
       !
       icb_alloc = 0
-      ALLOCATE( & !cbr berg_grid                      ,                                               &
-         &      berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   &
+      ALLOCATE( berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   &
          &      berg_grid%stored_heat(jpi,jpj) , berg_grid%floating_melt(jpi,jpj)          ,   &
          &      berg_grid%maxclass   (jpi,jpj) , berg_grid%stored_ice   (jpi,jpj,nclasses) ,   &
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 4276)
@@ -35,6 +35,8 @@
    PUBLIC   icb_init  ! routine called in nemogcm.F90 module
 
-   CHARACTER(len=100) ::   cn_dir = './'   ! Root directory for location of icb files
-   TYPE(FLD_N)        ::   sn_icb          ! information about the calving file to be read
+   CHARACTER(len=100)                                 ::   cn_dir = './'   !: Root directory for location of icb files
+   TYPE(FLD_N)                                        ::   sn_icb          !: information about the calving file to be read
+   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)  ::   sf_icb          !: structure: file information, fields read
+                                                                           !: used in icbini and icbstp
 
    !!----------------------------------------------------------------------
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 4276)
@@ -24,4 +24,5 @@
    USE lib_mpp
    USE iom
+   USE fldread
    USE timing         ! timing
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4276)
@@ -31,4 +31,5 @@
    USE sbc_oce, ONLY :   nn_fsbc         ! ocean space and time domain
    USE trc_oce, ONLY :   nn_dttrc        !  !: frequency of step on passive tracers
+   USE icb_oce, ONLY :   class_num       !  !: iceberg classes
    USE domngb          ! ocean space and time domain
    USE phycst          ! physical constants
@@ -36,4 +37,5 @@
    USE xios
 # endif
+   USE ioipsl, ONLY :  ju2ymds    ! for calendar
 
    IMPLICIT NONE
@@ -52,6 +54,6 @@
    PRIVATE iom_p1d, iom_p2d, iom_p3d
 #if defined key_iomput
-   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_set_grid_attr
-   PRIVATE set_grid, set_scalar, set_xmlatt, set_mooring
+   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr
+   PRIVATE set_grid, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate
 # endif
 
@@ -98,5 +100,9 @@
       clname = "nemo"
       IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname)
+# if defined key_mpp_mpi
       CALL xios_context_initialize(TRIM(clname), mpi_comm_opa)
+# else
+      CALL xios_context_initialize(TRIM(clname), 0)
+# endif
       CALL iom_swap
 
@@ -123,6 +129,7 @@
       CALL iom_set_axis_attr( "depthw", gdepw_0 )
 # if defined key_floats
-      CALL iom_set_axis_attr( "nfloat", (ji, ji=1,nfloat) )
+      CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) )
 # endif
+      CALL iom_set_axis_attr( "icbcla", class_num )
       
       ! automatic definitions of some of the xml attributs
@@ -130,11 +137,11 @@
 
       ! end file definition
-       dtime%second=rdt
-       CALL xios_set_timestep(dtime)
-       CALL xios_close_context_definition()
-
-       CALL xios_update_calendar(0)
+      dtime%second = rdt
+      CALL xios_set_timestep(dtime)
+      CALL xios_close_context_definition()
+      
+      CALL xios_update_calendar(0)
 #endif
-
+      
    END SUBROUTINE iom_init
 
@@ -174,9 +181,9 @@
       LOGICAL         , INTENT(in   ), OPTIONAL ::   ldiof    ! Interp On the Fly, needed for AGRIF (default = .FALSE.)
 
-      CHARACTER(LEN=100)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu]
-      CHARACTER(LEN=100)    ::   cltmpn    ! tempory name to store clname (in writting mode)
+      CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu]
+      CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode)
       CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" or ".dimg"
       CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits)
-      CHARACTER(LEN=100)    ::   clinfo    ! info character
+      CHARACTER(LEN=256)    ::   clinfo    ! info character
       LOGICAL               ::   llok      ! check the existence 
       LOGICAL               ::   llwrt     ! local definition of ldwrt
@@ -561,6 +568,6 @@
       REAL(wp)                       ::   zscf, zofs  ! sacle_factor and add_offset
       INTEGER                        ::   itmp        ! temporary integer
-      CHARACTER(LEN=100)             ::   clinfo      ! info character
-      CHARACTER(LEN=100)             ::   clname      ! file name
+      CHARACTER(LEN=256)             ::   clinfo      ! info character
+      CHARACTER(LEN=256)             ::   clname      ! file name
       CHARACTER(LEN=1)               ::   clrankpv, cldmspc      ! 
       !---------------------------------------------------------------------
@@ -1010,10 +1017,9 @@
    !!----------------------------------------------------------------------
 
-
 #if defined key_iomput
 
-   SUBROUTINE iom_set_domain_attr( cdname, ni_glo, nj_glo, ibegin, jbegin, ni, nj, zoom_ibegin, zoom_jbegin, zoom_ni, zoom_nj,   &
+   SUBROUTINE iom_set_domain_attr( cdid, ni_glo, nj_glo, ibegin, jbegin, ni, nj, zoom_ibegin, zoom_jbegin, zoom_ni, zoom_nj,   &
       &                                    data_dim, data_ibegin, data_ni, data_jbegin, data_nj, lonvalue, latvalue, mask )
-      CHARACTER(LEN=*)                 , INTENT(in) ::   cdname
+      CHARACTER(LEN=*)                 , INTENT(in) ::   cdid
       INTEGER                , OPTIONAL, INTENT(in) ::   ni_glo, nj_glo, ibegin, jbegin, ni, nj
       INTEGER                , OPTIONAL, INTENT(in) ::   data_dim, data_ibegin, data_ni, data_jbegin, data_nj
@@ -1022,50 +1028,81 @@
       LOGICAL, DIMENSION(:,:), OPTIONAL, INTENT(in) ::   mask
 
-      IF ( xios_is_valid_domain     (cdname) ) THEN
-         CALL xios_set_domain_attr     ( cdname, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
-            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj   ,   &
-            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                         &
+      IF ( xios_is_valid_domain     (cdid) ) THEN
+         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
+            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   &
+            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       &
             &    lonvalue=lonvalue, latvalue=latvalue,mask=mask )
       ENDIF
 
-      IF ( xios_is_valid_domaingroup(cdname) ) THEN
-         CALL xios_set_domaingroup_attr( cdname, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
-            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj   ,   &
-            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                         &
+      IF ( xios_is_valid_domaingroup(cdid) ) THEN
+         CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   &
+            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   &
+            &    zoom_ibegin=zoom_ibegin, zoom_jbegin=zoom_jbegin, zoom_ni=zoom_ni, zoom_nj=zoom_nj,                       &
             &    lonvalue=lonvalue, latvalue=latvalue,mask=mask )
       ENDIF
+      CALL xios_solve_inheritance()
 
    END SUBROUTINE iom_set_domain_attr
 
 
-   SUBROUTINE iom_set_axis_attr( cdname, paxis )
-      CHARACTER(LEN=*)      , INTENT(in) ::   cdname
+   SUBROUTINE iom_set_axis_attr( cdid, paxis )
+      CHARACTER(LEN=*)      , INTENT(in) ::   cdid
       REAL(wp), DIMENSION(:), INTENT(in) ::   paxis
-      IF ( xios_is_valid_axis     (cdname) )   CALL xios_set_axis_attr     ( cdname, size=size(paxis),value=paxis )
-      IF ( xios_is_valid_axisgroup(cdname) )   CALL xios_set_axisgroup_attr( cdname, size=size(paxis),value=paxis )
+      IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=size(paxis),value=paxis )
+      IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=size(paxis),value=paxis )
+      CALL xios_solve_inheritance()
    END SUBROUTINE iom_set_axis_attr
 
 
-   SUBROUTINE iom_set_field_attr( cdname, freq_op)
-      CHARACTER(LEN=*)          , INTENT(in) ::   cdname
+   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset )
+      CHARACTER(LEN=*)          , INTENT(in) ::   cdid
       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op
-      IF ( xios_is_valid_field     (cdname) )   CALL xios_set_field_attr     ( cdname, freq_op=freq_op )
-      IF ( xios_is_valid_fieldgroup(cdname) )   CALL xios_set_fieldgroup_attr( cdname, freq_op=freq_op )
+      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset
+      IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr     ( cdid, freq_op=freq_op, freq_offset=freq_offset )
+      IF ( xios_is_valid_fieldgroup(cdid) )   CALL xios_set_fieldgroup_attr( cdid, freq_op=freq_op, freq_offset=freq_offset )
+      CALL xios_solve_inheritance()
    END SUBROUTINE iom_set_field_attr
 
 
-   SUBROUTINE iom_set_file_attr( cdname, name, name_suffix )
-      CHARACTER(LEN=*)          , INTENT(in) ::   cdname
+   SUBROUTINE iom_set_file_attr( cdid, name, name_suffix )
+      CHARACTER(LEN=*)          , INTENT(in) ::   cdid
       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   name, name_suffix
-      IF ( xios_is_valid_file     (cdname) )   CALL xios_set_file_attr     ( cdname, name=name, name_suffix=name_suffix )
-      IF ( xios_is_valid_filegroup(cdname) )   CALL xios_set_filegroup_attr( cdname, name=name, name_suffix=name_suffix )
+      IF ( xios_is_valid_file     (cdid) )   CALL xios_set_file_attr     ( cdid, name=name, name_suffix=name_suffix )
+      IF ( xios_is_valid_filegroup(cdid) )   CALL xios_set_filegroup_attr( cdid, name=name, name_suffix=name_suffix )
+      CALL xios_solve_inheritance()
    END SUBROUTINE iom_set_file_attr
 
 
-   SUBROUTINE iom_set_grid_attr( cdname, mask )
-      CHARACTER(LEN=*)                   , INTENT(in) ::   cdname
+   SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq )
+      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid
+      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix, output_freq
+      LOGICAL                                 ::   llexist1,llexist2,llexist3
+      !---------------------------------------------------------------------
+      IF( PRESENT( name        ) )   name = ''          ! default values
+      IF( PRESENT( name_suffix ) )   name_suffix = ''
+      IF( PRESENT( output_freq ) )   output_freq = ''
+      IF ( xios_is_valid_file     (cdid) ) THEN
+         CALL xios_solve_inheritance()
+         CALL xios_is_defined_file_attr     ( cdid, name = llexist1, name_suffix = llexist2, output_freq = llexist3)
+         IF(llexist1)   CALL xios_get_file_attr     ( cdid, name = name )
+         IF(llexist2)   CALL xios_get_file_attr     ( cdid, name_suffix = name_suffix )
+         IF(llexist3)   CALL xios_get_file_attr     ( cdid, output_freq = output_freq )
+      ENDIF
+      IF ( xios_is_valid_filegroup(cdid) ) THEN
+         CALL xios_solve_inheritance()
+         CALL xios_is_defined_filegroup_attr( cdid, name = llexist1, name_suffix = llexist2, output_freq = llexist3)
+         IF(llexist1)   CALL xios_get_filegroup_attr( cdid, name = name )
+         IF(llexist2)   CALL xios_get_filegroup_attr( cdid, name_suffix = name_suffix )
+         IF(llexist3)   CALL xios_get_filegroup_attr( cdid, output_freq = output_freq )
+      ENDIF
+   END SUBROUTINE iom_get_file_attr
+
+
+   SUBROUTINE iom_set_grid_attr( cdid, mask )
+      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid
       LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask
-      IF ( xios_is_valid_grid     (cdname) )   CALL xios_set_grid_attr     ( cdname, mask=mask )
-      IF ( xios_is_valid_gridgroup(cdname) )   CALL xios_set_gridgroup_attr( cdname, mask=mask )
+      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask )
+      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask )
+      CALL xios_solve_inheritance()
    END SUBROUTINE iom_set_grid_attr
 
@@ -1073,5 +1110,5 @@
    SUBROUTINE set_grid( cdgrd, plon, plat )
       !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE   ***
+      !!                     ***  ROUTINE set_grid  ***
       !!
       !! ** Purpose :   define horizontal grids
@@ -1101,6 +1138,6 @@
          END SELECT
          !
-         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = zmask(:,:,1) /= 0. )
-         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = zmask(:,:,:) /= 0. )
+         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni,nj    /)) /= 0. )
+         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. )
       ENDIF
       
@@ -1110,5 +1147,5 @@
    SUBROUTINE set_scalar
       !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE   ***
+      !!                     ***  ROUTINE set_scalar  ***
       !!
       !! ** Purpose :   define fake grids for scalar point
@@ -1126,19 +1163,14 @@
    SUBROUTINE set_xmlatt
       !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE   ***
+      !!                     ***  ROUTINE set_xmlatt  ***
       !!
       !! ** Purpose :   automatic definitions of some of the xml attributs...
       !!
       !!----------------------------------------------------------------------
-      CHARACTER(len=6),DIMENSION( 8) ::   clsuff                   ! suffix name
       CHARACTER(len=1),DIMENSION( 3) ::   clgrd                    ! suffix name
-      CHARACTER(len=50)              ::   clname                   ! file name
+      CHARACTER(len=256)             ::   clsuff                   ! suffix name
       CHARACTER(len=1)               ::   cl1                      ! 1 character
       CHARACTER(len=2)               ::   cl2                      ! 1 character
-      CHARACTER(len=255)             ::   tfo
-      INTEGER                        ::   idt                      ! time-step in seconds
-      INTEGER                        ::   iddss, ihhss             ! number of seconds in 1 day, 1 hour and 1 year
-      INTEGER                        ::   iyymo                    ! number of months in 1 year
-      INTEGER                        ::   jg, jh, jd, jm, jy       ! loop counters
+      INTEGER                        ::   ji, jg                   ! loop counters
       INTEGER                        ::   ix, iy                   ! i-,j- index
       REAL(wp)        ,DIMENSION(11) ::   zlontao                  ! longitudes of tao    moorings
@@ -1150,39 +1182,18 @@
       !!----------------------------------------------------------------------
       ! 
-      idt   = NINT( rdttra(1)     )
-      iddss = NINT( rday          )                                         ! number of seconds in 1 day
-      ihhss = NINT( rmmss * rhhmm )                                         ! number of seconds in 1 hour
-      iyymo = NINT( raamo         )                                         ! number of months in 1 year
-
       ! frequency of the call of iom_put (attribut: freq_op)
-      tfo = TRIM(i2str(idt))//'s'
-      CALL iom_set_field_attr('field_definition', freq_op=tfo)
-      CALL iom_set_field_attr('SBC'   , freq_op=TRIM(i2str(idt* nn_fsbc ))//'s')
-      CALL iom_set_field_attr('ptrc_T', freq_op=TRIM(i2str(idt* nn_dttrc))//'s')
-      CALL iom_set_field_attr('diad_T', freq_op=TRIM(i2str(idt* nn_dttrc))//'s')
+      WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts')
+      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts')
+      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op = cl1//'ts', freq_offset='0ts')
+      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op = cl1//'ts', freq_offset='0ts')
        
       ! output file names (attribut: name)
-      clsuff(:) = (/ 'grid_T', 'grid_U', 'grid_V', 'grid_W', 'icemod', 'ptrc_T', 'diad_T', 'scalar' /)      
-      DO jg = 1, SIZE(clsuff)                                                                  ! grid type
-         DO jh = 1, 24                                                                         ! 1-24 hours
-            WRITE(cl2,'(i2)') jh 
-            CALL dia_nam( clname, jh * ihhss, clsuff(jg), ldfsec = .TRUE. )
-            CALL iom_set_file_attr(TRIM(ADJUSTL(cl2))//'h_'//clsuff(jg), name=TRIM(clname))
-         END DO
-         DO jd = 1, 30                                                                         ! 1-30 days
-            WRITE(cl1,'(i1)') jd 
-            CALL dia_nam( clname, jd * iddss, clsuff(jg), ldfsec = .TRUE. )
-            CALL iom_set_file_attr(cl1//'d_'//clsuff(jg), name=TRIM(clname))
-         END DO
-         DO jm = 1, 11                                                                         ! 1-11 months
-            WRITE(cl1,'(i1)') jm 
-            CALL dia_nam( clname, -jm, clsuff(jg) )
-            CALL iom_set_file_attr(cl1//'m_'//clsuff(jg), name=TRIM(clname))
-         END DO
-         DO jy = 1, 50                                                                         ! 1-50 years  
-            WRITE(cl2,'(i2)') jy 
-            CALL dia_nam( clname, -jy * iyymo, clsuff(jg) )
-            CALL iom_set_file_attr(TRIM(ADJUSTL(cl2))//'y_'//clsuff(jg), name=TRIM(clname))
-         END DO
+      DO ji = 1, 9
+         WRITE(cl1,'(i1)') ji 
+         CALL iom_update_file_name('file'//cl1)
+      END DO
+      DO ji = 1, 99
+         WRITE(cl2,'(i2.2)') ji 
+         CALL iom_update_file_name('file'//cl2)
       END DO
 
@@ -1193,6 +1204,8 @@
          ! Equatorial section (attributs: jbegin, ni, name_suffix)
          CALL dom_ngb( 0., 0., ix, iy, cl1 )
-         CALL iom_set_domain_attr('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo)
-         CALL iom_set_file_attr('Eq'//cl1, name_suffix= '_Eq')
+         CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo)
+         CALL iom_get_file_attr   ('Eq'//cl1, name_suffix = clsuff             )
+         CALL iom_set_file_attr   ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq')
+         CALL iom_update_file_name('Eq'//cl1)
       END DO
       ! TAO moorings (attributs: ibegin, jbegin, name_suffix)
@@ -1214,5 +1227,5 @@
    SUBROUTINE set_mooring( plon, plat)
       !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE   ***
+      !!                     ***  ROUTINE set_mooring  ***
       !!
       !! ** Purpose :   automatic definitions of moorings xml attributs...
@@ -1223,5 +1236,6 @@
 !!$      CHARACTER(len=1),DIMENSION(4) ::   clgrd = (/ 'T', 'U', 'V', 'W' /)   ! suffix name
       CHARACTER(len=1),DIMENSION(1) ::   clgrd = (/ 'T' /)        ! suffix name
-      CHARACTER(len=50)             ::   clname                   ! file name
+      CHARACTER(len=256)            ::   clname                   ! file name
+      CHARACTER(len=256)            ::   clsuff                   ! suffix name
       CHARACTER(len=1)              ::   cl1                      ! 1 character
       CHARACTER(len=6)              ::   clon,clat                ! name of longitude, latitude
@@ -1269,6 +1283,8 @@
                ENDIF
                clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon))
-               CALL iom_set_domain_attr(TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy)
-               CALL iom_set_file_attr(TRIM(clname)//cl1, name_suffix= '_'//TRIM(clname))
+               CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy)
+               CALL iom_get_file_attr   (TRIM(clname)//cl1, name_suffix = clsuff                         )
+               CALL iom_set_file_attr   (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname))
+               CALL iom_update_file_name(TRIM(clname)//cl1)
             END DO
          END DO
@@ -1277,4 +1293,139 @@
    END SUBROUTINE set_mooring
 
+   
+   SUBROUTINE iom_update_file_name( cdid )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE iom_update_file_name  ***
+      !!
+      !! ** Purpose :   
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(LEN=*)          , INTENT(in) ::   cdid
+      !
+      CHARACTER(LEN=256) ::   clname
+      CHARACTER(LEN=20)  ::   clfreq
+      CHARACTER(LEN=20)  ::   cldate
+      INTEGER            ::   idx
+      INTEGER            ::   jn
+      INTEGER            ::   itrlen
+      INTEGER            ::   iyear, imonth, iday, isec
+      REAL(wp)           ::   zsec
+      LOGICAL            ::   llexist
+      !!----------------------------------------------------------------------
+
+      DO jn = 1,2
+
+         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq )
+         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname )
+
+         IF ( TRIM(clname) /= '' ) THEN 
+
+            idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
+            DO WHILE ( idx /= 0 ) 
+               clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname))
+               idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@')
+            END DO
+
+            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@')
+            DO WHILE ( idx /= 0 ) 
+               IF ( TRIM(clfreq) /= '' ) THEN
+                  itrlen = LEN_TRIM(clfreq)
+                  IF ( clfreq(itrlen-1:itrlen) == 'mo' ) clfreq = clfreq(1:itrlen-1)
+                  clname = clname(1:idx-1)//TRIM(clfreq)//clname(idx+6:LEN_TRIM(clname))
+               ELSE
+                  CALL ctl_stop('error in the name of file id '//TRIM(cdid),   &
+                     & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) )
+               ENDIF
+               idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@')
+            END DO
+
+            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@')
+            DO WHILE ( idx /= 0 ) 
+               cldate = iom_sdate( fjulday - rdttra(1) / rday )
+               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname))
+               idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@')
+            END DO
+
+            idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@')
+            DO WHILE ( idx /= 0 ) 
+               cldate = iom_sdate( fjulday - rdttra(1) / rday, ldfull = .TRUE. )
+               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname))
+               idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@')
+            END DO
+
+            idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@')
+            DO WHILE ( idx /= 0 ) 
+               cldate = iom_sdate( fjulday + rdttra(1) / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. )
+               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname))
+               idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@')
+            END DO
+
+            idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@')
+            DO WHILE ( idx /= 0 ) 
+               cldate = iom_sdate( fjulday + rdttra(1) / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. )
+               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname))
+               idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@')
+            END DO
+
+            IF( jn == 1 )   CALL iom_set_file_attr( cdid, name        = clname )
+            IF( jn == 2 )   CALL iom_set_file_attr( cdid, name_suffix = clname )
+
+         ENDIF
+
+      END DO
+
+   END SUBROUTINE iom_update_file_name
+
+
+   FUNCTION iom_sdate( pjday, ld24, ldfull )
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE iom_sdate  ***
+      !!
+      !! ** Purpose :   send back the date corresponding to the given julian day
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(in   )           ::   pjday         ! julian day
+      LOGICAL , INTENT(in   ), OPTIONAL ::   ld24          ! true to force 24:00 instead of 00:00
+      LOGICAL , INTENT(in   ), OPTIONAL ::   ldfull        ! true to get the compleate date: yyyymmdd_hh:mm:ss
+      !
+      CHARACTER(LEN=20) ::   iom_sdate
+      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
+      INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec
+      REAL(wp)          ::   zsec
+      LOGICAL           ::   ll24, llfull
+      !
+      IF( PRESENT(ld24) ) THEN   ;   ll24 = ld24
+      ELSE                       ;   ll24 = .FALSE.
+      ENDIF
+
+      IF( PRESENT(ldfull) ) THEN   ;   llfull = ldfull
+      ELSE                         ;   llfull = .FALSE.
+      ENDIF
+
+      CALL ju2ymds( pjday, iyear, imonth, iday, zsec )
+      isec = NINT(zsec)
+
+      IF ( ll24 .AND. isec == 0 ) THEN   ! 00:00 of the next day -> move to 24:00 of the current day
+         CALL ju2ymds( pjday - 1., iyear, imonth, iday, zsec )
+         isec = 86400
+      ENDIF
+
+      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date 
+      ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1
+      ENDIF
+      
+      IF( llfull ) THEN 
+         clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2"
+         ihour   = isec / 3600
+         isec    = MOD(isec, 3600)
+         iminute = isec / 60
+         isec    = MOD(isec, 60)
+         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday, ihour, iminute, isec    ! date of the end of run
+      ELSE
+         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run
+      ENDIF
+
+   END FUNCTION iom_sdate
+
 #else
 
@@ -1285,13 +1436,4 @@
 
 #endif
-
-   FUNCTION i2str(int)
-   IMPLICIT NONE
-      INTEGER, INTENT(IN) :: int
-      CHARACTER(LEN=255) :: i2str
-
-      WRITE(i2str,*) int
-      
-   END FUNCTION i2str  
    
    !!======================================================================
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lbclnk.F90	(revision 4276)
@@ -283,38 +283,4 @@
    END SUBROUTINE lbc_lnk_3d
 
-   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE lbc_bdy_lnk  ***
-      !!
-      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
-      !!                to maintain the same interface with regards to the mpp case
-      !!
-      !!----------------------------------------------------------------------
-      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
-      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
-      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
-      !!
-      CALL lbc_lnk_3d( pt3d, cd_type, psgn)
-
-   END SUBROUTINE lbc_bdy_lnk_3d
-
-   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy )
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE lbc_bdy_lnk  ***
-      !!
-      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
-      !!                to maintain the same interface with regards to the mpp case
-      !!
-      !!----------------------------------------------------------------------
-      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
-      REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied
-      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
-      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
-      !!
-      CALL lbc_lnk_2d( pt2d, cd_type, psgn)
-
-   END SUBROUTINE lbc_bdy_lnk_2d
-
    SUBROUTINE lbc_lnk_2d( pt2d, cd_type, psgn, cd_mpp, pval )
       !!---------------------------------------------------------------------
@@ -406,4 +372,44 @@
    END SUBROUTINE lbc_lnk_2d
 
+#endif
+
+
+   SUBROUTINE lbc_bdy_lnk_3d( pt3d, cd_type, psgn, ib_bdy )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE lbc_bdy_lnk  ***
+      !!
+      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
+      !!                to maintain the same interface with regards to the mpp
+      !case
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)           ::   pt3d      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
+      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
+      !!
+      CALL lbc_lnk_3d( pt3d, cd_type, psgn)
+
+   END SUBROUTINE lbc_bdy_lnk_3d
+
+   SUBROUTINE lbc_bdy_lnk_2d( pt2d, cd_type, psgn, ib_bdy )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE lbc_bdy_lnk  ***
+      !!
+      !! ** Purpose :   wrapper rountine to 'lbc_lnk_3d'. This wrapper is used
+      !!                to maintain the same interface with regards to the mpp
+      !case
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type   ! nature of pt3d grid-points
+      REAL(wp), DIMENSION(jpi,jpj),     INTENT(inout)           ::   pt2d      ! 3D array on which the lbc is applied
+      REAL(wp)                        , INTENT(in   )           ::   psgn      ! control of the sign 
+      INTEGER                                                   ::   ib_bdy    ! BDY boundary set
+      !!
+      CALL lbc_lnk_2d( pt2d, cd_type, psgn)
+
+   END SUBROUTINE lbc_bdy_lnk_2d
+
+
    SUBROUTINE lbc_lnk_2d_e( pt2d, cd_type, psgn, jpri, jprj )
       !!---------------------------------------------------------------------
@@ -430,5 +436,4 @@
    END SUBROUTINE lbc_lnk_2d_e
 
-# endif
 #endif
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4276)
@@ -162,16 +162,16 @@
 
    ! Arrays used in mpp_lbc_north_3d()
-   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   ztab, znorthloc
-   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   znorthgloio
-   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   zfoldwk      ! Workspace for message transfers avoiding mpi_allgather
+   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   tab_3d, xnorthloc
+   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, SAVE   ::   xnorthgloio
+   REAL(wp), DIMENSION(:,:,:)  , ALLOCATABLE, SAVE   ::   foldwk      ! Workspace for message transfers avoiding mpi_allgather
 
    ! Arrays used in mpp_lbc_north_2d()
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_2d, znorthloc_2d
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_2d
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   zfoldwk_2d    ! Workspace for message transfers avoiding mpi_allgather
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_2d, xnorthloc_2d
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_2d
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   foldwk_2d    ! Workspace for message transfers avoiding mpi_allgather
 
    ! Arrays used in mpp_lbc_north_e()
-   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   ztab_e, znorthloc_e
-   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   znorthgloio_e
+   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE, SAVE    ::   tab_e, xnorthloc_e
+   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE    ::   xnorthgloio_e
 
    ! North fold arrays used to minimise the use of allgather operations. Set in nemo_northcomms (nemogcm) so need to be public
@@ -207,11 +207,11 @@
          &      t2p1(jpi,jprecj    ,2)   , t2p2(jpi,jprecj    ,2)   ,                                            &
          !
-         &      ztab(jpiglo,4,jpk) , znorthloc(jpi,4,jpk) , znorthgloio(jpi,4,jpk,jpni) ,                        &
-         &      zfoldwk(jpi,4,jpk) ,                                                                             &
-         !
-         &      ztab_2d(jpiglo,4)  , znorthloc_2d(jpi,4)  , znorthgloio_2d(jpi,4,jpni)  ,                        &
-         &      zfoldwk_2d(jpi,4)  ,                                                                             &
-         !
-         &      ztab_e(jpiglo,4+2*jpr2dj) , znorthloc_e(jpi,4+2*jpr2dj) , znorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   &
+         &      tab_3d(jpiglo,4,jpk) , xnorthloc(jpi,4,jpk) , xnorthgloio(jpi,4,jpk,jpni) ,                        &
+         &      foldwk(jpi,4,jpk) ,                                                                             &
+         !
+         &      tab_2d(jpiglo,4)  , xnorthloc_2d(jpi,4)  , xnorthgloio_2d(jpi,4,jpni)  ,                        &
+         &      foldwk_2d(jpi,4)  ,                                                                             &
+         !
+         &      tab_e(jpiglo,4+2*jpr2dj) , xnorthloc_e(jpi,4+2*jpr2dj) , xnorthgloio_e(jpi,4+2*jpr2dj,jpni) ,   &
          !
          &      STAT=lib_mpp_alloc )
@@ -2179,9 +2179,9 @@
 !!gm Remark : this is very time consumming!!!
       !                                         ! ------------------------ !
-            IF( ijpt0 > ijpt1 .OR. iipt0 > iipt1 ) THEN
+        IF(((nbondi .ne. 0) .AND. (ktype .eq. 2)) .OR. ((nbondj .ne. 0) .AND. (ktype .eq. 1))) THEN
             ! there is nothing to be migrated
-               lmigr = .FALSE.
+              lmigr = .TRUE.
             ELSE
-              lmigr = .TRUE.
+              lmigr = .FALSE.
             ENDIF
 
@@ -2598,12 +2598,12 @@
       ityp = -1
       ijpjm1 = 3
-      ztab(:,:,:) = 0.e0
-      !
-      DO jj = nlcj - ijpj +1, nlcj          ! put in znorthloc the last 4 jlines of pt3d
+      tab_3d(:,:,:) = 0.e0
+      !
+      DO jj = nlcj - ijpj +1, nlcj          ! put in xnorthloc the last 4 jlines of pt3d
          ij = jj - nlcj + ijpj
-         znorthloc(:,ij,:) = pt3d(:,jj,:)
+         xnorthloc(:,ij,:) = pt3d(:,jj,:)
       END DO
       !
-      !                                     ! Build in procs of ncomm_north the znorthgloio
+      !                                     ! Build in procs of ncomm_north the xnorthgloio
       itaille = jpi * jpk * ijpj
       IF ( l_north_nogather ) THEN
@@ -2615,5 +2615,5 @@
             ij = jj - nlcj + ijpj
             DO ji = 1, nlci
-               ztab(ji+nimpp-1,ij,:) = pt3d(ji,jj,:)
+               tab_3d(ji+nimpp-1,ij,:) = pt3d(ji,jj,:)
             END DO
          END DO
@@ -2640,8 +2640,8 @@
 
             DO jr = 1,nsndto(ityp)
-               CALL mppsend(5, znorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) )
+               CALL mppsend(5, xnorthloc, itaille, isendto(jr,ityp), ml_req_nf(jr) )
             END DO
             DO jr = 1,nsndto(ityp)
-               CALL mpprecv(5, zfoldwk, itaille, isendto(jr,ityp))
+               CALL mpprecv(5, foldwk, itaille, isendto(jr,ityp))
                iproc = isendto(jr,ityp) + 1
                ildi = nldit (iproc)
@@ -2650,5 +2650,5 @@
                DO jj = 1, ijpj
                   DO ji = ildi, ilei
-                     ztab(ji+iilb-1,jj,:) = zfoldwk(ji,jj,:)
+                     tab_3d(ji+iilb-1,jj,:) = foldwk(ji,jj,:)
                   END DO
                END DO
@@ -2665,6 +2665,6 @@
 
       IF ( ityp .lt. 0 ) THEN
-         CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,                &
-            &                znorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
+         CALL MPI_ALLGATHER( xnorthloc  , itaille, MPI_DOUBLE_PRECISION,                &
+            &                xnorthgloio, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
          !
          DO jr = 1, ndim_rank_north         ! recover the global north array
@@ -2675,5 +2675,5 @@
             DO jj = 1, ijpj
                DO ji = ildi, ilei
-                  ztab(ji+iilb-1,jj,:) = znorthgloio(ji,jj,:,jr)
+                  tab_3d(ji+iilb-1,jj,:) = xnorthgloio(ji,jj,:,jr)
                END DO
             END DO
@@ -2681,5 +2681,5 @@
       ENDIF
       !
-      ! The ztab array has been either:
+      ! The tab_3d array has been either:
       !  a. Fully populated by the mpi_allgather operation or
       !  b. Had the active points for this domain and northern neighbours populated
@@ -2688,10 +2688,10 @@
       ! this domain will be identical.
       !
-      CALL lbc_nfd( ztab, cd_type, psgn )   ! North fold boundary condition
+      CALL lbc_nfd( tab_3d, cd_type, psgn )   ! North fold boundary condition
       !
       DO jj = nlcj-ijpj+1, nlcj             ! Scatter back to pt3d
          ij = jj - nlcj + ijpj
          DO ji= 1, nlci
-            pt3d(ji,jj,:) = ztab(ji+nimpp-1,ij,:)
+            pt3d(ji,jj,:) = tab_3d(ji+nimpp-1,ij,:)
          END DO
       END DO
@@ -2730,12 +2730,12 @@
       ityp = -1
       ijpjm1 = 3
-      ztab_2d(:,:) = 0.e0
-      !
-      DO jj = nlcj-ijpj+1, nlcj             ! put in znorthloc_2d the last 4 jlines of pt2d
+      tab_2d(:,:) = 0.e0
+      !
+      DO jj = nlcj-ijpj+1, nlcj             ! put in xnorthloc_2d the last 4 jlines of pt2d
          ij = jj - nlcj + ijpj
-         znorthloc_2d(:,ij) = pt2d(:,jj)
+         xnorthloc_2d(:,ij) = pt2d(:,jj)
       END DO
 
-      !                                     ! Build in procs of ncomm_north the znorthgloio_2d
+      !                                     ! Build in procs of ncomm_north the xnorthgloio_2d
       itaille = jpi * ijpj
       IF ( l_north_nogather ) THEN
@@ -2747,5 +2747,5 @@
             ij = jj - nlcj + ijpj
             DO ji = 1, nlci
-               ztab_2d(ji+nimpp-1,ij) = pt2d(ji,jj)
+               tab_2d(ji+nimpp-1,ij) = pt2d(ji,jj)
             END DO
          END DO
@@ -2773,8 +2773,8 @@
 
             DO jr = 1,nsndto(ityp)
-               CALL mppsend(5, znorthloc_2d, itaille, isendto(jr,ityp), ml_req_nf(jr) )
+               CALL mppsend(5, xnorthloc_2d, itaille, isendto(jr,ityp), ml_req_nf(jr) )
             END DO
             DO jr = 1,nsndto(ityp)
-               CALL mpprecv(5, zfoldwk_2d, itaille, isendto(jr,ityp))
+               CALL mpprecv(5, foldwk_2d, itaille, isendto(jr,ityp))
                iproc = isendto(jr,ityp) + 1
                ildi = nldit (iproc)
@@ -2783,5 +2783,5 @@
                DO jj = 1, ijpj
                   DO ji = ildi, ilei
-                     ztab_2d(ji+iilb-1,jj) = zfoldwk_2d(ji,jj)
+                     tab_2d(ji+iilb-1,jj) = foldwk_2d(ji,jj)
                   END DO
                END DO
@@ -2798,6 +2798,6 @@
 
       IF ( ityp .lt. 0 ) THEN
-         CALL MPI_ALLGATHER( znorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        &
-            &                znorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
+         CALL MPI_ALLGATHER( xnorthloc_2d  , itaille, MPI_DOUBLE_PRECISION,        &
+            &                xnorthgloio_2d, itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
          !
          DO jr = 1, ndim_rank_north            ! recover the global north array
@@ -2808,5 +2808,5 @@
             DO jj = 1, ijpj
                DO ji = ildi, ilei
-                  ztab_2d(ji+iilb-1,jj) = znorthgloio_2d(ji,jj,jr)
+                  tab_2d(ji+iilb-1,jj) = xnorthgloio_2d(ji,jj,jr)
                END DO
             END DO
@@ -2814,5 +2814,5 @@
       ENDIF
       !
-      ! The ztab array has been either:
+      ! The tab array has been either:
       !  a. Fully populated by the mpi_allgather operation or
       !  b. Had the active points for this domain and northern neighbours populated
@@ -2821,5 +2821,5 @@
       ! this domain will be identical.
       !
-      CALL lbc_nfd( ztab_2d, cd_type, psgn )   ! North fold boundary condition
+      CALL lbc_nfd( tab_2d, cd_type, psgn )   ! North fold boundary condition
       !
       !
@@ -2827,5 +2827,5 @@
          ij = jj - nlcj + ijpj
          DO ji = 1, nlci
-            pt2d(ji,jj) = ztab_2d(ji+nimpp-1,ij)
+            pt2d(ji,jj) = tab_2d(ji+nimpp-1,ij)
          END DO
       END DO
@@ -2860,18 +2860,18 @@
       !
       ijpj=4
-      ztab_e(:,:) = 0.e0
+      tab_e(:,:) = 0.e0
 
       ij=0
-      ! put in znorthloc_e the last 4 jlines of pt2d
+      ! put in xnorthloc_e the last 4 jlines of pt2d
       DO jj = nlcj - ijpj + 1 - jpr2dj, nlcj +jpr2dj
          ij = ij + 1
          DO ji = 1, jpi
-            znorthloc_e(ji,ij)=pt2d(ji,jj)
+            xnorthloc_e(ji,ij)=pt2d(ji,jj)
          END DO
       END DO
       !
       itaille = jpi * ( ijpj + 2 * jpr2dj )
-      CALL MPI_ALLGATHER( znorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    &
-         &                znorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
+      CALL MPI_ALLGATHER( xnorthloc_e(1,1)  , itaille, MPI_DOUBLE_PRECISION,    &
+         &                xnorthgloio_e(1,1,1), itaille, MPI_DOUBLE_PRECISION, ncomm_north, ierr )
       !
       DO jr = 1, ndim_rank_north            ! recover the global north array
@@ -2882,5 +2882,5 @@
          DO jj = 1, ijpj+2*jpr2dj
             DO ji = ildi, ilei
-               ztab_e(ji+iilb-1,jj) = znorthgloio_e(ji,jj,jr)
+               tab_e(ji+iilb-1,jj) = xnorthgloio_e(ji,jj,jr)
             END DO
          END DO
@@ -2890,5 +2890,5 @@
       ! 2. North-Fold boundary conditions
       ! ----------------------------------
-      CALL lbc_nfd( ztab_e(:,:), cd_type, psgn, pr2dj = jpr2dj )
+      CALL lbc_nfd( tab_e(:,:), cd_type, psgn, pr2dj = jpr2dj )
 
       ij = jpr2dj
@@ -2897,5 +2897,5 @@
       ij  = ij +1
          DO ji= 1, nlci
-            pt2d(ji,jj) = ztab_e(ji+nimpp-1,ij)
+            pt2d(ji,jj) = tab_e(ji+nimpp-1,ij)
          END DO
       END DO
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4276)
@@ -122,4 +122,12 @@
       irestj = 1 + MOD( jpjglo - nrecj -1 , jpnj )
 
+#if defined key_nemocice_decomp
+      ! Change padding to be consistent with CICE
+      ilci(1:jpni-1      ,:) = jpi
+      ilci(jpni          ,:) = jpiglo - (jpni - 1) * (jpi - nreci)
+
+      ilcj(:,      1:jpnj-1) = jpj
+      ilcj(:,          jpnj) = jpjglo - (jpnj - 1) * (jpj - nrecj)
+#else
       ilci(1:iresti      ,:) = jpi
       ilci(iresti+1:jpni ,:) = jpi-1
@@ -127,4 +135,5 @@
       ilcj(:,      1:irestj) = jpj
       ilcj(:, irestj+1:jpnj) = jpj-1
+#endif
 
       IF(lwp) WRITE(numout,*)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 4276)
@@ -187,5 +187,5 @@
          &      gsinf(jpi,jpj), gcosf(jpi,jpj), STAT=ierr )
       IF(lk_mpp)   CALL mpp_sum( ierr )
-      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+      IF( ierr /= 0 )   CALL ctl_stop('angle: unable to allocate arrays' )
 
       ! ============================= !
@@ -361,5 +361,5 @@
             &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
          IF( lk_mpp    )   CALL mpp_sum( ierr )
-         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+         IF( ierr /= 0 )   CALL ctl_stop('geo2oce: unable to allocate arrays' )
       ENDIF
 
@@ -438,9 +438,9 @@
       !!----------------------------------------------------------------------
 
-      IF( ALLOCATED( gsinlon ) ) THEN
+      IF( .NOT. ALLOCATED( gsinlon ) ) THEN
          ALLOCATE( gsinlon(jpi,jpj,4) , gcoslon(jpi,jpj,4) ,   &
             &      gsinlat(jpi,jpj,4) , gcoslat(jpi,jpj,4) , STAT=ierr )
          IF( lk_mpp    )   CALL mpp_sum( ierr )
-         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'angle_msh_geo: unable to allocate arrays' )
+         IF( ierr /= 0 )   CALL ctl_stop('oce2geo: unable to allocate arrays' )
       ENDIF
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 4276)
@@ -72,4 +72,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   sfx    , sfx_b    !: salt flux                                    [PSU/m2/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff   [Kg/m2/s]  
    !!
@@ -117,5 +118,5 @@
          &      qsr_tot(jpi,jpj) , qsr  (jpi,jpj) ,                        &
          &      emp    (jpi,jpj) , emp_b(jpi,jpj) ,                        &
-         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj) , STAT=ierr(2) )
+         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) )
          !
       ALLOCATE( rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,     &
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 4276)
@@ -407,5 +407,7 @@
       SELECT CASE( TRIM( sn_rcv_emp%cldes ) )
       CASE( 'oce only'      )   ;   srcv(                                 jpr_oemp   )%laction = .TRUE. 
-      CASE( 'conservative'  )   ;   srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
+      CASE( 'conservative'  )
+         srcv( (/jpr_rain, jpr_snow, jpr_ievp, jpr_tevp/) )%laction = .TRUE.
+         IF ( k_ice <= 1 )  srcv(jpr_ivep)%laction = .FALSE.
       CASE( 'oce and ice'   )   ;   srcv( (/jpr_ievp, jpr_sbpr, jpr_semp, jpr_oemp/) )%laction = .TRUE.
       CASE default              ;   CALL ctl_stop( 'sbc_cpl_init: wrong definition of sn_rcv_emp%cldes' )
@@ -465,13 +467,4 @@
          CALL ctl_stop( 'sbc_cpl_init: namsbc_cpl namelist mismatch between sn_rcv_qns%cldes and sn_rcv_dqnsdt%cldes' )
       !                                                      ! ------------------------- !
-      !                                                      !    Ice Qsr penetration    !   
-      !                                                      ! ------------------------- !
-      ! fraction of net shortwave radiation which is not absorbed in the thin surface layer 
-      ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
-      ! Coupled case: since cloud cover is not received from atmosphere 
-      !               ===> defined as constant value -> definition done in sbc_cpl_init
-      fr1_i0(:,:) = 0.18
-      fr2_i0(:,:) = 0.82
-      !                                                      ! ------------------------- !
       !                                                      !      10m wind module      !   
       !                                                      ! ------------------------- !
@@ -508,4 +501,9 @@
       ! Allocate taum part of frcv which is used even when not received as coupling field
       IF ( .NOT. srcv(jpr_taum)%laction ) ALLOCATE( frcv(jpr_taum)%z3(jpi,jpj,srcv(jn)%nct) )
+      ! Allocate itx1 and ity1 as they are used in sbc_cpl_ice_tau even if srcv(jpr_itx1)%laction = .FALSE.
+      IF( k_ice /= 0 ) THEN
+         IF ( .NOT. srcv(jpr_itx1)%laction ) ALLOCATE( frcv(jpr_itx1)%z3(jpi,jpj,srcv(jn)%nct) )
+         IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jn)%nct) )
+      END IF
 
       ! ================================ !
@@ -911,8 +909,8 @@
       !!                 third  as  2 components on the cp_ice_msh point 
       !!
-      !!                In 'oce and ice' case, only one vector stress field 
+      !!                Except in 'oce and ice' case, only one vector stress field 
       !!             is received. It has already been processed in sbc_cpl_rcv
       !!             so that it is now defined as (i,j) components given at U-
-      !!             and V-points, respectively. Therefore, here only the third
+      !!             and V-points, respectively. Therefore, only the third
       !!             transformation is done and only if the ice-grid is a 'I'-grid. 
       !!
@@ -1329,4 +1327,13 @@
       END SELECT
 
+      !    Ice Qsr penetration used (only?)in lim2 or lim3 
+      ! fraction of net shortwave radiation which is not absorbed in the thin surface layer 
+      ! and penetrates inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
+      ! Coupled case: since cloud cover is not received from atmosphere 
+      !               ===> defined as constant value -> definition done in sbc_cpl_init
+      fr1_i0(:,:) = 0.18
+      fr2_i0(:,:) = 0.82
+
+
       CALL wrk_dealloc( jpi,jpj, zcptn, ztmp, zicefr )
       !
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 4276)
@@ -146,4 +146,6 @@
       sfx(:,:) = 0.0_wp                            ! the salt flux due to freezing/melting will be computed (i.e. will be non-zero) 
                                                    ! only if sea-ice is present
+ 
+      fmmflx(:,:) = 0.0_wp                        ! freezing-melting array initialisation
 
       !                                            ! restartability   
@@ -218,4 +220,6 @@
          IF( nsbc ==  6 )   WRITE(numout,*) '              MFS Bulk formulation'
       ENDIF
+      !
+                          CALL sbc_ssm_init               ! Sea-surface mean fields initialisation
       !
       IF( ln_ssr      )   CALL sbc_ssr_init               ! Sea-Surface Restoring initialisation
@@ -362,4 +366,5 @@
                                                                 ! (includes virtual salt flux beneath ice 
                                                                 ! in linear free surface case)
+         CALL iom_put( "fmmflx", fmmflx  )                      ! Freezing-melting water flux
          CALL iom_put( "qt"    , qns  + qsr )                   ! total heat flux 
          CALL iom_put( "qns"   , qns        )                   ! solar heat flux
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 4276)
@@ -30,4 +30,5 @@
    USE lbclnk          ! lateral boudary conditions
    USE lib_mpp         ! distributed memory computing
+   USE c1d               ! 1D vertical configuration
    USE in_out_manager  ! I/O manager
    USE timing          ! timing
@@ -271,4 +272,5 @@
       
       ! SOR and PCG solvers
+      IF( lk_c1d ) CALL lbc_lnk( gcdmat, 'T', 1._wp ) ! 1D case bmask =/0  but gcdmat not define everywhere 
       DO jj = 1, jpj
          DO ji = 1, jpi
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4276)
@@ -675,5 +675,5 @@
 
 
-   FUNCTION tfreez( psal ) RESULT( ptf )
+   FUNCTION tfreez( psal, pdep ) RESULT( ptf )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE eos_init  ***
@@ -688,4 +688,5 @@
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   psal   ! salinity             [psu]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ), OPTIONAL ::   pdep   ! depth      [decibars]
       ! Leave result array automatic rather than making explicitly allocated
       REAL(wp), DIMENSION(jpi,jpj)                ::   ptf    ! freezing temperature [Celcius]
@@ -694,4 +695,7 @@
       ptf(:,:) = ( - 0.0575_wp + 1.710523e-3_wp * SQRT( psal(:,:) )   &
          &                     - 2.154996e-4_wp *       psal(:,:)   ) * psal(:,:)
+      IF ( PRESENT( pdep ) ) THEN   
+         ptf(:,:) = ptf(:,:) - 7.53e-4_wp * pdep(:,:)
+      ENDIF
       !
    END FUNCTION tfreez
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 4276)
@@ -271,5 +271,5 @@
       !
 #if defined key_iomput
-      IF( kstp == nitend   )   CALL xios_context_finalize() ! needed for XIOS+AGRIF
+      IF( kstp == nitend .OR. indic < 0 )   CALL xios_context_finalize() ! needed for XIOS+AGRIF
 #endif
       !
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/daymod.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/daymod.F90	(revision 4276)
@@ -246,4 +246,9 @@
                nday_year = 1
                nsec_year = ndt05
+               IF( nsec1jan000 >= 2 * (2**30 - nsecd * nyear_len(1) / 2 ) ) THEN   ! test integer 4 max value
+                  CALL ctl_stop( 'The number of seconds between Jan. 1st 00h of nit000 year and Jan. 1st 00h ',   &
+                     &           'of the current year is exceeding the INTEGER 4 max VALUE: 2^31-1 -> 68.09 years in seconds', &
+                     & 'You must do a restart at higher frequency (or remove this STOP and recompile everything in I8)' )
+               ENDIF
                nsec1jan000 = nsec1jan000 + nsecd * nyear_len(1)
                IF( nleapy == 1 )   CALL day_mth
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/diawri.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/diawri.F90	(revision 4276)
@@ -259,6 +259,6 @@
          CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! (emp-rnf)
             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! (emps-rnf)
-            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sosfldow", "downward salt flux"                 , "PSU/m2/s",  &  ! (sfx)
+             &         jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
          CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qns + qsr
             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
@@ -309,6 +309,9 @@
       CALL histwrite( nid_T, "sst_m", it, sst_m, ndim_hT, ndex_hT )   ! sea surface temperature
       CALL histwrite( nid_T, "sss_m", it, sss_m, ndim_hT, ndex_hT )   ! sea surface salinity
-      CALL histwrite( nid_T, "sowaflup", it, emp   , ndim_hT, ndex_hT )   ! upward water flux
-      CALL histwrite( nid_T, "sowaflcd", it, emps  , ndim_hT, ndex_hT )   ! c/d water flux
+      CALL histwrite( nid_T, "sowaflup", it, (emp - rnf )  , ndim_hT, ndex_hT )   ! upward water flux
+      CALL histwrite( nid_T, "sosfldow", it, sfx           , ndim_hT, ndex_hT )   ! downward salt flux 
+                                                                                  ! (includes virtual salt flux beneath ice 
+                                                                                  ! in linear free surface case)
+
       CALL histwrite( nid_T, "sohefldo", it, qns + qsr     , ndim_hT, ndex_hT )   ! total heat flux
       CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90	(revision 4276)
@@ -382,6 +382,7 @@
       USE diawri    , ONLY: dia_wri_alloc
       USE dom_oce   , ONLY: dom_oce_alloc
-      !
-      INTEGER :: ierr
+      USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 
+      !
+      INTEGER :: ierr,ierr4
       !!----------------------------------------------------------------------
       !
@@ -389,4 +390,7 @@
       ierr = ierr + dom_oce_alloc   ()          ! ocean domain
       ierr = ierr + lib_mpp_alloc   (numout)    ! mpp exchanges
+      ALLOCATE( snwice_mass(jpi,jpj)  , snwice_mass_b(jpi,jpj),             &
+         &      snwice_fmass(jpi,jpj), STAT= ierr4 )
+      ierr = ierr + ierr4
       !
       IF( lk_mpp    )   CALL mpp_sum( ierr )
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 4276)
@@ -81,4 +81,6 @@
       
       !
+      IF (kt == nn_it000 ) CALL sbc_ssm_init()
+
       IF( nn_timing == 1 )  CALL timing_start( 'sbc_ssm')
 
@@ -100,4 +102,8 @@
       tsn(:,:,1,jp_tem) = sst_m(:,:)
       tsn(:,:,1,jp_sal) = sss_m(:,:)
+      IF ( nn_ice == 1 ) THEN
+         tsb(:,:,1,jp_tem) = sst_m(:,:)
+         tsb(:,:,1,jp_sal) = sss_m(:,:)
+      ENDIF
       ub (:,:,1       ) = ssu_m(:,:)
       vb (:,:,1       ) = ssv_m(:,:)
@@ -135,5 +141,5 @@
       TYPE(FLD_N) :: sn_usp, sn_vsp, sn_ssh
       !
-      NAMELIST/namsbc_ssm/cn_dir, ln_3d_uv, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh
+      NAMELIST/namsbc_sas/cn_dir, ln_3d_uv, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh
 
       !!----------------------------------------------------------------------
@@ -151,12 +157,12 @@
       !
       REWIND( numnam )                          ! read in namlist namsbc_ssm
-      READ  ( numnam, namsbc_ssm )
+      READ  ( numnam, namsbc_sas )
       !                                         ! store namelist information in an array
       !                                         ! Control print
       IF(lwp) THEN
          WRITE(numout,*)
-         WRITE(numout,*) 'sbc_ssm : standalone surface scheme '
+         WRITE(numout,*) 'sbc_sas : standalone surface scheme '
          WRITE(numout,*) '~~~~~~~~~~~ '
-         WRITE(numout,*) '   Namelist namsbc_ssm'
+         WRITE(numout,*) '   Namelist namsbc_sas'
          WRITE(numout,*)
       ENDIF
@@ -273,9 +279,11 @@
       ! so allocate enough of arrays to use
       !
+      ierr3 = 0
       jpm = MAX(jp_tem, jp_sal)
       ALLOCATE( tsn(jpi,jpj,1,jpm), STAT=ierr0 )
       ALLOCATE( ub(jpi,jpj,1)     , STAT=ierr1 )
       ALLOCATE( vb(jpi,jpj,1)     , STAT=ierr2 )
-      ierr = ierr0 + ierr1 + ierr2
+      IF ( nn_ice == 1 ) ALLOCATE( tsb(jpi,jpj,1,jpm), STAT=ierr3 )
+      ierr = ierr0 + ierr1 + ierr2 + ierr3
       IF( ierr > 0 ) THEN
          CALL ctl_stop('sbc_ssm_init: unable to allocate surface arrays')
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 4276)
@@ -129,5 +129,5 @@
                   zoxy   = trn(ji,jj,jk,jpoxy) * ( rhop(ji,jj,jk) / 1.e3 )
                   ! Fe2+ oxydation rate from Santana-Casiano et al. (2005)
-                  zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,1,jp_tem) + 273.15 )  &
+                  zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,jk,jp_tem) + 273.15 )  &
                     &    - 0.04406 * SQRT( tsn(ji,jj,jk,jp_sal) ) - 0.002847 * tsn(ji,jj,jk,jp_sal)
                   zkox   = ( 10.** zkox ) * spd
@@ -263,5 +263,5 @@
                zdep    = MIN( 1., 1000. / fsdept(ji,jj,jk) )
                zlam1b  = xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - ztotlig(ji,jj,jk) ) )
-               zcoag   = zfeequi * zlam1b * zstep + 1E-4 * ( 1. - zlamfac ) * zdep * zstep *zfecoll
+               zcoag   = zfeequi * zlam1b * zstep + 1E-4 * ( 1. - zlamfac ) * zdep * zstep * trn(ji,jj,jk,jpfer)
 
                !  Compute the coagulation of colloidal iron. This parameterization 
@@ -278,5 +278,5 @@
                tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zscave * zdenom1 + zaggdfea + zaggdfeb
 #else
-               zlam1b = 3.53E3 *   trn(ji,jj,jk,jpgoc) * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep 
+               zlam1b = 3.53E3 *   trn(ji,jj,jk,jpgoc) * xdiss(ji,jj,jk)
                zaggdfeb = zlam1b * zstep * zfecoll
                !
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90	(revision 4276)
@@ -109,6 +109,6 @@
          ! then the first atmospheric CO2 record read is at years(1)
          zyr_dec = REAL( nyear + nn_offset, wp ) + REAL( nday_year, wp ) / REAL( nyear_len(1), wp )
-         jm = 2
-         DO WHILE( jm <= nmaxrec .AND. years(jm-1) < zyr_dec .AND. years(jm) >= zyr_dec ) ;  jm = jm + 1 ;  END DO
+         jm = 1
+         DO WHILE( jm <= nmaxrec .AND. years(jm) < zyr_dec ) ;  jm = jm + 1 ;  END DO
          iind = jm  ;   iindm1 = jm - 1
          zdco2dt = ( atcco2h(iind) - atcco2h(iindm1) ) / ( years(iind) - years(iindm1) + rtrn )
@@ -196,6 +196,6 @@
       END DO
 
-      t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )            ! Cumulative Total Flux of Carbon
-      t_atm_co2_flx = glob_sum( satmco2(:,:) * patm(:,:) * e1e2t(:,:) )   ! Total atmospheric pCO2
+      t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )      ! Cumulative Total Flux of Carbon
+      t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) )         ! Total atmospheric pCO2
 
       IF(ln_ctl)   THEN  ! print mean trends (used for debugging)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90	(revision 4276)
@@ -140,12 +140,8 @@
                !  ----------------------------------
 # if ! defined key_kriest
-               zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk)      &
-!                 &                   * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes)
-               &                     * 2. *  trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes)
+               zgrazffeg = grazflux  * zstep * wsbio4(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes)
                zgrazfffg = zgrazffeg * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)
 # endif
-               zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk)     &
-!                 &                   * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes)
-               &                     * 2. * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes)
+               zgrazffep = grazflux  * zstep *  wsbio3(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes)
                zgrazfffp = zgrazffep * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)
               !
@@ -154,12 +150,9 @@
               ! Compute the proportion of filter feeders
               zproport  = (zgrazffep + zgrazffeg)/(rtrn + zgraztot)
+              ! Compute fractionation of aggregates. It is assumed that diatoms based aggregates are more prone to fractionation
+              ! since they are more porous (marine snow instead of fecal pellets)
               zratio    = trn(ji,jj,jk,jpgsi) / ( trn(ji,jj,jk,jpgoc) + rtrn )
               zratio2   = zratio * zratio
-!              zfrac =  zproport * 0.15 * zstep *                     &
-!                       ( 0.2 + 0.8 * zratio2 / ( 1.5**2 + zratio2 ) )   &
-!                      *trn(ji,jj,jk,jpmes)/3E-7 *trn(ji,jj,jk,jpgoc)
-              zfrac     = zproport * grazflux  * zstep * wsbio4(ji,jj,jk)      &
-                 &       * ( 0.1 + 3.9 * zratio2 / ( 1.**2 + zratio2 ) )       &
-                 &       * 2. * trn(ji,jj,jk,jpmes) * trn(ji,jj,jk,jpgoc) 
+              zfrac     = zproport * zgrazffeg * ( 0.1 + 3.9 * zratio2 / ( 1.**2 + zratio2 ) )
 
               zfracfe   = zfrac * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)
@@ -193,8 +186,8 @@
                zepshert  = epsher2 * MIN( 1., zncratio )
                zepsherv  = zepshert * MIN( 1., zgrasrat / ferat3 )
-               zgrarem2  = zgraztot * ( 1. - zepsherv - unass2 ) + zrespz2  &
-               &    + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv + rtrn) * ztortz2
-               zgrafer2  = zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepsherv )    &
-               &    + ferat3 * ( zrespz2 + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv + rtrn) * ztortz2 )
+               zgrarem2  =  zgraztot * ( 1. - zepsherv - unass2 ) + zrespz2  &
+                  &       + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv ) * ztortz2
+               zgrafer2  =  zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepsherv )    &
+                  &       + ferat3 * ( zrespz2 + ( 1. - zepsherv - unass2 ) /( 1. - zepsherv ) * ztortz2 )
                zgrapoc2  = zgraztot * unass2
 
@@ -208,17 +201,7 @@
                tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig
                tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig              
-#if defined key_kriest
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2
-               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * xkr_dmeso
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass2
-#else
-               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 - zfrac 
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zfrac
-               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zgraztotf * unass2 - zfracfe
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zfracfe
-
-#endif
+
                zmortz2 = ztortz2 + zrespz2
-               zmortzgoc = unass2 / ( 1. - zepsherv + rtrn ) * ztortz2
+               zmortzgoc = unass2 / ( 1. - zepsherv ) * ztortz2
                tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + zepsherv * zgraztot 
                tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd
@@ -242,15 +225,14 @@
 #if defined key_kriest
                znumpoc = trn(ji,jj,jk,jpnum) / ( trn(ji,jj,jk,jppoc) + rtrn )
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortzgoc - zgrazpoc - zgrazffep
-               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc &
-               &   + zmortzgoc * xkr_dmeso - zgrazffep * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn )
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfffp - zgrazpof
+               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortzgoc - zgrazpoc - zgrazffep + zgrapoc2
+               tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc + zgrapoc2 * xkr_dmeso      &
+               &                   + zmortzgoc * xkr_dmeso - zgrazffep * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn )
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfffp - zgrazpof + zgraztotf * unass2
 #else
-               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc - zgrazffep
-               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortzgoc - zgrazffeg
-               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof - zgrazfffp
-               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortzgoc - zgrazfffg
+               tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc - zgrazffep + zfrac
+               tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortzgoc - zgrazffeg + zgrapoc2 - zfrac
+               tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof - zgrazfffp + zfracfe
+               tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortzgoc - zgrazfffg + zgraztotf * unass2 - zfracfe
 #endif
-
             END DO
          END DO
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90	(revision 4276)
@@ -201,5 +201,5 @@
                       zconctemp2  = trn(ji,jj,jk,jpdia) - zconctemp
                       !
-                      zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * EXP( enano(ji,jj,jk) ) )
+                      zpislopead (ji,jj,jk) = pislope  * ( 1.+ zadap  * EXP( -0.21 * enano(ji,jj,jk) ) )
                       zpislopead2(ji,jj,jk) = (pislope * zconctemp2 + pislope2 * zconctemp)  / ( trn(ji,jj,jk,jpdia) + rtrn )
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90	(revision 4276)
@@ -69,5 +69,5 @@
       REAL(wp) ::  zwflux, zfminus, zfplus
       REAL(wp) ::  zlim, zfact, zfactcal
-      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit
+      REAL(wp) ::  zo2, zno3, zflx, zpdenit, z1pdenit, zdenitt, zolimit
       REAL(wp) ::  zsiloss, zcaloss, zwsbio3, zwsbio4, zwscal, zdep, zwstpoc
       REAL(wp) ::  ztrfer, ztrpo4, zwdust
@@ -82,5 +82,5 @@
       IF( nn_timing == 1 )  CALL timing_start('p4z_sed')
       !
-      IF( kt == nit000 .AND. jnt == 1 )  THEN
+      IF( kt == nittrc000 .AND. jnt == 1 )  THEN
          ryyss    = nyear_len(1) * rday    ! number of seconds per year and per month
          rmtss    = ryyss / raamo
@@ -105,9 +105,7 @@
             DO ji = 1, jpi
                zdep    = rfact2 / fse3t(ji,jj,1)
-    !           zwflux  = ( emps(ji,jj) - emp(ji,jj) ) &
-    !           &        * tsn(ji,jj,1,jp_sal) / ( tsn(ji,jj,1,jp_sal) - 6.0 ) / 1000.
-               zwflux = 0.
-               zfminus = MIN( 0., -zwflux ) * trn(ji,jj,1,jpfer) * zdep
-               zfplus  = MAX( 0., -zwflux ) * 10E-9 * zdep
+               zwflux  = fmmflx(ji,jj) / 1000._wp
+               zfminus = MIN( 0._wp, -zwflux ) * trn(ji,jj,1,jpfer) * zdep
+               zfplus  = MAX( 0._wp, -zwflux ) * icefeinput * zdep
                zironice(ji,jj) =  zfplus + zfminus
             END DO
@@ -135,5 +133,5 @@
          ENDIF
          zsidep(:,:) = 8.8 * 0.075 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 28.1  * rmtss )
-         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss )
+         zpdep (:,:) = 0.1 * 0.021 * dust(:,:) * rfact2 / fse3t(:,:,1) / ( 31.   * rmtss ) / po4r 
          !                                              ! Iron solubilization of particles in the water column
          zwdust = 0.005 / ( wdust * 55.85 * 30.42 ) / ( 45. * rday ) 
@@ -246,8 +244,6 @@
 #endif
 
-      ! THEN this loss is scaled at each bottom grid cell for
-      ! equilibrating the total budget of silica in the ocean.
-      ! Thus, the amount of silica lost in the sediments equal
-      ! the supply at the surface (dust+rivers)
+      ! This loss is scaled at each bottom grid cell for equilibrating the total budget of silica in the ocean.
+      ! Thus, the amount of silica lost in the sediments equal the supply at the surface (dust+rivers)
       ! ------------------------------------------------------
 #if ! defined key_sed
@@ -302,12 +298,17 @@
 
 #if ! defined key_sed
-            zpdenit  = MIN( ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 )
+            ! The 0.5 factor in zpdenit and zdenitt is to avoid negative NO3 concentration after both denitrification
+            ! in the sediments and just above the sediments. Not very clever, but simpliest option.
+            zpdenit  = MIN( 0.5 * ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, zdenit2d(ji,jj) * zwstpoc * zrivno3 )
             z1pdenit = zwstpoc * zrivno3 - zpdenit
-            trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + z1pdenit
-            trn(ji,jj,ikt,jppo4) = trn(ji,jj,ikt,jppo4) + zpdenit
-            trn(ji,jj,ikt,jpnh4) = trn(ji,jj,ikt,jpnh4) + zpdenit
-            trn(ji,jj,ikt,jpno3) = trn(ji,jj,ikt,jpno3) - rdenit * zpdenit
-            trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + rno3 * ( 1. + rdenit ) * zpdenit
-            trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zpdenit
+            zolimit = MIN( ( trn(ji,jj,ikt,jpoxy) - rtrn ) / o2ut, z1pdenit * ( 1.- nitrfac(ji,jj,ikt) ) )
+            zdenitt = MIN(  0.5 * ( trn(ji,jj,ikt,jpno3) - rtrn ) / rdenit, z1pdenit * nitrfac(ji,jj,ikt) )
+            trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + z1pdenit - zolimit - zdenitt
+            trn(ji,jj,ikt,jppo4) = trn(ji,jj,ikt,jppo4) + zpdenit + zolimit + zdenitt
+            trn(ji,jj,ikt,jpnh4) = trn(ji,jj,ikt,jpnh4) + zpdenit + zolimit + zdenitt
+            trn(ji,jj,ikt,jpno3) = trn(ji,jj,ikt,jpno3) - rdenit * (zpdenit + zdenitt)
+            trn(ji,jj,ikt,jpoxy) = trn(ji,jj,ikt,jpoxy) - zolimit * o2ut
+            trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + rno3 * (zolimit + (1.+rdenit) * (zpdenit + zdenitt) )
+            trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zpdenit + zolimit + zdenitt
             zwork4(ji,jj) = rdenit * zpdenit * fse3t(ji,jj,ikt)
 #endif
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90	(revision 4276)
@@ -156,5 +156,5 @@
             DO ji = 1, jpi
                IF( tmask(ji,jj,jk) == 1 ) THEN
-                 zwsmax = 0.8 * fse3t(ji,jj,jk) / xstep
+                 zwsmax = 0.5 * fse3t(ji,jj,jk) / xstep
                  wsbio3(ji,jj,jk) = MIN( wsbio3(ji,jj,jk), zwsmax * FLOAT( iiter1 ) )
                  wsbio4(ji,jj,jk) = MIN( wsbio4(ji,jj,jk), zwsmax * FLOAT( iiter2 ) )
@@ -217,12 +217,9 @@
                zaggdoc  = ( ( 0.369 * 0.3 * trn(ji,jj,jk,jpdoc) + 102.4 * trn(ji,jj,jk,jppoc) ) * zfact       &
                &            + 2.4 * zstep * trn(ji,jj,jk,jppoc) ) * 0.3 * trn(ji,jj,jk,jpdoc)
-!               zaggdoc  = ( 0.83 * trn(ji,jj,jk,jpdoc) + 271. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc)
                ! transfer of DOC to GOC : 
                ! 1st term is shear aggregation
                ! 2nd term is differential settling 
                zaggdoc2 = ( 3.53E3 * zfact + 0.1 * zstep ) * trn(ji,jj,jk,jpgoc) * 0.3 * trn(ji,jj,jk,jpdoc)
-!               zaggdoc2 = 1.07e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc)
                ! tranfer of DOC to POC due to brownian motion
-!               zaggdoc3 =   0.02 * ( 16706. * trn(ji,jj,jk,jppoc) + 231. * trn(ji,jj,jk,jpdoc) ) * zstep * trn(ji,jj,jk,jpdoc)
                zaggdoc3 =  ( 5095. * trn(ji,jj,jk,jppoc) + 114. * 0.3 * trn(ji,jj,jk,jpdoc) ) *zstep * 0.3 * trn(ji,jj,jk,jpdoc)
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4276)
@@ -76,6 +76,14 @@
       ENDIF
       !
-      IF( ln_rsttr .AND. kt == nittrc000 )                         CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields 
-      IF( ln_rsttr  .AND. ln_pisclo )                              CALL p4z_clo            ! damping on closed seas
+      IF( kt == nittrc000 ) THEN
+        !
+        CALL p4z_che                              ! initialize the chemical constants
+        !
+        IF( .NOT. ln_rsttr ) THEN  ;   CALL p4z_ph_ini   !  set PH at kt=nit000 
+        ELSE                       ;   CALL p4z_rst( nittrc000, 'READ' )  !* read or initialize all required fields 
+        ENDIF
+        !
+      ENDIF
+
       IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 )   CALL p4z_dmp( kt )      ! Relaxation of some tracers
       !
@@ -164,5 +172,5 @@
       NAMELIST/nampiskrp/ xkr_eta, xkr_zeta, xkr_ncontent, xkr_mass_min, xkr_mass_max
 #endif
-      NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp, ln_pisclo
+      NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp
       NAMELIST/nampismass/ ln_check_mass
       !!----------------------------------------------------------------------
@@ -215,5 +223,4 @@
       ln_pisdmp = .true.
       nn_pisdmp = 1
-      ln_pisclo = .false.
 
       REWIND( numnatp )
@@ -225,5 +232,4 @@
          WRITE(numout,*) '    Relaxation of tracer to glodap mean value             ln_pisdmp      =', ln_pisdmp
          WRITE(numout,*) '    Frequency of Relaxation                               nn_pisdmp      =', nn_pisdmp
-         WRITE(numout,*) '    Restoring of tracer to initial value  on closed seas  ln_pisclo      =', ln_pisclo
          WRITE(numout,*) ' '
       ENDIF
@@ -241,4 +247,32 @@
    END SUBROUTINE p4z_sms_init
 
+   SUBROUTINE p4z_ph_ini
+      !!---------------------------------------------------------------------
+      !!                   ***  ROUTINE p4z_ini_ph  ***
+      !!
+      !!  ** Purpose : Initialization of chemical variables of the carbon cycle
+      !!---------------------------------------------------------------------
+      INTEGER  ::  ji, jj, jk
+      REAL(wp) ::  zcaralk, zbicarb, zco3
+      REAL(wp) ::  ztmas, ztmas1
+      !!---------------------------------------------------------------------
+
+      ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???)
+      ! --------------------------------------------------------
+      DO jk = 1, jpk
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               ztmas   = tmask(ji,jj,jk)
+               ztmas1  = 1. - tmask(ji,jj,jk)
+               zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  )
+               zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1
+               zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )
+               hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1
+            END DO
+         END DO
+     END DO
+     !
+   END SUBROUTINE p4z_ph_ini
+
    SUBROUTINE p4z_rst( kt, cdrw )
       !!---------------------------------------------------------------------
@@ -269,18 +303,5 @@
          ELSE
 !            hi(:,:,:) = 1.e-9 
-            ! Set PH from  total alkalinity, borat (???), akb3 (???) and ak23 (???)
-            ! --------------------------------------------------------
-            DO jk = 1, jpk
-               DO jj = 1, jpj
-                  DO ji = 1, jpi
-                     ztmas   = tmask(ji,jj,jk)
-                     ztmas1  = 1. - tmask(ji,jj,jk)
-                     zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  )
-                     zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1
-                     zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )
-                     hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1
-                  END DO
-               END DO
-            END DO
+            CALL p4z_ph_ini
          ENDIF
          CALL iom_get( numrtr, jpdom_autoglo, 'Silicalim', xksi(:,:) )
@@ -395,5 +416,5 @@
 #endif
             &                    + trn(:,:,:,jpsfe)                     &
-            &                    + trn(:,:,:,jpzoo)                     &
+            &                    + trn(:,:,:,jpzoo) * ferat3            &
             &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  )
 
@@ -421,119 +442,4 @@
    END SUBROUTINE p4z_chk_mass
 
-   SUBROUTINE p4z_clo   
-      !!---------------------------------------------------------------------
-      !!                  ***  ROUTINE p4z_clo  ***
-      !!
-      !! ** Purpose :   Closed sea domain initialization
-      !!
-      !! ** Method  :   if a closed sea is located only in a model grid point
-      !!                we restore to initial data
-      !!
-      !! ** Action  :   ictsi1(), ictsj1() : south-west closed sea limits (i,j)
-      !!                ictsi2(), ictsj2() : north-east Closed sea limits (i,j)
-      !!----------------------------------------------------------------------
-      INTEGER, PARAMETER           ::   npicts   = 4        ! number of closed sea
-      INTEGER, DIMENSION(npicts)   ::   ictsi1, ictsj1      ! south-west closed sea limits (i,j)
-      INTEGER, DIMENSION(npicts)   ::   ictsi2, ictsj2      ! north-east closed sea limits (i,j)
-      INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indices
-      INTEGER :: ierr                                       ! local integer
-      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta     ! 4D  workspace
-      !!----------------------------------------------------------------------
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)' p4z_clo : closed seas '
-      IF(lwp) WRITE(numout,*)'~~~~~~~'
-
-      ! initial values
-      ictsi1(:) = 1  ;  ictsi2(:) = 1 
-      ictsj1(:) = 1  ;  ictsj2(:) = 1 
-
-      ! set the closed seas (in data domain indices)
-      ! -------------------
-
-      IF( cp_cfg == "orca" ) THEN
-         !
-         SELECT CASE ( jp_cfg )
-         !                                           ! =======================
-         CASE ( 2 )                                  !  ORCA_R2 configuration
-            !                                        ! =======================
-            !                                            ! Caspian Sea
-            ictsi1(1)   =  11  ;  ictsj1(1)   = 103
-            ictsi2(1)   =  17  ;  ictsj2(1)   = 112
-            !                                            ! Great North American Lakes
-            ictsi1(2)   =  97  ;  ictsj1(2)   = 107
-            ictsi2(2)   = 103  ;  ictsj2(2)   = 111
-            !                                            ! Black Sea 1 : west part of the Black Sea
-            ictsi1(3)   = 174  ; ictsj1(3)   = 107
-            ictsi2(3)   = 181  ; ictsj2(3)   = 112
-            !                                            ! Black Sea 2 : est part of the Black Sea
-            ictsi1(4)   =   2  ;  ictsj1(4)   = 107
-            ictsi2(4)   =   6  ;  ictsj2(4)   = 112
-            !                                        ! =======================
-         CASE ( 4 )                                  !  ORCA_R4 configuration
-            !                                        ! =======================
-            !                                            ! Caspian Sea
-            ictsi1(1)   =  4  ;  ictsj1(1)   = 53
-            ictsi2(1)   =  4  ;  ictsj2(1)   = 56
-            !                                            ! Great North American Lakes
-            ictsi1(2)   = 49  ;  ictsj1(2)   = 55
-            ictsi2(2)   = 51  ;  ictsj2(2)   = 56
-            !                                            ! Black Sea
-            ictsi1(3)   = 88  ;  ictsj1(3)   = 55
-            ictsi2(3)   = 91  ;  ictsj2(3)   = 56
-            !                                            ! Baltic Sea
-            ictsi1(4)   = 75  ;  ictsj1(4)   = 59
-            ictsi2(4)   = 76  ;  ictsj2(4)   = 61
-            !                                        ! =======================
-            !                                        ! =======================
-         CASE ( 025 )                                ! ORCA_R025 configuration
-            !                                        ! =======================
-                                                     ! Caspian + Aral sea
-            ictsi1(1)   = 1330 ; ictsj1(1)   = 645
-            ictsi2(1)   = 1400 ; ictsj2(1)   = 795
-            !                                        ! Azov Sea
-            ictsi1(2)   = 1284 ; ictsj1(2)   = 722
-            ictsi2(2)   = 1304 ; ictsj2(2)   = 747
-            !
-         END SELECT
-         !
-      ENDIF
-
-      ! convert the position in local domain indices
-      ! --------------------------------------------
-      DO jc = 1, npicts 
-         ictsi1(jc)   = mi0( ictsi1(jc) )
-         ictsj1(jc)   = mj0( ictsj1(jc) )
-
-         ictsi2(jc)   = mi1( ictsi2(jc) )
-         ictsj2(jc)   = mj1( ictsj2(jc) )
-      END DO
-
-      ! Restore close seas values to initial data
-      IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping
-         !
-         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )   ! Memory allocation
-         !
-         CALL trc_dta( nittrc000, ztrcdta )   ! read tracer data at nittrc000
-         !
-         DO jn = 1, jptra
-            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
-                jl = n_trc_index(jn)
-                DO jc = 1, npicts
-                   DO jk = 1, jpkm1
-                      DO jj = ictsj1(jc), ictsj2(jc)
-                         DO ji = ictsi1(jc), ictsi2(jc)
-                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk)
-                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
-                         ENDDO
-                      ENDDO
-                   ENDDO
-                ENDDO
-             ENDIF
-          ENDDO
-          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
-      ENDIF
-      !
-   END SUBROUTINE p4z_clo
 #else
    !!======================================================================
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90	(revision 4276)
@@ -56,5 +56,4 @@
    LOGICAL  ::  ln_pisdmp          !: restoring or not of nutrients to a mean value
    INTEGER  ::  nn_pisdmp          !: frequency of relaxation or not of nutrients to a mean value
-   LOGICAL  ::  ln_pisclo          !: Restoring or not of nutrients to initial value on closed seas
 
    !!* Mass conservation
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90	(revision 4276)
@@ -122,6 +122,4 @@
       rdenita =   3._wp /  5._wp
       o2ut    = 131._wp / 122._wp
-
-      CALL p4z_che        ! initialize the chemical constants
 
       ! Initialization of tracer concentration in case of  no restart 
@@ -162,20 +160,5 @@
          xksi(:,:)    = 2.e-6
          xksimax(:,:) = xksi(:,:)
-
-         ! Initialization of chemical variables of the carbon cycle
-         ! --------------------------------------------------------
-         DO jk = 1, jpk
-            DO jj = 1, jpj
-               DO ji = 1, jpi
-                  ztmas   = tmask(ji,jj,jk)
-                  ztmas1  = 1. - tmask(ji,jj,jk)
-                  zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / (  1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) )  )
-                  zco3    = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1
-                  zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk )
-                  hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1
-               END DO
-            END DO
-         END DO
-         !
+        !
       END IF
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 4276)
@@ -11,7 +11,5 @@
    !!            3.3  !  2010-06  (C. Ethe, G. Madec) merge TRA-TRC 
    !!----------------------------------------------------------------------
-#if  defined key_top && defined key_trcdmp 
-   !!----------------------------------------------------------------------
-   !!   key_trcdmp                                         internal damping
+#if  defined key_top 
    !!----------------------------------------------------------------------
    !!   trc_dmp      : update the tracer trend with the internal damping
@@ -25,4 +23,5 @@
    USE prtctl_trc      ! Print control for debbuging
    USE trdtra
+   USE trdmod_oce
 
    IMPLICIT NONE
@@ -30,17 +29,13 @@
 
    PUBLIC trc_dmp            ! routine called by step.F90
+   PUBLIC trc_dmp_clo        ! routine called by step.F90
    PUBLIC trc_dmp_alloc      ! routine called by nemogcm.F90
 
-   LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .TRUE.   !: internal damping flag
-
    !                                !!* Namelist namtrc_dmp : passive tracer newtonian damping *
-   INTEGER  ::   nn_hdmp_tr =   -1   ! = 0/-1/'latitude' for damping over passive tracer
-   INTEGER  ::   nn_zdmp_tr =    0   ! = 0/1/2 flag for damping in the mixed layer
-   REAL(wp) ::   rn_surf_tr =   50.  ! surface time scale for internal damping        [days]
-   REAL(wp) ::   rn_bot_tr  =  360.  ! bottom time scale for internal damping         [days]
-   REAL(wp) ::   rn_dep_tr  =  800.  ! depth of transition between rn_surf and rn_bot [meters]
-   INTEGER  ::   nn_file_tr =    2   ! = 1 create a damping.coeff NetCDF file 
-
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1)
+
+   INTEGER, PARAMETER           ::   npncts   = 5        ! number of closed sea
+   INTEGER, DIMENSION(npncts)   ::   nctsi1, nctsj1      ! south-west closed sea limits (i,j)
+   INTEGER, DIMENSION(npncts)   ::   nctsi2, nctsj2      ! north-east closed sea limits (i,j)
 
    !! * Substitutions
@@ -86,8 +81,9 @@
       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
       !!
-      INTEGER  ::   ji, jj, jk, jn       ! dummy loop indices
+      INTEGER  ::   ji, jj, jk, jn, jl       ! dummy loop indices
       REAL(wp) ::   ztra                 ! temporary scalars
       CHARACTER (len=22) :: charout
       REAL(wp), POINTER, DIMENSION(:,:,:) ::   ztrtrd
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 4D  workspace
       !!----------------------------------------------------------------------
       !
@@ -99,63 +95,68 @@
 
       IF( l_trdtrc )   CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )   ! temporary save of trends
-
-      ! 1. Newtonian damping trends on tracer fields
-      ! --------------------------------------------
-      ! Initialize the input fields for newtonian damping
-      CALL trc_dta( kt )
-      !                                                          ! ===========
-      DO jn = 1, jptra                                           ! tracer loop
-         !                                                       ! ===========
-         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends 
-
-         IF( lutini(jn) ) THEN
+      !
+      IF( nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping
+         !
+         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )    ! Memory allocation
+         CALL trc_dta( kt, ztrcdta )   ! read tracer data at nit000
+         !                                                          ! ===========
+         DO jn = 1, jptra                                           ! tracer loop
+            !                                                       ! ===========
+            IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)    ! save trends 
             !
-            SELECT CASE ( nn_zdmp_trc )
-            !
-            CASE( 0 )                !==  newtonian damping throughout the water column  ==!
-               DO jk = 1, jpkm1
-                  DO jj = 2, jpjm1
-                     DO ji = fs_2, fs_jpim1   ! vector opt.
-                        ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) )
-                        tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
+            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
+               
+               jl = n_trc_index(jn) 
+
+               SELECT CASE ( nn_zdmp_tr )
+               !
+               CASE( 0 )                !==  newtonian damping throughout the water column  ==!
+                  DO jk = 1, jpkm1
+                     DO jj = 2, jpjm1
+                        DO ji = fs_2, fs_jpim1   ! vector opt.
+                           ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) )
+                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
+                        END DO
                      END DO
                   END DO
-               END DO
-            !
-            CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==!
-               DO jk = 1, jpkm1
-                  DO jj = 2, jpjm1
-                     DO ji = fs_2, fs_jpim1   ! vector opt.
-                        IF( avt(ji,jj,jk) <= 5.e-4 )  THEN 
-                           ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) )
-                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
-                        ENDIF
+               !
+               CASE ( 1 )                !==  no damping in the turbocline (avt > 5 cm2/s)  ==!
+                  DO jk = 1, jpkm1
+                     DO jj = 2, jpjm1
+                        DO ji = fs_2, fs_jpim1   ! vector opt.
+                           IF( avt(ji,jj,jk) <= 5.e-4 )  THEN 
+                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) )
+                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
+                           ENDIF
+                        END DO
                      END DO
                   END DO
-               END DO
-            !
-            CASE ( 2 )               !==  no damping in the mixed layer   ==! 
-               DO jk = 1, jpkm1
-                  DO jj = 2, jpjm1
-                     DO ji = fs_2, fs_jpim1   ! vector opt.
-                        IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN
-                           ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) )
-                           tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
-                        END IF
+               !
+               CASE ( 2 )               !==  no damping in the mixed layer   ==! 
+                  DO jk = 1, jpkm1
+                     DO jj = 2, jpjm1
+                        DO ji = fs_2, fs_jpim1   ! vector opt.
+                           IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN
+                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk,jl) - trb(ji,jj,jk,jn) )
+                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra
+                           END IF
+                        END DO
                      END DO
                   END DO
-               END DO
-            !  
-            END SELECT
-            ! 
-         ENDIF
-         !
-         IF( l_trdtrc ) THEN
-            ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:)
-            CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd )
-         END IF
-         !                                                       ! ===========
-      END DO                                                     ! tracer loop
-      !                                                          ! ===========
+               !  
+               END SELECT
+               ! 
+            ENDIF
+            !
+            IF( l_trdtrc ) THEN
+               ztrtrd(:,:,:) = tra(:,:,:,jn) -  ztrtrd(:,:,:)
+               CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd )
+            END IF
+            !                                                       ! ===========
+         END DO                                                     ! tracer loop
+         !                                                          ! ===========
+         CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
+      ENDIF
+      !
       IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
       !                                          ! print mean trends (used for debugging)
@@ -168,4 +169,125 @@
       !
    END SUBROUTINE trc_dmp
+
+   SUBROUTINE trc_dmp_clo( kt )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE trc_dmp_clo  ***
+      !!
+      !! ** Purpose :   Closed sea domain initialization
+      !!
+      !! ** Method  :   if a closed sea is located only in a model grid point
+      !!                we restore to initial data
+      !!
+      !! ** Action  :   nctsi1(), nctsj1() : south-west closed sea limits (i,j)
+      !!                nctsi2(), nctsj2() : north-east Closed sea limits (i,j)
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
+      !
+      INTEGER :: ji, jj, jk, jn, jl, jc                     ! dummy loop indicesa
+      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta     ! 4D  workspace
+
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         ! initial values
+         nctsi1(:) = 1  ;  nctsi2(:) = 1
+         nctsj1(:) = 1  ;  nctsj2(:) = 1
+
+         ! set the closed seas (in data domain indices)
+         ! -------------------
+
+         IF( cp_cfg == "orca" ) THEN
+            !
+            SELECT CASE ( jp_cfg )
+            !                                           ! =======================
+            CASE ( 2 )                                  !  ORCA_R2 configuration
+               !                                        ! =======================
+               !                                            ! Caspian Sea
+               nctsi1(1)   =  11  ;  nctsj1(1)   = 103
+               nctsi2(1)   =  17  ;  nctsj2(1)   = 112
+               !                                            ! Great North American Lakes
+               nctsi1(2)   =  97  ;  nctsj1(2)   = 107
+               nctsi2(2)   = 103  ;  nctsj2(2)   = 111
+               !                                            ! Black Sea 1 : west part of the Black Sea
+               nctsi1(3)   = 174  ;  nctsj1(3)   = 107
+               nctsi2(3)   = 181  ;  nctsj2(3)   = 112
+              !                                            ! Black Sea 2 : est part of the Black Sea
+               nctsi1(4)   =   2  ;  nctsj1(4)   = 107
+               nctsi2(4)   =   6  ;  nctsj2(4)   = 112
+               !                                            ! Baltic Sea
+               nctsi1(5)   =  145 ;  nctsj1(5)   = 116
+               nctsi2(5)   =  150 ;  nctsj2(5)   = 126
+               !                                        ! =======================
+            CASE ( 4 )                                  !  ORCA_R4 configuration
+               !                                        ! =======================
+               !                                            ! Caspian Sea
+               nctsi1(1)   =  4  ;  nctsj1(1)   = 53
+               nctsi2(1)   =  4  ;  nctsj2(1)   = 56
+               !                                            ! Great North American Lakes
+               nctsi1(2)   = 49  ;  nctsj1(2)   = 55
+               nctsi2(2)   = 51  ;  nctsj2(2)   = 56
+               !                                            ! Black Sea
+               nctsi1(3)   = 88  ;  nctsj1(3)   = 55
+               nctsi2(3)   = 91  ;  nctsj2(3)   = 56
+               !                                            ! Baltic Sea
+               nctsi1(4)   = 75  ;  nctsj1(4)   = 59
+               nctsi2(4)   = 76  ;  nctsj2(4)   = 61
+               !                                        ! =======================
+            CASE ( 025 )                                ! ORCA_R025 configuration
+               !                                        ! =======================
+                                                     ! Caspian + Aral sea
+               nctsi1(1)   = 1330 ; nctsj1(1)   = 645
+               nctsi2(1)   = 1400 ; nctsj2(1)   = 795
+               !                                        ! Azov Sea
+               nctsi1(2)   = 1284 ; nctsj1(2)   = 722
+               nctsi2(2)   = 1304 ; nctsj2(2)   = 747
+               !
+            END SELECT
+            !
+         ENDIF
+         !
+
+         ! convert the position in local domain indices
+         ! --------------------------------------------
+         DO jc = 1, npncts
+            nctsi1(jc)   = mi0( nctsi1(jc) )
+            nctsj1(jc)   = mj0( nctsj1(jc) )
+
+            nctsi2(jc)   = mi1( nctsi2(jc) )
+            nctsj2(jc)   = mj1( nctsj2(jc) )
+         END DO
+         !
+      ENDIF
+
+      ! Restore close seas values to initial data
+      IF( ln_trcdta .AND. nb_trcdta > 0 )  THEN   ! Initialisation of tracer from a file that may also be used for damping
+         !
+         IF(lwp)  WRITE(numout,*)
+         IF(lwp)  WRITE(numout,*) ' trc_dmp_clo : Restoring of nutrients on close seas at time-step kt = ', kt
+         IF(lwp)  WRITE(numout,*)
+         !
+         CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )   ! Memory allocation
+         !
+         CALL trc_dta( kt , ztrcdta )   ! read tracer data at nittrc000
+         !
+         DO jn = 1, jptra
+            IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file
+                jl = n_trc_index(jn)
+                DO jc = 1, npncts
+                   DO jk = 1, jpkm1
+                      DO jj = nctsj1(jc), nctsj2(jc)
+                         DO ji = nctsi1(jc), nctsi2(jc)
+                            trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk)
+                            trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn)
+                         ENDDO
+                      ENDDO
+                   ENDDO
+                ENDDO
+             ENDIF
+          ENDDO
+          CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta )
+      ENDIF
+      !
+   END SUBROUTINE trc_dmp_clo
 
 
@@ -199,8 +321,5 @@
       END SELECT
 
-      IF( .NOT. lk_dtatrc )   &
-         &   CALL ctl_stop( 'no passive tracer data define key_dtatrc' )
-
-      IF( .NOT. lk_tradmp )   &
+      IF( .NOT. ln_tradmp )   &
          &   CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' )
       !
@@ -214,9 +333,9 @@
       !
    END SUBROUTINE trc_dmp_init
+
 #else
    !!----------------------------------------------------------------------
-   !!   Default key                                     NO internal damping
-   !!----------------------------------------------------------------------
-   LOGICAL , PUBLIC, PARAMETER ::   lk_trcdmp = .FALSE.    !: internal damping flag
+   !!  Dummy module :                                     No passive tracer
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE trc_dmp( kt )        ! Empty routine
@@ -225,4 +344,6 @@
    END SUBROUTINE trc_dmp
 #endif
+
+
    !!======================================================================
 END MODULE trcdmp
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90	(revision 4276)
@@ -13,5 +13,6 @@
    !!   trc_nam_trp  : read the passive tracer namelist for transport
    !!----------------------------------------------------------------------
-   USE trc                 ! ocean passive tracers variables
+   USE oce_trc              ! shared ocean passive tracers variables
+   USE trc                 ! passive tracers variables
    USE in_out_manager      ! ocean dynamics and active tracers variables
 
@@ -48,6 +49,4 @@
    INTEGER , PUBLIC ::   nn_trczdf_exp = 3             !: number of sub-time step (explicit time stepping)
 
-
-#if defined key_trcdmp
    !                                                 !!: ** newtonian damping namelist (nam_trcdmp) **
    INTEGER , PUBLIC ::   nn_hdmp_tr      =   -1       ! = 0/-1/'latitude' for damping over passive tracer
@@ -57,5 +56,4 @@
    REAL(wp), PUBLIC ::   rn_dep_tr       =  800.      ! depth of transition between rn_surf and rn_bot [meters]
    INTEGER , PUBLIC ::   nn_file_tr      =    2       ! = 1 create a damping.coeff NetCDF file 
-#endif
 
    !!----------------------------------------------------------------------
@@ -82,8 +80,6 @@
       NAMELIST/namtrc_zdf/ ln_trczdf_exp  , nn_trczdf_exp
       NAMELIST/namtrc_rad/ ln_trcrad
-#if defined key_trcdmp
-      NAMELIST/namtrc_dmp/ ln_trcdmp, nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, &
+      NAMELIST/namtrc_dmp/ nn_hdmp_tr, nn_zdmp_tr, rn_surf_tr, &
         &                  rn_bot_tr , rn_dep_tr , nn_file_tr
-#endif
       !!----------------------------------------------------------------------
 
@@ -148,8 +144,7 @@
 
 
-# if defined key_trcdmp
       REWIND ( numnat )                  ! Read Namelist namtra_dmp : temperature and salinity damping term
       READ   ( numnat, namtrc_dmp )
-      IF( lzoom )   nn_zdmp_trc = 0           ! restoring to climatology at closed north or south boundaries
+      IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries
 
       IF(lwp) THEN                       ! Namelist print
@@ -158,5 +153,4 @@
          WRITE(numout,*) '~~~~~~~'
          WRITE(numout,*) '   Namelist namtrc_dmp : set damping parameter'
-         WRITE(numout,*) '      add a damping term or not      ln_trcdmp = ', ln_trcdmp
          WRITE(numout,*) '      tracer damping option          nn_hdmp_tr = ', nn_hdmp_tr
          WRITE(numout,*) '      mixed layer damping option     nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)'
@@ -166,5 +160,4 @@
          WRITE(numout,*) '      create a damping.coeff file    nn_file_tr = ', nn_file_tr
       ENDIF
-#endif
       !
    END SUBROUTINE trc_nam_trp
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 4276)
@@ -66,5 +66,6 @@
                                 CALL trc_sbc( kstp )            ! surface boundary condition
          IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme
-         IF( lk_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
+         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
+         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
                                 CALL trc_adv( kstp )            ! horizontal & vertical advection 
                                 CALL trc_ldf( kstp )            ! lateral mixing
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 4276)
@@ -99,5 +99,5 @@
    USE sbc_oce , ONLY :   emp        =>    emp        !: freshwater budget: volume flux               [Kg/m2/s]
    USE sbc_oce , ONLY :   emp_b      =>    emp_b      !: freshwater budget: volume flux               [Kg/m2/s]
-   USE sbc_oce , ONLY :   sfx        =>    sfx        !: downward salt flux                          [PSU/m2/s]
+   USE sbc_oce , ONLY :   fmmflx     =>    fmmflx     !: freshwater budget: volume flux               [Kg/m2/s]
    USE sbc_oce , ONLY :   rnf        =>    rnf        !: river runoff   [Kg/m2/s]
    USE sbc_oce , ONLY :   ln_dm2dc   =>    ln_dm2dc   !: Daily mean to Diurnal Cycle short wave (qsr) 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 4276)
@@ -26,5 +26,4 @@
    INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read )
    INTEGER, PUBLIC                                                 ::   numrtw        !: logical unit for trc restart ( write )
-   LOGICAL, PUBLIC                                                 ::   ln_top_euler  !: boolean term for euler integration in the first timestep
 
    !! passive tracers fields (before,now,after)
@@ -53,6 +52,8 @@
    CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_out  !: suffix of pass. tracer restart name (output)
    REAL(wp)            , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::  rdttrc         !: vertical profile of passive tracer time step
+   LOGICAL             , PUBLIC                                    ::  ln_top_euler  !: boolean term for euler integration 
    LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files
    LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag
+   LOGICAL             , PUBLIC                                    ::  ln_trcdmp_clo  !: internal damping flag on closed seas
    INTEGER             , PUBLIC                                    ::  nittrc000       !: first time step of passive tracers model
 
@@ -140,5 +141,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fr_i_tm    !: average ice fraction     [m/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_tm     !: freshwater budget: volume flux [Kg/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sfx_tm     !: downward salt flux [PSU/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fmmflx_tm  !: freshwater budget: freezing/melting [Kg/m2/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_b_hold !: hold emp from the beginning of each sub-stepping[m]  
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_tm     !: solar radiation average [m]
@@ -180,5 +181,5 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_temp, qsr_temp, fr_i_temp,wndm_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, sfx_temp, emp_b_temp
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, fmmflx_temp, emp_b_temp
    !
 #if defined key_trabbl
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 4276)
@@ -254,6 +254,6 @@
             ENDDO
          ENDIF
-         !
-         IF( .NOT.ln_trcdmp ) THEN                   !==   deallocate data structure   ==! 
+         
+         IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !==   deallocate data structure   ==! 
             !                                              (data used only for initialisation)
             IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only use to initialize the run'
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 4276)
@@ -59,6 +59,6 @@
       !!
       NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, &
-         &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, ln_trcdmp, &
-         &             ln_top_euler
+         &             cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta, &
+         &             ln_trcdmp, ln_trcdmp_clo, ln_top_euler
 #if defined key_trdmld_trc  || defined key_trdtrc
       NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &
@@ -92,6 +92,7 @@
          sn_tracer(jn)%llsave  = .TRUE.
       END DO
-      ln_trcdta = .FALSE.
-      ln_trcdmp = .FALSE.
+      ln_trcdta     = .FALSE.
+      ln_trcdmp     = .FALSE.
+      ln_trcdmp_clo = .FALSE.
 
 
@@ -121,4 +122,5 @@
          WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta
          WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp
+         WRITE(numout,*) '   Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo
          WRITE(numout,*) '   Use euler integration for TRC (y/n)          ln_top_euler  = ', ln_top_euler
          WRITE(numout,*) ' '
@@ -181,14 +183,7 @@
 
 
-      IF( ln_trcdmp .AND. .NOT.ln_trcdta ) THEN
-         CALL ctl_warn( 'trc_nam: passive tracer damping requires data from files we set ln_trcdta to TRUE' )
-         ln_trcdta = .TRUE.
-      ENDIF
-      !
-      IF( ln_rsttr .AND. .NOT.ln_trcdmp .AND. ln_trcdta ) THEN
-          CALL ctl_warn( 'trc_nam: passive tracer restart and  data intialisation, ',   &
-             &           'we keep the restart values and set ln_trcdta to FALSE' )
-         ln_trcdta = .FALSE.
-      ENDIF
+      IF( ln_rsttr )                      ln_trcdta = .FALSE.   ! restart : no need of clim data
+      !
+      IF( ln_trcdmp .OR. ln_trcdmp_clo )  ln_trcdta = .TRUE.   ! damping : need to have clim data
       !
       IF( .NOT.ln_trcdta ) THEN
@@ -199,12 +194,16 @@
          IF( ln_rsttr ) THEN
             WRITE(numout,*)
-            WRITE(numout,*) '    read a restart file for passive tracer : ', TRIM( cn_trcrst_in )
-            WRITE(numout,*)
-         ELSE
-            IF( .NOT.ln_trcdta ) THEN
-                WRITE(numout,*)
-                WRITE(numout,*) '  All the passive tracers are initialised with constant values '
-                WRITE(numout,*)
-            ENDIF
+            WRITE(numout,*) '  Read a restart file for passive tracer : ', TRIM( cn_trcrst_in )
+            WRITE(numout,*)
+         ENDIF
+         IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '  Some of the passive tracers are initialised from climatologies '
+            WRITE(numout,*)
+         ENDIF
+         IF( .NOT.ln_trcdta ) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '  All the passive tracers are initialised with constant values '
+            WRITE(numout,*)
          ENDIF
       ENDIF
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 4276)
@@ -123,5 +123,5 @@
           fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:)
           emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:) 
-          sfx_tm   (:,:)         = sfx_tm   (:,:)         + sfx   (:,:)
+          fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:)
           qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:)
           wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:)
@@ -211,5 +211,5 @@
          emp_temp   (:,:)        = emp   (:,:)
          emp_b_temp (:,:)        = emp_b (:,:)
-         sfx_temp   (:,:)        = sfx   (:,:)
+         fmmflx_temp(:,:)        = fmmflx(:,:)
          qsr_temp   (:,:)        = qsr   (:,:)
          wndm_temp  (:,:)        = wndm  (:,:)
@@ -315,5 +315,5 @@
          fr_i_tm  (:,:)          = fr_i_tm    (:,:)       + fr_i  (:,:)
          emp_tm   (:,:)          = emp_tm     (:,:)       + emp   (:,:) 
-         sfx_tm   (:,:)          = sfx_tm     (:,:)       + sfx   (:,:)
+         fmmflx_tm(:,:)          = fmmflx_tm  (:,:)       + fmmflx(:,:)
          qsr_tm   (:,:)          = qsr_tm     (:,:)       + qsr   (:,:)
          wndm_tm  (:,:)          = wndm_tm    (:,:)       + wndm  (:,:)
@@ -334,5 +334,5 @@
             qsr   (:,:)          = qsr_tm     (:,:) * r1_ndttrc 
             emp   (:,:)          = emp_tm     (:,:) * r1_ndttrc 
-            sfx   (:,:)          = sfx_tm     (:,:) * r1_ndttrc 
+            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrc 
             fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrc
 # if defined key_trabbl
@@ -350,5 +350,5 @@
             qsr   (:,:)          = qsr_tm     (:,:) * r1_ndttrcp1 
             emp   (:,:)          = emp_tm     (:,:) * r1_ndttrcp1 
-            sfx   (:,:)          = sfx_tm     (:,:) * r1_ndttrcp1 
+            fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrcp1 
             fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrcp1 
 # if defined key_trabbl
@@ -500,5 +500,5 @@
          CALL lbc_lnk( emp   (:,:)         , 'T', 1. ) 
          CALL lbc_lnk( emp_b (:,:)         , 'T', 1. ) 
-         CALL lbc_lnk( sfx   (:,:)         , 'T', 1. ) 
+         CALL lbc_lnk( fmmflx(:,:)         , 'T', 1. ) 
          CALL lbc_lnk( qsr   (:,:)         , 'T', 1. ) 
          CALL lbc_lnk( wndm  (:,:)         , 'T', 1. ) 
@@ -600,5 +600,5 @@
       fr_i_tm(:,:) = 0._wp
       emp_tm (:,:) = 0._wp
-      sfx_tm(:,:)  = 0._wp
+      fmmflx_tm(:,:)  = 0._wp
       qsr_tm (:,:) = 0._wp
       wndm_tm(:,:) = 0._wp
@@ -707,5 +707,5 @@
       fr_i  (:,:)     =  fr_i_temp  (:,:)
       emp   (:,:)     =  emp_temp   (:,:)
-      sfx   (:,:)     =  sfx_temp   (:,:)
+      fmmflx(:,:)     =  fmmflx_temp(:,:)
       emp_b (:,:)     =  emp_b_temp (:,:)
       qsr   (:,:)     =  qsr_temp   (:,:)
@@ -826,5 +826,5 @@
       fr_i_tm    (:,:) = fr_i  (:,:)
       emp_tm     (:,:) = emp   (:,:)
-      sfx_tm     (:,:) = sfx   (:,:)
+      fmmflx_tm  (:,:) = fmmflx(:,:)
       qsr_tm     (:,:) = qsr   (:,:)
       wndm_tm    (:,:) = wndm  (:,:)
@@ -1055,5 +1055,5 @@
          &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,     &
          &      tsn_temp(jpi,jpj,jpk,2)     ,  emp_b_temp(jpi,jpj),      &
-         &      emp_temp(jpi,jpj)           ,  sfx_temp(jpi,jpj)  ,      &
+         &      emp_temp(jpi,jpj)           ,  fmmflx_temp(jpi,jpj),     &
          &      hmld_temp(jpi,jpj)          ,  qsr_temp(jpi,jpj) ,       &
          &      fr_i_temp(jpi,jpj)          ,  fr_i_tm(jpi,jpj) ,        &
@@ -1103,5 +1103,5 @@
          &      sshv_n_tm(jpi,jpj)          ,  sshv_b_hold(jpi,jpj),     &
          &      tsn_tm(jpi,jpj,jpk,2)       ,                            &
-         &      emp_tm(jpi,jpj)             ,  sfx_tm(jpi,jpj)  ,        &
+         &      emp_tm(jpi,jpj)             ,  fmmflx_tm(jpi,jpj)  ,     &
          &      emp_b_hold(jpi,jpj)         ,                            &
          &      hmld_tm(jpi,jpj)            ,  qsr_tm(jpi,jpj) ,         &
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/SETTE/iodef_sette.xml
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/SETTE/iodef_sette.xml	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/SETTE/iodef_sette.xml	(revision 4276)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".FALSE."/> <!-- 1h files -->
@@ -54,9 +54,10 @@
     
    <axis_definition>  
-      <axis id="deptht" long_name="Vertical T levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthu" long_name="Vertical U levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthv" long_name="Vertical V levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthw" long_name="Vertical W levels" unit="m"  /><!-- positive=".FALSE." -->
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh	(revision 4276)
@@ -40,5 +40,5 @@
 # ::
 #
-#  $ ./Fcheck_archfile.sh ARCHFILE COMPILER
+#  $ ./Fcheck_archfile.sh ARCHFILE CPPFILE COMPILER
 #
 #
@@ -59,23 +59,139 @@
 #
 #-
+cpeval () 
+{
+    cat > $2 << EOF
 
-if [ ${#2} -eq 0 ]; then
-   if [ ! -f ${COMPIL_DIR}/$1 ]; then
-   echo "Warning !!!"
-   echo "NO compiler chosen"
-   echo "Try makenemo -h for help"
-   echo "EXITING..."
-   exit 1 
-   fi
+#==========================================================
+#    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?
+if [ "$2" != "nocpp" ] 
+then
+    use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_iomput )
 else
-   myfile=$( find ${MAIN_DIR}/ARCH -name arch-${2}.fcm -print )
-   if [ ${#myfile} -gt 0 ]; then
-      ln -sf  ${myfile} ${COMPIL_DIR}/$1
-   else
-      echo "Warning !!!"
-      echo "Compiler not existing"
-      echo "Try makenemo -h for help"
-      echo "EXITING..."
-      exit 1       
-   fi   
+    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
+
+#- 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
+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: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Flist_archfile.sh
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Flist_archfile.sh	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/COMPILE/Flist_archfile.sh	(revision 4276)
@@ -61,5 +61,5 @@
 
 echo "Available compilers for -m option :"
-for file in  $(ls ${MAIN_DIR}/ARCH | grep fcm )
+for file in  $(ls ${MAIN_DIR}/ARCH | grep "fcm$" )
 do
 zvar1=${file#arch-}
@@ -71,8 +71,8 @@
 
 if [ "$1" == "all" ]; then
-   for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v fcm )
+   for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" )
    do 
       echo "Available compilers at ${dir} :"
-      for file in  $(ls ${MAIN_DIR}/ARCH/${dir} | grep  fcm )
+      for file in  $(ls ${MAIN_DIR}/ARCH/${dir} | grep "fcm$" )
       do
       zvar1=${file#arch-}
@@ -84,5 +84,5 @@
 elif [ -d ${MAIN_DIR}/ARCH/${1} ]; then
       echo "Available compilers at $1 :"
-      for file in  $(ls ${MAIN_DIR}/ARCH/$1 | grep fcm )
+      for file in  $(ls ${MAIN_DIR}/ARCH/$1 | grep "fcm$" )
       do
       zvar1=${file#arch-}
@@ -93,5 +93,5 @@
 else
       echo "Available consortium member sub-directories :"
-      for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v fcm )
+      for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v "fcm$" )
       do
          echo ${dir}
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4276)
@@ -35,7 +35,7 @@
 	    echo ' --insrc              only print all variable definitions found in the source code'
 	    echo 'Examples'
-	    echo '      chk_iomput.sh'
-	    echo '      chk_iomput.sh --help'
-	    echo '      chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"'
+	    echo '      ./chk_iomput.sh'
+	    echo '      ./chk_iomput.sh --help'
+	    echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"'
 	    echo
 	    exit ;;
@@ -59,5 +59,13 @@
 #------------------------------------------------
 #
-[ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfile
+external=$( grep -c "<field_definition  *\([^ ].* \)*src=" $xmlfile )
+if [ $external -eq 1 ]
+then
+    xmlfield_def=$( grep "<field_definition  *\([^ ].* \)*src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' )
+    xmlfield_def=$( dirname $xmlfile )/$xmlfield_def   
+else
+    xmlfield_def=$xmlfile
+fi
+[ $inxml -eq 1 ] && grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def
 [ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \;
 [ $(( $insrc + $inxml )) -ge 1 ] && exit
@@ -71,17 +79,25 @@
 # list of variables used in "CALL iom_put"
 #
-varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | sort -d )
+badvarsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -ic iom_put )
+if [ $badvarsrc -ne 0 ]
+then
+    echo "The following call to iom_put cannot be checked"
+    echo
+    find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -i iom_put | sort -d 
+    echo
+fi
+varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -vi iom_put | sort -d )
 #
 # list of variables defined in the xml file
 #
-varlistxml=$( grep "< *field * id *=" $xmlfile  | sed -e "s/^.*< *field * id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistxml=$( grep "< *field  *\([^ ].* \)*id *=" $xmlfield_def  | sed -e "s/^.*< *field .*id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 # list of variables to be outputed in the xml file
 #
-varlistout=$( grep "< *field * ref *=" $xmlfile  | sed -e "s/^.*< *field * ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistout=$( grep "< *field  *\([^ ].* \)*field_ref *=" $xmlfile  | sed -e "s/^.*< *field .*field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 echo "--------------------------------------------------"
 echo  check if all iom_put found in $srcdir
-echo  have a corresponding variable definition in $xmlfile
+echo  have a corresponding variable definition in $xmlfield_def
 echo "--------------------------------------------------"
 for var in $varlistsrc
@@ -90,5 +106,5 @@
     if [ $tst -ne 1 ] 
     then
-	echo "problem with $var: $tst lines corresponding to its definition in $xmlfile, but defined in the code in"
+	echo "problem with $var: $tst lines corresponding to its definition in $xmlfield_def, but defined in the code in"
 	for f in $srclist
 	do
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/maketools
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/maketools	(revision 4275)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/TOOLS/maketools	(revision 4276)
@@ -146,5 +146,5 @@
 
 #- When used for the first time, choose a compiler ---
-. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm ${CMP_NAM} || exit
+. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm nocpp ${CMP_NAM} || exit
 
 #- Choose a default tool if needed ---
