Index: trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make	(revision 1136)
@@ -0,0 +1,105 @@
+# $Header: /home/opalod/NEMOCVSROOT/CONFIG/ORCA2_LIM/AA_make,v 1.4 2005/03/23 10:07:37 opalod Exp $
+all: ioipsl $(RUN)
+
+ioipsl:
+#-Q- sx8brodie	(cd ../../modeles/IOIPSL/src; sxgmake;)
+#-Q- aix	(cd ../../modeles/IOIPSL/src; gmake;)
+
+$(filter-out mpi omp, $(RUN)): omp
+#-Q- aix	../../util/ins_make -t ax_mono -w $(NEMOLIB)/WORK
+	gmake -C WORK COMP=$@ clean > $(NEMOLIB)_logbook_$@.txt
+	gmake -C WORK COMP=$@ >> $(NEMOLIB)_logbook_$@.txt
+
+	cp ../../bin/opa_$(NEMOLIB)_$@  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/opa_$(NEMOLIB)_$@
+ifneq ($(JOB),nojob)
+	cp ../VALID/2INSTALL/JOBS/job_$(NEMOLIB).ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/job_$(NEMOLIB).ksh
+	cp -p ../VALID/2INSTALL/JOBS/lance_batch.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/lance_batch.ksh
+	cp -p ../VALID/2INSTALL/JOBS/assessment.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/assessment.ksh
+	cp -p ../VALID/2INSTALL/JOBS/cron_jobs.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/cron_jobs.ksh
+	cp -p  specifs.txt $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/specifs.txt
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/jhd_sx8brodie_mon  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_sx8brodie_mon
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/CPU_time_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/MEM_size_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/BIO_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_sx8brodie.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/jhd_ax_mono_mon  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_ax_mono_mon
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/CPU_time_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_aix.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/MEM_size_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_aix.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/BIO_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_aix.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/jhd_osxxlf_mon  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_osxxlf_mon
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/CPU_time_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_osxxlf.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/MEM_size_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_osxxlf.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/BIO_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_osxxlf.ksh
+	( cd $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/ ; ./lance_batch.ksh $(NEMOLIB) $(MKTE) $(JOB) $(RTG) ; )
+endif
+
+omp: mpi
+ifeq ($(filter omp,$(RUN)),omp)
+	gmake -C WORK COMP=$@ clean > $(NEMOLIB)_logbook_$@.txt
+	gmake -C WORK COMP=$@ >> $(NEMOLIB)_logbook_$@.txt
+
+	cp ../../bin/opa_$(NEMOLIB)_$@  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/opa_$(NEMOLIB)_$@
+ifneq ($(JOB),nojob)
+	cp ../VALID/2INSTALL/JOBS/job_$(NEMOLIB).ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/job_$(NEMOLIB).ksh
+	cp -p ../VALID/2INSTALL/JOBS/lance_batch.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/lance_batch.ksh
+	cp -p ../VALID/2INSTALL/JOBS/assessment.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/assessment.ksh
+	cp -p ../VALID/2INSTALL/JOBS/cron_jobs.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/cron_jobs.ksh
+	cp -p  specifs.txt $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/specifs.txt
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/jhd_sx8brodie_omp  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_sx8brodie_omp
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/CPU_time_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/MEM_size_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/BIO_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_sx8brodie.ksh
+	( cd $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/ ; ./lance_batch.ksh $(NEMOLIB) $(MKTE) $(JOB) $(RTG) ; )
+endif
+
+else
+	@echo 'No omp compilation'
+endif
+
+mpi: memo
+ifeq ($(filter mpi,$(RUN)),mpi)
+#-Q- aix	../../util/ins_make -t aix -w $(NEMOLIB)/WORK
+	cp ./MY_SRC/par_oce.F90_keep ./MY_SRC/par_oce.F90 
+	gmake -C WORK COMP=$@ clean > $(NEMOLIB)_logbook_$@.txt
+	gmake -C WORK COMP=$@ >> $(NEMOLIB)_logbook_$@.txt
+	rm -f ./MY_SRC/par_oce.F90
+
+	cp ../../bin/opa_$(NEMOLIB)_$@  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/opa_$(NEMOLIB)_$@
+ifneq ($(JOB),nojob)
+	cp ../VALID/2INSTALL/JOBS/job_$(NEMOLIB).ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/job_$(NEMOLIB).ksh
+	cp -p ../VALID/2INSTALL/JOBS/lance_batch.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/lance_batch.ksh
+	cp -p ../VALID/2INSTALL/JOBS/assessment.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/assessment.ksh
+	cp -p ../VALID/2INSTALL/JOBS/cron_jobs.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/cron_jobs.ksh
+	cp -p  specifs.txt $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/specifs.txt
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/jhd_sx8brodie_mpi  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_sx8brodie_mpi
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/CPU_time_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/MEM_size_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_sx8brodie.ksh
+#-Q- sx8brodie	cp ../VALID/2INSTALL/JOBS/BIO_sx8brodie.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_sx8brodie.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/jhd_aix_mpi  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_aix_mpi
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/CPU_time_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_aix.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/MEM_size_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_aix.ksh
+#-Q- aix	cp ../VALID/2INSTALL/JOBS/BIO_aix.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_aix.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/jhd_osxxlf_mpi  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/jhd_osxxlf_mpi
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/CPU_time_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/CPU_time_osxxlf.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/MEM_size_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/MEM_size_osxxlf.ksh
+#-Q- osxxlf	cp ../VALID/2INSTALL/JOBS/BIO_osxxlf.ksh  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/BIO_osxxlf.ksh
+	( cd $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/$@/ ; ./lance_batch.ksh $(NEMOLIB) $(MKTE) $(JOB) $(RTG) ; )
+endif
+
+else
+	@echo 'No mpi compilation'
+endif
+
+clean:
+	(cd ../../config/$(NEMOLIB)/WORK;  gmake clean ;)
+
+memo:
+#-Q- aix	../../util/ins_make -t ax_mono -w $(NEMOLIB)/WORK
+ifeq ($(MKMO),memo)
+	gmake -C WORK COMP=$@ clean > $(NEMOLIB)_logbook_$@.txt
+	gmake -C WORK COMP=$@ >> $(NEMOLIB)_logbook_$@.txt
+
+	cp ../../bin/opa_$(NEMOLIB)_$@  $(WWDIR)/NEMO_VALID/W$(NEMOLIB)/opa_$(NEMOLIB)_$@
+else
+	@echo 'No memory check'
+endif
+
Index: trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make.ldef
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make.ldef	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/AA_make.ldef	(revision 1136)
@@ -0,0 +1,18 @@
+#---------------------------------------------------------------------
+#- Creation des elements relatifs a ORCA :
+#-      ORCA  (lib, executable : opa)
+#---------------------------------------------------------------------
+SHELL = /bin/sh
+#---------------------------------------------------------------------
+LIBDIR = ../../../../lib
+BINDIR = ../../../../bin
+MODDIR = $(LIBDIR)
+NEMOLIB := $(shell awk '{ print $$1 }' ./WORK/.config)
+RUN=
+JOB=
+RTG=
+MKTE=
+MKMO=
+WWDIR=/Users/ctlod/WORK/AZE/modipsl/config
+#---------------------------------------------------------------------
+#-
Index: trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE	(revision 1136)
@@ -0,0 +1,54 @@
+#---------------------------------------------------------------------
+#- NEMO SYSTEM : Ocean model (BB_make.ldef in scripts)
+#---------------------------------------------------------------------
+SHELL = /bin/sh
+#-
+#-Q- t3e     #--- Please use gmake instead of make
+#-Q- fjvpp   #--- Please use gmake instead of make
+
+#-
+#- Define the libraries ---
+LIBDIR = ../../../lib
+MODDIR = $(LIBDIR)
+NEMOLIB := $(shell awk '{ print $$1 }' .config)
+COMP=
+MODEL_LIB = $(LIBDIR)/oce_$(NEMOLIB)/$(COMP)
+IOIPSL_LIB = $(LIBDIR)/libioipsl.a
+#-Q- sxnec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sx6nec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sxdkrz  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+AGRIF_LIB = $(LIBDIR)/libagrif.a
+#-Q- sxnec  AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sx6nec AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sxdkrc AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+SXMODEL_LIB = $(MODEL_LIB)
+#-Q- sxnec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sx6nec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sxdkrz  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+OASISMPI2_LIB = 
+LIBMPI  =
+LIBMP   =
+EXEC_BIN = ../../../bin/opa_$(NEMOLIB)_$(COMP)
+NBPRC = 6
+
+#-
+#- Key options for GYRE ocean configuration: Analytical forcing ---
+#  Keys have to be written on one single line (does NOT accept "\")
+
+P_P = key_zco key_gyre key_dynspg_flt key_ldfslp key_zdftke key_vectopt_loop key_vectopt_memory   
+
+#-
+#- Prefix for preprocessing ---
+#-Q- sxnec  prefix = -D
+#-Q- sx6nec prefix = -D
+#-Q- sx8brodie prefix = -D
+#-Q- eshpux prefix = -D
+#-Q- sxdkrz prefix = -D
+#-Q- linux  prefix = -D
+#-Q- lxiv7  prefix = -D
+#-Q- lxiv8  prefix = -D
+#-Q- g95    prefix = -D
+#-Q- aix    prefix = -WF,-D
+#-Q- ax_mono    prefix = -WF,-D
+#-Q- osxxlf prefix = -WF,-D
+
Index: trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE_LOBSTER
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE_LOBSTER	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_GYRE_LOBSTER	(revision 1136)
@@ -0,0 +1,54 @@
+#---------------------------------------------------------------------
+#- NEMO SYSTEM : Ocean model (BB_make.ldef in scripts)
+#---------------------------------------------------------------------
+SHELL = /bin/sh
+#-
+#-Q- t3e     #--- Please use gmake instead of make
+#-Q- fjvpp   #--- Please use gmake instead of make
+
+#-
+#- Define the libraries ---
+LIBDIR = ../../../lib
+MODDIR = $(LIBDIR)
+NEMOLIB := $(shell awk '{ print $$1 }' .config)
+COMP=
+MODEL_LIB = $(LIBDIR)/oce_$(NEMOLIB)/$(COMP)
+IOIPSL_LIB = $(LIBDIR)/libioipsl.a
+#-Q- sxnec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sx6nec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sxdkrz  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+AGRIF_LIB = $(LIBDIR)/libagrif.a
+#-Q- sxnec  AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sx6nec AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sxdkrc AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+SXMODEL_LIB = $(MODEL_LIB)
+#-Q- sxnec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sx6nec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sxdkrz  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+OASISMPI2_LIB = 
+LIBMPI  =
+LIBMP   =
+EXEC_BIN = ../../../bin/opa_$(NEMOLIB)_$(COMP)
+NBPRC = 6
+
+#-
+#- Key options for GYRE+LOBSTER configuration: Analytical forcing ---
+#  Keys have to be written on one single line (does NOT accept "\")
+
+P_P = key_zco key_gyre key_dynspg_flt key_ldfslp key_zdftke key_vectopt_loop key_vectopt_memory key_top key_lobster key_trc_diaadd key_trc_dia3d
+
+#-
+#- Prefix for preprocessing ---
+#-Q- sxnec  prefix = -D
+#-Q- sx6nec prefix = -D
+#-Q- sx8brodie prefix = -D
+#-Q- eshpux prefix = -D
+#-Q- sxdkrz prefix = -D
+#-Q- linux  prefix = -D
+#-Q- lxiv7  prefix = -D
+#-Q- lxiv8  prefix = -D
+#-Q- g95    prefix = -D
+#-Q- aix    prefix = -WF,-D
+#-Q- ax_mono    prefix = -WF,-D
+#-Q- osxxlf prefix = -WF,-D
+
Index: trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ORCA2_LIM
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ORCA2_LIM	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ORCA2_LIM	(revision 1136)
@@ -0,0 +1,54 @@
+#----------------------------------------------------------------------
+#- NEMO SYSTEM : Ocean model + Sea Ice Model   (BB_make.ldef in scripts)
+#----------------------------------------------------------------------
+SHELL = /bin/sh
+#-
+#-Q- t3e     #--- Please use gmake instead of make
+#-Q- fjvpp   #--- Please use gmake instead of make
+
+#-
+#- Define the libraries ---
+LIBDIR = ../../../lib
+NEMOLIB := $(shell awk '{ print $$1 }' .config)
+COMP=
+MODDIR = $(LIBDIR)
+MODEL_LIB = $(LIBDIR)/oce_$(NEMOLIB)/$(COMP)
+IOIPSL_LIB = $(LIBDIR)/libioipsl.a
+#-Q- sxnec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sx6nec IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sxdkrz IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+AGRIF_LIB = $(LIBDIR)/libagrif.a
+#-Q- sxnec  AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sx6nec AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sxdkrc AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+SXMODEL_LIB = $(MODEL_LIB)
+#-Q- sxnec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sx6nec SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sxdkrz SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+OASISMPI2_LIB = 
+LIBMPI  =
+LIBMP   =
+EXEC_BIN = ../../../bin/opa_$(NEMOLIB)_$(COMP)
+NBPRC = 6
+
+#-
+#- Key options for OPA ocean model + LIM sea ice model : ORCA_R2 - FORCED (CLIO)
+#  Keys have to be written on one single line (does NOT accept "\")
+
+P_P = key_trabbl_dif key_vectopt_loop key_vectopt_memory key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_dtatem key_dtasal key_trabbc key_zdftke key_zdfddm
+
+#-
+#- Prefix for preprocessing ---
+#-Q- sxnec  prefix = -D
+#-Q- sx6nec prefix = -D
+#-Q- sx8brodie prefix = -D
+#-Q- eshpux prefix = -D
+#-Q- sxdkrz prefix = -D
+#-Q- linux  prefix = -D
+#-Q- lxiv7  prefix = -D
+#-Q- lxiv8  prefix = -D
+#-Q- g95    prefix = -D
+#-Q- aix    prefix = -WF,-D
+#-Q- ax_mono    prefix = -WF,-D
+#-Q- osxxlf prefix = -WF,-D
+
Index: trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ZAGRIF
===================================================================
--- trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ZAGRIF	(revision 1136)
+++ trunk/HEAD/2INSTALL/CONFIG_FILES/BB_make.ldef_ZAGRIF	(revision 1136)
@@ -0,0 +1,54 @@
+#----------------------------------------------------------------------
+#- NEMO SYSTEM : Ocean model + Sea Ice Model   (BB_make.ldef in scripts)
+#----------------------------------------------------------------------
+SHELL = /bin/sh
+#-
+#-Q- t3e     #--- Please use gmake instead of make
+#-Q- fjvpp   #--- Please use gmake instead of make
+
+#-
+#- Define the libraries ---
+LIBDIR = ../../../lib
+NEMOLIB := $(shell awk '{ print $$1 }' .config)
+COMP=
+MODDIR = $(LIBDIR)
+MODEL_LIB = $(LIBDIR)/oce_$(NEMOLIB)/$(COMP)
+IOIPSL_LIB = $(LIBDIR)/libioipsl.a
+#-Q- sxnec  IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sx6nec IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+#-Q- sxdkrz IOIPSL_LIB = $(LIBDIR)/libsxioipsl.a
+AGRIF_LIB = $(LIBDIR)/libagrif.a
+#-Q- sxnec  AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sx6nec AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+#-Q- sxdkrc AGRIF_LIB = $(LIBDIR)/libsxagrif.a
+SXMODEL_LIB = $(MODEL_LIB)
+#-Q- sxnec  SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sx6nec SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+#-Q- sxdkrz SXMODEL_LIB = $(LIBDIR)/oce/libsxopa.a
+OASISMPI2_LIB = 
+LIBMPI  =
+LIBMP   =
+EXEC_BIN = ../../../bin/opa_$(NEMOLIB)_$(COMP)
+NBPRC = 1
+
+#-
+#- Key options for OPA ocean model + LIM sea ice model : ORCA_R2 - FORCED (CLIO)
+#  Keys have to be written on one single line (does NOT accept "\")
+
+P_P = key_trabbl_dif key_vectopt_loop key_vectopt_memory key_orca_r2 key_lim2 key_dynspg_flt key_diaeiv key_ldfslp key_traldf_c2d key_traldf_eiv key_dynldf_c3d key_dtatem key_dtasal key_trabbc key_zdftke key_zdfddm key_agrif
+
+#-
+#- Prefix for preprocessing ---
+#-Q- sxnec  prefix = -D
+#-Q- sx6nec prefix = -D
+#-Q- sx8brodie prefix = -D
+#-Q- eshpux prefix = -D
+#-Q- sxdkrz prefix = -D
+#-Q- linux  prefix = -D
+#-Q- lxiv7  prefix = -D
+#-Q- lxiv8  prefix = -D
+#-Q- g95    prefix = -D
+#-Q- aix    prefix = -WF,-D
+#-Q- ax_mono    prefix = -WF,-D
+#-Q- osxxlf prefix = -WF,-D
+
Index: trunk/HEAD/2INSTALL/JOBS/BIO_aix.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/BIO_aix.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/BIO_aix.ksh	(revision 1136)
@@ -0,0 +1,55 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 2
+#     - zfile1 : first tracer statistic file to output
+#     - zfile2 : second tracer statistic file to output
+#
+# WORK: It aims to :
+#
+#      - Extract tracers statistics from ocean.output 
+#        for mon, mpi & omp runs
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Initialization
+zfile1=
+zfile2=
+
+# Get arguments
+while getopts a:b:c: opt
+do
+  case "$opt" in
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zfile3="$OPTARG";;
+  esac
+done
+
+zfile[0]=${zfile1}
+zfile[1]=${zfile2}
+zfilein=${zfile3}
+
+ind=0
+
+while [ ${ind} -le 1 ] ; do
+
+       zpath=$( ( dirname ${zfile[${ind}]} ) )
+
+       awk '/----TRACER STAT----/ { print $0 }' ${zpath}/${zfilein} > ${zfile[${ind}]}
+       awk '/MEAN NO   1  DET/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   2  ZOO/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   3  PHY/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   4  NO3/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   5  NH4/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   6  DOM/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+
+       let ind=${ind}+1
+done
Index: trunk/HEAD/2INSTALL/JOBS/BIO_osxxlf.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/BIO_osxxlf.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/BIO_osxxlf.ksh	(revision 1136)
@@ -0,0 +1,55 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 2
+#     - zfile1 : first tracer statistic file to output
+#     - zfile2 : second tracer statistic file to output
+#
+# WORK: It aims to :
+#
+#      - Extract tracers statistics from ocean.output 
+#        for mon, mpi & omp runs
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Initialization
+zfile1=
+zfile2=
+
+# Get arguments
+while getopts a:b:c: opt
+do
+  case "$opt" in
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zfile3="$OPTARG";;
+  esac
+done
+
+zfile[0]=${zfile1}
+zfile[1]=${zfile2}
+zfilein=${zfile3}
+
+ind=0
+
+while [ ${ind} -le 1 ] ; do
+
+       zpath=$( ( dirname ${zfile[${ind}]} ) )
+
+       awk '/----TRACER STAT----/ { print $0 }' ${zpath}/${zfilein} > ${zfile[${ind}]}
+       awk '/MEAN NO   1  DET/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   2  ZOO/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   3  PHY/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   4  NO3/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   5  NH4/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   6  DOM/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+
+       let ind=${ind}+1
+done
Index: trunk/HEAD/2INSTALL/JOBS/BIO_sx8brodie.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/BIO_sx8brodie.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/BIO_sx8brodie.ksh	(revision 1136)
@@ -0,0 +1,55 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 2
+#     - zfile1 : first tracer statistic file to output
+#     - zfile2 : second tracer statistic file to output
+#
+# WORK: It aims to :
+#
+#      - Extract tracers statistics from ocean.output 
+#        for mon, mpi & omp runs
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Initialization
+zfile1=
+zfile2=
+
+# Get arguments
+while getopts a:b:c: opt
+do
+  case "$opt" in
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zfile3="$OPTARG";;
+  esac
+done
+
+zfile[0]=${zfile1}
+zfile[1]=${zfile2}
+zfilein=${zfile3}
+
+ind=0
+
+while [ ${ind} -le 1 ] ; do
+
+       zpath=$( ( dirname ${zfile[${ind}]} ) )
+
+       awk '/----TRACER STAT----/ { print $0 }' ${zpath}/${zfilein} > ${zfile[${ind}]}
+       awk '/MEAN NO   1  DET/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   2  ZOO/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   3  PHY/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   4  NO3/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   5  NH4/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+       awk '/MEAN NO   6  DOM/ { print $3, $4, $7, $8, $9, $10, $11, $12 }' ${zpath}/${zfilein} >> ${zfile[${ind}]}
+
+       let ind=${ind}+1
+done
Index: trunk/HEAD/2INSTALL/JOBS/CPU_time_aix.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/CPU_time_aix.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/CPU_time_aix.ksh	(revision 1136)
@@ -0,0 +1,173 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zrunt  : run type to treat
+#     - zfile1 : mon run timing input file name
+#     - zfile2 : mpi run timing input file name
+#     - zconf  : configuration name
+#     - zout   : output file name
+#     - ztag   : tag name to which are compared files
+#     - zxis   : (0/1) reference timing files (do/do not) exist
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the aix target for 
+#        mon & mpi run 
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-r] [-a] [-b] [-c] [-o] [-t] [-x]"
+  echo "Options: These are optional argument"
+  echo " -r : run type to treat"
+  echo " -a : current version timing input file name"
+  echo " -b : reference version timing input file name"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " -x : (0/1) reference timing files (do/do not) exist"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zrunt=
+zfile1=
+zfile2=
+zconf=
+zout=
+ztag=
+zxis=1
+
+# Get arguments
+while getopts r:a:b:c:o:t:x: opt
+do
+  case "$opt" in
+    r) zrunt="$OPTARG";;
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    x) zxis="$OPTARG";;
+    *) help_CPU_time;;
+  esac
+done
+
+# Check if results must be compare to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+case "${zrunt}" in
+
+     'mon' )
+
+           # OUTPUT TIMING OF THE MON RUN
+           ##############################
+           
+           if [ ${evaltag} -a ${zxis} == 0 ] ; then
+               # Get values from the reference tag
+               zreal=$( (awk '/wall clock time/           {print $6}' ${zfile2} ) )
+               zuser=$( (awk '/Total amount of time in u/ {print $9}' ${zfile2} ) )
+               zmemo=$( (awk '/Maximum resident set size/ {print $6/1024}' ${zfile2} ) )
+               zuzra=$( (awk '/Utilization rate/          {print $4}' ${zfile2} ) )
+               zcoin=$( (awk '/Computation intensity/     {print $4}' ${zfile2} ) )
+               # Print: Variable long name | current version values | reference version values | variations
+               echo "                                                 Current version     ${ztag} version       Variation " >> ${zout}
+               echo "                                                                 " >> ${zout}
+               awk '/wall clock time/            { creal=$6      ; printf("%-6s %.33s %8s %12.2f    | %12.2f      |     %7.2f % \n", " ", $0, "(sec) :"    , $6  , invar, ((creal-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '/Total amount of time in u/  { cuser=$9      ; printf("%-6s %.34s %7s %12.2f    | %12.2f      |     %7.2f % \n", " ", $0, "(sec) :"    , $9  , invar, ((cuser-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '/Maximum resident set size/  { cmflo=$6/1024 ; printf("%-6s %.26s %15s %12.2f    | %12.2f      |     %7.2f % \n", " ", $0, "(Mo) :"     ,cmflo, invar, ((cmflo-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout}
+               awk '/Utilization rate/           { cuzra=$4      ; printf("%-5s %.24s %18s %12.2f    | %12.2f      |     %7.2f % \n", " ", $0, "~100% (%) :", $4  , invar, ((cuzra-invar)/invar)*100 ) }' invar=${zuzra} ${zfile1} >> ${zout}
+               awk '/Computation intensity/      { ccoin=$4      ; printf("%-5s %.23s %19s %12.2f    | %12.2f      |     %7.2f % \n", " ", $0, "> 1  :"     , $4  , invar, ((ccoin-invar)/invar)*100 ) }' invar=${zcoin} ${zfile1} >> ${zout} 
+           else
+               # Print: Variable long name | current version values
+               echo "                                                 Current version " >> ${zout}
+               echo "                                                                 " >> ${zout}
+               awk '/wall clock time/            {printf("%-6s %.33s %8s %9.2f \n", " ", $0, "(sec) :"    , $6      ) }' ${zfile1} >> ${zout}
+               awk '/Total amount of time in u/  {printf("%-6s %.34s %7s %9.2f \n", " ", $0, "(sec) :"    , $9      ) }' ${zfile1} >> ${zout}
+               awk '/Maximum resident set size/  {printf("%-6s %.26s %15s %9.2f \n", " ", $0, "(Mo) :"     , $6/1024) }' ${zfile1} >> ${zout}
+               awk '/Utilization rate/           {printf("%-5s %.24s %18s %9.2f \n", " ", $0, "~100% (%) :", $4     ) }' ${zfile1} >> ${zout}
+               awk '/Computation intensity/      {printf("%-5s %.23s %19s %9.2f \n", " ", $0, "> 1  :"     , $4     ) }' ${zfile1} >> ${zout} 
+           fi 
+
+           ;;
+
+     'mpi' )
+           
+           # OUTPUT TIMING OF THE MPI RUN
+           ##############################
+           
+           if [ ${evaltag} -a ${zxis} == 0 ] ; then
+               # Get values from the reference tag
+               awk '/wall clock time/           {print}' ${zfile2} > temp1
+               awk '/Maximum resident set size/ {print}' ${zfile2} > temp2
+               awk '/Utilization rate/          {print}' ${zfile2} > temp3
+               awk '/Computation intensity/     {print}' ${zfile2} > temp4 
+           
+               zreal=$( (awk '/wall clock time/           {cum += $6} END {printf("%f", cum/NR) }'        temp1 ) )
+               zuser=$( (awk '/Total amount of time in u/ {cum += $9} END {printf("%f", cum )   }'        ${zfile2}) )
+               zmemo=$( (awk '/Maximum resident set size/ {cum += $6} END {printf("%f", cum/(1024*NR)) }' temp2 ) )
+               zuzra=$( (awk '/Utilization rate/          {cum += $4} END {printf("%f", cum/NR) }'        temp3 ) )
+               zcoin=$( (awk '/Computation intensity/     {cum += $4} END {printf("%f", cum/NR) }'        temp4 ) )
+           
+               # Get values from the current version
+               awk '/wall clock time/           {print}' ${zfile1} > temp1
+               awk '/Maximum resident set size/ {print}' ${zfile1} > temp2
+               awk '/Utilization rate/          {print}' ${zfile1} > temp3
+               awk '/Computation intensity/     {print}' ${zfile1} > temp4 
+           
+               echo "                                                 Current version     ${ztag} version       Variation " >> ${zout}
+               echo "                                                                                                     " >> ${zout}
+               awk '/wall clock time/           {cum += $6} END {printf("%-7s %-39s %1s %11.2f    |     %12.2f   |     %7.2f %\n" , " ", "Execution time (wall clock time)  (sec)", ":", cum/NR       , invar, ((cum/NR-invar)/invar)*100  ) }' invar=${zreal} temp1     >> ${zout}
+               awk '/Total amount of time in u/ {cum += $9} END {printf("%-7s %-39s %1s %11.2f    |     %12.2f   |     %7.2f %\n" , " ", "Total amount of time in user mode (sec)", ":", cum          , invar, ((cum-invar)/invar)*100  ) }'    invar=${zuser} ${zfile1} >> ${zout}
+               awk '/Maximum resident set size/ {cum += $6} END {printf("%-7s %-25s %15s %12.2f   |     %12.2f   |     %7.2f %\n", " ", "Maximum resident set size", "(Mo)  :"        , cum/(1024*NR), invar, ((cum/(1024*NR)-invar)/invar)*100  ) }'  invar=${zmemo} temp2     >> ${zout}
+               awk '/Utilization rate/          {cum += $4} END {printf("%-7s %-16s %24s %12.2f   |     %12.2f   |     %7.2f %\n", " ", "Utilization rate", "(%)   :"                 , cum/NR       , invar, ((cum/NR-invar)/invar)*100  ) }' invar=${zuzra} temp3     >> ${zout}
+               awk '/Computation intensity/     {cum += $4} END {printf("%-7s %-21s %19s %12.2f   |     %12.2f   |     %7.2f %\n", " ", "Computation intensity", ":"                  , cum/NR       , invar, ((cum/NR-invar)/invar)*100  ) }' invar=${zcoin} temp4     >> ${zout}
+           
+               echo "                                                                                                     " >> ${zout}
+           
+               \rm temp*
+           
+           else
+               # Get values from the current version
+               awk '/wall clock time/           {print}' ${zfile1} > temp1
+               awk '/Maximum resident set size/ {print}' ${zfile1} > temp2
+               awk '/Utilization rate/          {print}' ${zfile1} > temp3
+               awk '/Computation intensity/     {print}' ${zfile1} > temp4 
+           
+               echo "                                                 Current version " >> ${zout}
+               echo "                                                                 " >> ${zout}
+               awk '/wall clock time/           {cum += $6} END {printf("%-7s %-39s %1s %9.2f\n" , " ", "Execution time (wall clock time)  (sec)", ":", cum/NR ) }' temp1     >> ${zout}
+               awk '/Total amount of time in u/ {cum += $9} END {printf("%-7s %-39s %1s %9.2f\n" , " ", "Total amount of time in user mode (sec)", ":", cum ) }'    ${zfile1} >> ${zout}
+               awk '/Maximum resident set size/ {cum += $6} END {printf("%-7s %-25s %15s %9.2f\n", " ", "Maximum resident set size", "(Mo)  :", cum/(1024*NR) ) }'  temp2     >> ${zout}
+               awk '/Utilization rate/          {cum += $4} END {printf("%-7s %-16s %24s %9.2f\n", " ", "Utilization rate", "(%)   :", cum/NR ) }'                  temp3     >> ${zout}
+               awk '/Computation intensity/     {cum += $4} END {printf("%-7s %-21s %19s %9.2f\n", " ", "Computation intensity", ":", cum/NR ) }'                   temp4     >> ${zout}
+           
+               echo "                                                                                                     " >> ${zout}
+           
+               \rm temp*
+           fi
+
+           ;;
+esac
Index: trunk/HEAD/2INSTALL/JOBS/CPU_time_osxxlf.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/CPU_time_osxxlf.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/CPU_time_osxxlf.ksh	(revision 1136)
@@ -0,0 +1,182 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zfile1 : mon run timing input file name
+#     - zfile2 : mpi run timing input file name
+#     - zconf  : configuration name
+#     - zout   : output file name
+#     - ztag   : tag name to which are compared files
+#     - zxis   : (0/1) reference timing files (do/do not) exist
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the sx8brodie target for 
+#        mon, mpi & omp runs
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-r] [-a] [-b] [-c] [-o] [-t] [-x]"
+  echo "Options: These are optional argument"
+  echo " -r : run type to treat"
+  echo " -a : current version timing input file name"
+  echo " -b : reference version timing input file name"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " -x : (0/1) reference timing files (do/do not) exist"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zrunt=
+zfile1=
+zfile2=
+zconf=
+zout=
+ztag=
+zxis=1
+
+# Get arguments
+while getopts r:a:b:c:o:t:x: opt
+do
+  case "$opt" in
+    r) zrunt="$OPTARG";;
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    x) zxis="$OPTARG";;
+    *) help_CPU_time;;
+  esac
+done
+
+# Check if results must be compare to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+case "${zrunt}" in
+
+     'mon' )
+
+           # OUTPUT TIMING OF THE MON/OMP RUN
+           ###################################
+           
+           if [ ${evaltag} == 0 -a ${zxis} == 0 ] ; then
+               # Get values from the reference tag
+               zreal=$( (awk '/Real/        {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '/User/        {print $NF}' ${zfile2} ) )
+               zmflo=$( (awk '/MFLOPS/ && ! /concurrent/      {print $NF}' ${zfile2} ) )
+               [ ${zrunt} = 'omp' ] && zmfli=$( (awk '/MFLOPS/ &&   /concurrent/      {print $NF}' ${zfile2} ) )
+               [ ${zrunt} = 'omp' ] && zmprc=$( (awk '/Max Concurrent Proc/           {print $NF}' ${zfile2} ) )
+               zvlen=$( (awk '/VLEN/        {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '/Memory Size/ {print $NF}' ${zfile2} ) )
+               # Print: Variable long name | current version values | reference version values | variations
+               echo "                                Current version    ${ztag} version    Variation " >> ${zout}
+               awk '/Real/         { creal=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((creal-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '/User/         { cuser=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cuser-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '/MFLOPS/ && ! /concurrent/      { cmflo=$3 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmflo-invar)/invar)*100 ) }' invar=${zmflo} ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/MFLOPS/ &&   /concurrent/      { cmfli=$4 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmfli-invar)/invar)*100 ) }' invar=${zmfli} ${zfile1} >> ${zout}
+               awk '/VLEN/         { cvlen=$3 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cvlen-invar)/invar)*100 ) }' invar=${zvlen} ${zfile1} >> ${zout}
+               awk '/Memory Size/  { cmemo=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmemo-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout} 
+               [ ${zrunt} = 'omp' ] && awk '/Max Concurrent Proc/  { cmprc=$5 ; printf("%-5s %.25s  %10i      | %10i    |   %7i \n", " ", $0, $NF, invar, (cmprc-invar) ) }' invar=${zmprc} ${zfile1} >> ${zout} 
+           else
+               # Print: Variable long name | current version values
+               echo "                                 Current version " >> ${zout}
+               awk '/Real/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/User/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/MFLOPS/ && ! /concurrent/     {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/MFLOPS/ &&   /concurrent/     {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/VLEN/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/Memory Size/ {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/Max Concurrent Proc/  { cmprc=$5 ; printf("%-5s %.25s  %10i\n", " ", $0, $NF ) }' ${zfile1} >> ${zout} 
+           fi 
+
+           ;;
+
+     'mpi' )
+           # OUTPUT TIMING OF THE MPI RUN
+           ##############################
+           
+           if [ ${evaltag} == 0 -a ${zxis} == 0 ] ; then
+               # Get reference tag information
+               # Syntax: 1) search pattern between // symbol, 2) print text of the last column (identified by $NF)
+               zreal=$( (awk '( /\[/ && /\]/ ) && /Real/                           {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '( /\[/ && /\]/ ) && /User/                           {print $NF}' ${zfile2} ) )
+               zmflo=$( (awk '( /\[/ && /\]/ ) && /MFLOPS/                         {print $NF}' ${zfile2} ) )
+               zvlen=$( (awk '( /\[/ && /\]/ ) && /Average Vector Length/          {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '( /\[/ && /\]/ ) && ! /Global/ && /Memory size used/ {print $NF}' ${zfile2} ) )
+           
+               # Print: Variable long name | current version values | reference version values | variations
+               # Syntax: 1) search pattern between // symbol, 2) print text & values following a format (printf) explicited between "" symbol
+               awk '/Global Data/ { printf( "        %.29s  Current version   %s version      Variation \n", $0, tag) }' tag=${ztag} ${zfile1} >> ${zout}
+               awk '/==========================/ { printf("        %s \n", $0) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Real/                  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /User/                  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /MFLOPS/                { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmflo} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Average Vector Length/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zvlen} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Memory size used/ && !/Global/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout}
+               echo " " >> ${zout} 
+           
+               # Get reference tag information (Overall data)
+               # Syntax: 1) search pattern between // symbol, 2) print text of the last column (identified by $NF)
+               zreal=$( (awk '!( /\[/ && /\]/ ) && /Real/                           {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/                {print $NF}' ${zfile2} ) )
+               zgflo=$( (awk '!( /\[/ && /\]/ ) && /GFLOPS/                         {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '!( /\[/ && /\]/ ) && ! /Global/ && /Memory size used/ {print $NF}' ${zfile2} ) )
+           
+               # Print: Variable long name | current version values 
+               # Syntax: 1) search pattern between // symbol, 2) print text & values following a format (printf) explicited between "" symbol
+               awk '/Overall Data/ { printf( "        %-28s  Current version   %s version       Variation \n", $0, tag) }' tag=${ztag} ${zfile1} >> ${zout}
+               echo "        =============" >> ${zout} 
+               awk '!( /\[/ && /\]/ ) && /Real/             { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /GFLOPS/           { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zgflo} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /Memory size used/ && !/Global/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout}
+               echo " " >> ${zout} 
+           
+           else
+           
+               # Print: Variable long name | current version values 
+               awk '/Global Data/ { printf( "        %.29s   Current version\n ", $0) }' ${zfile1} >> ${zout}
+               awk '/==========================/ { printf("%-7s %-.26s \n", " ", $0) } ' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Real/                  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /User/                  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /MFLOPS/                { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Average Vector Length/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Memory size used/ && ! /Global/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile2} >> ${zout}
+               echo " " >> ${zout} 
+           
+               # Print: Variable long name | current version values (Overall data)
+               awk '/Overall Data/ { printf( "        %-28s   Current version\n ", $0 ) }' ${zfile1} >> ${zout}
+               echo "        =============" >> ${zout} 
+               awk '!( /\[/ && /\]/ ) && /Real/             { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /GFLOPS/           { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /Memory size used/  && ! /Global/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               echo "" >> ${zout} 
+           fi
+           ;;
+esac
Index: trunk/HEAD/2INSTALL/JOBS/CPU_time_sx8brodie.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/CPU_time_sx8brodie.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/CPU_time_sx8brodie.ksh	(revision 1136)
@@ -0,0 +1,182 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zfile1 : mon run timing input file name
+#     - zfile2 : mpi run timing input file name
+#     - zconf  : configuration name
+#     - zout   : output file name
+#     - ztag   : tag name to which are compared files
+#     - zxis   : (0/1) reference timing files (do/do not) exist
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the sx8brodie target for 
+#        mon, mpi & omp runs
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-r] [-a] [-b] [-c] [-o] [-t] [-x]"
+  echo "Options: These are optional argument"
+  echo " -r : run type to treat"
+  echo " -a : current version timing input file name"
+  echo " -b : reference version timing input file name"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " -x : (0/1) reference timing files (do/do not) exist"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zrunt=
+zfile1=
+zfile2=
+zconf=
+zout=
+ztag=
+zxis=1
+
+# Get arguments
+while getopts r:a:b:c:o:t:x: opt
+do
+  case "$opt" in
+    r) zrunt="$OPTARG";;
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    x) zxis="$OPTARG";;
+    *) help_CPU_time;;
+  esac
+done
+
+# Check if results must be compare to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+case "${zrunt}" in
+
+     'mon' | 'omp' )
+
+           # OUTPUT TIMING OF THE MON/OMP RUN
+           ###################################
+           
+           if [ ${evaltag} == 0 -a ${zxis} == 0 ] ; then
+               # Get values from the reference tag
+               zreal=$( (awk '/Real/        {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '/User/        {print $NF}' ${zfile2} ) )
+               zmflo=$( (awk '/MFLOPS/ && ! /concurrent/      {print $NF}' ${zfile2} ) )
+               [ ${zrunt} = 'omp' ] && zmfli=$( (awk '/MFLOPS/ &&   /concurrent/      {print $NF}' ${zfile2} ) )
+               [ ${zrunt} = 'omp' ] && zmprc=$( (awk '/Max Concurrent Proc/           {print $NF}' ${zfile2} ) )
+               zvlen=$( (awk '/VLEN/        {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '/Memory Size/ {print $NF}' ${zfile2} ) )
+               # Print: Variable long name | current version values | reference version values | variations
+               echo "                                Current version    ${ztag} version    Variation " >> ${zout}
+               awk '/Real/         { creal=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((creal-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '/User/         { cuser=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cuser-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '/MFLOPS/ && ! /concurrent/      { cmflo=$3 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmflo-invar)/invar)*100 ) }' invar=${zmflo} ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/MFLOPS/ &&   /concurrent/      { cmfli=$4 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmfli-invar)/invar)*100 ) }' invar=${zmfli} ${zfile1} >> ${zout}
+               awk '/VLEN/         { cvlen=$3 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cvlen-invar)/invar)*100 ) }' invar=${zvlen} ${zfile1} >> ${zout}
+               awk '/Memory Size/  { cmemo=$5 ; printf("%-5s %.25s  %10.2f      | %10.2f    |   %7.2f % \n", " ", $0, $NF, invar, ((cmemo-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout} 
+               [ ${zrunt} = 'omp' ] && awk '/Max Concurrent Proc/  { cmprc=$5 ; printf("%-5s %.25s  %10i      | %10i    |   %7i \n", " ", $0, $NF, invar, (cmprc-invar) ) }' invar=${zmprc} ${zfile1} >> ${zout} 
+           else
+               # Print: Variable long name | current version values
+               echo "                                 Current version " >> ${zout}
+               awk '/Real/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/User/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/MFLOPS/ && ! /concurrent/     {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/MFLOPS/ &&   /concurrent/     {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/VLEN/        {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               awk '/Memory Size/ {printf("%-5s %.25s  %10.2f\n", " ", $0, $NF ) }' ${zfile1} >> ${zout}
+               [ ${zrunt} = 'omp' ] && awk '/Max Concurrent Proc/  { cmprc=$5 ; printf("%-5s %.25s  %10i\n", " ", $0, $NF ) }' ${zfile1} >> ${zout} 
+           fi 
+
+           ;;
+
+     'mpi' )
+           # OUTPUT TIMING OF THE MPI RUN
+           ##############################
+           
+           if [ ${evaltag} == 0 -a ${zxis} == 0 ] ; then
+               # Get reference tag information
+               # Syntax: 1) search pattern between // symbol, 2) print text of the last column (identified by $NF)
+               zreal=$( (awk '( /\[/ && /\]/ ) && /Real/                           {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '( /\[/ && /\]/ ) && /User/                           {print $NF}' ${zfile2} ) )
+               zmflo=$( (awk '( /\[/ && /\]/ ) && /MFLOPS/                         {print $NF}' ${zfile2} ) )
+               zvlen=$( (awk '( /\[/ && /\]/ ) && /Average Vector Length/          {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '( /\[/ && /\]/ ) && ! /Global/ && /Memory size used/ {print $NF}' ${zfile2} ) )
+           
+               # Print: Variable long name | current version values | reference version values | variations
+               # Syntax: 1) search pattern between // symbol, 2) print text & values following a format (printf) explicited between "" symbol
+               awk '/Global Data/ { printf( "        %.29s  Current version   %s version      Variation \n", $0, tag) }' tag=${ztag} ${zfile1} >> ${zout}
+               awk '/==========================/ { printf("        %s \n", $0) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Real/                  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /User/                  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /MFLOPS/                { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmflo} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Average Vector Length/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zvlen} ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Memory size used/ && !/Global/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout}
+               echo " " >> ${zout} 
+           
+               # Get reference tag information (Overall data)
+               # Syntax: 1) search pattern between // symbol, 2) print text of the last column (identified by $NF)
+               zreal=$( (awk '!( /\[/ && /\]/ ) && /Real/                           {print $NF}' ${zfile2} ) )
+               zuser=$( (awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/                {print $NF}' ${zfile2} ) )
+               zgflo=$( (awk '!( /\[/ && /\]/ ) && /GFLOPS/                         {print $NF}' ${zfile2} ) )
+               zmemo=$( (awk '!( /\[/ && /\]/ ) && ! /Global/ && /Memory size used/ {print $NF}' ${zfile2} ) )
+           
+               # Print: Variable long name | current version values 
+               # Syntax: 1) search pattern between // symbol, 2) print text & values following a format (printf) explicited between "" symbol
+               awk '/Overall Data/ { printf( "        %-28s  Current version   %s version       Variation \n", $0, tag) }' tag=${ztag} ${zfile1} >> ${zout}
+               echo "        =============" >> ${zout} 
+               awk '!( /\[/ && /\]/ ) && /Real/             { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zreal} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/  { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zuser} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /GFLOPS/           { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zgflo} ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /Memory size used/ && !/Global/ { printf( "%-7s %.29s  %10.2f     |   %10.2f    |    %7.2f %\n", " ", $0 , $NF, invar, (($NF-invar)/invar)*100 ) }' invar=${zmemo} ${zfile1} >> ${zout}
+               echo " " >> ${zout} 
+           
+           else
+           
+               # Print: Variable long name | current version values 
+               awk '/Global Data/ { printf( "        %.29s   Current version\n ", $0) }' ${zfile1} >> ${zout}
+               awk '/==========================/ { printf("%-7s %-.26s \n", " ", $0) } ' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Real/                  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /User/                  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /MFLOPS/                { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Average Vector Length/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile1} >> ${zout}
+               awk '( /\[/ && /\]/ ) && /Memory size used/ && ! /Global/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF) }' ${zfile2} >> ${zout}
+               echo " " >> ${zout} 
+           
+               # Print: Variable long name | current version values (Overall data)
+               awk '/Overall Data/ { printf( "        %-28s   Current version\n ", $0 ) }' ${zfile1} >> ${zout}
+               echo "        =============" >> ${zout} 
+               awk '!( /\[/ && /\]/ ) && /Real/             { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && ! /OPS/ && /User/  { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /GFLOPS/           { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               awk '!( /\[/ && /\]/ ) && /Memory size used/  && ! /Global/ { printf( "%-7s %.29s  %10.2f \n", " ", $0 , $NF ) }' ${zfile1} >> ${zout}
+               echo "" >> ${zout} 
+           fi
+           ;;
+esac
Index: trunk/HEAD/2INSTALL/JOBS/MEM_size_aix.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/MEM_size_aix.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/MEM_size_aix.ksh	(revision 1136)
@@ -0,0 +1,101 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zxcm   : (0/1) mon${zconf}_err file (do/do not) exist"
+#     - zxrs   : (0/1) Ref memory_size.txt file (do/do not) exist"
+#     - zxrm   : (0/1) Ref mon${zconf}_err file (do/do not) exist"
+#     - zconf  : configuration name"
+#     - zout   : output file name"
+#     - ztag   : tag name to which are compared files"
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the sx8brodie target for 
+#        mon, mpi & omp runs
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-a] [-b] [-d] [-c] [-o] [-t]"
+  echo "Options: These are optional argument"
+  echo " -a : (0/1) mon${zconf}_err file (do/do not) exist"
+  echo " -b : (0/1) Ref memory_size.txt file (do/do not) exist"
+  echo " -d : (0/1) Ref mon${zconf}_err file (do/do not) exist"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zxcm=1
+zxrs=1
+zxrm=1
+zconf=
+zout=
+ztag=
+
+# Get arguments
+while getopts a:b:d:c:o:t: opt
+do
+  case "$opt" in
+    a) zxcm="$OPTARG";;
+    b) zxrs="$OPTARG";;
+    d) zxrm="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    *) help_MEM_size;;
+  esac
+done
+
+# Check if results must be compared to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+zfilecs='mon/LONG/memory_size.txt' ;  zfilers='mon/LONG/REF/memory_size.txt'
+zfilecm="mon/LONG/mon${zconf}_err"  ;  zfilerm="mon/LONG/REF/mon${zconf}_err"
+
+# If reference version files exist
+if [ ${evaltag} == 0 -a ${zxrm} == 0 ] ;  then
+    # Get values from the reference tag
+    Mo_stack_ms=$( (awk '/Stack/ {print $NF/(1024*1024) }' ${zfilers} ) )
+    Mo_stati_ms=$( (awk '/Stati/ {print $NF/(1024*1024) }' ${zfilers} ) )
+    if [ ${zxcm} == 0 ] ; then Mo_max_used=$( (awk '/resident/ {print $6/1024}' ${zfilerm} ) ) ; fi
+
+    # Print: Variable long name | current version values | reference version values | variations
+    echo "                                                 " >> ${zout}
+    echo "                                      Version    " >> ${zout}
+    echo "             Memory          Current /       \ ${ztag}        Variation " >> ${zout}
+    awk ' /Stack/ { val=$NF/(1024*1024) } END {printf("%-9s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Stack     (Mo) :", val, inck, ((val-inck)/inck)*100 ) }' inck=${Mo_stack_ms} ${zfilecs} >> ${zout}
+    awk ' /Stati/ { val=$NF/(1024*1024) } END {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Static    (Mo) :", val, inti, ((val-inti)/inti)*100 ) }' inti=${Mo_stati_ms} ${zfilecs} >> ${zout}
+    if [ ${zxcm} == 0 ] ; then awk ' /resident/ { val=$6/1024 } END {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Max. used (Mo) :", val, inus, ((val-inus)/inus)*100 ) }' inus=${Mo_max_used} ${zfilecm} >> ${zout} ; fi
+else
+    # Print: Variable long name | current version values
+    echo "                                                 " >> ${zout}
+    echo "             Memory          Current version "     >> ${zout}
+    awk ' /Stack/  {printf("%-9s %-.16s %11.1f\n ", " ", "Stack     (Mo) :", $NF/(1024*1024) ) }' ${zfilecs} >> ${zout}
+    awk ' /Stati/  {printf("%-8s %-.16s %11.1f\n ", " ", "Static    (Mo) :", $NF/(1024*1024) ) }' ${zfilecs} >> ${zout}
+    if [ ${zxcm} == 0 ] ; then awk ' /resident/ {printf("%-8s %-.16s %11.1f\n ", " ", "Max. used (Mo) :", $6/1024 ) }' ${zfilecm} >> ${zout} ; fi
+fi
Index: trunk/HEAD/2INSTALL/JOBS/MEM_size_osxxlf.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/MEM_size_osxxlf.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/MEM_size_osxxlf.ksh	(revision 1136)
@@ -0,0 +1,107 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zmxcu  : (0/1) mon${CONF}_err file (do/do not) exist"
+#     - zxrs   : (0/1) Ref memory_size.txt file (do/do not) exist"
+#     - zxrm   : (0/1) Ref mon${CONF}_err file (do/do not) exist"
+#     - zconf  : configuration name"
+#     - zout   : output file name"
+#     - ztag   : tag name to which are compared files"
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the osxxlf target for 
+#        mon, mpi runs
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-a] [-b] [-d] [-c] [-o] [-t]"
+  echo "Options: These are optional argument"
+  echo " -a : (0/1) mon${CONF}_err file (do/do not) exist"
+  echo " -b : (0/1) Ref memory_size.txt file (do/do not) exist"
+  echo " -d : (0/1) Ref mon${CONF}_err file (do/do not) exist"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zmxcu=1
+zxrs=1
+zxrm=1
+zconf=
+zout=
+ztag=
+
+# Get arguments
+while getopts a:b:d:c:o:t: opt
+do
+  case "$opt" in
+    a) zmxcu="$OPTARG";;
+    b) zxrs="$OPTARG";;
+    d) zxrm="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    *) help_MEM_size;;
+  esac
+done
+
+# Check if results must be compared to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+zfilecs='mon/LONG/memory_size.txt'
+zfilers='mon/LONG/REF/memory_size.txt'
+
+# Select only appropriate lines
+grep -v Stack ${zfilecs} | head -1 > temp_cs_sck
+tail -1 ${zfilecs}                 > temp_cs_sic
+
+# Select only appropriate lines
+grep -v Stack ${zfilers} | head -1 > temp_rs_sck
+tail -1 ${zfilers}                 > temp_rs_sic
+
+# If reference version files exist
+if [ ${evaltag} == 0 -a ${zxrs} == 0 ] ;  then
+    # Get values from the reference tag
+    Mo_stack_ms=$( (awk '{print $5/(1024*1024) }' temp_rs_sck ) )
+    Mo_stati_ms=$( (awk '{print $5/(1024*1024) }' temp_rs_sic ) )
+
+    # Print: Variable long name | current version values | reference version values | variations
+    echo "                                                 " >> ${zout}
+    echo "                                      Version    " >> ${zout}
+    echo "             Memory          Current /       \ ${ztag}        Variation " >> ${zout}
+    awk ' { val=$5/(1024*1024) } {printf("%-9s %-16s %8.1f      |   %8.1f     |    %5.1f \n ", " ", "Stack     (Mo) :", val, inck, ((val-inck)/inck)*100 ) }' inck=${Mo_stack_ms} temp_cs_sck >> ${zout}
+    awk ' { val=$5/(1024*1024) } {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f \n ", " ", "Static    (Mo) :", val, inti, ((val-inti)/inti)*100 ) }' inti=${Mo_stati_ms} temp_cs_sic >> ${zout}
+else
+    # Print: Variable long name | current version values
+    echo "                                                 " >> ${zout}
+    echo "             Memory          Current version "     >> ${zout}
+    awk ' {printf("%-9s %-.16s %11.1f\n ", " ", "Stack     (Mo) :", $5/(1024*1024) ) }' temp_cs_sck >> ${zout}
+    awk ' {printf("%-8s %-.16s %11.1f\n ", " ", "Static    (Mo) :", $5/(1024*1024) ) }' temp_cs_sic >> ${zout}
+fi
+
Index: trunk/HEAD/2INSTALL/JOBS/MEM_size_sx8brodie.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/MEM_size_sx8brodie.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/MEM_size_sx8brodie.ksh	(revision 1136)
@@ -0,0 +1,101 @@
+#!/bin/ksh
+##############################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is called by the assessment.ksh script for a 
+# given configuration 
+#
+# INPUT ARGS: 6
+#     - zxcm   : (0/1) mon${zconf}_err file (do/do not) exist"
+#     - zxrs   : (0/1) Ref memory_size.txt file (do/do not) exist"
+#     - zxrm   : (0/1) Ref mon${zconf}_err file (do/do not) exist"
+#     - zconf  : configuration name"
+#     - zout   : output file name"
+#     - ztag   : tag name to which are compared files"
+#
+# WORK: It aims to :
+#
+#      - Treat output timing from the sx8brodie target for 
+#        mon, mpi & omp runs
+#     *- compare it to a reference version 
+#
+# * this step is performed only if a reference tag 
+#   is specified with the -t option and if files exist.
+#   See the Makefile under ./config/HEAD directory
+#
+##############################################################
+#set -xv
+##############################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+#
+# help_CPU_time() To print help
+#
+function help_CPU_time
+{
+  echo "Usage: $nscript [-a] [-b] [-d] [-c] [-o] [-t]"
+  echo "Options: These are optional argument"
+  echo " -a : (0/1) mon${zconf}_err file (do/do not) exist"
+  echo " -b : (0/1) Ref memory_size.txt file (do/do not) exist"
+  echo " -d : (0/1) Ref mon${zconf}_err file (do/do not) exist"
+  echo " -c : configuration name"
+  echo " -o : output file name"
+  echo " -t : tag name to which are compared files"
+  echo " their values are not taken)"
+  exit 1
+}
+
+# Initialization
+zxcm=1
+zxrs=1
+zxrm=1
+zconf=
+zout=
+ztag=
+
+# Get arguments
+while getopts a:b:d:c:o:t: opt
+do
+  case "$opt" in
+    a) zxcm="$OPTARG";;
+    b) zxrs="$OPTARG";;
+    d) zxrm="$OPTARG";;
+    c) zconf="$OPTARG";;
+    o) zout="$OPTARG";;
+    t) ztag="$OPTARG";;
+    *) help_MEM_size;;
+  esac
+done
+
+# Check if results must be compared to the reference version
+test -n "${ztag}"
+evaltag=$?
+
+zfilecs='mon/LONG/memory_size.txt' ;  zfilers='mon/LONG/REF/memory_size.txt'
+zfilecm="mon/LONG/mon${zconf}_err"  ;  zfilerm="mon/LONG/REF/mon${zconf}_err"
+
+# If reference version files exist
+if [ ${evaltag} == 0 -a ${zxrm} == 0 ] ;  then
+    # Get values from the reference tag
+    Mo_stack_ms=$( (awk '/Stack/ {print $NF/(1024*1024) }' ${zfilers} ) )
+    Mo_stati_ms=$( (awk '/Stati/ {print $NF/(1024*1024) }' ${zfilers} ) )
+    if [ ${zxcm} == 0 ] ; then Mo_max_used=$( (awk '/Memory/ {print $NF}' ${zfilerm} ) ) ; fi
+
+    # Print: Variable long name | current version values | reference version values | variations
+    echo "                                                 " >> ${zout}
+    echo "                                      Version    " >> ${zout}
+    echo "             Memory          Current /       \ ${ztag}        Variation " >> ${zout}
+    awk ' /Stack/ { val=$NF/(1024*1024) } END {printf("%-9s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Stack     (Mo) :", val, inck, ((val-inck)/inck)*100 ) }' inck=${Mo_stack_ms} ${zfilecs} >> ${zout}
+    awk ' /Stati/ { val=$NF/(1024*1024) } END {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Static    (Mo) :", val, inti, ((val-inti)/inti)*100 ) }' inti=${Mo_stati_ms} ${zfilecs} >> ${zout}
+    if [ ${zxcm} == 0 ] ; then awk ' /Memory/ { val=$NF } END {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f %\n ", " ", "Max. used (Mo) :", val, inus, ((val-inus)/inus)*100 ) }' inus=${Mo_max_used} ${zfilecm} >> ${zout} ; fi
+else
+    # Print: Variable long name | current version values
+    echo "                                                 " >> ${zout}
+    echo "             Memory          Current version "     >> ${zout}
+    awk ' /Stack/  {printf("%-9s %-.16s %11.1f\n ", " ", "Stack     (Mo) :", $NF/(1024*1024) ) }' ${zfilecs} >> ${zout}
+    awk ' /Stati/  {printf("%-8s %-.16s %11.1f\n ", " ", "Static    (Mo) :", $NF/(1024*1024) ) }' ${zfilecs} >> ${zout}
+    if [ ${zxcm} == 0 ] ; then awk ' /Memory/   {printf("%-8s %-.16s %11.1f\n ", " ", "Max. used (Mo) :", $NF ) }' ${zfilecm} >> ${zout} ; fi
+fi
Index: trunk/HEAD/2INSTALL/JOBS/assessment.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/assessment.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/assessment.ksh	(revision 1136)
@@ -0,0 +1,594 @@
+#!/bin/ksh
+######################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# It is automatically launched (by the cron_jobs.ksh 
+# script) when all runs (mon, mpi, (omp)) for a given 
+# configuration are finished 
+#
+# INPUT ARGS: 1 + 1 optional
+#     - CONF: configuration name (ORCA2_LIM, GYRE ..)
+#     - TODO: (optional) Arg=yes or empty to build 
+#             output files including timing results. 
+#             Specific to Zahir
+#
+# WORK: It aims to (for each standard configuration) :
+#
+#    I. Check Executable Memory size
+#       - from memory_size.txt output file
+#      *- compare it to a reference version 
+#
+#   II. Check CPU time used (if specified)
+#       - from timing output files
+#      *- compare it to a reference version 
+#
+#  III. Check the reproductibility between mon & mpi runs
+#       - making diff of solver.stat output files
+#
+#   IV. Check the restartability for mon & mpi runs
+#       - making diff of solver.stat output files
+#
+#    V.*Compare current results to a reference one
+#        
+#   VI. Send the assessment file "endjob.txt" using 
+#       user's e-mail
+#        
+# * this step is performed only if a reference tag 
+#   is passing through the specifs.txt file
+#   See the Makefile under ./config/HEAD directory
+#
+# It is based on the directories architecture below :
+#
+#         NEMO_VALID/WNAME_CONFIG/
+#                    |-- mon            --> MONO run
+#                    |   |-- 1_SHORT
+#                    |   |-- 2_SHORT
+#                    |   |-- LONG
+#                    |   `-- GTIME
+#                    |-- mpi            --> MPI run
+#                    |   |-- 1_SHORT
+#                    |   |-- 2_SHORT
+#                    |   |-- LONG
+#                    |   `-- GTIME
+#                    `-- omp            --> Open-MP run
+#                        |-- 1_SHORT
+#                        |-- 2_SHORT
+#                        |-- LONG
+#                        `-- GTIME
+#
+###########################################################
+#set -xv 
+###########################################################
+CONF=$1
+TODO=$2
+TARGET=osxxlf
+VERSION=$( ( awk '/test=/ { print $2 }' specifs.txt ) )
+LRTYPE="$( ( awk '/runs=/ { printf  "%s %s %s", $2 , $3 , $4}' specifs.txt ) )"
+VTIME=$( ( awk '/time=/ { print $2 }' specifs.txt ) )
+REF_TAG=$( (awk '/tagname=/ {print $2}' specifs.txt) )
+TITLE="NEMO VALIDATION ${VERSION} : $CONF on $TARGET"
+EMAIL='ctlod@locean-ipsl.upmc.fr'
+
+\rm endjob.txt 2> /dev/null
+touch endjob.txt
+
+###########################################################
+# checkfile() is a local function to check if a file exist
+# 2 arguments:
+#    - zf2check : file name to check
+#    - zoutfile : output file name to print results
+#    - zwork    : kind of prints to perform
+#    - zreprint : (optional) to avoid printing twice a message
+###########################################################
+################ Begin checkfile function #################
+function checkfile
+{
+# name of the file to check
+zf2check=$1
+# print output file name
+zoutfile=$2
+# white space prints
+zworkt=$3
+# Print a message only once
+zreprint=$4
+
+#set -x 
+
+test -n "${zreprint}"
+zrep=$?
+
+
+genf=$( basename ${zf2check} )
+
+case "${zworkt}" in
+      'NORM' )  blnk='       ' ;;
+      'DIFF' )  blnk=' '  ;;
+esac
+fmes4=" - file ${zf2check} doesn't exist "
+
+# Check file exists
+if [ -a ${zf2check} ] ; then
+    fmes1=" List ${genf} files and check date creation:   "
+    fmes2=" `ls -l ${zf2check}`           "
+    fmes3=" - file ${zf2check} is empty  "
+    [ ${zrep} == 0 ] && echo "${blnk}${fmes1}"  >> ${zoutfile}
+
+   # Check file is not empty
+   if [ -s ${zf2check} ] ; then
+       [ ${zoutfile} ] && echo "${blnk}${fmes2}" >> ${zoutfile}
+       xist=0 ; return ${xist}
+   else
+       [ ${zoutfile} ] &&  echo "${blnk}${fmes3}" >> ${zoutfile}
+       xist=1 ; return ${xist}
+   fi
+else
+   [ ${zoutfile} ] && echo "${blnk}${fmes4}" >> ${zoutfile}
+   xist=1 ; return ${xist}
+fi
+return
+}
+############### End checkfile function ###############
+######################################################
+
+# Get the name of the present script
+nscript=$( (basename $0) )
+
+###########################################################
+# mak_diff_file() is a local function which performs diff
+# on some files and print messages in the endjob.txt file
+# 7 input arguments:
+#    - zfex    : (0/1) (make/do not make) diff (files doesn't exist)
+#    - zfile1  : first input file name
+#    - zfile2  : second input file name
+#    - zruntype: run type (mon, mpi, omp)
+#    - zstream : stream of the run (long, stream_1, stream_2)
+#    - ztag    : the tag name to which are compared files
+#    - zkind   : kind of the check (repro/resta)
+###############################################################
+################ Begin mak_diff_file function #################
+function mak_diff_file
+{
+#
+# help_diff() To print help
+#
+function help_diff
+{
+  echo "Usage: ${nscript} [-x] [-a] [-b] [-r] [-s] [-t] [-k]"
+  echo "Options: These are optional argument"
+  echo " -x : (0/1) (make/do not make) diff "
+  echo " -a : first input file name"
+  echo " -b : second input file name"
+  echo " -r : run type (mon, mpi, omp)"
+  echo " -s : stream of the run (long, stream_1, stream_2)"
+  echo " -t : tag name to which are compared files"
+  echo " -k : kind of the check (repro/resta)" 
+  echo " their values are not taken)"
+  exit 1
+}
+
+##set -xv
+
+# Initialization
+zfex=1
+zfile1=
+zfile2=
+zruntype=
+zstream=
+ztag=
+zkind=none
+
+# Get arguments
+while getopts x:a:b:r:s:t:k: opt
+do
+  case "$opt" in
+    x) zfex="$OPTARG";;
+    a) zfile1="$OPTARG";;
+    b) zfile2="$OPTARG";;
+    r) zruntype="$OPTARG";;
+    s) zstream="$OPTARG";;
+    t) ztag="$OPTARG";;
+    k) zkind="$OPTARG";;
+    *) help_diff;;
+  esac
+done
+
+zgenf=$( basename ${zfile1} )
+zgenftrc=$( basename ${zfile1%.*} )
+
+case "$zkind" in
+  none ) 
+      zmesg1="                   Current run                                                     ${ztag} run   "
+      zmesg2="                   -----------                                                     --------------"
+      zmesg_NOK="        ${zstream} ${zgenf} is NOT identical to the version ${ztag} one"
+      zmesg_OK="        ${zstream} ${zgenf} IS IDENTICAL to the version ${ztag} one  "
+      zmesg_wht="        NO comparison between current ${zstream} and the version ${ztag} ${zgenf} "
+      bnam='cvref_'${zgenftrc}_${zstream}_${zruntype} ;;
+  repro ) 
+      zmesg1="                   mon run                                                         ${zruntype} run      "
+      zmesg2="                   -------                                                         -------      "
+      zmesg_NOK="        NO NO NO NO NO NO for the current version"
+      zmesg_OK="        YES YES YES YES YES YES YES YES for the current version "
+      zmesg_wht="        NO CONCLUSION !!!!!  "
+      bnam=${zkind}_${zgenftrc} ;;
+  resta ) 
+      zmesg1="                   LONG Stream                                                     SHORT Streams"
+      zmesg2="                   -----------                                                     -------------"
+      zmesg_NOK="        NO NO NO NO NO NO for the current version i.e. LONG stream != ( 1_SHORT + 2_SHORT ) streams "
+      zmesg_OK="        YES YES YES YES YES YES YES YES for the current version i.e. LONG stream = ( 1_SHORT + 2_SHORT ) streams "
+      zmesg_wht="        NO CONCLUSION !!!!!! "
+      bnam=${zkind}_${zgenftrc} ;;
+esac
+
+
+if [ ${zfex} == 0 ] ;  then
+    \rm ${bnam}.txt 2> /dev/null
+    echo "                                    Make difference between ${zgenf} files                       "  > ${bnam}.txt
+    echo "                                            ${zstream} ${zruntype} run                           " >> ${bnam}.txt
+    echo "${zmesg1}"                                                                                         >> ${bnam}.txt
+    echo "${zmesg2}"                                                                                         >> ${bnam}.txt
+    sdiff    ${zfile1} ${zfile2} >>  ${bnam}.txt
+    sdiff -s ${zfile1} ${zfile2} >>  ${bnam}_dd.txt
+
+    #---------
+    if [ ${zgenf} = 'ocean.output' ] ; then
+        echo "                                                                                                 " >> ${zstream}_head.txt
+        echo "                                    Make difference between ${zgenf} files                       "  > ${zstream}_head.txt
+        echo "                                            ${zstream} ${zruntype} run                           " >> ${zstream}_head.txt
+        echo "                   Current run                                                     ${ztag} run   " >> ${zstream}_head.txt
+        echo "                   -----------                                                     --------------" >> ${zstream}_head.txt
+        echo "                                                                                                 " >> ${zstream}_head.txt
+        zfout=${bnam}_dd.txt
+        zspmes=" See ${bnam}.txt file for full difference"
+    else
+        touch ${zstream}_head.txt
+        zfout=${bnam}.txt
+        zspmes=""
+    fi
+    #---------
+    if [ -s ${bnam}_dd.txt ] ; then
+    # Differences exist between solver.stat or ocean.output files
+       echo "                             " >> endjob.txt
+       echo "${zmesg_NOK}"                  >> endjob.txt
+       echo "           ${zspmes}         " >> endjob.txt
+       echo "                             " >> endjob.txt
+       cat ${zstream}_head.txt ${zfout}     >> endjob.txt
+       echo "                             " >> endjob.txt
+       echo "                             " >> endjob.txt
+    else
+       # No differences exist between solver.stat or ocean.output files
+       echo "                             " >> endjob.txt
+       echo "${zmesg_OK}"                   >> endjob.txt
+       echo "                             " >> endjob.txt
+    fi
+
+    \rm *_dd* *_head.txt 2> /dev/null
+
+else
+       # It is not possible to conclude because files are missing or empty
+       echo "                             " >> endjob.txt
+       echo "${zmesg_wht}"                  >> endjob.txt
+       echo "                             " >> endjob.txt
+fi
+
+return
+
+}
+############### End mak_diff_file function ####################
+###############################################################
+
+###########################################################
+# concat_perf() is a local function to gather performances
+# files (perfs_runtype.txt_xxxx) build with the hpmcount 
+# command on Zahir and standard(s) error output file(s)
+# runtypeCONFNAME_err
+# 1 argument:
+#    - zconf : configuration name
+#############################################################
+################ Begin concat_perf function #################
+function concat_perf
+{
+
+#set -x
+
+# name of the configuration
+zconf=$1
+
+# List of files to treat
+zcatfe[0]="mon/LONG/mon${zconf}_err"
+zcatfe[1]="mon/GTIME/mon${zconf}_err"
+zcatfe[2]="mpi/GTIME/mpi${zconf}_err"
+
+ind=0
+while [ ${ind} -lt 3 ] ; do
+
+       zpath=$( ( dirname ${zcatfe[${ind}]} ) )
+       zname=$( ( basename ${zcatfe[${ind}]} ) )
+       cd ${zpath}
+       cp ${zname} ${zname}_save
+       for kf in `ls perf*` ; do
+           cat ${kf} >> ${zname}
+       done
+       cd ../..
+       let ind=${ind}+1
+done
+
+return
+}
+############### End concat_perf function ###############
+########################################################
+
+
+# ###############################
+# 0. CURRENT VERSION NAME
+# ###############################
+echo " ############################                           "  > endjob.txt
+echo " CURRENT VERSION: $VERSION                              " >> endjob.txt
+echo " ############################                           " >> endjob.txt
+echo "                                                        " >> endjob.txt
+echo "                                                        " >> endjob.txt
+
+test -n "${TODO}"
+id2do=$?
+if [ ${id2do} == 0 -a ${TARGET} = 'aix' ] ; then concat_perf ${CONF} ; fi
+
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# ###############################
+# I. CHECK EXECUTABLE MEMORY SIZE
+# ###############################
+filecs='mon/LONG/memory_size.txt' ;  filers='mon/LONG/REF/memory_size.txt'
+filecm="mon/LONG/mon${CONF}_err"  ;  filerm="mon/LONG/REF/mon${CONF}_err"
+xfilecs=0  ; xfilecm=0 ; xfilers=0 ; xfilerm=0
+echo " ############################                           " >> endjob.txt
+echo " CHECK EXECUTABLE MEMORY SIZE                           " >> endjob.txt
+echo " ############################                           " >> endjob.txt
+echo "                                                        " >> endjob.txt
+#--------
+checkfile ${filecs} 'endjob.txt' DIFF yes ; xfilecs=$?
+checkfile ${filers} 'endjob.txt' DIFF     ; xfilers=$?
+checkfile ${filecm} 'endjob.txt' DIFF     ; xfilecm=$?
+checkfile ${filerm} 'endjob.txt' DIFF     ; xfilerm=$?
+
+# If current version files exist
+if [ ${xfilecs} == 0 ] ;  then
+
+    if [ ${REF_TAG} ] ; then 
+        ./MEM_size_${TARGET}.ksh -a ${xfilecm} -b ${xfilers} -d ${xfilerm} -c ${CONF} -o endjob.txt -t ${REF_TAG} 
+    else
+        ./MEM_size_${TARGET}.ksh -a ${xfilecm} -b ${xfilers} -d ${xfilerm} -c ${CONF} -o endjob.txt
+    fi
+
+else
+    echo "                                                    " >> endjob.txt
+    echo "   ---> NO memory size check                        " >> endjob.txt
+    echo "                                                    " >> endjob.txt
+fi
+#
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# #######################
+# II. CHECK CPU TIME USED
+# #######################
+if [ ${VTIME} = 'timing' ] ; then
+
+    echo "                                                        " >> endjob.txt
+    echo " ######################                                 " >> endjob.txt
+    echo " CHECK CPU TIME USED                                    " >> endjob.txt
+    echo " ######################                                 " >> endjob.txt
+    echo "                                                        " >> endjob.txt
+    #------
+
+    for runt in ${LRTYPE} ; do
+
+        echo "                                                    " >> endjob.txt
+        echo "   ---> Timing for the ${runt} run :                " >> endjob.txt
+        echo "        ----------------------------                " >> endjob.txt
+        echo "                                                    " >> endjob.txt
+
+        xfilecv=0 ; xfilerv=0
+
+        # Check that timing file for the ${runt} current version exist
+        filecv="${runt}/GTIME/${runt}${CONF}_err" 
+        checkfile ${filecv} 'endjob.txt' NORM yes ; xfilecv=$?
+
+        # Check that timing file for the ${runt} reference version exist
+        filerv="${runt}/GTIME/REF/${runt}${CONF}_err" 
+        checkfile ${filerv} 'endjob.txt' NORM ; xfilerv=$?
+        echo "                                                             " >> endjob.txt
+
+        if [ ${xfilecv} == 0 ] ; then 
+            if [ ${REF_TAG} ] ; then 
+                ./CPU_time_${TARGET}.ksh -r ${runt} -a ${filecv} -b ${filerv} -c ${CONF} -o endjob.txt -x ${xfilerv} -t ${REF_TAG} 
+            else
+                ./CPU_time_${TARGET}.ksh -r ${runt} -a ${filecv} -b ${filerv} -c ${CONF} -o endjob.txt -x ${xfilerv}
+            fi
+        fi
+
+    done
+
+fi
+
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# ########################################################
+# III. CHECK REPRODUCTIBILITY: mon .vs. mpi & mon .vs .omp
+# ########################################################
+echo "                                                        " >> endjob.txt
+echo " ######################                                 " >> endjob.txt
+echo " CHECK REPRODUCTIBILITY                                 " >> endjob.txt
+echo " ######################                                 " >> endjob.txt
+echo "                                                        " >> endjob.txt
+#------
+for runt in ${LRTYPE} ; do
+
+    if [ ${runt} != 'mon' ] ; then
+        echo "                                                    " >> endjob.txt
+        echo "   ---> Reproductibility mon .vs. ${runt} ? :       " >> endjob.txt
+        echo "        -------------------------------------       " >> endjob.txt
+
+        filemon="mon/LONG/solver.stat" ;  filexxx="${runt}/LONG/solver.stat"
+        xfilemon=0
+
+        checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$?
+        checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$?
+        
+        mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro
+        
+        if [ ${CONF} = 'GYRE_LOBSTER' ] ; then
+            echo "                                                    " >> endjob.txt
+            echo "   ---> BIO Reproductibility mon .vs. ${runt} ? :   " >> endjob.txt
+            echo "        -----------------------------------------   " >> endjob.txt
+
+            # check that ocean.output files exist
+            filemon="mon/LONG/ocean.output" ;  filexxx="${runt}/LONG/ocean.output"
+            xfilemon=0
+
+            checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$?
+            checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$?
+            
+            # check that tracer.stat files have been built based on ocean.output ones
+            filemon="mon/LONG/tracer.stat" ;  filexxx="${runt}/LONG/tracer.stat"
+            xfilemon=0
+            
+            ./BIO_${TARGET}.ksh -a ${filemon} -b ${filexxx} -c ocean.output
+
+            checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$?
+            checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$?
+            
+            mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro
+        fi
+    fi
+done
+
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# ##########################################
+# IV. CHECK RESTARTABILITY: mon mpi omp runs
+# ##########################################
+echo "                                                        " >> endjob.txt
+echo " ####################                                   " >> endjob.txt
+echo " CHECK RESTARTABILITY                                   " >> endjob.txt
+echo " ####################                                   " >> endjob.txt
+echo "                                                        " >> endjob.txt
+
+for runt in ${LRTYPE} ; do
+
+    echo "                                                    " >> endjob.txt
+    echo "   ---> ${runt} restartability ? :                  " >> endjob.txt
+    echo "        --------------------------                  " >> endjob.txt
+
+    file1="${runt}/1_SHORT/solver.stat" ;  file2="${runt}/2_SHORT/solver.stat" ; file3="${runt}/LONG/solver.stat"
+    xfile1=0
+    #-------
+    checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$?
+    checkfile ${file2} 'endjob.txt' NORM ; xfile1=$?
+    #
+    cat ${file1} ${file2}  > short_solver_${runt}.stat
+    mak_diff_file -x ${xfile1} -a ${file3} -b short_solver_${runt}.stat -r ${runt} -k resta
+    \rm short_solver_${runt}.stat
+    
+    #-------
+
+    if [ ${CONF} = 'GYRE_LOBSTER' ] ; then
+        echo "                                                    " >> endjob.txt
+        echo "   ---> ${runt} BIO restartability ? :              " >> endjob.txt
+        echo "        ------------------------------              " >> endjob.txt
+
+       # check that ocean.output files exist
+        file1="${runt}/2_SHORT/ocean.output" ;  file2="${runt}/LONG/ocean.output"
+        xfile1=0
+
+        checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$?
+        checkfile ${file2} 'endjob.txt' NORM     ; xfile1=$?
+            
+        # check that tracer.stat files have been built based on ocean.output ones
+        file1="${runt}/2_SHORT/tracer.stat" ;  file2="${runt}/LONG/tracer.stat"
+        xfile1=0
+
+        ./BIO_${TARGET}.ksh -a ${file1} -b ${file2} -c ocean.output
+
+        checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$?
+        checkfile ${file2} 'endjob.txt' NORM     ; xfile1=$?
+        #
+        mak_diff_file -x ${xfile1} -a ${file2} -b ${file1} -r ${runt} -k resta
+
+    fi
+    
+done
+
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# #######################################################
+# V. COMPARE CURRENT ${runt} RESULTS TO THE $REF_TAG ONES
+# #######################################################
+
+# This step is realised only if a reference tag ${REF_TAG} is specified
+if [ ${REF_TAG} ] ; then
+
+    echo "                                                        " >> endjob.txt
+    echo " ####################################################   " >> endjob.txt
+    echo " COMPARE CURRENT VERSION RESULTS TO THE $REF_TAG ONES   " >> endjob.txt
+    echo " ####################################################   " >> endjob.txt
+    echo "                                                        " >> endjob.txt
+
+    for runt in ${LRTYPE} ; do
+
+        echo "   -----------------------------------------------------------------------------" >> endjob.txt
+        echo "   ---> ${runt} results :  current version  |   ${REF_TAG} version  STREAM 1 & 2" >> endjob.txt
+        echo '                        solver.stat    .vs.    solver.stat         ' >> endjob.txt
+        echo '                        ocean.output   .vs.    ocean.output        ' >> endjob.txt
+
+        file1="${runt}/1_SHORT/solver.stat"          ;  file2="${runt}/2_SHORT/solver.stat"
+        filev1="${runt}/1_SHORT/REF/solver.stat"     ;  filev2="${runt}/2_SHORT/REF/solver.stat"
+        file_oc1="${runt}/1_SHORT/ocean.output"      ;  file_oc2="${runt}/2_SHORT/ocean.output"
+        file_roc1="${runt}/1_SHORT/REF/ocean.output" ;  file_roc2="${runt}/2_SHORT/REF/ocean.output"
+        xfilev1=0 ; xfilev2=0 ; xfile_oc1=0 ; xfile_oc2=0
+
+        echo "                                           " >> endjob.txt
+        echo "        STREAM 1 results :                 " >> endjob.txt
+        echo "        -----------------                  " >> endjob.txt
+        #
+        #-------
+        # solver.stat STREAM 1
+        checkfile ${file1}  'endjob.txt' NORM yes ; xfilev1=$?
+        checkfile ${filev1} 'endjob.txt' NORM ; xfilev1=$?
+    
+        mak_diff_file -x ${xfilev1} -a ${file1} -b ${filev1} -r ${runt} -s STREAM_1 -t ${REF_TAG}
+    
+        #-------
+        # ocean.output STREAM 1
+        checkfile ${file_oc1}  'endjob.txt' NORM yes ; xfile_oc1=$?
+        checkfile ${file_roc1} 'endjob.txt' NORM ; xfile_oc1=$?
+    
+        mak_diff_file -x ${xfile_oc1} -a ${file_oc1} -b ${file_roc1} -r ${runt} -s STREAM_1 -t ${REF_TAG}
+    
+        echo "                                           " >> endjob.txt
+        echo "        STREAM 2 results :                 " >> endjob.txt
+        echo "        -----------------                  " >> endjob.txt
+        #
+        #-------
+        # solver.stat STREAM 2
+        checkfile ${file2}  'endjob.txt' NORM yes ; xfilev2=$?
+        checkfile ${filev2} 'endjob.txt' NORM ; xfilev2=$?
+    
+        mak_diff_file -x ${xfilev2} -a ${file2} -b ${filev2} -r ${runt} -s STREAM_2 -t ${REF_TAG}
+    
+        #-------
+        # ocean.output STREAM 2
+        checkfile ${file_oc2}  'endjob.txt' NORM yes ; xfile_oc2=$?
+        checkfile ${file_roc2} 'endjob.txt' NORM ; xfile_oc2=$?
+    
+        mak_diff_file -x ${xfile_oc2} -a ${file_oc2} -b ${file_roc2} -r ${runt} -s STREAM_2 -t ${REF_TAG}
+    
+    done
+    #
+    #-------
+fi
+
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+# ###############################################
+# VI. SEND THE ASSESSMENT FILE REPORT "endjob.txt"
+# ###############################################
+mail -s "$TITLE" ${EMAIL} < endjob.txt
Index: trunk/HEAD/2INSTALL/JOBS/cron_jobs.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/cron_jobs.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/cron_jobs.ksh	(revision 1136)
@@ -0,0 +1,40 @@
+#!/usr/bin/ksh
+######################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# This script is launched by the lance_batch.ksh script
+# for a given configuration.
+# It aims to (for each standard configuration) check if
+# there are jobs in queue associated with the considered 
+# configuration. 
+# If jobs are still in queue it re-launched itself either
+# it launchs the assessment.ksh script 
+######################################################
+
+#set -xv
+
+CONF=$1
+LJOBS=qstat
+
+if [ ${CONF} == 'ORCA2_LIM' ] ; then
+CONFS=ORCA2
+elif [ ${CONF} == 'GYRE_LOBSTER' ] ; then
+CONFS=GYRE_
+elif [ ${CONF} == 'ZAGRIF' ] ; then
+CONFS=ZAGRI
+else
+CONFS=${CONF}
+fi
+
+JOBS_LIST=` ${LJOBS} |  grep -c ${CONFS}`
+if [ ${JOBS_LIST} = 0 ]
+then
+    sleep 60
+    ./assessment.ksh ${CONF} yes &
+    exit
+fi
+sleep 300
+./cron_jobs.ksh ${CONF} &
+exit
+
Index: trunk/HEAD/2INSTALL/JOBS/jhd_aix_mpi
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_aix_mpi	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_aix_mpi	(revision 1136)
@@ -0,0 +1,21 @@
+#!/bin/ksh
+############################################################################
+#### aix Header mpi
+############################################################################
+# Temps CPU max. en secondes (d'un processus)
+# @ cpu_limit  = 1000
+# Mémoire max. utilisée (ici 11 Go)
+# @ data_limit = 3gb
+# Type du travail
+# @ job_type = parallel
+# Nom du travail LoadLeveler
+# @ job_name   = 
+# Fichier de sortie standard du travail
+# @ output     = $(job_name)_std
+# Fichier de sortie d'erreur du travail
+# @ error      =  $(job_name)_err
+# Nombre de processus demandes
+# @ total_tasks = 8
+# @ queue
+#                                           
+
Index: trunk/HEAD/2INSTALL/JOBS/jhd_ax_mono_mon
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_ax_mono_mon	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_ax_mono_mon	(revision 1136)
@@ -0,0 +1,17 @@
+#!/bin/ksh
+############################################################################
+#### ax_mono Header mon
+############################################################################
+# Temps CPU max. en secondes (d'un processus)
+# @ cpu_limit  = 2000
+# Mémoire max. utilisée (ici 11 Go)
+# @ data_limit = 3gb
+# Nom du travail LoadLeveler
+# @ job_name   = 
+# Fichier de sortie standard du travail
+# @ output     = $(job_name)_std
+# Fichier de sortie d'erreur du travail
+# @ error      =  $(job_name)_err
+# @ queue
+#                                           
+
Index: trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mon
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mon	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mon	(revision 1136)
@@ -0,0 +1,4 @@
+#!/bin/ksh
+############################################################################
+#### osxxlf Header mon
+############################################################################
Index: trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mpi
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mpi	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_osxxlf_mpi	(revision 1136)
@@ -0,0 +1,4 @@
+#!/bin/ksh
+############################################################################
+#### osxxlf Header mpi
+############################################################################
Index: trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mon
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mon	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mon	(revision 1136)
@@ -0,0 +1,12 @@
+############################################################################
+#### sx8brodie Header mon
+############################################################################
+#PBS -S /bin/ksh                  # Shell used
+#PBS -l cputim_prc=00:20:00       # temps max (HH:MM:SS)
+#PBS -l cputim_job=00:40:00       # temps max (HH:MM:SS)
+#PBS -l memsz_job=3.0gb           # memoire max /job
+#PBS -N                           # Job name
+#PBS -e                           # error output file name
+#PBS -o                           # standard output file name
+
+
Index: trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mpi
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mpi	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_mpi	(revision 1136)
@@ -0,0 +1,13 @@
+############################################################################
+#### sx8brodie Header mpi
+############################################################################
+#PBS -S /bin/ksh                  # Shell used
+#PBS -q multi                     # classe multiple
+#PBS -l cpunum_job=8              # réservation de 8 processeurs
+#PBS -l cputim_prc=00:20:00       # temps max (HH:MM:SS)
+#PBS -l cputim_job=00:40:00       # temps max (HH:MM:SS)
+#PBS -l memsz_job=5.0gb           # memoire max /job
+#PBS -N                           # Job name
+#PBS -e                           # error output file name
+#PBS -o                           # standard output file name
+
Index: trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_omp
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_omp	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/jhd_sx8brodie_omp	(revision 1136)
@@ -0,0 +1,14 @@
+############################################################################
+#### sx8brodie Header omp
+############################################################################
+#PBS -S /bin/ksh                  # Shell used
+#PBS -q multi                     # classe multiple
+#PBS -l cpunum_job=8              # réservation de 8 processeurs
+#PBS -l cputim_prc=00:20:00       # temps max (HH:MM:SS)
+#PBS -l cputim_job=00:40:00       # temps max (HH:MM:SS)
+#PBS -l memsz_job=3.0gb           # memoire max /job
+#PBS -N                           # Job name
+#PBS -e                           # error output file name
+#PBS -o                           # standard output file name
+
+
Index: trunk/HEAD/2INSTALL/JOBS/job_GYRE.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/job_GYRE.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/job_GYRE.ksh	(revision 1136)
@@ -0,0 +1,236 @@
+set -xv
+
+CONF=GYRE
+# Variables changed by lance_batch.ksh script
+RUN=xxx
+NB_PROCS=xxx
+LAUNCH=xxx
+LEXE=xxx
+CPERF=xxx
+D_INPUT=xxx
+D_GET=xxx
+REF_TAG=xxx
+TSYMB=xxx
+
+# Variables changed by ins_valid.ksh script
+MAINDIR=/Users/ctlod/WORK/AZE
+WORK=/Users/ctlod/WORK/AZE/modipsl/config
+REF_OD=/Volumes/FENUA/ORCA2_LIM_nemo_v2_IO
+
+# Arguments
+# type = 'long' or '1_short' or '2_short'
+type=$1
+
+case ${type} in
+        'long' ) 
+             DIROUT='LONG'
+             ITERATIONS=360 ;;
+              
+        '1_short' ) 
+             DIROUT='1_SHORT'
+             ITERATIONS=180 ;;
+              
+        '2_short' ) 
+             DIROUT='2_SHORT'
+             ITERATIONS=180 ;;
+
+        'gtime' ) 
+             DIROUT='GTIME'
+             ITERATIONS=4320 ;;
+esac
+
+# Working directory
+cd ${TMPDIR}
+#-T- osxxlf cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/RUN
+#-T- osxxlf zback=$?
+#-T- osxxlf if [ ${zback} = 0 ] ; then rm -rf namelist* *.nc memory* solver.stat ocean.output* mpp.output* mono.output* ; fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Input files
+##############################################################
+##############################################################
+##############################################################
+# Ocean namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
+
+# namelist modifications
+PAT_NIT000=$( grep 'nit000      =' namelist )
+PAT_NITEND=$( grep 'nitend      =' namelist )
+PAT_NSTOCK=$( grep 'nstock      =' namelist )
+PAT_NWRITE=$( grep 'nwrite      =' namelist )
+PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
+PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
+PAT_NSOLVV=$( grep 'nsolv       =' namelist )
+PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+
+sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
+-e "s%$PAT_NIT000%   nit000     =     1%" \
+-e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
+-e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
+-e "s%$PAT_NWRITE%   nwrite     =     75%" \
+-e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
+-e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
+-e "s%$PAT_NSOLVV%   nsolv     =      2%" \
+-e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
+namelist > nam.tmp
+
+mv nam.tmp namelist
+
+# Analytical forcing
+
+# Get restarts files if needed
+if [ $type = '2_short' ]
+then
+    if [ ${RUN} = 'mon' -o ${RUN} = 'omp' ] ; then 
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart.nc restart.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld.nc restart_mld.nc
+    fi
+
+    if [ ${RUN} = 'mpi' ] ; then
+        typeset -Z4 i=0
+        while [ $i -lt $NB_PROCS ]
+        do
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_${i}.nc restart_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld_${i}.nc restart_mld_${i}.nc
+           let i=$i+1
+        done
+    fi
+
+    # namelist modifications
+    PAT_NIT000=$( grep 'nit000     =' namelist )
+    PAT_NITEND=$( grep 'nitend     =' namelist )
+    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
+    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    ORCA_NIT000=$(( $ITERATIONS + 1 ))
+    ORCA_NITEND=$(( $ITERATIONS*2 ))
+    
+    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
+    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
+    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
+    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
+    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
+    namelist > nam.tmp
+    
+    mv nam.tmp namelist
+
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch run
+##############################################################
+##############################################################
+##############################################################
+
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_${RUN} opa_${CONF}_${RUN}
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_memo opa_${CONF}_memo
+chmod 777 opa_${CONF}_${RUN}
+chmod 777 opa_${CONF}_memo
+
+#
+# Profiling & Executable memory size
+####################################
+touch memory_size.txt
+
+case ${RUN} in
+        'mon' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie echo "Stack memory: $( (size opa_${CONF}_${RUN}) )"    >> memory_size.txt 
+#-T- sx8brodie echo "Static memory: $( (size opa_${CONF}_memo) )"   >> memory_size.txt  ;;
+#-T- aix     ;;
+#-T- ax_mono echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- ax_mono echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;;
+#-T- osxxlf echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- osxxlf echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;; 
+        'mpi' ) 
+#-T- sx8brodie export MPIPROGINF=detail ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+        'omp' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie export OMP_NUM_THREADS=${NB_PROCS} ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+esac
+#
+# >>>>>> EXECUTION < < < <
+##########################
+
+case ${RUN} in
+        'mon' | 'omp' ) 
+              ${CPERF} ./opa_${CONF}_${RUN} ;;
+        'mpi' ) 
+#-T- sx8brodie              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- aix              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- osxxlf   mpd&
+#-T- osxxlf   sleep 5
+#-T- osxxlf   ${CPERF} ${LEXE} ./opa_${CONF}_${RUN}
+#-T- osxxlf   mpdallexit ;;
+esac
+
+ls -l
+#
+
+##############################################################
+##############################################################
+##############################################################
+###             Save output files
+##############################################################
+##############################################################
+##############################################################
+case ${RUN} in
+	'mon' | 'omp' )
+               liste_files=' *abort* memory* namelist* perfs* solver.stat ocean.output layout* GYRE* restart* mono*' ;;
+	'mpi' )
+               liste_files=' *abort* namelist* solver.stat perfs* ocean.output* layout* GYRE* restart* mpp*' ;;
+esac
+
+# Ensure that all files saved are coming from the current run
+ind=1
+for k in $liste_files
+do
+   echo $k > temp
+   var=$( ( awk '{printf("%-.4s", varin ) } ' varin=$k temp ) )
+   if [ ${ind} = 1 -a ${var} = 'perf' ] ; then
+       kc='perf*'
+       rm -f ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/${kc}
+       ind=0
+   fi
+   cp $k ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/$k
+done
+
+##############################################################
+##############################################################
+##############################################################
+###             Retrieve some reference run files
+##############################################################
+##############################################################
+##############################################################
+if [ ${REF_TAG} ]
+then
+   STORE_DATA=${REF_OD}/${CONF}/${REF_TAG}/${RUN}/${DIROUT}
+   LFILES="solver.stat memory_size.txt ocean.output ${RUN}${CONF}_err"
+   for ref_file in ${LFILES}
+   do
+       ${D_GET} ${STORE_DATA}/${TSYMB}${ref_file} ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/REF/${ref_file}
+   done
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch restart job
+##############################################################
+##############################################################
+##############################################################
+if [ $type = '1_short' ] ; then
+    cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/2_SHORT
+    ${LAUNCH}job_${RUN}_2_short.ksh
+fi
Index: trunk/HEAD/2INSTALL/JOBS/job_GYRE_LOBSTER.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/job_GYRE_LOBSTER.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/job_GYRE_LOBSTER.ksh	(revision 1136)
@@ -0,0 +1,263 @@
+set -xv
+
+CONF=GYRE_LOBSTER
+# Variables changed by lance_batch.ksh script
+RUN=xxx
+NB_PROCS=xxx
+LAUNCH=xxx
+LEXE=xxx
+CPERF=xxx
+D_INPUT=xxx
+D_GET=xxx
+REF_TAG=xxx
+TSYMB=xxx
+
+# Variables changed by ins_valid.ksh script
+MAINDIR=/Users/ctlod/WORK/AZE
+WORK=/Users/ctlod/WORK/AZE/modipsl/config
+REF_OD=/Volumes/FENUA/ORCA2_LIM_nemo_v2_IO
+
+# Arguments
+# type = 'long' or '1_short' or '2_short'
+type=$1
+
+case ${type} in
+        'long' ) 
+             DIROUT='LONG'
+             ITERATIONS=360 ;;
+              
+        '1_short' ) 
+             DIROUT='1_SHORT'
+             ITERATIONS=180 ;;
+              
+        '2_short' ) 
+             DIROUT='2_SHORT'
+             ITERATIONS=180 ;;
+
+        'gtime' ) 
+             DIROUT='GTIME'
+             ITERATIONS=4320 ;;
+esac
+
+# Working directory
+cd ${TMPDIR}
+#-T- osxxlf cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/RUN
+#-T- osxxlf zback=$?
+#-T- osxxlf if [ ${zback} = 0 ] ; then rm -rf namelist* *.nc memory* solver.stat ocean.output* mpp.output* mono.output* ; fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Input files
+##############################################################
+##############################################################
+##############################################################
+# Ocean namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
+
+# namelist modifications
+PAT_NIT000=$( grep 'nit000      =' namelist )
+PAT_NITEND=$( grep 'nitend      =' namelist )
+PAT_NSTOCK=$( grep 'nstock      =' namelist )
+PAT_NWRITE=$( grep 'nwrite      =' namelist )
+PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
+PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
+PAT_NSOLVV=$( grep 'nsolv       =' namelist )
+PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+
+sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
+-e "s%$PAT_NIT000%   nit000     =     1%" \
+-e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
+-e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
+-e "s%$PAT_NWRITE%   nwrite     =     75%" \
+-e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
+-e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
+-e "s%$PAT_NSOLVV%   nsolv     =      2%" \
+-e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
+namelist > nam.tmp
+
+mv nam.tmp namelist
+
+# Biogeochemistry namelists
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist_top namelist_top_f90
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist_lobster namelist_lobster_f90
+
+# namelist modifications
+PAT_TRC=$( grep 'nwritetrc   =' namelist_top_f90 )
+PAT_TRD=$( grep 'nwritetrd  ='  namelist_top_f90 )
+
+sed    -e "s/$PAT_TRC/   nwritetrc   = ${ITERATIONS},/" \
+-e "s/$PAT_TRD/   nwritetrd  = ${ITERATIONS},/" \
+namelist_top_f90 > nam.tmp
+
+mv nam.tmp namelist_top
+
+PAT_ADD=$( grep 'nwritedia    =' namelist_lobster_f90 )
+sed    -e "s/$PAT_ADD/   nwritedia    = ${ITERATIONS},/" namelist_lobster_f90 > nam.tmp
+mv nam.tmp namelist_lobster
+
+# Analytical forcing
+
+# Get restarts files if needed
+if [ $type = '2_short' ]
+then
+    if [ ${RUN} = 'mon' -o ${RUN} = 'omp' ] ; then 
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart.nc restart.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld.nc restart_mld.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_trc.nc restart.trc.nc
+    fi
+
+    if [ ${RUN} = 'mpi' ] ; then
+        typeset -Z4 i=0
+        while [ $i -lt $NB_PROCS ]
+        do
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_${i}.nc restart_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld_${i}.nc restart_mld_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_trc_${i}.nc restart.trc_${i}.nc
+           let i=$i+1
+        done
+    fi
+
+    # Ocean namelist modifications
+    PAT_NIT000=$( grep 'nit000     =' namelist )
+    PAT_NITEND=$( grep 'nitend     =' namelist )
+    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
+    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    ORCA_NIT000=$(( $ITERATIONS + 1 ))
+    ORCA_NITEND=$(( $ITERATIONS*2 ))
+    
+    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
+    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
+    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
+    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
+    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
+    namelist > nam.tmp
+    
+    mv nam.tmp namelist
+
+    # Biogeochemistry namelist modifications
+    PAT_RESTAR=$( grep '   lrsttr      = ' namelist_top )
+    
+    sed    -e "s/$PAT_RESTAR/   lrsttr      = .true.,/" namelist_top > nam.tmp
+    
+    mv nam.tmp namelist_top
+
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch run
+##############################################################
+##############################################################
+##############################################################
+
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_${RUN} opa_${CONF}_${RUN}
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_memo opa_${CONF}_memo
+chmod 777 opa_${CONF}_${RUN}
+chmod 777 opa_${CONF}_memo
+
+#
+# Profiling & Executable memory size
+####################################
+touch memory_size.txt
+
+case ${RUN} in
+        'mon' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie echo "Stack memory: $( (size opa_${CONF}_${RUN}) )"    >> memory_size.txt 
+#-T- sx8brodie echo "Static memory: $( (size opa_${CONF}_memo) )"   >> memory_size.txt  ;;
+#-T- aix     ;;
+#-T- ax_mono echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- ax_mono echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;;
+#-T- osxxlf echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- osxxlf echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;; 
+        'mpi' ) 
+#-T- sx8brodie export MPIPROGINF=detail ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+        'omp' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie export OMP_NUM_THREADS=${NB_PROCS} ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+esac
+#
+# >>>>>> EXECUTION < < < <
+##########################
+
+case ${RUN} in
+        'mon' | 'omp' ) 
+              ${CPERF} ./opa_${CONF}_${RUN} ;;
+        'mpi' ) 
+#-T- sx8brodie              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- aix              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- osxxlf   mpd&
+#-T- osxxlf   sleep 5
+#-T- osxxlf   ${CPERF} ${LEXE} ./opa_${CONF}_${RUN}
+#-T- osxxlf   mpdallexit ;;
+esac
+
+ls -l
+#
+
+##############################################################
+##############################################################
+##############################################################
+###             Save output files
+##############################################################
+##############################################################
+##############################################################
+case ${RUN} in
+	'mon' | 'omp' )
+               liste_files=' *abort* memory* namelist* perfs* solver.stat ocean.output layout* GYRE* restart* mono*' ;;
+	'mpi' )
+               liste_files=' *abort* namelist* solver.stat perfs* ocean.output* layout* GYRE* restart* mpp*' ;;
+esac
+
+# Ensure that all files saved are coming from the current run
+ind=1
+for k in $liste_files
+do
+   echo $k > temp
+   var=$( ( awk '{printf("%-.4s", varin ) } ' varin=$k temp ) )
+   if [ ${ind} = 1 -a ${var} = 'perf' ] ; then
+       kc='perf*'
+       rm -f ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/${kc}
+       ind=0
+   fi
+   cp $k ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/$k
+done
+
+##############################################################
+##############################################################
+##############################################################
+###             Retrieve some reference run files
+##############################################################
+##############################################################
+##############################################################
+if [ ${REF_TAG} ]
+then
+   STORE_DATA=${REF_OD}/${CONF}/${REF_TAG}/${RUN}/${DIROUT}
+   LFILES="solver.stat memory_size.txt ocean.output ${RUN}${CONF}_err"
+   for ref_file in ${LFILES}
+   do
+       ${D_GET} ${STORE_DATA}/${TSYMB}${ref_file} ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/REF/${ref_file}
+   done
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch restart job
+##############################################################
+##############################################################
+##############################################################
+if [ $type = '1_short' ] ; then
+    cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/2_SHORT
+    ${LAUNCH}job_${RUN}_2_short.ksh
+fi
Index: trunk/HEAD/2INSTALL/JOBS/job_ORCA2_LIM.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/job_ORCA2_LIM.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/job_ORCA2_LIM.ksh	(revision 1136)
@@ -0,0 +1,250 @@
+set -xv
+
+CONF=ORCA2_LIM
+# Variables changed by lance_batch.ksh script
+RUN=xxx
+NB_PROCS=xxx
+LAUNCH=xxx
+LEXE=xxx
+CPERF=xxx
+D_INPUT=xxx
+D_GET=xxx
+REF_TAG=xxx
+TSYMB=xxx
+
+# Variables changed by ins_valid.ksh script
+MAINDIR=/Users/ctlod/WORK/AZE
+WORK=/Users/ctlod/WORK/AZE/modipsl/config
+REF_OD=/Volumes/FENUA/ORCA2_LIM_nemo_v2_IO
+
+# Arguments
+# type = 'long' or '1_short' or '2_short'
+type=$1
+
+case ${type} in
+        'long' ) 
+             DIROUT='LONG'
+             ITERATIONS=210 ;;
+              
+        '1_short' ) 
+             DIROUT='1_SHORT'
+             ITERATIONS=105 ;;
+              
+        '2_short' ) 
+             DIROUT='2_SHORT'
+             ITERATIONS=105 ;;
+
+        'gtime' ) 
+             DIROUT='GTIME'
+             ITERATIONS=5475 ;;
+esac
+
+# Working directory
+cd ${TMPDIR}
+#-T- osxxlf cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/RUN
+#-T- osxxlf zback=$?
+#-T- osxxlf if [ ${zback} = 0 ] ; then rm -rf namelist* *.nc memory* solver.stat ocean.output* mpp.output* mono.output* ; fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Input files
+##############################################################
+##############################################################
+##############################################################
+# Ocean namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
+
+# Sea-Ice namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist_ice_lim2 namelist_ice
+
+# namelist modifications
+PAT_NIT000=$( grep 'nit000      =' namelist )
+PAT_NITEND=$( grep 'nitend      =' namelist )
+PAT_NSTOCK=$( grep 'nstock      =' namelist )
+PAT_NWRITE=$( grep 'nwrite      =' namelist )
+PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
+PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
+PAT_TRACEN=$( grep 'ln_traadv_cen2   =' namelist )
+PAT_TRATVD=$( grep 'ln_traadv_tvd    =' namelist )
+PAT_N_CLAA=$( grep 'n_cla       =' namelist )
+PAT_NSOLVV=$( grep 'nsolv       =' namelist )
+PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+
+sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
+-e "s%$PAT_NIT000%   nit000     =     1%" \
+-e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
+-e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
+-e "s%$PAT_NWRITE%   nwrite     =     75%" \
+-e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
+-e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
+-e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%" \
+-e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%" \
+-e "s%$PAT_N_CLAA%   n_cla   = 0%" \
+-e "s%$PAT_NSOLVV%   nsolv     =      2%" \
+-e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
+namelist > nam.tmp
+
+mv nam.tmp namelist
+
+# Get forcing files
+${D_GET} ${D_INPUT}/ORCA2_LIM_nemo_v3.tar ORCA2_LIM_nemo_v3.tar
+tar xvf ORCA2_LIM_nemo_v3.tar
+rm -rf ORCA2_LIM_nemo_v3.tar
+
+# Get restarts files if needed
+if [ $type = '2_short' ]
+then
+    if [ ${RUN} = 'mon' -o ${RUN} = 'omp' ] ; then 
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart.nc restart.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*restart_ice.nc restart_ice_in.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld.nc restart_mld.nc
+    fi
+
+    if [ ${RUN} = 'mpi' ] ; then
+        typeset -Z4 i=0
+        while [ $i -lt $NB_PROCS ]
+        do
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_${i}.nc restart_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*restart_ice_${i}.nc restart_ice_in_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld_${i}.nc restart_mld_${i}.nc
+           let i=$i+1
+        done
+    fi
+
+    # namelist modifications
+    PAT_NIT000=$( grep 'nit000     =' namelist )
+    PAT_NITEND=$( grep 'nitend     =' namelist )
+    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
+    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
+    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    ORCA_NIT000=$(( $ITERATIONS + 1 ))
+    ORCA_NITEND=$(( $ITERATIONS*2 ))
+    
+    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
+    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
+    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
+    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
+    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
+    namelist > nam.tmp
+    
+    mv nam.tmp namelist
+
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch run
+##############################################################
+##############################################################
+##############################################################
+
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_${RUN} opa_${CONF}_${RUN}
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_memo opa_${CONF}_memo
+chmod 777 opa_${CONF}_${RUN}
+chmod 777 opa_${CONF}_memo
+
+#
+# Profiling & Executable memory size
+####################################
+touch memory_size.txt
+
+case ${RUN} in
+        'mon' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie echo "Stack memory: $( (size opa_${CONF}_${RUN}) )"    >> memory_size.txt 
+#-T- sx8brodie echo "Static memory: $( (size opa_${CONF}_memo) )"   >> memory_size.txt  ;;
+#-T- aix     ;;
+#-T- ax_mono echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- ax_mono echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;;
+#-T- osxxlf echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- osxxlf echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;; 
+        'mpi' ) 
+#-T- sx8brodie export MPIPROGINF=detail ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+        'omp' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie export OMP_NUM_THREADS=${NB_PROCS} ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+#-T- osxxlf  ;;
+esac
+#
+# >>>>>> EXECUTION < < < <
+##########################
+
+case ${RUN} in
+        'mon' | 'omp' ) 
+              ${CPERF} ./opa_${CONF}_${RUN} ;;
+        'mpi' ) 
+#-T- sx8brodie              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- aix              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- osxxlf   mpd&
+#-T- osxxlf   sleep 5
+#-T- osxxlf   ${CPERF} ${LEXE} ./opa_${CONF}_${RUN}
+#-T- osxxlf   mpdallexit ;;
+esac
+
+ls -l
+#
+
+##############################################################
+##############################################################
+##############################################################
+###             Save output files
+##############################################################
+##############################################################
+##############################################################
+case ${RUN} in
+	'mon' | 'omp' )
+               liste_files='*abort* memory* namelist* perfs* solver.stat ocean.output layout* ORCA2* restart* mono*' ;;
+	'mpi' )
+               liste_files='*abort* namelist* solver.stat perfs* ocean.output* layout* ORCA2* restart* mpp*' ;;
+esac
+
+# Ensure that all files saved are coming from the current run
+ind=1
+for k in $liste_files
+do
+   echo $k > temp
+   var=$( ( awk '{printf("%-.4s", varin ) } ' varin=$k temp ) )
+   if [ ${ind} = 1 -a ${var} = 'perf' ] ; then
+       kc='perf*'
+       rm -f ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/${kc}
+       ind=0
+   fi
+   cp $k ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/$k
+done
+
+##############################################################
+##############################################################
+##############################################################
+###             Retrieve some reference run files
+##############################################################
+##############################################################
+##############################################################
+if [ ${REF_TAG} ]
+then
+   STORE_DATA=${REF_OD}/${CONF}/${REF_TAG}/${RUN}/${DIROUT}
+   LFILES="solver.stat memory_size.txt ocean.output ${RUN}${CONF}_err"
+   for ref_file in ${LFILES}
+   do
+       ${D_GET} ${STORE_DATA}/${TSYMB}${ref_file} ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/REF/${ref_file}
+   done
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch restart job
+##############################################################
+##############################################################
+##############################################################
+if [ $type = '1_short' ] ; then
+    cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/2_SHORT
+    ${LAUNCH}job_${RUN}_2_short.ksh
+fi
Index: trunk/HEAD/2INSTALL/JOBS/job_ZAGRIF.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/job_ZAGRIF.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/job_ZAGRIF.ksh	(revision 1136)
@@ -0,0 +1,277 @@
+set -xv
+
+CONF=ZAGRIF
+# Variables changed by lance_batch.ksh script
+RUN=xxx
+NB_PROCS=xxx
+LAUNCH=xxx
+LEXE=xxx
+CPERF=xxx
+D_INPUT=xxx
+D_GET=xxx
+REF_TAG=xxx
+TSYMB=xxx
+
+# Variables changed by ins_valid.ksh script
+MAINDIR=/Users/ctlod/WORK/AZE
+WORK=/Users/ctlod/WORK/AZE/modipsl/config
+REF_OD=/Volumes/FENUA/ORCA2_LIM_nemo_v2_IO
+
+# Arguments
+# type = 'long' or '1_short' or '2_short'
+type=$1
+
+case ${type} in
+        'long' ) 
+             DIROUT='LONG'
+             ITERATIONS=210
+             NOUTPUT=75 ;;
+              
+        '1_short' ) 
+             DIROUT='1_SHORT'
+             ITERATIONS=105
+             NOUTPUT=75 ;;
+              
+        '2_short' ) 
+             DIROUT='2_SHORT'
+             ITERATIONS=105
+             NOUTPUT=75 ;;
+
+        'gtime' ) 
+             DIROUT='GTIME'
+             ITERATIONS=5475
+             NOUTPUT=75 ;;
+esac
+
+# Working directory
+cd ${TMPDIR}
+
+##############################################################
+##############################################################
+##############################################################
+###             Input files
+##############################################################
+##############################################################
+##############################################################
+# Ocean namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
+
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/1_namelist .
+
+# Sea-Ice namelist
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist_ice_lim2 namelist_ice
+
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/1_namelist_ice_lim2 1_namelist_ice
+
+# AGRIF file
+cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/AGRIF_FixedGrids.in AGRIF_FixedGrids.in
+
+for CHGFILE in `ls *namelist`
+do
+     # namelist modifications
+     PAT_NIT000=$( grep 'nit000      =' ${CHGFILE} )
+     PAT_NITEND=$( grep 'nitend      =' ${CHGFILE} )
+     PAT_NSTOCK=$( grep 'nstock      =' ${CHGFILE} )
+     PAT_NWRITE=$( grep 'nwrite      =' ${CHGFILE} )
+     PAT_NRSTDT=$( grep 'nrstdt      =' ${CHGFILE} )
+     PAT_NBITCM=$( grep 'nbit_cmp   ='   ${CHGFILE} )
+     PAT_TRACEN=$( grep 'ln_traadv_cen2   =' ${CHGFILE} )
+     PAT_TRATVD=$( grep 'ln_traadv_tvd    =' ${CHGFILE} )
+     PAT_N_CLAA=$( grep 'n_cla       =' ${CHGFILE} )
+     PAT_NSOLVV=$( grep 'nsolv       =' ${CHGFILE} )
+     PAT_RESTAR=$( grep 'ln_rstart   =' ${CHGFILE} )
+     PAT_RESMLD=$( grep 'ln_trdmld_restart =' ${CHGFILE} )
+
+    if [ ${CHGFILE} = 'namelist' ] ; then
+        ORCA_NITEND=$(( $ITERATIONS   ))
+        ORCA_NSTOCK=$(( $NOUTPUT   ))
+        PAT_NAMECF_tmp="   cexper     =     \"${CONF}\""
+    else
+        ORCA_NITEND=$(( $ITERATIONS*2 ))
+        ORCA_NSTOCK=$(( $NOUTPUT*2   ))
+        PAT_NAMECF_tmp="$PAT_NAMECF"
+    fi
+
+     sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
+     -e "s%$PAT_NAMECF%$PAT_NAMECF_tmp%" \
+     -e "s%$PAT_NIT000%   nit000     =     1%" \
+     -e "s%$PAT_NITEND%   nitend     =     ${ORCA_NITEND}%" \
+     -e "s%$PAT_NSTOCK%   nstock     =     ${ORCA_NITEND}%" \
+     -e "s%$PAT_NWRITE%   nwrite     =     ${ORCA_NSTOCK}%" \
+     -e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
+     -e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
+     -e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%" \
+     -e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%" \
+     -e "s%$PAT_N_CLAA%   n_cla   = 0%" \
+     -e "s%$PAT_NSOLVV%   nsolv     =      2%" \
+     -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
+     ${CHGFILE} > nam.$$
+     
+     mv nam.$$ ${CHGFILE} && rm -f nam.$$
+done
+
+# Get forcing files
+${D_GET} ${D_INPUT}/ORCA2_LIM_nemo_v3.tar ORCA2_LIM_nemo_v3.tar
+tar xvf ORCA2_LIM_nemo_v3.tar
+rm -rf ORCA2_LIM_nemo_v3.tar
+
+# Get restarts files if needed
+if [ $type = '2_short' ]
+then
+    if [ ${RUN} = 'mon' -o ${RUN} = 'omp' ] ; then 
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/ZAGRI*_restart.nc restart.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/1_*restart.nc 1_restart.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/ZAGRI*restart_ice.nc restart_ice_in.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/1_*restart_ice.nc 1_restart_ice_in.nc
+        cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld.nc restart_mld.nc
+    fi
+
+    if [ ${RUN} = 'mpi' ] ; then
+        typeset -Z4 i=0
+        while [ $i -lt $NB_PROCS ]
+        do
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/ZAGRI*_restart_${i}.nc restart_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/1_*restart_${i}.nc 1_restart_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/ZAGRI*_restart_ice_${i}.nc restart_ice_in_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/1_*restart_ice_${i}.nc 1_restart_ice_in_${i}.nc
+           cp ${WORK}/NEMO_VALID/W${CONF}/${RUN}/1_SHORT/*_restart_mld_${i}.nc restart_mld_${i}.nc
+           let i=$i+1
+        done
+    fi
+
+    for CHGFILE in `ls *namelist`
+    do
+        # namelist modifications
+        PAT_NIT000=$( grep 'nit000     =' ${CHGFILE} )
+        PAT_NITEND=$( grep 'nitend     =' ${CHGFILE} )
+        PAT_NRSTDT=$( grep 'nrstdt     =' ${CHGFILE} )
+        PAT_RESTAR=$( grep 'ln_rstart   =' ${CHGFILE} )
+        PAT_RESMLD=$( grep 'ln_trdmld_restart =' ${CHGFILE} )
+
+        if [ ${CHGFILE} = 'namelist' ] ; then
+            ORCA_NIT000=$(( $ITERATIONS + 1 ))
+            ORCA_NITEND=$(( $ITERATIONS*2   ))
+        else
+            ORCA_NIT000=$(( $ITERATIONS*2 + 1 ))
+            ORCA_NITEND=$(( $ITERATIONS*4 ))
+        fi
+        
+        sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%" \
+        -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000%" \
+        -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND%" \
+        -e "s%$PAT_NRSTDT%   nrstdt     =     2%" \
+        -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" \
+        ${CHGFILE} > nam.$$
+        
+        mv nam.$$ ${CHGFILE} && rm -f nam.$$
+    done
+
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch run
+##############################################################
+##############################################################
+##############################################################
+
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_${RUN} opa_${CONF}_${RUN}
+cp ${WORK}/NEMO_VALID/W${CONF}/opa_${CONF}_memo opa_${CONF}_memo
+chmod 777 opa_${CONF}_${RUN}
+chmod 777 opa_${CONF}_memo
+
+#
+# Profiling & Executable memory size
+####################################
+touch memory_size.txt
+
+case ${RUN} in
+        'mon' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie echo "Stack memory: $( (size opa_${CONF}_${RUN}) )"    >> memory_size.txt 
+#-T- sx8brodie echo "Static memory: $( (size opa_${CONF}_memo) )"   >> memory_size.txt  ;;
+#-T- aix     ;;
+#-T- ax_mono echo "Stack memory: $( (size opa_${CONF}_memo) )"    >> memory_size.txt 
+#-T- ax_mono echo "Static memory: $( (size opa_${CONF}_${RUN}) )"   >> memory_size.txt ;;
+        'mpi' ) 
+#-T- sx8brodie export MPIPROGINF=detail ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+        'omp' ) 
+#-T- sx8brodie export F_PROGINF=detail
+#-T- sx8brodie export OMP_NUM_THREADS=${NB_PROCS} ;;
+#-T- aix     ;;
+#-T- ax_mono ;;
+esac
+#
+# >>>>>> EXECUTION < < < <
+##########################
+
+case ${RUN} in
+        'mon' | 'omp' ) 
+              ${CPERF} ./opa_${CONF}_${RUN} ;;
+        'mpi' ) 
+#-T- sx8brodie              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+#-T- aix              ${CPERF} ${LEXE} ./opa_${CONF}_${RUN} ;;
+esac
+
+ls -l
+#
+
+##############################################################
+##############################################################
+##############################################################
+###             Save output files
+##############################################################
+##############################################################
+##############################################################
+case ${RUN} in
+	'mon' | 'omp' )
+               liste_files=' *abort* memory* *namelist* perfs* solver.stat ocean.output 1_Agulhas* layout* ZAGRIF* restart* mono*' ;;
+	'mpi' )
+               liste_files=' *abort* *namelist* solver.stat perfs* ocean.output* layout* 1_Agulhas* ZAGRIF* restart* mpp*' ;;
+esac
+
+# Ensure that all files saved are coming from the current run
+ind=1
+for k in $liste_files
+do
+   echo $k > temp
+   var=$( ( awk '{printf("%-.4s", varin ) } ' varin=$k temp ) )
+   if [ ${ind} = 1 -a ${var} = 'perf' ] ; then
+       kc='perf*'
+       rm -f ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/${kc}
+       ind=0
+   fi
+   cp $k ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/$k
+done
+
+##############################################################
+##############################################################
+##############################################################
+###             Retrieve some reference run files
+##############################################################
+##############################################################
+##############################################################
+if [ ${REF_TAG} ]
+then
+   STORE_DATA=${REF_OD}/${CONF}/${REF_TAG}/${RUN}/${DIROUT}
+   LFILES="solver.stat memory_size.txt ocean.output ${RUN}${CONF}_err"
+   for ref_file in ${LFILES}
+   do
+       ${D_GET} ${STORE_DATA}/${TSYMB}${ref_file} ${WORK}/NEMO_VALID/W${CONF}/${RUN}/${DIROUT}/REF/${ref_file}
+   done
+fi
+
+##############################################################
+##############################################################
+##############################################################
+###             Launch restart job
+##############################################################
+##############################################################
+##############################################################
+if [ $type = '1_short' ] ; then
+    cd ${WORK}/NEMO_VALID/W${CONF}/${RUN}/2_SHORT
+    ${LAUNCH}job_${RUN}_2_short.ksh
+fi
Index: trunk/HEAD/2INSTALL/JOBS/lance_batch.ksh
===================================================================
--- trunk/HEAD/2INSTALL/JOBS/lance_batch.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/JOBS/lance_batch.ksh	(revision 1136)
@@ -0,0 +1,290 @@
+#!/bin/ksh
+######################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# INPUT ARGS: 3 + 1 optional
+#     - CONF  : configuration name (ORCA2_LIM, GYRE ..)
+#     - MTIME : timing/no timing (timing or notiming)
+#     - JOBTOL: jobs to launch: all, long, 1_short or gtime
+#     - REFTAG: (optional): reference tag name to which current 
+#               version will be compare to
+#
+# WORK: This script aims to (for each standard configuration) :
+#
+#    I.   Take into account target's specificities 
+#         Variables below must be filled for a new target
+#         - W_XX   = name of target 
+#         - LAUN   = name of jobs launcher command
+#         - LLJOBS = name of jobs listing command
+#         - LSUB   = name of running command
+#         - LPERF  = name of timing command for the whole run
+#         - LJTIM  = required time for a one year run (/proc)
+#         - LJTIMJ = required time for a one year run (job)
+#         - CMDGET = name of specific command to retrieve files
+#         - SYMBOL = identifier associated to a platform which 
+#                    is used to name all outputs files
+#                    Ex: For Brodie, this symbol could be "B_" so
+#                    file names looks like B_solver.stat ...
+#
+#    II.  Build jobs
+#         - based on specific header depending on target, it must 
+#           be provided for a new target following samples
+#           jhd_[target_name]_mon for mono-processors runs
+#           jhd_[target_name]_mpi for multi-processors MPI runs
+#           jhd_[target_name]_omp for multi-processors OPen-MP runs
+#
+#    III. Launch jobs
+#         to test both reproductibility and restartability
+#         for each configuration NAME_CONF 
+#         & for each run type [mon, mpi, omp] 
+#         3 runs will be launched:
+#              - LONG
+#              - 1_SHORT
+#              - 2_SHORT
+#
+#    IV. Launch cron job
+#         Since no jobs (for a given configuration) are in 
+#         the batch queue, this cron will launch the assessment.ksh 
+#         script
+#
+##########################################################
+#set -xv
+##########################################################
+##### Begin Users modifications
+##########################################################
+# IODIR     : directory where to get ORCA2_LIM_nemo_v2.tar 
+# PRC       : total number of processors which will be used
+##########################################################
+IODIR=/Volumes/FENUA/ORCA2_LIM_nemo_v2_IO
+PRC=8
+TARGET=osxxlf
+##########################################################
+##### End   Users modifications
+##########################################################
+
+CONF=$1
+MTIME=$2
+JOBTOL=$3
+REFTAG=$4
+RUN=$(basename `pwd`)
+
+# Specific case of Zahir:
+if [ ${RUN} = 'mon' -a ${TARGET} = 'aix' ] ; then TARGET=ax_mono ; fi
+
+# ---------------------------------------------------------------
+#  I. Take into account target's specificities 
+#     Select appropriate target lines in Job_${CONF}.ksh
+# ---------------------------------------------------------------
+if   [ ${TARGET} = 'sx8brodie' ]; then
+    W_XX='#-T- sx8brodie'
+    LAUN='qsub '
+    LLJOBS=qstat
+    LSUB="mpirun -np ${PRC}"
+    LPERF=
+    LJTIM='01:20:00'
+    LJTIMJ='01:40:00'
+    CMDGET=mfget
+    SYMBOL=B_
+elif [ ${TARGET} = 'aix' ]; then
+    W_XX='#-T- aix'
+    LAUN='llsubmit '
+    LLJOBS=Qstat
+    LSUB=
+    LPERF="poe hpmcount -o perfs_mpi.txt" 
+    LJTIM=4000
+    LJTIMJ=
+    CMDGET=mfget
+    SYMBOL=Z_
+elif [ ${TARGET} = 'ax_mono' ]; then
+    W_XX='#-T- ax_mono'
+    LAUN='llsubmit '
+    LLJOBS=Qstat
+    LSUB=
+    LPERF="hpmcount -o perfs_mon.txt" 
+    LJTIM=30000
+    LJTIMJ=
+    CMDGET=mfget
+    SYMBOL=Z_
+elif [ ${TARGET} = 'osxxlf' ]; then
+    W_XX='#-T- osxxlf'
+    LAUN='./'
+    LLJOBS=
+    LSUB="mpirun -np ${PRC}"
+    LPERF=
+    LJTIM=
+    LJTIMJ=
+    CMDGET=cp
+    SYMBOL=D_
+else
+    echo '	#######################################'
+    echo ' 	You must give a target name :'
+    echo ' 	sx8brodie, aix, ax_mono or add one'
+    echo ' 	Have a look in lance_batch.ksh script'
+    echo '	#######################################'
+    stop
+fi
+
+sed -e "s/^$W_XX *//" job_${CONF}.ksh | grep -v '^#-T- ' > job_${CONF}.$$
+
+# --------------------------------------------------------------
+# II. Build jobs 
+#     Adapt header (batch jobs) and concatanate it with core job
+# --------------------------------------------------------------
+case ${TARGET} in
+     'osxxlf' )
+	  cp jhd_${TARGET}_${RUN} jhd_${TARGET}_${RUN}_tmp  ;;
+     'ax_mono' )
+          CAR_JNAM=$( grep '\# @ job_name' jhd_${TARGET}_${RUN} )
+          sed    -e "s/$CAR_JNAM/\# @ job_name = ${RUN}${CONF}/" \
+          jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp  ;;
+     'aix' )
+          CAR_JNAM=$( grep '\# @ job_name' jhd_${TARGET}_${RUN} )
+          CAR_JMPI=$( grep '\# @ total_tasks' jhd_${TARGET}_${RUN} )
+          sed    -e "s/$CAR_JNAM/\# @ job_name = ${RUN}${CONF}/" \
+          -e "s/$CAR_JMPI/\# @ total_tasks = ${PRC}/" \
+          jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp  ;;
+     'sx8brodie' )
+          CAR_JNAM=$( grep '\#PBS -N ' jhd_${TARGET}_${RUN} )
+          CAR_JNAMO=$( grep '\#PBS -o ' jhd_${TARGET}_${RUN} )
+          CAR_JNAME=$( grep '\#PBS -e ' jhd_${TARGET}_${RUN} )
+          if [ ${RUN} = 'mpi' -o ${RUN} = 'omp' ] ; then
+              CAR_JMPI=$( grep '\#PBS -l cpunum_job' jhd_${TARGET}_${RUN} )
+              sed    -e "s/$CAR_JNAM/\#PBS -N  ${RUN}${CONF}/" \
+              -e "s/$CAR_JNAMO/\#PBS -o  ${RUN}${CONF}_std/" \
+              -e "s/$CAR_JNAME/\#PBS -e  ${RUN}${CONF}_err/" \
+              -e "s/$CAR_JMPI/\#PBS -l cpunum_job=${PRC}/" \
+              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+          else
+              sed    -e "s/$CAR_JNAM/\#PBS -N  ${RUN}${CONF}/" \
+              -e "s/$CAR_JNAMO/\#PBS -o  ${RUN}${CONF}_std/" \
+              -e "s/$CAR_JNAME/\#PBS -e  ${RUN}${CONF}_err/" \
+              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+          fi ;;
+esac
+
+cat jhd_${TARGET}_${RUN}_tmp job_${CONF}.$$ > job_tmp_${RUN}.ksh
+rm -f job_${CONF}.$$ jhd_${TARGET}_${RUN}_tmp
+
+# -----------------------------------------------------------------------------
+# III. Launch jobs
+#      The 3 following jobs are created for the run [type]=mon,mpi,omp :
+#      - "job_[type]_long.ksh"      ---> long run
+#      - "job_[type]_1_short.ksh"   ---> stream 1 run
+#      - "job_[type]_2_short.ksh"   ---> stream 2 run
+#      - "job_[type]_gtime.ksh"     ---> one year run
+#      The first 2 as the last one are immediatly launched whereas "job_[type]_2_short.ksh"
+#      is launched only when the "job_[type]_1_short.ksh" short run is finished
+# -----------------------------------------------------------------------------
+jobnam[0]=long ; jobnam[1]=1_short ; jobnam[2]=2_short ; jobnam[3]=gtime 
+dirjob[0]=LONG ; dirjob[1]=1_SHORT ; dirjob[2]=2_SHORT ; dirjob[3]=GTIME 
+
+case ${JOBTOL} in
+     'all' )
+              if [ ${MTIME} = 'timing' ] ; then 
+	          ind=0 
+		  iloop=4
+	      else
+	          ind=0 
+		  iloop=3
+              fi 
+	      ;;
+     'long' )
+              ind=0 
+	      iloop=1 ;;
+     'short' )
+              ind=1 
+	      iloop=3 ;;
+     'gtime' )
+              ind=3 
+	      iloop=4 ;;
+esac
+
+while [ $ind -lt ${iloop} ]
+do
+       CAR_TYPE_tmp=$( grep 'type=' job_tmp_${RUN}.ksh )
+       CAR_TYPE=`echo $CAR_TYPE_tmp | cut -f 1 -d " " `
+       CAR_RUN_tmp=$( grep 'RUN=xxx' job_tmp_${RUN}.ksh )
+       CAR_RUN=`echo $CAR_RUN_tmp | cut -f 1 -d " " `
+       CAR_MPP_tmp=$( grep 'NB_PROCS=xxx' job_tmp_${RUN}.ksh )
+       CAR_MPP=`echo $CAR_MPP_tmp | cut -f 1 -d " " `
+       CAR_SUB_tmp=$( grep 'LAUNCH=xxx' job_tmp_${RUN}.ksh )
+       CAR_SUB=`echo $CAR_SUB_tmp | cut -f 1 -d " " `
+       CAR_EXE_tmp=$( grep 'LEXE=xxx' job_tmp_${RUN}.ksh )
+       CAR_EXE=`echo $CAR_EXE_tmp | cut -f 1 -d " " `
+       CAR_PER_tmp=$( grep 'CPERF=xxx' job_tmp_${RUN}.ksh )
+       CAR_PER=`echo $CAR_PER_tmp | cut -f 1 -d " " `
+       CAR_MAN_tmp=$( grep 'MAINDIR=xxx' job_tmp_${RUN}.ksh )
+       CAR_MAN=`echo $CAR_MAN_tmp | cut -f 1 -d " " `
+       CAR_INP_tmp=$( grep 'D_INPUT=xxx' job_tmp_${RUN}.ksh )
+       CAR_INP=`echo $CAR_INP_tmp | cut -f 1 -d " " `
+       CAR_GET_tmp=$( grep 'D_GET=xxx' job_tmp_${RUN}.ksh )
+       CAR_GET=`echo $CAR_GET_tmp | cut -f 1 -d " " `
+       CAR_RTG_tmp=$( grep 'REF_TAG=xxx' job_tmp_${RUN}.ksh )
+       CAR_RTG=`echo $CAR_RTG_tmp | cut -f 1 -d " " `
+       CAR_TSY_tmp=$( grep 'TSYMB=xxx' job_tmp_${RUN}.ksh )
+       CAR_TSY=`echo $CAR_TSY_tmp | cut -f 1 -d " " `
+
+       sed    -e "s/$CAR_TYPE/type=${jobnam[$ind]}/" \
+       -e "s/$CAR_RUN/RUN=$RUN/" \
+       -e "s/$CAR_MPP/NB_PROCS=$PRC/" \
+       -e "s@$CAR_SUB@LAUNCH='$LAUN'@" \
+       -e "s/$CAR_EXE/LEXE='$LSUB'/" \
+       -e "s/$CAR_PER/CPERF='$LPERF'/" \
+       -e "s?$CAR_INP?D_INPUT=$IODIR?" \
+       -e "s/$CAR_GET/D_GET=$CMDGET/" \
+       -e "s/$CAR_RTG/REF_TAG=$REFTAG/" \
+       -e "s/$CAR_TSY/TSYMB=$SYMBOL/" \
+       job_tmp_${RUN}.ksh > job_${RUN}_${jobnam[$ind]}.ksh
+
+       if [ ${jobnam[$ind]} = 'gtime' ] ; then
+
+           case ${TARGET} in
+                'ax_mono' | 'aix' )
+                     CAR_JTIM=$( grep '\# @ cpu_limit' job_${RUN}_${jobnam[$ind]}.ksh )
+                     sed    -e "s/$CAR_JTIM/\# @ cpu_limit = ${LJTIM}/" \
+                     job_${RUN}_${jobnam[$ind]}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
+                'sx8brodie' )
+                     CAR_JTIMP=$( grep '\#PBS -l cputim_prc' job_${RUN}_${jobnam[$ind]}.ksh )
+                     CAR_JTIMJ=$( grep '\#PBS -l cputim_job' job_${RUN}_${jobnam[$ind]}.ksh )
+                     sed    -e "s/$CAR_JTIMP/\#PBS -l cputim_prc=${LJTIM}/" \
+                     -e "s/$CAR_JTIMJ/\#PBS -l cputim_job=${LJTIMJ}/" \
+                     job_${RUN}_${jobnam[$ind]}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
+           esac
+           mv job_${RUN}_${jobnam[$ind]}.ksh_tmp job_${RUN}_${jobnam[$ind]}.ksh
+
+       fi
+
+       chmod 750 job_${RUN}_${jobnam[$ind]}.ksh
+       mv job_${RUN}_${jobnam[$ind]}.ksh ${dirjob[$ind]}/.
+
+       if [ ${jobnam[$ind]} != '2_short' ] ; then
+           cd ${dirjob[$ind]}
+           ${LAUN}job_${RUN}_${jobnam[$ind]}.ksh &
+           cd ../
+       fi
+
+       let ind=$ind+1
+done
+rm -f job_tmp_${RUN}.ksh
+
+# List all jobs submitted
+${LLJOBS}
+
+# -----------------------------------------------------------------------------
+# IV. Launch cron to be able to launch the assessment step
+# -----------------------------------------------------------------------------
+if [ ${RUN} == 'mon' ] ; then
+    cd ..
+    
+    CAR_LJOB_tmp=$( grep 'LJOBS=' cron_jobs.ksh )
+    CAR_LJOB=`echo $CAR_LJOB_tmp | cut -f 1 -d " " `
+    
+    sed    -e "s/$CAR_LJOB/LJOBS=${LLJOBS}/" cron_jobs.ksh > cron_jobs.$$
+    mv cron_jobs.$$ cron_jobs.ksh &&  rm -rf cron_jobs.$$
+    chmod 744 cron_jobs.ksh 
+
+    if [ ${TARGET} != 'osxxlf' ]; then
+        ./cron_jobs.ksh ${CONF} &
+    fi
+fi
Index: trunk/HEAD/2INSTALL/MODIPSL_FILES/ins_make
===================================================================
--- trunk/HEAD/2INSTALL/MODIPSL_FILES/ins_make	(revision 1136)
+++ trunk/HEAD/2INSTALL/MODIPSL_FILES/ins_make	(revision 1136)
@@ -0,0 +1,163 @@
+#!/bin/ksh
+# $Id: ins_make 108 2007-07-26 10:18:31Z bellier $
+#---------------------------------------------------------------------
+#- Installation of Makefiles according to an environment
+#---------------------------------------------------------------------
+function ins_make_Usage
+{
+echo "
+ins_make install the Makefile in the directories
+
+Usage :
+  ${b_n} [-h] [-v] [-d] [-p r] [-t h] [-w w] [-m m]
+
+Options :
+  -h   : help
+  -v   : verbose mode
+  -d   : debug mode
+  -p p : int and real precision I4R4/I4R8/I8R8/4/8
+  -t h : target host_name
+  -w w : directory Where to install the Makefile (recursive)
+  -m m : mpi context choosen for the coupling MPI1/MPI2
+
+Defaults :
+   -t local_host -p I4R8
+
+Example for remote host compilation :
+  ins_make -t sx8brodie
+"
+}
+#-  dirname and  basename
+d_n=${0%/*}; b_n=${0##*/};
+#- Retrieving and validation of the options
+x_v='silencious'; x_d='normal'; x_p="??"; x_t="??"; x_w="??"; x_m='??';
+while getopts :hvdp:m:t:w: V
+  do
+   case ${V} in
+    (h)  ins_make_Usage; exit 0;;
+    (v)  x_v='verbose';;
+    (d)  x_d='debug';;
+    (p)  x_p=${OPTARG};;
+    (t)  x_t=${OPTARG};;
+    (w)  x_w=${OPTARG};;
+    (m)  x_m=${OPTARG};;
+    (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
+         exit 2;;
+    (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
+         exit 2;;
+   esac
+  done
+shift $(($OPTIND-1));
+#-
+# Treatment of the options
+#-
+# Default INTEGER and REAL precision
+case ${x_p} in
+ ( I4R4 | 4 )  x_p='I4R4'; w_ip='4'; w_rp='4';;
+ ( I4R8 | ?? ) x_p='I4R8'; w_ip='4'; w_rp='8';;
+ ( I8R8 | 8 )  x_p='I8R8'; w_ip='8'; w_rp='8';;
+ (*)
+   echo 'Invalid precision ' 1>&2;
+   echo ${x_p}' (must be I4R4, I4R8, I8R8, 4 or 8)' 1>&2;
+   exit 1;;
+esac
+#-
+# Target_Host Name
+[[ ${x_t} = '??' ]] && \
+ { x_t=$(${d_n}/w_i_h);
+   { [[ ${?} != 0 ]] && \
+      { echo "Bad installation : w_i_h/uname unreachable" 1>&2;
+        exit 1; }; } || \
+     [[ ${x_t} = "Unknown" ]] && \
+      { echo "Local_Host not supported" 1>&2; exit 1; }; }
+#-
+MKTG=${d_n}'/AA_make.gdef'
+[[ ! -f "${MKTG}" ]] && { echo "${MKTG} unreachable ..."; exit 3; }
+#-
+W_XX=$(sed -n -e "s/^#-Q-  *\([^ ]*\).*$/\1/p" ${MKTG} | \
+       sort -u | sed -e "/${x_t}/!d");
+[[ '\?'"${W_XX}" != '\?'${x_t} ]] && \
+  { echo "Target_Host  "${x_t}"  not supported" 1>&2; exit 1; }
+#-
+case ${x_m} in
+ ( mpi1 | mpi2 | MPI1 | MPI2 | ?? );;
+ (*) echo "MPI context "${x_m}" not supported" 1>&2; exit 1;;
+esac
+#-
+[[ ${x_v} = 'verbose' ]] && \
+ { echo "";
+   echo '--- Mode         : '${x_v};
+   echo '--- Compilation  : '${x_d};
+   echo '--- Precision    : '${x_p};
+   echo '--- Target       : '${x_t};
+   echo '--- MPI context  : '${x_m}; }
+#-
+if [ '\?'${x_w} = '\?' ]; then
+l_rep=$(find ${d_n}/.. -name AA_make -print)
+else
+l_rep=$(find ${d_n}/../*/${x_w} -name AA_make -print)
+fi
+#-
+W_OS=${x_t};
+echo " ";
+echo "Installation of makefiles for $W_OS";
+echo " ";
+#-
+for i in ${l_rep}
+do
+  j=${i%/AA_make};
+  echo "Installation in ${j}";
+  MKTL="${j}"'/AA_make.ldef';
+  [[ ! -f "${MKTL}" ]] && { echo "${MKTL} unreachable ..."; exit 3; }
+  MKTR="${j}"'/AA_make';
+  cat ${MKTL} ${MKTG} ${MKTR} > mk1.$$;
+  W_PR='#-Q- '; W_XX=${W_PR}${x_t};
+  sed -e "/^${W_XX} */ s///" -e "/^${W_PR}/d" mk1.$$ > mk2.$$;
+#-
+# Default INTEGER and REAL precision
+  W_PR='#-P- '; W_XX=${W_PR}${x_p};
+  sed -e "/^${W_XX} */ s///" -e "/^${W_PR}/d" mk2.$$ > mk1.$$;
+#-
+# Handle the precision module "defprec.f90" in "IOIPSL/src"
+  [[ '!!'${j##*/modeles} = '!!/IOIPSL/src' ]] && \
+   { [[ ${x_v} = 'verbose' ]] && W_XX='-v' || W_XX="";
+     ${d_n}/ins_m_prec ${W_XX} -i ${w_ip} -r ${w_rp}; r_c=${?};
+     unset w_ip w_rp;
+     [[ ${r_c} != 0 ]] && exit ${r_c}; }
+#-
+# Debug
+  W_PR='#-D- ';
+  [[ ${x_d} = 'debug' ]] && W_XX=${W_PR}'MD' || W_XX=${W_PR}'MN';
+  sed -e "/^${W_XX} */ s///" -e "/^${W_PR}/d" mk1.$$ > mk2.$$;
+#-
+# Retrieve the path of the directory
+  mk_dir=$(cd ${j};/bin/pwd;)
+  W_XX='MAKE_DIR ='
+# Update the value
+  sed -e "s!^${W_XX}.*!${W_XX} ${mk_dir}!" mk2.$$ > mk1.$$
+  unset mk_dir;
+#-
+# Choice of mpi library for the coupling
+  W_XX='LIB_MPI ='; W_XX_BIS='LIB_MPI_BIS =';
+  case ${x_m} in
+   ( mpi1 | MPI1 )
+    lib_mpi='MPI1'; lib_mpi_bis='MPI1';
+    sed -e "s!^${W_XX}.*!${W_XX} ${lib_mpi}!" \
+        -e "s!^${W_XX_BIS}.*!${W_XX_BIS} ${lib_mpi_bis}!" \
+      mk1.$$ > ${j}/Makefile;;
+   ( mpi2 | MPI2 )
+    lib_mpi='MPI2'; lib_mpi_bis='';
+    sed -e "s!^${W_XX}.*!${W_XX} ${lib_mpi}!" \
+        -e "s!^${W_XX_BIS}.*!${W_XX_BIS} ${lib_mpi_bis}!" \
+      mk1.$$ > ${j}/Makefile;;
+   (??) 
+    cp mk1.$$ ${j}/Makefile;;
+   (*) ;;
+  esac
+  unset lib_mpi lib_mpi_bis;
+done
+#-
+echo "";
+unset W_XX W_XX_BIS; rm -f mk1.$$ mk2.$$;
+#-
+exit 0;
Index: trunk/HEAD/2INSTALL/ins_valid.ksh
===================================================================
--- trunk/HEAD/2INSTALL/ins_valid.ksh	(revision 1136)
+++ trunk/HEAD/2INSTALL/ins_valid.ksh	(revision 1136)
@@ -0,0 +1,283 @@
+#!/bin/ksh
+######################################################
+# Original : C. Talandier for ESOPA
+# Contact  : opatlod@locean-ipsl.upmc.fr
+#
+# This script aims to (for each standard configuration) :
+#  - I. Take into account specific files changes
+#       - ./modipsl/util/ins_make
+#       - ./modipsl/config/NAME_CONFIG/AA_make*
+#       - ./modipsl/config/NAME_CONFIG/scripts/BB_make.ldef
+#  - II. Build configuration's environment & dependencies
+#       - ./modipsl/config/NAME_CONFIG/WORK
+#       - ./modipsl/config/NAME_CONFIG/MY_SRC
+#       - ./modipsl/config/NAME_CONFIG/scripts/BB_make
+#  - III. Build results sub-directories in the OUTDIR 
+#         directory specified by user just below
+#         NEMO_VALID/WNAME_CONFIG/
+#                    |-- mon		--> MONO run
+#                    |   |-- 1_SHORT
+#                    |   |-- 2_SHORT
+#                    |   |-- LONG
+#                    |   `-- GTIME
+#                    |-- mpi		--> MPI run
+#                    |   |-- 1_SHORT
+#                    |   |-- 2_SHORT
+#                    |   |-- LONG
+#                    |   `-- GTIME
+#                    `-- omp		--> Open-MP run
+#                        |-- 1_SHORT
+#                        |-- 2_SHORT
+#                        |-- LONG
+#                        `-- GTIME
+#
+#  - IV. Modify lance_batch.ksh & assessment.ksh scripts
+#  - V. Preliminary compilations
+######################################################
+
+#set -xv
+
+##########################################################
+##### Begin Users modifications
+##########################################################
+# OUTDIR : working directory from which jobs will be launched 
+#          & results stored
+# INPUTD : directory where to get ORCA2_LIM_nemo_v2.tar 
+# REFDAT : directory where to get results from reference tags
+# DECOMP : total number of processors which will be used
+# MAIL   : give your e-mail
+# UAGRIF : one of the standard configurations is based on AGRIF yes/no
+##########################################################
+OUTDIR=/Users/ctlod/WORK/AZE/modipsl/config
+INPUTD=/u/rech/eee/reee831/IO_NEMO_ORCA2_LIM
+REFDAT=/u/rech/eee/reee831/NEMO_VALIDATION
+DECOMP=8
+MAIL="ctlod@locean-ipsl.upmc.fr"
+UAGRIF=yes
+##########################################################
+##### End   Users modifications
+##########################################################
+
+
+# Standard configurations
+NBCFG=4
+CONF[0]=ORCA2_LIM
+CONF[1]=GYRE
+CONF[2]=GYRE_LOBSTER
+CONF[3]=ZAGRIF
+LCLDIR=`pwd`
+
+# Use a modified modipsl script: ins_make
+# which allows to build Makefiles of a specific configuration
+# using the following syntax: ins_make -w NAME_CONF
+cp ./MODIPSL_FILES/ins_make ../../../util/.
+
+# Set following variable in AA_make.ldef script
+# - WWDIR = directory where to store results and jobs
+CAR_WORK_tmp=$( grep 'WWDIR=' ./CONFIG_FILES/AA_make.ldef )
+CAR_WORK=`echo $CAR_WORK_tmp | cut -f 1 -d " " `
+sed -e "s?${CAR_WORK}?WWDIR=${OUTDIR}?" ./CONFIG_FILES/AA_make.ldef > ./CONFIG_FILES/AA_make.ldef.$$ 
+mv ./CONFIG_FILES/AA_make.ldef.$$  ./CONFIG_FILES/AA_make.ldef && rm -f ./CONFIG_FILES/AA_make.ldef.$$
+
+# Get the current target name
+LOCTARG=`../../../util/w_i_h`
+
+# Loop over each standard configuration
+# #####################################
+ind=0
+while [ $ind -lt ${NBCFG} ]
+do
+       # I. Take into account specific changes
+       # #####################################
+       # Set following variables in job_NAME_CONF.ksh script
+       # - MAINDIR = directory where to get namelist input files
+       # - WORK    = directory where to store results
+       # - REF_OD  = directory where Are stored results from previous tags
+       cd ../../../.. ; NAME_ARCH=$( pwd ) ;
+       cd ${LCLDIR}
+       echo ${NAME_ARCH}
+       CAR_MAIN_tmp=$( grep 'MAINDIR=' ./JOBS/job_${CONF[${ind}]}.ksh )
+       CAR_MAIN=`echo $CAR_MAIN_tmp | cut -f 1 -d " " `
+       CAR_WORK_tmp=$( grep 'WORK=' ./JOBS/job_${CONF[${ind}]}.ksh )
+       CAR_WORK=`echo $CAR_WORK_tmp | cut -f 1 -d " " `
+       CAR_REFO_tmp=$( grep 'REF_OD=' ./JOBS/job_${CONF[${ind}]}.ksh  | head -1 )
+       CAR_REFO=`echo $CAR_REFO_tmp | cut -f 1 -d " " `
+       sed -e "s?${CAR_MAIN}?MAINDIR=${NAME_ARCH}?" -e "s?${CAR_WORK}?WORK=${OUTDIR}?" \
+       -e "s?${CAR_REFO}?REF_OD=${REFDAT}?" ./JOBS/job_${CONF[${ind}]}.ksh > ./JOBS/job_tmp.$$
+       mv ./JOBS/job_tmp.$$  ./JOBS/job_${CONF[${ind}]}.ksh && rm -f ./JOBS/job_tmp.$$
+
+       # II. Build configuration environment
+       # ###################################
+       (cd ../ ; ./use_cfg -n ${CONF[${ind}]} ;)
+echo '			'
+echo '	     >>>>>>>>   Configuration directories have been built:'
+echo "			./config/${CONF[${ind}]}/WORK"
+echo "			./config/${CONF[${ind}]}/MY_SRC"
+echo '			'
+
+       cp ./CONFIG_FILES/AA_make* ../../${CONF[${ind}]}/.
+       cp ./CONFIG_FILES/BB_make.ldef_${CONF[${ind}]} ../../${CONF[${ind}]}/scripts/BB_make.ldef
+
+       # Configuration dependencies
+       (cd ../../${CONF[${ind}]} ; ../VALID/fait_AA_make ; )
+echo '			'
+echo "             >>>>>>>>   Dependencies file ./config/${CONF[${ind}]}/BB_make have been re-built"
+echo '			'
+
+       # III. Build output sub-directories
+       # #################################
+       # Directories from where Jobs will be launched 
+       # and where results will be stored before analysed
+       cd ${OUTDIR}
+       if [ ! -d 'NEMO_VALID' ] ;  then
+           mkdir  NEMO_VALID
+       fi
+           cd NEMO_VALID
+       if [ ! -d W${CONF[${ind}]} ] ;  then
+           mkdir W${CONF[${ind}]}
+       fi
+       if [ ! -d W${CONF[${ind}]}/mon ] ;  then
+           mkdir W${CONF[${ind}]}/mon
+       fi
+       if [ ! -d W${CONF[${ind}]}/mon/LONG ] ;  then
+           mkdir W${CONF[${ind}]}/mon/LONG
+           mkdir W${CONF[${ind}]}/mon/LONG/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mon/LONG/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mon/GTIME ] ;  then
+           mkdir W${CONF[${ind}]}/mon/GTIME
+           mkdir W${CONF[${ind}]}/mon/GTIME/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mon/GTIME/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mon/1_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/mon/1_SHORT
+           mkdir W${CONF[${ind}]}/mon/1_SHORT/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mon/1_SHORT/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mon/2_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/mon/2_SHORT
+           mkdir W${CONF[${ind}]}/mon/2_SHORT/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mon/2_SHORT/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mpi ] ;  then
+           mkdir W${CONF[${ind}]}/mpi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mpi/LONG ] ;  then
+           mkdir W${CONF[${ind}]}/mpi/LONG
+           mkdir W${CONF[${ind}]}/mpi/LONG/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mpi/LONG/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mpi/GTIME ] ;  then
+           mkdir W${CONF[${ind}]}/mpi/GTIME
+           mkdir W${CONF[${ind}]}/mpi/GTIME/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mpi/GTIME/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mpi/1_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/mpi/1_SHORT
+           mkdir W${CONF[${ind}]}/mpi/1_SHORT/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mpi/1_SHORT/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/mpi/2_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/mpi/2_SHORT
+           mkdir W${CONF[${ind}]}/mpi/2_SHORT/REF
+	   if [ ${LOCTARG} = 'osxxlf' ] ; then mkdir W${CONF[${ind}]}/mpi/2_SHORT/RUN ; fi
+       fi
+       if [ ! -d W${CONF[${ind}]}/omp ] ;  then
+           mkdir W${CONF[${ind}]}/omp
+       fi
+       if [ ! -d W${CONF[${ind}]}/omp/LONG ] ;  then
+           mkdir W${CONF[${ind}]}/omp/LONG
+           mkdir W${CONF[${ind}]}/omp/LONG/REF
+       fi
+       if [ ! -d W${CONF[${ind}]}/omp/GTIME ] ;  then
+           mkdir W${CONF[${ind}]}/omp/GTIME
+           mkdir W${CONF[${ind}]}/omp/GTIME/REF
+       fi
+       if [ ! -d W${CONF[${ind}]}/omp/1_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/omp/1_SHORT
+           mkdir W${CONF[${ind}]}/omp/1_SHORT/REF
+       fi
+       if [ ! -d W${CONF[${ind}]}/omp/2_SHORT ] ;  then
+           mkdir W${CONF[${ind}]}/omp/2_SHORT
+           mkdir W${CONF[${ind}]}/omp/2_SHORT/REF
+       fi
+echo '			'
+echo '	     >>>>>>>>   The following sub-directories have been built '
+echo '                        under main directory '$( pwd )
+echo '			They are dedicated to store results'
+       tree W${CONF[${ind}]}
+echo '			'
+
+       cd ${LCLDIR}
+
+       let ind=$ind+1
+done
+
+
+# IV. Modify lance_batch.ksh & assessment.ksh scripts
+# ###################################################
+# Set following variables in lance_batch.ksh script
+# - IODIR = directory where to get ORCA2_LIM_nemo_v2.tar
+# - PRC   = total number of processors which will be used
+
+CAR_INPU_tmp=$( grep 'IODIR=' ./JOBS/lance_batch.ksh )
+CAR_INPU=`echo $CAR_INPU_tmp | cut -f 1 -d " " `
+CAR_PROC_tmp=$( grep 'PRC=' ./JOBS/lance_batch.ksh )
+CAR_PROC=`echo $CAR_PROC_tmp | cut -f 1 -d " " `
+CAR_TARG_tmp=$( grep 'TARGET=' ./JOBS/lance_batch.ksh | head -1)
+CAR_TARG=`echo $CAR_TARG_tmp | cut -f 1 -d " " `
+sed -e "s?${CAR_INPU}?IODIR=${INPUTD}?" -e "s?${CAR_PROC}?PRC=${DECOMP}?" \
+-e "s/${CAR_TARG}/TARGET=${LOCTARG}/" ./JOBS/lance_batch.ksh > ./JOBS/lance_batch.$$
+mv ./JOBS/lance_batch.$$  ./JOBS/lance_batch.ksh && rm -f ./JOBS/lance_batch.$$
+chmod 744 ./JOBS/lance_batch.ksh
+
+# Set following variables in assessment.ksh script
+# - TARGET = the current plateform 
+# - MAIL   = your e-mail
+CAR_TARG_tmp=$( grep 'TARGET=' ./JOBS/assessment.ksh )
+CAR_TARG=`echo $CAR_TARG_tmp | cut -f 1 -d " " `
+CAR_MAIL_tmp=$( grep 'EMAIL=' ./JOBS/assessment.ksh )
+CAR_MAIL=`echo $CAR_MAIL_tmp | cut -f 1 -d " " `
+sed -e "s/${CAR_TARG}/TARGET=${LOCTARG}/" -e "s/${CAR_MAIL}/EMAIL='${MAIL}'/" \
+./JOBS/assessment.ksh > ./JOBS/assessment.$$
+mv ./JOBS/assessment.$$  ./JOBS/assessment.ksh && rm -f ./JOBS/assessment.$$
+chmod 744 ./JOBS/assessment.ksh
+
+# V. Preliminary compilations
+# ###########################
+
+# IOIPSL compilation
+../../../util/ins_make -w IOIPSL
+if [ ${LOCTARG} = 'sx8brodie' ] ; then
+    (cd ../../../modeles/IOIPSL/src ; sxgmake ;)
+else
+    (cd ../../../modeles/IOIPSL/src ; gmake ;)
+fi
+echo '			'
+echo '	     >>>>>>>>   IOIPSL Makefile and compilation done'
+echo '			'
+
+# AGRIF compilation
+if [ ${UAGRIF} = 'yes' ] ;  then
+    ../../../util/ins_make -w AGRIF
+    (cd ../../../modeles/AGRIF/ ; gmake ;)
+    echo '			'
+    echo '			AGRIF Makefile and compilation done'
+    echo '			'
+fi
+
+
+echo '			'
+echo '			#############################################################'
+echo '             >>>>>>>>   Now set "by hand" the mpi domain decomposition indices jpni, '
+echo '                        jpnj & jpnij in par_oce.F90_keep files (keeping the "_keep" extension) '
+echo "                        in coherence with the ${DECOMP} total number of processors you just set "
+echo '                        Make this modification in the following directories:         '
+ind=0
+while [ $ind -lt ${NBCFG} ]
+do
+echo "                        ../config/${CONF[${ind}]}/MY_SRC"
+let ind=$ind+1
+done
+echo '			###########################################################'
+echo '			'
Index: trunk/HEAD/cfg.txt
===================================================================
--- trunk/HEAD/cfg.txt	(revision 1136)
+++ trunk/HEAD/cfg.txt	(revision 1136)
@@ -0,0 +1,5 @@
+ORCA2_LIM OPA_SRC LIM_SRC_2 C1D_SRC NST_SRC
+GYRE OPA_SRC LIM_SRC_2 C1D_SRC
+ZAGRIF OPA_SRC LIM_SRC_2 C1D_SRC NST_SRC
+GYRE_LOBSTER OPA_SRC LIM_SRC_2 C1D_SRC TOP_SRC
+
Index: trunk/HEAD/diff_nemo
===================================================================
--- trunk/HEAD/diff_nemo	(revision 1136)
+++ trunk/HEAD/diff_nemo	(revision 1136)
@@ -0,0 +1,34 @@
+#!/bin/ksh
+######################################################
+# Author : Rachid benshila for ESOPA
+# Contact : opatlod@lodyc.jussieu.fr
+#
+# This script to copy  a file from NEMO in the current 
+# directory
+#
+######################################################
+d_n=$(dirname $0); b_n=$(basename $0);
+d_file=$(dirname $1);b_file=$(basename $1);
+
+nemo_file=`find ${d_n}/../../modeles/NEMO/${d_file} -name ${b_file}`
+set -A nemo_tab $nemo_file
+
+if [ ${#nemo_tab[*]} -gt 1 ] ; then
+echo 'Multiple occurence found'
+echo ${nemo_tab[*]}
+echo 'Please specify one directory'
+exit
+fi
+if [ ${#nemo_tab[*]} -eq 0 ] ; then
+echo 'No occurence found'
+echo 'exiting'
+exit
+fi
+if [ ${#nemo_tab[*]} -eq 1 ] ; then
+diff ${b_file} ${nemo_file} 
+fi
+
+unset d_n
+unset b_n
+unset d_file
+unset b_file
Index: trunk/HEAD/env_cfg.csh
===================================================================
--- trunk/HEAD/env_cfg.csh	(revision 1136)
+++ trunk/HEAD/env_cfg.csh	(revision 1136)
@@ -0,0 +1,24 @@
+#- Some tests ---
+set MODIPSL=$1
+if ( $1 == '' ) then
+echo 'error : usage source env_cfg.csh DIR/modipsl'
+exit
+endif 
+
+#- For the scripts
+alias getn ${MODIPSL}/config/UTIL/get_nemo
+alias difn ${MODIPSL}/config/UTIL/diff_nemo
+alias usec ${MODIPSL}/config/UTIL/use_cfg
+alias insm ${MODIPSL}/util/ins_make
+alias clrm ${MODIPSL}/util/clr_make
+alias inss ${MODIPSL}/util/ins_script
+alias faa  ${MODIPSL}/config/UTIL/fait_AA_make 
+
+#- To move easy
+alias cnw "chdir ${MODIPSL}/modeles/NEMO/WORK"
+alias cno "chdir ${MODIPSL}/modeles/NEMO/OPA_SRC"
+alias cnl "chdir ${MODIPSL}/modeles/NEMO/LIM_SRC"
+alias cnt "chdir ${MODIPSL}/modeles/NEMO/TOP_SRC"
+alias cco "chdir ${MODIPSL}/config"
+
+
Index: trunk/HEAD/env_cfg.ksh
===================================================================
--- trunk/HEAD/env_cfg.ksh	(revision 1136)
+++ trunk/HEAD/env_cfg.ksh	(revision 1136)
@@ -0,0 +1,23 @@
+#- Some tests ---
+MODIPSL=$1
+if [ ${#MODIPSL} -eq 0 ]; then
+echo 'error : usage . env_cfg.ksh DIR/modipsl'
+fi
+
+#- For the scripts
+alias getn=${MODIPSL}/config/UTIL/get_nemo
+alias difn=${MODIPSL}/config/UTIL/diff_nemo
+alias usec=${MODIPSL}/config/UTIL/use_cfg
+alias insm=${MODIPSL}/util/ins_make
+alias clrm=${MODIPSL}/util/clr_make
+alias inss=${MODIPSL}/util/ins_script
+alias faa=${MODIPSL}/config/UTIL/fait_AA_make
+
+#- To move easy
+alias cnw="chdir ${MODIPSL}/modeles/NEMO/WORK"
+alias cno="chdir ${MODIPSL}/modeles/NEMO/OPA_SRC"
+alias cnl="chdir ${MODIPSL}/modeles/NEMO/LIM_SRC"
+alias cnt="chdir ${MODIPSL}/modeles/NEMO/TOP_SRC"
+alias cco="chdir ${MODIPSL}/config"
+
+
Index: trunk/HEAD/fait_AA_make
===================================================================
--- trunk/HEAD/fait_AA_make	(revision 1136)
+++ trunk/HEAD/fait_AA_make	(revision 1136)
@@ -0,0 +1,694 @@
+#!/bin/ksh
+##set -vx
+############################################################
+#
+# Purpose :
+# This script aims to create create the AA_make file
+# in the WORK directory. 
+# AA_make contains :
+#    - compilation options speccific to NEMO
+#    - compilation rules
+#    - dependancies
+# Running the modipsl/util/ins_make command is needed AFTER
+# fait_AA_make.
+#
+# Method :
+# We use temporary files to perform the following steps :
+#    1- search all CPP keys in the code
+#    2- write compilation rules 
+#    3- add compilation options add the beginning of AA_make 
+#    4- search and write dependancies
+#    5- add some specific rules (links creation in the WORK)
+#
+############################################################
+#-
+echo "This script must be run from the ../modipsl/config/CONFIG_NAME directory"
+echo ""
+
+#- Save the previous BB_make file before its rebuild
+echo "Save the previous BB_make file before its rebuild"
+cp scripts/BB_make scripts/BB_make_save
+
+#- Start the BB_make rebuild step
+echo "Start the BB_make rebuild step"
+
+cd WORK
+pwd
+
+#-
+#- Search CPP keys ---
+liste_cle=$(egrep '^# *if[!( &]*def|^# *elif' *.[Fh] *.[Fh]90  2> /dev/null | grep key_ | sed 's/||/\
+/' | sed 's/\&\&/\
+/' | sed 's/^.*key_/key_/' | sed 's/ *[) ] *$//' | sort -u  )
+
+#-
+#- Write main compilation rules ---
+cat > tampon <<end
+
+.SUFFIXES: .f90 .F90 .F
+
+# Target
+all :	diroce libioipsl key keyverif src_file_list libagrif \$(IOIPSL_LIB) \$(AGRIF_LIB)
+		@echo --------------------------------------------
+		time gmake \$(EXEC_BIN) -j \$(NBPRC)
+		@echo --------------------------------------------
+		@cp SRC_FILE_LIST.temp SRC_FILE_LIST
+		@echo OPA model is OK
+
+# Cleaning objects, libraries and executables
+clean:
+ifeq (\$(AGRIF),use)
+		-@(cd OPAFILES; ./efface)
+endif
+		\$(RM) model.o \$(EXEC_BIN)
+		\$(RM) \$(MODDIR)/oce_\$(NEMOLIB)/\$(COMP)/*.mod
+		\$(RM) \$(MODEL_LIB)/*.o
+		\$(RM) ../../../tmp/tmp_\$(NEMOLIB)/\$(COMP)/* 
+		@echo OPA model \(.o .mod libraries and executables are removed\)
+
+# Dependancies
+diroce:
+		@if [ ! -d ../../../lib/oce_\$(NEMOLIB) ] ; then mkdir ../../../lib/oce_\$(NEMOLIB) ; fi
+		@if [ ! -d ../../../tmp/tmp_\$(NEMOLIB) ] ; then mkdir ../../../tmp/tmp_\$(NEMOLIB) ; fi
+		@if [ ! -d ../../../lib/oce_\$(NEMOLIB)/\$(COMP) ] ; then mkdir ../../../lib/oce_\$(NEMOLIB)/\$(COMP) ; fi
+		@if [ ! -d ../../../tmp/tmp_\$(NEMOLIB)/\$(COMP) ] ; then mkdir ../../../tmp/tmp_\$(NEMOLIB)/\$(COMP) ; fi
+
+\$(EXEC_BIN) :	 \$(MODEL_LIB) agrif2model.o model.o
+ifeq (\$(AGRIF),use)
+		\$(F_L) \$(L_X) -o \$(EXEC_BIN) model.o agrif2model.o \$(MODEL_LIB)/*.o \$(OASISMPI2_LIB) \$(IOIPSL_LIB) \$(AGRIF_LIB) \$(NCDF_LIB) \$(LIBMPI) \$(LIBMP)
+else
+		\$(F_L) \$(L_X) -o \$(EXEC_BIN) model.o \$(MODEL_LIB)/*.o \$(OASISMPI2_LIB) \$(IOIPSL_LIB) \$(NCDF_LIB) \$(LIBMPI) \$(LIBMP)
+endif
+
+# Agrif library and conv
+libagrif : firstagrif mpiagrif
+ifeq (\$(AGRIF),use)
+	@( if [ ! -d OPAFILES ]; then mkdir OPAFILES; fi )
+	@( if [ ! -d OPAFILES/AGRIF_INC ]; then mkdir OPAFILES/AGRIF_INC ; fi )
+	@( if [ ! -d OPAFILES/AGRIF_MODELFILES ]; then mkdir OPAFILES/AGRIF_MODELFILES ; fi )
+	@(cd ../../../modeles/AGRIF ; \$(M_K) -f Makefile P_P="\$(AGRIF_MPI)" )
+	@cp -rf ../../../modeles/AGRIF/agrif_opa.in OPAFILES/. 
+	@cp -rf ../../../modeles/AGRIF/conv OPAFILES/. 
+	@cp -rf ../../../modeles/AGRIF/efface OPAFILES/. 
+endif
+
+# Agrif interface with NEMO
+agrif2model.o :
+ifeq (\$(AGRIF),use)
+	@\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC \$*.F90 > OPAFILES/\$*.F90 
+	@\$(F_C) \\
+#-Q- aix		-qsuffix=f=F90 \\
+#-Q- ax_mono		-qsuffix=f=F90 \\
+#-Q- osxxlf		-qsuffix=f=F90 \\
+	\$(P_P) \$(F_O) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+	   OPAFILES/\$*.F90 || { mv \$(PREF).L \$(TMP) ; false ; exit ; }
+endif
+
+# IOIPSL library 
+libioipsl :
+	(cd ../../../modeles/IOIPSL/src ; \$(M_K) -f Makefile )
+
+# Main program
+model.o :	\$(MODEL_LIB) model.f90
+		@\$(F_C) \$(F_O) -c model.f90
+
+# if the make script is stopped, one doesn't destroy library
+.PRECIOUS : \$(MODEL_LIB)
+#-Q- sxnec .PRECIOUS : \$(SXMODEL_LIB)
+#-Q- sx6nec .PRECIOUS : \$(SXMODEL_LIB)
+#-Q- sx8brodie .PRECIOUS : \$(SXMODEL_LIB)
+#-Q- sxdkrz .PRECIOUS : \$(SXMODEL_LIB)
+#-Q- eshpux .PRECIOUS : \$(SXMODEL_LIB)
+
+# library dependancies
+\$(MODEL_LIB):	\$(LIB_OBJ)
+		@echo
+		@echo La bibliotheque est a jour
+		@echo
+
+# Default rules
+.DEFAULTS:
+
+# rules for the .f90 files
+\$(MODEL_LIB)/%.o : %.f90           
+		@\$(F_C) \$(P_P) \$(F_O) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+		\$*.f90 || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; }
+		@mv \$*.o \$(MODEL_LIB)/.
+		@\$(RM) \$*.[f]
+		@if [ -f \$*.mod ] ; then mv \$*.mod \$(MODDIR)/oce_\$(NEMOLIB)/\$(COMP) ; fi
+#-Q- aix		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- ax_mono		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- linux		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- osxxlf		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+		@if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi
+
+# rules for the .F90 files
+\$(MODEL_LIB)/%.o : %.F90           
+ifeq (\$(AGRIF),use) 
+		@\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC \$*.F90 > OPAFILES/\$*.F90 
+		@(cd OPAFILES ; ./conv agrif_opa.in -rm \\
+#-Q- linux		-SubloopScalar \\
+#-Q- lxiv8		-SubloopScalar \\
+#-Q- g95			-SubloopScalar \\
+#-Q- f95			-SubloopScalar \\
+#-Q- osf1			-SubloopScalar \\
+		-comdirin ./ -comdirout AGRIF_MODELFILES/. -convfile \$*.F90)
+		-@mv -f OPAFILES/AGRIF_MODELFILES/\$*.F90 OPAFILES/\$*.F90
+		@\$(P_C) \$(P_O) -IOPAFILES/AGRIF_INC OPAFILES/\$*.F90 > OPAFILES/AGRIF_MODELFILES/\$*.F90
+		-@mv -f OPAFILES/AGRIF_MODELFILES/\$*.F90 OPAFILES/\$*.F90
+		@\$(F_C) \$(P_P) \$(F_O) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+		OPAFILES/\$*.F90 || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; } 
+else
+		@\$(F_C) \$(P_P) \$(F_O) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+		\$*.F90 || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; }
+endif
+		@mv \$*.o \$(MODEL_LIB)/.
+		@\$(RM) \$*.[f]
+		@if [ -f \$*.mod ] ; then mv \$*.mod \$(MODDIR)/oce_\$(NEMOLIB)/\$(COMP) ; fi
+#-Q- aix		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- ax_mono		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- linux		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- osxxlf		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+		@if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi
+
+# rules for the .F files
+\$(MODEL_LIB)/%.o : %.F           
+		@\$(F_C) \$(P_P) \$(F_F) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+		\$*.F || { if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi ; false ; exit ; }
+		@mv \$*.o \$(MODEL_LIB)/.
+		@\$(RM) \$*.[f]
+		@if [ -f \$*.mod ] ; then mv \$*.mod \$(MODDIR)/oce_\$(NEMOLIB)/\$(COMP) ; fi
+#-Q- aix		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- ax_mono		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- linux		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- osxxlf		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+		@if [ -f \$(PREF)\$*.L ] ; then mv \$(PREF)\$*.L \$(TMP) ; fi
+
+# rules for the library from the .f files 
+\$(MODEL_LIB)/%.o : %.f           
+		@\$(F_C) \$(F_O) \\
+#-Q- fjvpp		-Z \$*.L \\
+#-Q- sxnec		-R2 \\
+#-Q- sx6nec		-R2 \\
+#-Q- sx8brodie		-R2 \\
+#-Q- sxdkrz		-R2 \\
+#-Q- eshpux		-R2 \\
+#-Q- aix		-qsource \\
+#-Q- ax_mono		-qsource \\
+		\$*.f|| { if [ -f \$(PREF)\$*.L ] ; then mv \$*.L \$(TMP) ; fi ; false ; exit ; }
+		@mv \$*.o \$(MODEL_LIB)/.
+#-Q- aix		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- ax_mono		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- linux	@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+#-Q- osxxlf		@mv \$(PREF)\$*.lst \$(PREF)\$*.L
+		@if [ -f \$(PREF)\$*.L ] ; then mv \$*.L \$(TMP) ; fi
+
+end
+#-
+#- Compilation options ---
+exec 1> AA_make
+MAIN="model"
+echo '# $Header: /home/opalod/NEMOCVSROOT/VALID/fait_AA_make,v 1.22 2006/03/13 13:59:10 opalod Exp $'
+echo '# some variables'
+echo 'TMP = ../../../tmp/tmp_$(NEMOLIB)/$(COMP)'
+echo '#-Q- sxnec  # Compiler options for NEMO (IDRIS SX5-NEC) '
+echo '#-Q- sxnec  F_O = -dw -Wf\"-A idbl4\" -sx5 -ftrace -C vsafe -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- sx6nec  # Compiler options NEMO (CEA SX6-NEC) '
+echo '#-Q- sx6nec  F_O = -size_t64 -dw -Wf\"-A dbl4\" -sx6 -C vsafe -Wf"-P nh" -Wf',-pvctl noassume loopcnt=10000 -L transform' -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- sx6nec  F_O = -size_t64 -dw -Wf\"-A dbl4\" -sx6 -ftrace -C vsafe -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- sx6nec  F_F = $(F_O)'
+echo '#-Q- sx6nec  L_X = $(L_O) -ftrace'
+echo '#-Q- sx8brodie  # Compiler options NEMO (CEA SX6-NEC) '
+echo '#-Q- sx8brodie  F_O = -dw -Wf\"-A idbl4\" -sx8 -C vopt -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh -O overlap" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- sx8brodie  F_F = $(F_O) -f3'
+echo '#-Q- sx8brodie  L_X = $(L_O)'
+echo '#-Q- sxdkrz  # Compiler options for NEMO (DKRZ SX6-NEC) '
+echo '#-Q- sxdkrz  F_O = -ew -sx6 -ftrace -C vsafe -Wf"-init stack=nan" -Wl"-f nan" -Wf"-P nh" -Wf"-pvctl noassume loopcnt=10000" -L transform -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- sxdkrz  F_F = $(F_O)'
+echo '#-Q- sxdkrz  L_X = $(L_O) -ftrace'
+echo '#-Q- eshpux  # Compiler options for NEMO (Earth Simulator)'
+echo '#-Q- eshpux  # for super perfs!'
+echo '#-Q- eshpux  # F_O = $(FTRACE) -pi nest=5 line=10000 expin=Fmpplib.F -Wf,-A idbl4 -C hopt -Wf"-P nh -O overlap" -Wf,-pvctl noassume loopcnt=10000 -L transform -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- eshpux  # regular options!'
+echo '#-Q- eshpux  F_O = $(FTRACE) -Wf,-A idbl4 -C vsafe -P stack -Wf"-P nh" -Wf,-pvctl noassume loopcnt=10000 -L transform -Wf,-pvctl nomsg -Wf"-O nomsg" -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- eshpux  F_F = $(F_O)'
+echo '#-Q- eshpux  L_X = $(L_O)'
+echo '#-Q- linux  # Compiler options for NEMO (pgf version)'
+echo '#-Q- linux  F_O = -Mlist -O3 -byteswapio -r8  -I $(MODDIR) -I$(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- linux  F_F = $(F_O)'
+echo '#-Q- linux  L_X = -r8 -O3'
+echo '#-Q- lxiv7  # Compiler options for NEMO (ifc version)'
+echo '#-Q- lxiv7  F_O = -O3 -r8  -I $(MODDIR) -I$(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- lxiv7  L_X = -r8 -O3'
+echo '#-Q- lxiv8  # Compiler options for NEMO (ifort version)'
+echo '#-Q- lxiv8  F_O = -O3 -r8  -I $(MODDIR) -I$(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- lxiv8  F_F = $(F_O) '
+echo '#-Q- lxiv8  L_X = -r8 -O3'
+echo '#-Q- g95  # Compiler options for NEMO (g95 version)'
+echo '#-Q- g95  F_O = -O3 -fno-second-underscore -r8 -funroll-all-loops -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)'
+echo '#-Q- g95  F_F = $(F_O)'
+echo '#-Q- g95  L_X = -r8 -O3'
+echo '#-Q- aix  # Compiler options for NEMO (aix version)'
+echo '#-Q- aix  F_O = -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- aix  F_F = -O3 -qsave -qrealsize=8 -qsuffix=f=f -qsuffix=cpp=F -qfixed=132 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- aix  L_O = $(F_P) -q64 -O3'
+echo '#-Q- aix  L_X = $(L_O)'
+echo '#-Q- ax_mono    # Compiler options for NEMO (aix version)'
+echo '#-Q- ax_mono    F_O = -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- ax_mono    F_F = -O3 -qsave -qrealsize=8 -qsuffix=f=f -qsuffix=cpp=F -qfixed=132 -qextname -qsource -q64 -qlargepage -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- ax_mono   L_O = $(F_P) -q64 -O3'
+echo '#-Q- ax_mono   L_X = $(L_O)'
+echo '#-Q- osxxlf    # Compiler options for NEMO (osxxlf version)'
+echo '#-Q- osxxlf    F_O = -O3 -qsave -qrealsize=8 -qsuffix=f=f90 -qsuffix=cpp=F90 -qsource -qextname -qstrict -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- osxxlf    F_F = -O3 -qsave -qrealsize=8 -qsuffix=f=f -qsuffix=cpp=F -qfixed=132 -qsource -qextname -qstrict -qmaxmem=-1 -I $(MODDIR) -I $(MODEL_LIB) -I $(NCDF_INC)' 
+echo '#-Q- osxxlf    L_X = -qrealsize=8 -O3'
+
+
+echo 'PREF='
+echo '#-Q- sxnec	PREF=i.'
+echo '#-Q- sx6nec	PREF=i.'
+echo '#-Q- sx8brodie	PREF=i.'
+echo '#-Q- sxdkrz	PREF=i.'
+echo '#-Q- eshpux	PREF=i.'
+echo ''
+echo '#Run type: mon, mpi or omp '
+echo 'ifeq ($(COMP),mon)'
+echo '#-Q- osxxlf  override F_C = xlf90 -c'
+echo '#-Q- osxxlf  override F_L = xlf90'
+echo 'endif'
+echo ''
+echo 'ifeq ($(COMP),memo)'
+echo '#-Q- sx8brodie  F_O := $(F_O) -P static'
+echo '#-Q- ax_mono    F_O := $(F_O) -qnosave'
+echo '#-Q- osxxlf     F_O := $(F_O) -qnosave'
+echo 'endif'
+echo ''
+echo 'ifeq ($(COMP),mpi)'
+echo 'P_P := $(P_P) key_mpp_mpi'
+echo '#-Q- osxxlf  override F_C = mpif90 -c'
+echo '#-Q- osxxlf  override F_L = mpif90'
+echo 'endif'
+echo ''
+echo 'ifeq ($(COMP),omp)'
+echo 'P_P := $(P_P) key_mpp_omp'
+echo '#-Q- sx8brodie F_O := $(F_O) -P auto'
+echo '#-Q- sx8brodie override F_F = $(F_O) '
+echo '#-Q- sx8brodie L_X := $(L_X) -P auto'
+echo 'endif'
+echo ''
+echo '# add suffix to P_P'
+echo 'P_P := $(P_P:%=$(prefix)%)'
+echo ''
+echo '# Some tests to define variables related to Agrif compilation'
+echo '# Please do not change '
+echo 'ifneq (,$(findstring key_agrif,$(P_P)))'
+echo 'AGRIF=use'
+echo 'else'
+echo 'AGRIF=notuse'
+echo 'AGRIF_LIB='
+echo 'endif'
+echo 'ifneq (,$(findstring key_mpp_mpi,$(P_P)))'
+echo 'AGRIF_MPI=-DAGRIF_MPI'
+echo 'else'
+echo 'AGRIF_MPI='
+echo 'endif'
+
+echo ''
+# Write the cpp key list with one key by line
+echo 'KEY_LIST = \c'
+for i in ${liste_cle}
+do
+ echo "\\"
+ echo "     $i \c"
+done
+
+echo ''
+echo '# .o file list in the library'
+echo 'LIB_OBJ = \c'
+#
+# find all .f in the current directory
+# build object files list  LIB_OBJ
+# one dependancy by line
+
+for i in `ls *.f 2> /dev/null`
+do
+  bn=`basename $i .f`
+    echo "\\"
+    echo "		\$(MODEL_LIB)/$bn.o\c"
+done
+
+# find all .f90 in the current directory
+# build object files list  LIB_OBJ
+# one dependancy by line
+
+for i in `ls *.f90  `
+do
+  bn=`basename $i .f90`
+  if [ "${bn}" != "${MAIN}" ] 
+  then 
+  if [ "${bn}" != "agrif2model" ] 
+  then 
+    echo "\\"
+    echo "		\$(MODEL_LIB)/$bn.o\c"
+  fi
+  fi
+done
+
+# find all .F90 in the current directory
+# build object files list  LIB_OBJ
+# one dependancy by line
+
+for i in `ls *.F90  `
+do
+  bn=`basename $i .F90`
+  if [ "${bn}" != "${MAIN}" ] 
+  then 
+  if [ "${bn}" != "agrif2model" ] 
+  then 
+    echo "\\"
+    echo "		\$(MODEL_LIB)/$bn.o\c"
+  fi
+  fi
+done
+
+# find all .F in the current directory
+# build object files list  LIB_OBJ
+# one dependancy by line
+
+for i in `ls *.F 2> /dev/null `
+do
+  bn=`basename $i .F`
+    echo "\\"
+    echo "		\$(MODEL_LIB)/$bn.o\c"
+ done
+
+echo ""
+
+cat tampon
+rm tampon
+#-
+#- Write all dependancies ---
+
+for fic in `ls *.f90 *.F90  *.F 2> /dev/null `
+do
+    if [ "${fic}" != "agrif2model.F90" ]
+    then
+    if [ "${fic}" != "${MAIN}.[Ff]" ]
+    then
+	i=0
+	j=0
+	dep=""
+	inc=""
+	inc2=""
+	inc3=""
+	luse0=""
+	luse1=""
+	luse2=""
+	luse3=""
+	key=""
+#- search include files (old ice model form, should it be suppressed ?)
+	for inc in `sed -n 's/^[  	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u`
+	do
+	    dep="$dep\n$inc"
+	done
+
+#- take into account CPP dependancies  keys only (par_trc_trp example)
+	for key in `sed -n 's/^#[       eElL]*[iF][fF][         ]*[dD][eE][fF][iI][nN][eE][dD][         ]*//p' $fic | sort -u`
+	do
+	    j=1
+	done
+
+#- search include files on 3 levels
+	for inc in `sed -n 's/^#[ 	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u`
+	do
+	    j=1
+	    dep="$dep\n$inc"
+		for inc2 in `sed -n 's/^#[ 	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $inc | sort -u`
+		do
+		    dep="$dep\n$inc2"
+		    #- search include  in include (third level !!!)
+		    for inc3 in `sed -n 's/^#[  	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $inc2 | sort -u`
+		    do
+			dep="$dep\n$inc3"
+		    done
+		done
+	done
+
+#- search USE in include files
+	for inc in `sed -n 's/^#[ 	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $fic | sort -u`
+	do
+		for fuse0 in `sed -n 's/^[ 	]*[uU][sS][eE] [ 	]*\([^!,;]*\).*/\1/p' $inc | sort -u`
+		do
+                    [ -f $fuse0.[hfF]90 ] || continue
+		    lfuse0=$fuse0.f90
+		    [ -f $fuse0.F90 ] && lfuse0=$fuse0.F90
+		    luse0="$luse0\n$lfuse0\n\$(MODEL_LIB)/$fuse0.o"
+		done
+
+#- search USE in  files included in included files and add to luse0
+
+		for inc2 in `sed -n 's/^#[ 	]*[iI][nN][cC][lL][uU][dD][eE][ 	]*\(['\''"]\)\([^'\''"]*\)\1.*/\2/p' $inc | sort -u`
+		do
+		    for fuse0 in `sed -n 's/^[ 	]*[uU][sS][eE] [ 	]*\([^!,;]*\).*/\1/p' $inc2 | sort -u`
+		    do
+                        [ -f $fuse0.[hfF]90 ] || continue
+		        lfuse0=$fuse0.f90
+		        [ -f $fuse0.F90 ] && lfuse0=$fuse0.F90
+		        luse0="$luse0\n$lfuse0\n\$(MODEL_LIB)/$fuse0.o"
+		    done
+  	        done
+	done
+
+#- search USE (and USE of USE and so on three levels)
+	for fuse1 in `sed -n 's/^[ 	]*[uU][sS][eE] [ 	]*\([^!,;]*\).*/\1/p' $fic | sort -u`
+	do
+            [ -f $fuse1.[hfF]90 ] || continue
+	    lfuse1=$fuse1.f90
+	    [ -f $fuse1.F90 ] && lfuse1=$fuse1.F90
+	    luse1="$luse1\n$lfuse1\n\$(MODEL_LIB)/$fuse1.o"
+		for fuse2 in `sed -n 's/^[ 	]*[uU][sS][eE] [ 	]*\([^!,;]*\).*/\1/p' $lfuse1 | sort -u`
+		do
+                    [ -f $fuse2.[hfF]90 ] || continue
+		    lfuse2=$fuse2.f90
+		    [ -f $fuse2.F90 ] && lfuse2=$fuse2.F90
+		    luse2="$luse2\n$lfuse2\n\$(MODEL_LIB)/$fuse2.o"
+		    # on cherche les USE  dans le fichier deja USE (3eme niveau! balaise!)
+		    for fuse3 in `sed -n 's/^#[  	]*[uU][sS][eE] [ 	]*\([^!,;]*\).*/\1/p' $lfuse2 | sort -u`
+		    do
+                        [ -f $fuse3.[hfF]90 ] || continue
+			luse3="$luse3\n$lfuse3\n\$(MODEL_LIB)($fuse3.o)"
+                    done
+		done
+	done
+#-
+#-  dep contains all dependancies 
+	echo "\$(MODEL_LIB)/`echo $fic|awk -F. '{print $1}'`.o :       \c"
+	for depele in `echo $luse3 | sort -u` `echo $luse2 | sort -u` `echo $luse1 | sort -u` `echo $luse0 | sort -u` `echo $dep | sort -u`
+	do
+	    echo "\\"
+ 	    echo "	$depele \c"
+ 	    let i=i+1 # pour signaler le premier
+	done
+
+#-
+#- add dependancies with IOIPSL library (if source files contains IOIPSL)
+        grep -i 'use *ioipsl' ${fic} >/dev/null && ( echo "\\" ; echo "	\$(IOIPSL_LIB) \c")
+
+#-
+#- add dependancies with IOIPSL library (if source files contains Agrif_*)
+        grep -i 'use Agrif_*' ${fic} >/dev/null && ( echo "\\" ; echo "	\$(AGRIF_LIB) \c")
+
+#-
+#- on ajoute la dependance avecadd dependancies with KEY_CPP (if source file inclides cp  keys)
+	if [ ${j} != "0" ] 
+        then 
+	  echo "\\"
+	  echo "	KEY_CPP \c" 
+	fi
+#-
+#- end with the file itself
+	     echo "\\"
+       	     echo "	$fic"
+    fi
+    fi
+echo $fic done >/dev/tty
+done
+#-
+#- Write some special rules ---
+echo '# agrif previous use'
+echo "firstagrif:"
+echo "ifeq (\$(AGRIF),use)"
+echo '	@if [ -z "`cat KEY_CPP | grep key_agrif`" ]; then $(RM) model.o $(MODDIR)/oce_$(NEMOLIB)/$(COMP)/*.mod $(SXMODEL_LIB); fi'
+echo "else"
+echo '	@if [ -n "`cat KEY_CPP | grep key_agrif`" ]; then $(RM) -r OPAFILES model.o $(MODDIR)/oce_$(NEMOLIB)/$(COMP)/*.mod $(SXMODEL_LIB); fi'
+echo "endif"
+#-
+echo '#- RB : this rule is a pretty miserable trick to be able to re-compile NEMP-AGRIF-mono after NEMO-AGRIF-mpp'
+echo '#- I guess the good correction should be in AGRIF/LIB/toamr.c for the conv, to remove useless allocation declarations in AGRIF_INC'
+echo '# recompile all in this case' 
+echo "mpiagrif:"
+echo "ifeq (\$(AGRIF),use)"
+echo "ifeq (,\$(AGRIF_MPI))"
+echo '	@if [ -n "`cat KEY_CPP | grep key_mpp_mpi`" ]; then $(RM) -r OPAFILES model.o $(MODDIR)/oce_$(NEMOLIB)/$(COMP)/*.mod $(SXMODEL_LIB); fi'
+echo "endif"
+echo "endif"
+#-
+echo '# key changing control'
+echo "key: "
+echo "	@echo CHANGE of CPP KEYS yes/no ?"
+echo "	-@if [ \"\`cat KEY_CPP\`\" != \"\$(P_P:\$(prefix)%=%)\" ] ; then \\"
+echo "		echo CPP options changed ; echo \"\$(P_P:\$(prefix)%=%)\" > KEY_CPP ; fi "
+#-
+echo '# check key values'
+echo "keyverif:"
+echo '	@echo CHECKING KEY'
+echo '	@echo KEY USED : '
+echo '	@for v in ` echo $(P_P:$(prefix)%=%) ` ; \'
+echo '	do \'
+echo '	echo $$v ;\'
+echo '        w=`echo $$v | cut -c1-3` ; \'
+echo '        if [ $$w = `echo "key"` ] ; then \'
+echo '        r=n ; \'
+echo '        echo " $(KEY_LIST) " | (grep $$v >/dev/null 2>&1) || r=o ; \'
+echo '           if [ $$r != "n" ] ; then \'
+echo '              echo "UNKNOWN KEY" ;\'
+echo '              false ;  \'
+echo '              exit ;  \'
+echo '           fi \'
+echo '        fi \'
+echo '	done'
+echo '# Checking the number of routines'
+echo "src_file_list: EMPTY"
+echo '	@echo CHECKING THE NUMBER AND NAMES OF SOURCE FILES '
+echo '	@$(RM) `ls | fgrep -v -f .patron` '
+echo '	@check=`grep OPA_SRC .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use OPA_SRC files"                ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/*.[Ffh]90          . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/DYN/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/TRA/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/TRD/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/DIA/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/DOM/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/OBC/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/BDY/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/FLO/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/LDF/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/ZDF/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/SOL/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/DTA/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/SBC/*.[Ffh]90      . ; \'
+echo '	    ln -sf ../../../modeles/NEMO/OPA_SRC/IOM/*.[Ffh]90      . ; \'
+echo '  fi '
+echo '	@check=`grep LIM_SRC_2 .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use LIM_SRC_2 files"                ; \'
+echo '      ln -sf ../../../modeles/NEMO/LIM_SRC_2/*.[Ffh]90          . ; \'
+echo '  fi '
+echo '	@check=`grep LIM_SRC_3 .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use LIM_SRC_3 files"                ; \'
+echo '      ln -sf ../../../modeles/NEMO/LIM_SRC_3/*.[Ffh]90          . ; \'
+echo '  fi '
+echo '	@check=`grep NST_SRC .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use NST_SRC files"                ; \'
+echo '      \$(RM) agrif_opa_interp.F90           ; \'
+echo '      \$(RM) agrif_opa_sponge.F90           ; \'
+echo '      \$(RM) agrif_opa_update.F90           ; \'
+echo '      ln -sf ../../../modeles/NEMO/NST_SRC/*.[Ffh]90      .     ; \'
+echo '  fi '
+echo '	@check=`grep C1D_SRC .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use C1D_SRC files"                ; \'
+echo '      ln -sf ../../../modeles/NEMO/C1D_SRC/*.[Ffh]90          . ; \'
+echo '  fi '
+echo '	@check=`grep TOP_SRC .config`              ; \'
+echo '	if [ -n "$$check" ] ; then  \'
+echo '	echo "   use TOP_SRC files"                ; \'
+echo '      \$(RM) trcstp.F90                      ; \'
+echo '      \$(RM) sms.F90                         ; \'
+echo '      \$(RM) initrc.F90                      ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh]90          . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/TRP/*.[Ffh]90      . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/PISCES/*.[Ffh]90   . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/LOBSTER/*.[Ffh]90  . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/CFC/*.[Ffh]90      . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/C14b/*.[Ffh]90     . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/MY_TRC/*.[Ffh]90   . ; \'
+echo '      ln -sf ../../../modeles/NEMO/TOP_SRC/DUMMY/*.[Ffh]90    . ; \'
+echo '  fi '
+echo '	@check=`grep OFF_SRC .config`              ; \'
+echo '	if [ -n "$$check" ] ; then                   \'
+echo '	echo "   use OFF_SRC files"                ; \'
+echo '      ln -sf ../../../modeles/NEMO/OFF_SRC/*.[Ffh]90          . ; \'
+echo '      ln -sf ../../../modeles/NEMO/OFF_SRC/*/*.[Ffh]90        . ; \'
+echo '  fi '
+echo ' '
+echo '	@mn=`awk '"'"'{ print $$1 }'"'"' .config `  ; \'
+echo '  myrep=../../../config/$$mn/MY_SRC ; \'
+echo '  echo "*** Dealing with my modified source code, located in" $$myrep ; \'
+echo '  for i in `ls $$myrep` ; do \'
+echo '    [ -f $$i ] && \$(RM) $$i ;\'
+echo '  done ; \'
+echo '  myrep_list=`(cd $$myrep ; ls *.[Ffh]90 *.[Ffh] *.mk)` ; \'
+echo '  if [ -n "$$myrep_list" ] ; then \'
+echo '      for F in $$myrep_list; do \'
+echo '         echo "---> Reconstruct link to MY_SRC/$$F" ; \'
+echo '         ln -sf  $$myrep/$$F . ; \'
+echo '      done ; \'
+echo '  fi '
+echo ' '
+echo '	@\$(RM) tmplist'
+echo '	@ls -1 | fgrep -v -f .patron >tmplist'
+echo '	@cmp tmplist SRC_FILE_LIST.temp || { echo some routines have been added or suppressed ; \'
+echo '	sdiff -s tmplist SRC_FILE_LIST.temp ; cp tmplist SRC_FILE_LIST.temp ; \'
+echo '	\$(RM) model.o \$(MODEL_LIB)/*.o  \$(EXEC_BIN) ; \'
+echo '	echo "Rebuilding the AA_make files" ; \'
+echo '	cd ..  ; ../VALID/fait_AA_make ; echo " " ; \'
+echo '	echo "THE ins_make COMMAND in modipsl/util MUST BE RERUN PLEASE DO SO BEFORE gmake" ; \'
+echo '	echo "========================================== " ; \'
+echo '	../../util/ins_make -w \$(NEMOLIB) ; echo " " ;  false ; exit ; }'
+echo "EMPTY: "
+exec > /dev/null
+
Index: trunk/HEAD/get_nemo
===================================================================
--- trunk/HEAD/get_nemo	(revision 1136)
+++ trunk/HEAD/get_nemo	(revision 1136)
@@ -0,0 +1,34 @@
+#!/bin/ksh
+######################################################
+# Author : Rachid benshila for ESOPA
+# Contact : opatlod@lodyc.jussieu.fr
+#
+# This script to copy  a file from NEMO in the current 
+# directory
+#
+######################################################
+d_n=$(dirname $0); b_n=$(basename $0);
+d_file=$(dirname $1);b_file=$(basename $1);
+
+nemo_file=`find ${d_n}/../../modeles/NEMO/${d_file} -name ${b_file}` 
+set -A nemo_tab $nemo_file
+
+if [ ${#nemo_tab[*]} -gt 1 ] ; then
+echo 'Multiple occurence found'
+echo ${nemo_tab[*]}
+echo 'Please specify one directory'
+exit
+fi
+if [ ${#nemo_tab[*]} -eq 0 ] ; then
+echo 'No occurence found'
+echo 'exiting'
+exit
+fi
+if [ ${#nemo_tab[*]} -eq 1 ] ; then
+\cp ${nemo_file} .
+fi
+
+unset d_n
+unset b_n
+unset d_file
+unset b_file
Index: trunk/HEAD/use_cfg
===================================================================
--- trunk/HEAD/use_cfg	(revision 1136)
+++ trunk/HEAD/use_cfg	(revision 1136)
@@ -0,0 +1,300 @@
+#!/bin/ksh
+######################################################
+# Author : Rachid benshila for ESOPA
+# Contact : opatlod@lodyc.jussieu.fr
+#
+# This script aims to create the OPA/WORK directory
+# and to link in the WORK the BB_make and BB_make.ldef 
+# associated  to a chosen configuration
+#
+######################################################
+d_n=$(dirname $0); b_n=$(basename $0);
+
+#set -xv
+
+#- Saisie et validation des options
+x_d="";
+x_n="";
+x_r="";
+while getopts :hld:n:r: V
+  do
+    case $V in
+      (h)  echo "Usage    : "${b_n} \
+                " [-h] [-l] [-d] [-p r] [-t h] ";
+           echo " -h      : help";
+           echo " -l      : list existing configurations";
+           echo " -n name : config name";
+           echo " -d dir  : choose directories";
+           echo "";
+           echo "Example to install a new configuration MY_CONFIG";
+           echo "with OPA_SRC and ICE_SRC ";
+           echo "use_cfg -n MY_CONFIG -d \"OPA_SRC ICE_SRC\"";
+           echo "";
+#           echo "Defaults     : ";
+           echo "";
+           exit 0;;
+      (d)  x_d=${OPTARG};;
+      (n)  x_n=${OPTARG};;
+      (r)  x_r=${OPTARG};;
+      (l)  cat ${d_n}/cfg.txt; exit;;
+      (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
+           exit 2;;
+      (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
+           exit 2;;
+    esac
+  done
+shift $(($OPTIND-1));
+
+#- Some tests ---
+m_n=${x_n}
+
+if [ ${#x_n} -eq 0 ]; then
+echo "Warning"
+echo "No configuration specified"
+echo "use_cfg -h for help"
+exit
+fi
+
+cat ${d_n}/cfg.txt | grep ${m_n} > ${d_n}/cfg.tmp
+read CONFIG TAB[0] TAB[1] TAB[2] TAB[3] TAB[4] TAB[5] < ${d_n}/cfg.tmp
+\rm ${d_n}/cfg.tmp
+
+if [ ${#CONFIG} -eq 0 ] ; then
+if [ ${#x_d} -eq 0 ] ; then
+
+echo "You are  installing a new configuration"
+echo -n " OPA_SRC [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[1]=OPA_SRC   
+echo " OPA_SRC selected "
+echo "  "
+    else
+echo " OPA_SRC Not selected "
+echo "  "
+    fi
+unset answer
+echo -n " LIM_SRC_2 [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[2]=LIM_SRC_2 
+echo " LIM_SRC_2 selected "
+echo "  "
+    else
+echo " LIM_SRC_2 Not selected "
+echo "  "
+    fi
+unset answer
+echo -n " LIM_SRC_3 [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[2]=LIM_SRC_3
+echo " LIM_SRC_3 selected "
+echo "  "
+    else
+echo " LIM_SRC_3 Not selected "
+echo "  "
+    fi
+unset answer
+echo -n " TOP_SRC [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[3]=TOP_SRC   
+echo " TOP_SRC selected "
+echo "  "
+    else
+echo " TOP_SRC Not selected "
+echo "  "
+    fi
+unset answer   
+echo -n " C1D_SRC [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[4]=C1D_SRC   
+echo " C1D_SRC selected "
+echo "  "
+    else
+echo " C1D_SRC Not selected "
+echo "  "
+    fi
+unset answer
+echo -n " NST_SRC [Y/n] "
+    read answer
+    answer=`echo $answer | sed 's/^[yY].*$/y/'`
+    if [  -z "$answer" -o "x$answer" = "xy" ]; then
+    TAB[5]=NST_SRC   
+echo " NST_SRC selected "
+echo "  "
+    else
+echo " NST_SRC Not selected "
+echo "  "
+    fi
+unset answer
+
+else
+set -A TAB ${x_d} 
+fi
+print ${m_n} ${TAB[*]} >> ${d_n}/cfg.txt
+fi
+
+
+#- Create the config  --
+r_cfg='ORCA2_LIM'
+if [ ${#x_r} -ne 0 ]; then
+r_cfg=${x_r}
+fi
+
+if  [ ! -d ${d_n}/../../config/${m_n} ]; then
+echo " The new configuration ${x_n} will be based on ${r_cfg} following files:"
+echo "`ls ../${r_cfg}/AA_make*` "
+echo "`ls ../${r_cfg}/scripts/BB_make*` "
+echo "`ls ../${r_cfg}/EXP00/*` "
+echo "`ls ../${r_cfg}/MY_SRC/*` "
+echo "  "
+\mkdir  ${d_n}/../../config/${m_n} 
+\mkdir  ${d_n}/../../config/${m_n}/scripts
+\mkdir  ${d_n}/../../config/${m_n}/EXP00
+\mkdir  ${d_n}/../../config/${m_n}/MY_SRC
+\cp -R ${d_n}/../../config/${r_cfg}/AA_make ${d_n}/../../config/${m_n}/. 
+\cp -R ${d_n}/../../config/${r_cfg}/AA_make.ldef ${d_n}/../../config/${m_n}/. 
+\cp -R ${d_n}/../../config/${r_cfg}/scripts/BB_make ${d_n}/../../config/${m_n}/scripts/. 
+\cp -R ${d_n}/../../config/${r_cfg}/scripts/BB_make.ldef ${d_n}/../../config/${m_n}/scripts/. 
+\cp -R ${d_n}/../../config/${r_cfg}/EXP00/* ${d_n}/../../config/${m_n}/EXP00/. 
+\cp -R ${d_n}/../../config/${r_cfg}/MY_SRC/* ${d_n}/../../config/${m_n}/MY_SRC/. 
+fi
+#- Create the WORK --
+d_m=`find ${d_n}/../.. -name ${m_n}`  ;
+[ -d ${d_m}/WORK ] || mkdir ${d_m}/WORK;
+cd ${d_m}/WORK
+
+#- Clean links and librairies
+[ -n "`\ls`" ] && \rm * 
+
+#- Find the number of directories ---
+NDIR=${#TAB[*]}
+
+#- Creating the good links, at first on OPA_SRC ---
+    echo " Creating ${m_n}/WORK = ${TAB[*]} for ${m_n}"
+
+    i=0
+    while [ i -lt $NDIR ]
+    do
+	[ ${#TAB[i]} -ne 0 ] && [ "${TAB[i]}" = "OPA_SRC" ] && ln -sf ../../../modeles/NEMO/OPA_SRC/*.[Ffh]90 .
+	[ ${#TAB[i]} -ne 0 ] && [ "${TAB[i]}" = "OPA_SRC" ] && ln -sf ../../../modeles/NEMO/OPA_SRC/*/*.[Ffh]90 . && break
+	let i=$i+1
+    done
+
+    i=0
+    while [ i -lt $NDIR ]
+    do
+      if [ "${TAB[i]}" = "LIM_SRC_2" ]; then
+	  ln -sf ../../../modeles/NEMO/LIM_SRC_2/*.[Ffh]90 .  
+      
+      elif [ "${TAB[i]}" = "LIM_SRC_3" ]; then
+	  ln -sf ../../../modeles/NEMO/LIM_SRC_3/*.[Ffh]90 .  
+
+      elif [ "${TAB[i]}" = "TOP_SRC" ]; then
+	  \rm trcstp.F90                    
+	  \rm sms.F90                    
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/TRP/*.[Ffh]90 .
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/PISCES/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/LOBSTER/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/CFC/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/C14b/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/MY_TRC/*.[Ffh]90 . 
+	   ln -sf ../../../modeles/NEMO/TOP_SRC/DUMMY/*.[Ffh]90 .
+      
+      elif [ "${TAB[i]}" = "SRC_OFFLINE_TOP" ]; then  
+	  ln -sf ../../../modeles/NEMO/TOP_SRC/*.[Ffh] .
+	  ln -sf ../../../modeles/NEMO/TOP_SRC/SMS/*.[Ffh] .
+	  ln -sf ../../../modeles/NEMO/SRC_OFFLINE_TOP/*.[Ffh] .
+
+      elif [ "${TAB[i]}" = "C1D_SRC" ]; then  
+	  ln -sf ../../../modeles/NEMO/C1D_SRC/*.[Ffh]90 .
+
+      elif [ "${TAB[i]}" = "NST_SRC" ]; then  
+	  ln -sf ../../../modeles/NEMO/NST_SRC/*.[Ffh]90 .
+      fi
+      let i=$i+1
+    done
+
+    ln -sf ../../../*/${m_n}/scripts/BB_make AA_make ; 
+    ln -sf ../../../*/${m_n}/scripts/BB_make.ldef AA_make.ldef ;
+
+
+    if [ -d ../../../config/${m_n}/MY_SRC ]; then
+        f_list=`\ls ../../../config/${m_n}/MY_SRC/*.[Ffh]90`  ;
+        if [ ${#f_list} -ne 0 ] ; then
+            echo " "
+            echo " Files in the ../config/${m_n}/MY_SRC directory will be taken into account"
+            echo " "
+	    for i in `ls ../../../config/${m_n}/MY_SRC/*.[Ffh]90`
+	       do
+	       [ -f $i ] && \rm $i  
+	       [ -f ../../../config/${m_n}/MY_SRC/$i ] &&  ln -sf ../../../config/${m_n}/MY_SRC/${i} .
+	     done
+        fi
+    fi
+
+#- Building the standard list of source files ---
+cat >.patron <<"EOF" 
+CVS
+SRC_PARAM
+SRC_FILE_LIST
+tmplist
+AA_make
+KEY_CPP
+Makefile
+*?.o
+ i.?*
+*?.L
+.patron
+bloc.com
+para.com
+defcst.f
+fontbc.f
+icdyna.f
+thersf.f
+OPAFILES
+EOF
+
+[ ! -d ../../../config/${m_n}/scripts/Attic ] && \mkdir ../../../config/${m_n}/scripts/Attic
+
+#- Writing KEY_CPP file ---
+sed -e "s/#-Q- sxnec *//" -e /^P_P/\!d -e "s/P_P = //" AA_make.ldef > ../../../config/${m_n}/scripts/Attic/KEY_CPP  
+ln -sf ../../../config/${m_n}/scripts/Attic/KEY_CPP .  
+
+#- Creating SRC list ---
+ls -1 | fgrep -v -f .patron  > ../../../config/${m_n}/scripts/Attic/SRC_FILE_LIST
+ln -sf ../../../config/${m_n}/scripts/Attic/SRC_FILE_LIST .
+cp SRC_FILE_LIST SRC_FILE_LIST.temp   
+
+#- Save new configuration and directories names ---
+print ${m_n} ${TAB[*]} >.config 
+
+#- Create repository to store modified files
+[ ! -d ../../../config/${m_n}/MY_SRC ] && \mkdir ../../../config/${m_n}/MY_SRC
+cp ../../../modeles/NEMO/OPA_SRC/par_oce.F90 ../../../config/${m_n}/MY_SRC/par_oce.F90_keep
+if [ -d ../../../config/HEAD/2TEST ]; then
+    f_2test=`\ls ../../../config/HEAD/2TEST/*.[Ffh]90`  ;
+    if [ ${#f_2test} -ne 0 ] ; then
+        echo " "
+        echo " Files in the ../config/HEAD/2TEST directory will be taken into account"
+        echo " "
+        for i in `ls ../../../config/HEAD/2TEST/*.[Ffh]90`
+          do
+             ln -sf ../../../config/HEAD/2TEST/${i} ../../../config/${m_n}/MY_SRC/.
+          done
+    fi
+fi
+
+unset m_n
+unset TAB
+unset CONFIG
+exit 0;
