Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.fcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.fcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.fcm	(revision 2071)
@@ -11,6 +11,6 @@
 %MPI_FFLAGS
 %OMP_FFLAGS          -openmp
-%BASE_LD             -shared-intel  -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -L/smplocal/pub/FFTW/3.3.3_dyn/lib -lfftw3 -Wl,-rpath=/smplocal/pub/NetCDF/4.1.3/lib:/smplocal/pub/HDF5/1.8.9/seq/lib:/smplocal/pub/FFTW/3.3.3_dyn/lib
-%MPI_LD
+%BASE_LD             -L/smplocal/pub/FFTW/3.3.3_dyn/lib -lfftw3 -shared-intel  -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -Wl,-rpath=/smplocal/pub/NetCDF/4.1.3/mpi/lib:/smplocal/pub/HDF5/1.8.9/par/lib:/smplocal/pub/FFTW/3.3.3_dyn/lib
+%MPI_LD              
 %OMP_LD              -openmp
 
Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.path
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.path	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_ADA.path	(revision 2071)
@@ -1,10 +1,12 @@
-NETCDF_LIBDIR="${NETCDF_LDFLAGS:--L/smplocal/pub/NetCDF/4.1.3/lib -lnetcdff -lnetcdf -L/smplocal/pub/HDF5/1.8.9/seq/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lz}"
-NETCDF_INCDIR="${NETCDF_FFLAGS:--I/smplocal/pub/HDF5/1.8.9/seq/include -I/smplocal/pub/NetCDF/4.1.3/include}"
+NETCDF_LIBDIR="${NETCDF_LDFLAGS:--L/smplocal/pub/NetCDF/4.1.3/mpi/lib -lnetcdff -lnetcdf -L/smplocal/pub/HDF5/1.8.9/par/lib -Bstatic -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -Bdynamic -lz}"
+NETCDF_INCDIR="${NETCDF_FFLAGS:--I/smplocal/pub/HDF5/1.8.9/par/include -I/smplocal/pub/NetCDF/4.1.3/mpi/include}"
 IOIPSL_INCDIR=$LMDGCM/../../lib
 IOIPSL_LIBDIR=$LMDGCM/../../lib
+XIOS_INCDIR=$LMDGCM/../XIOS/inc
+XIOS_LIBDIR=$LMDGCM/../XIOS/lib
 ORCH_INCDIR=$LMDGCM/../../lib
 ORCH_LIBDIR=$LMDGCM/../../lib
-OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.$couple
-OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib
+OASIS_INCDIR=$LMDGCM/../../oasis3-mct/BLD/build/lib/psmile.MPI1
+OASIS_LIBDIR=$LMDGCM/../../oasis3-mct/BLD/lib
 INCA_LIBDIR=$LMDGCM/../INCA/config/lib
 INCA_INCDIR=$LMDGCM/../INCA/config/lib
Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.fcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.fcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.fcm	(revision 2071)
@@ -5,5 +5,6 @@
 %FPP_FLAGS           -P -traditional
 %FPP_DEF             NC_DOUBLE BLAS SGEMV=DGEMV SGEMM=DGEMM FFT_MKL
-%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+#%BASE_FFLAGS         -xHost -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64
 %PROD_FFLAGS         -O3
 %DEV_FFLAGS          -p -g -O2 -traceback -fp-stack-check
Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.path
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.path	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-X64_CURIE.path	(revision 2071)
@@ -5,7 +5,8 @@
 ORCH_INCDIR=$LMDGCM/../../lib
 ORCH_LIBDIR=$LMDGCM/../../lib
-OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.$couple
-OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib
+OASIS_INCDIR=$LMDGCM/../../oasis3-mct/BLD/build/lib/psmile.MPI1
+OASIS_LIBDIR=$LMDGCM/../../oasis3-mct/BLD/lib
 INCA_LIBDIR=$LMDGCM/../INCA/config/lib
 INCA_INCDIR=$LMDGCM/../INCA/config/lib
-
+XIOS_INCDIR=$LMDGCM/../XIOS/inc
+XIOS_LIBDIR=$LMDGCM/../XIOS/lib
Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.fcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.fcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.fcm	(revision 2071)
@@ -3,13 +3,12 @@
 %AR                  ar
 %MAKE                make
-%FPP_FLAGS           -P -traditional
 %FPP_DEF             NC_DOUBLE 
-%BASE_FFLAGS         -c -fdefault-real-8
+%BASE_FFLAGS         -fdefault-real-8
 %PROD_FFLAGS         -O3
-%DEV_FFLAGS          -O
-%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all
+%DEV_FFLAGS          -g -O1
+%DEBUG_FFLAGS        -g -O0 -ffpe-trap=invalid,zero,overflow -fbounds-check -fstack-protector-all 
 %MPI_FFLAGS
 %OMP_FFLAGS          
-%BASE_LD      
+%BASE_LD             
 %MPI_LD
 %OMP_LD              
Index: /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.path
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.path	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/arch/arch-gfortran.path	(revision 2071)
@@ -1,6 +1,8 @@
 NETCDF_LIBDIR="-L/usr/local/lib -lnetcdf"
 NETCDF_INCDIR=-I/usr/local/include
-IOIPSL_INCDIR=$LMDGCM/../../lib
-IOIPSL_LIBDIR=$LMDGCM/../../lib
+#IOIPSL_INCDIR=$LMDGCM/../../lib
+#IOIPSL_LIBDIR=$LMDGCM/../../lib
+IOIPSL_INCDIR=/home/jgipsl/INSTALLSH/LMDZ20111103.trunk/modipsl/lib
+IOIPSL_LIBDIR=/home/jgipsl/INSTALLSH/LMDZ20111103.trunk/modipsl/lib
 ORCH_INCDIR=$LMDGCM/../../lib
 ORCH_LIBDIR=$LMDGCM/../../lib
Index: /LMDZ5/branches/LMDZ5-DOFOCO/bld.cfg
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/bld.cfg	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/bld.cfg	(revision 2071)
@@ -24,23 +24,19 @@
 src::dyn     %SRC_PATH/%DYN
 src::phys    %SRC_PATH/%PHYS
+#src::sisvat  %SRC_PATH/%PHYS/sisvat
+#src::rrtm  %SRC_PATH/%PHYS/rrtm
 src::grid    %SRC_PATH/grid
 src::filtrez %SRC_PATH/filtrez
 src::bibio   %SRC_PATH/bibio
+src::dyn3d_common   %SRC_PATH/dyn3d_common
 src::cosp    %COSP
 src::ext_src %EXT_SRC
 
-bld::lib::dyn      %DYN
-bld::lib::phys     %PHYS
-bld::lib::grid      grid
-bld::lib::filtrez   filtrez
-bld::lib::bibio     bibio
-bld::lib::cosp      cosp
-bld::lib: ext_src   ext_src
-
+bld::lib            lmdz
 
 bld::outfile_ext::exe    %SUFF_NAME.e
-bld::target              lib%{DYN}.a lib%{PHYS}.a libgrid.a libfiltrez.a libbibio.a libcosp.a libext_src.a
+bld::target              liblmdz.a 
 bld::target              %EXEC%SUFF_NAME.e
-bld::exe_dep             %{DYN} %{PHYS} grid filtrez bibio cosp ext_src
+bld::exe_dep             
 
 
@@ -64,14 +60,7 @@
 
 
+# Example of how to set specific compiling options for a specific file
+# -> this can be including in the arch.opt file
 #bld::tool::fflags::phys::readaerosol         %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt -pi auto
-#bld::tool::fflags::phys::aeropt_2bands       %BASE_FFLAGS %PROD_FFLAGS  %INCDIR
-#bld::tool::fflags::phys::radiation_AR4       %BASE_FFLAGS %PROD_FFLAGS1 %INCDIR -C hopt -Wf,-O,extendreorder
-#bld::tool::fflags::phys::radiation_AR4_param %BASE_FFLAGS %PROD_FFLAGS1 %INCDIR -C hopt -f3
-#bld::tool::fflags::phys::fisrtilp            %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt
-#bld::tool::fflags::phys::cv30_routines       %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -Wf,-O,extendreorder
-#bld::tool::fflags::phys::cvltr               %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt
-#bld::tool::fflags::phys::clouds_gno          %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt
-#bld::tool::fflags::dyn::vlsplt_p             %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt
-#bld::tool::fflags::dyn::groupeun_p           %BASE_FFLAGS %PROD_FFLAGS  %INCDIR -C hopt
 
 
@@ -95,5 +84,14 @@
 bld::excl_dep        use::mod_prism_get_proto
 bld::excl_dep        use::mod_prism_put_proto
-bld::excl_dep        use::mkl_dfti
+bld::excl_dep        use::mod_prism
+bld::excl_dep        use::xios
+bld::excl_dep        use::iaxis
+bld::excl_dep        use::iaxis_attr
+bld::excl_dep        use::icontext_attr
+bld::excl_dep        use::idate
+bld::excl_dep        use::idomain_attr
+bld::excl_dep        use::ifield_attr
+bld::excl_dep        use::ifile_attr
+bld::excl_dep        use::ixml_tree
 
 # Don't generate interface files
@@ -106,2 +104,3 @@
 bld::outfile_ext::mod .mod
 bld::tool::SHELL   /bin/bash
+bld::tool::SHELL   /bin/ksh
Index: /LMDZ5/branches/LMDZ5-DOFOCO/build_gcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/build_gcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/build_gcm	(revision 2071)
@@ -29,4 +29,5 @@
 fi
 
+job=1
 dirname="" #path to where the fcm command will be found
 if (( $# >= 1 )) ; then
@@ -39,8 +40,9 @@
   # add a trailing "/" to $dirname
   dirname=${dirname}"/"
+  shift;
 fi
 
 # run "fcm build" command
-${dirname}fcm build
+${dirname}fcm build $*
 
 # cleanup
Index: /LMDZ5/branches/LMDZ5-DOFOCO/create_make_gcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/create_make_gcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/create_make_gcm	(revision 2071)
@@ -5,9 +5,10 @@
 #set -xv
 
-rm -f create_make_gcm.log
 
 machine=`hostname`
 os=`uname`
 gcm=`pwd`
+logfile=$gcm/create_make_gcm.log
+rm -f $logfile ; touch -f $logfile
 libf=$gcm/libf
 libo=$gcm/libo
@@ -42,16 +43,12 @@
 echo 'LIBF    = $(GCM)/libf'
 if [ "$CRAY" = '0' ] ; then
-#   echo 'LIBO    = $(GCM)/libo/$(MACHINE)'
    echo 'LIBO    = $(LIBOGCM)/$(MACHINE)'
 else
    echo 'LIBO    = $(GCM)/libo'
 fi
-#echo 'LOCAL_DIR=$(GCM)'
-#echo $localdir
 echo "LOCAL_DIR=`echo $localdir`"
 echo 'BIBIO    = $(LIBF)/bibio'
 echo "FILTRE   = filtre"
 echo "PHYS  = "
-echo "DYN  = dyn "
 echo 'LIBPHY = $(LIBO)/libphy$(PHYS).a'
 echo 'DIRMAIN=dyn$(DIM)d$(FLAG_PARA)'
@@ -61,10 +58,5 @@
 echo
 echo '# Les differentes librairies pour l"edition des liens:'
-echo
-echo 'dyn3d            = $(LIBO)/libdyn3d.a $(LIBO)/lib$(FILTRE).a'
-echo 'dyn3dpar      = $(LIBO)/libdyn3dpar.a $(LIBO)/lib$(FILTRE).a'
-echo 'dyn2d            = $(LIBO)/libdyn2d.a'
-echo 'dyn1d            = $(LIBO)/libdyn1d.a'
-echo 'L_DYN      = -ldyn$(DIM)d$(FLAG_PARA)'
+echo 'L_DYN      = -ldyn$(DIM)d$(FLAG_PARA) -ldyn3d_common'
 echo 'L_FILTRE   = -l$(FILTRE)'
 echo 'L_PHY = -lphy$(PHYS) '
@@ -93,4 +85,5 @@
 echo
 echo "PROG = code"
+echo 'DYN  = dyn$(DIM)d'
 echo
 #echo 'main : chimie $(DYN) bibio phys $(OPTION_DEP) '
@@ -99,9 +92,11 @@
 echo '	cd $(LOCAL_DIR); \'
 echo '	$(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
-echo '	$(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_BIBIO) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
-echo
-echo 'dyn : $(LIBO)/libdyn$(DIM)d$(FLAG_PARA).a $(FILTRE)$(DIM)d'
+echo '	$(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_BIBIO) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
 echo
 echo 'phys : $(LIBPHY)'
+echo 'dyn3d : $(LIBO)/libdyn$(DIM)d$(FLAG_PARA).a $(LIBO)/lib$(FILTRE).a $(LIBO)/libdyn3d_common.a'
+echo 'dyn2d : $(LIBO)/libdyn2d.a'
+echo 'dyn1d :'
+echo
 echo
 #echo 'chimie : $(LIBO)/libchimie.a'
@@ -143,5 +138,5 @@
       done
       echo
-      echo $listlib >> create_makeg_gcm.log
+      echo $listlib >> $logfile
       echo
       echo "#=================================================================="
@@ -176,24 +171,38 @@
 ##########################################################################
 
-         for stri in ` ( sed -e '/^[cC\!]/d' $trufile | sed -n "/\#include/s/\#include//p" | sed 's/\"//g' ; sed -e '/^[cC\!]/d' $trufile | egrep -i '^ *use ' | sed -e 's/,/ /' | awk ' { print $2 } ' ) ` ; do
-            echo $trufile $fili $stri >> create_make_gcm.log
+         for stri in ` ( sed -e '/^[cC\!]/d' $trufile | sed -e "/\#include /s/\#include /XXnclude /" -e "/include /s/include /XXnclude /" -e "/INCLUDE /s/INCLUDE /XXnclude /" | sed -n "/XXnclude /s/XXnclude//p" | sed 's/\"//g' | sort | uniq ; sed -e '/^[cC\!]/d' $trufile | egrep -i '^ *use ' | sed -e 's/,/ /' | awk ' { print $2 } ' | sort | uniq ) ` ; do
+            echo $trufile $fili $stri >> $logfile
             strj=`echo $stri | tr [A-Z] [a-z]`
             str2=""
-            for dirinc in filtrez bibio grid dyn3d $diri $diri/*/ ; do
+            for dirinc in filtrez bibio dyn3d_common grid dyn3d phydev $diri $diri/*/ ; do
 # Recherche dans l'ordre hierarchique inverse car seule la derniere
 # ligne est conservee
+               if [ $dirinc = phydev ] ; then
+                   dirstr='$(PHYS)'
+                   libstr='phy$(PHYS)'
+               else
+                   dirstr=$dirinc
+                   libstr=$dirinc
+               fi
+               echo dirinc $dirinc >> $logfile
                if [ -f $dirinc/$stri ] ; then
-                  str2='$(LIBF)/'$dirinc/$stri
+                  str2='$(LIBF)/'$dirstr/$stri
                elif [ -f $dirinc/$strj ] ; then
-                  str2='$(LIBF)/'$dirinc/$stri
+                  str2='$(LIBF)/'$dirstr/$stri
                elif [ -f $dirinc/$strj.F90 ]  || [ -f $dirinc/$strj.F ]  ; then 
-                  strlib=`echo $dirinc | awk -F/ ' { print $1 } '`
+                  strlib=`echo $libstr | awk -F/ ' { print $1 } '`
                   str2='$(LIBO)/lib'$strlib'.a('$strj'.o)'
+               elif [ -f $dirinc/$stri.F90 ]  || [ -f $dirinc/$stri.F ]  ; then 
+                  strlib=`echo $libstr | awk -F/ ' { print $1 } '`
+                  str2='$(LIBO)/lib'$strlib'.a('$stri'.o)'
                fi
+               echo stri $stri  >> $logfile
+               echo str2 $str2  >> $logfile
             done
+               echo dernier str2 $str2  >> $logfile
             if [ "$str2" = "" ] ; then
-               echo Warn: Include $diri $trufile $fili $stri pas trouve >> $gcm/create_make_gcm.log
+               echo Warn: Include $diri $trufile $fili $stri pas trouve >> $logfile
             elif [ "$str2" = "$str1" ] ; then
-               echo Warn: Include $diri $trufile $fili $stri $str1 trouve 2x >> $gcm/create_make_gcm.log
+               echo Warn: Include $diri $trufile $fili $stri $str1 trouve 2x >> $logfile
             else
                echo $str1 \\
Index: /LMDZ5/branches/LMDZ5-DOFOCO/makegcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/makegcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/makegcm	(revision 2071)
@@ -7,8 +7,21 @@
 # options par defaut pour la commande make
 ########################################################################
+
+echo ' '
+echo 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
+echo 'Attention makegcm n est plus supporte par l equipe de developpement'
+echo 'Il faut maintenant utiliser ./makelmdz ou ./makelmdz_fcm              '
+echo 'Si vous tenez absolument a utiliser makegcm, editez le script et'
+echo 'retirer ces lignes (a vos risques et perils)'
+echo 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
+echo ' '
+
+exit
+
+
 set dim="96x71x19"
 set physique=lmd
 set phys="PHYS=$physique"
-set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I$(LIBF)/filtrez -I. '
+set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I$(LIBF)/dyn3d_common -I$(LIBF)/filtrez -I. '
 set filtre=filtrez
 set grille=reg
@@ -23,21 +36,18 @@
 set OPTIMI='-C debug -eC '
 set OPTIMI=' -ftrace '
-set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
-set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
+set OPT_LINUX="-O3 -fdefault-real-8 -DNC_DOUBLE"
 set io=ioipsl
 set cosp=false
-
-set FC_LINUX=g95
-set FC_LINUX=g95
-#set FC_LINUX=g95
-if ( $FC_LINUX == g95 ) then
-  set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
+set sisvat=false
+
+set FC_LINUX=gfortran
+
+if ( $FC_LINUX == gfortran ) then
+  set OPT_LINUX="-O3 -fdefault-real-8 -DNC_DOUBLE"
 else if ( $FC_LINUX == gfortran ) then
-  set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
-#   set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
-  set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
+  set OPT_LINUX="-O3 -fdefault-real-8 -DNC_DOUBLE"
 else
 # pgf90 options
-  set OPT_LINUX="-i4 -O3 -r8 -DNC_DOUBLE"
+  set OPT_LINUX="-O3 -fdefault-real-8 -DNC_DOUBLE"
 endif
 
@@ -54,6 +64,6 @@
 setenv IOIPSLDIR /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/modipsl/lib
 setenv MODIPSLDIR /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/modipsl/lib
-setenv NCDFINC /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/netcdf-4.0.1/include
-setenv NCDFLIB /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/netcdf-4.0.1/lib
+setenv NCDFINC /tmpdir/fairhead/Test_install/LMDZtrunk/netcdf-4.0.1/include
+setenv NCDFLIB /tmpdir/fairhead/Test_install/LMDZtrunk/netcdf-4.0.1/lib
 
 
@@ -107,10 +117,10 @@
   if ( ! $?NCDFLIB ) then
     echo You must initialize the variable NCDFLIB in your environnement
-    echo for instance: "setenv NCDFLIB /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/lib
+    echo for instance: "setenv NCDFLIB /tmpdir/fairhead/Test_install/LMDZtrunk/netcdf-4.0.1/lib
     exit
   endif
   if ( ! $?NCDFINC ) then
     echo You must initialize the variable NCDFINC in your environnement
-    echo for instance: "setenv NCDFINC /d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/include
+    echo for instance: "setenv NCDFINC /tmpdir/fairhead/Test_install/LMDZtrunk/netcdf-4.0.1/include
     exit
   endif
@@ -262,5 +272,5 @@
 else if $LINUX then
 #################
-   if ( $FC_LINUX == pgf90 || $FC_LINUX == g95 || $FC_LINUX == gfortran ) then
+   if ( $FC_LINUX == pgf90 || $FC_LINUX == gfortran || $FC_LINUX == gfortran ) then
      set optim=" $OPT_LINUX "
      set optim90=" $OPT_LINUX "
@@ -490,4 +500,7 @@
      case -cosp
         set cosp="$2"; shift ; shift ; goto top
+
+     case -sisvat
+        set sisvat="$2" ; shift ; shift ; goto top
 
      case -filtre
@@ -519,5 +532,5 @@
              set optim90="$optim90"" -g -ffpe-trap=invalid,zero,overflow -fbounds-check -Wall "
              set optimtru90="$optimtru90"" -ffpe-trap=invalid,zero,overflow -g -fbounds-check -Wall "
-           else if ( $FC_LINUX == 'g95' ) then
+           else if ( $FC_LINUX == 'gfortran' ) then
              set optim="$optim"" -g -fbounds-check -freal=nan -ftrace=full -Wall "
              set optim90="$optim90"" -g -fbounds-check -freal=nan -ftrace=full -Wall "
@@ -566,4 +579,8 @@
 endif
 
+if ( "$sisvat" == 'true' ) then
+    set cppflags="$cppflags -DCPP_SISVAT"
+endif
+
 if ( "$physique" == 'nophys' ) then
    set phys="L_PHY= LIBPHY="
@@ -581,5 +598,5 @@
    set cppflags="$cppflags -DCPP_VEGET"
 #   set link_veget=" -lsechiba -lparameters -lstomate  "
-   set link_veget=" -lsechiba -lparameters -lstomate"
+   set link_veget=" -lsechiba -lparameters -lstomate   -lorchidee"
    if ( $XNEC || $X8BRODIE || $X6NEC) then
 #      set link_veget=" -lsxsechiba -lsxparameters -lsxstomate -lsxorglob -lsxparallel"
@@ -841,9 +858,9 @@
        set opt_link="$opt_link  -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf "
      endif
-   else if ($FC_LINUX == 'g95' || $FC_LINUX == 'gfortran' ) then
+   else if ($FC_LINUX == 'gfortran' || $FC_LINUX == 'gfortran' ) then
      if ( $io == "ioipsl" ) then
-       set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdff -lnetcdf -lioipsl -lnetcdff -lnetcdf "
+       set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB  -lnetcdf -lioipsl  -lnetcdf "
      else
-       set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdff -lnetcdf "
+       set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB  -lnetcdf "
      endif
    endif
@@ -1015,8 +1032,8 @@
    set optimtru90=" $optimtru90 -module $libo "
    set optim90=" $optim90 -module $libo "
- else if ( $FC_LINUX == 'g95' ) then
-   set optimtru90=" $optimtru90 -fmod=$libo  "
-   set optim90=" $optim90 -fmod=$libo  "
- else if ( $FC_LINUX == 'gfortran' ) then
+else if ( $FC_LINUX == 'gfortran' ) then 
+   set optimtru90=" $optimtru90 -I$libo  " 
+   set optim90=" $optim90 -I$libo  "
+else if ( $FC_LINUX == 'gfortran' ) then
    set optimtru90=" $optimtru90 -M $libo  "
    set optim90=" $optim90 -M $libo  "
Index: /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz	(revision 2071)
@@ -25,4 +25,6 @@
 fcm_path=none
 cosp=false
+sisvat=false
+rrtm=false
 
 # guess a default 'arch'
@@ -30,15 +32,7 @@
 ## try to recognise machine and infer arch from it
 machine=`hostname`
-if [[ "$machine" == "brodie" ]]
-then
-  arch="SX8_BRODIE"
-fi
-if [[ "${machine:0:6}" == "vargas" ]]
-then
-  arch="PW6_VARGAS"
-fi
-if [[ "${machine:0:6}" == "ciclad" ]]
-then
-  arch="AMD64_CICLAD"
+if [[ "${machine:0:3}" == "ada" ]]
+then
+  arch="X64_ADA"
 fi
 if [[ "${machine:0:7}" == "platine" ]]
@@ -165,11 +159,12 @@
 	  CPP_KEY="$CPP_KEY $2" ; shift ; shift ;;
 
-      "-adjnt")
-	  echo "not operational ... work to be done here ";exit
-	  opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d "
-	  optim="$optim -Dadj" ; shift ;;
-
       "-cosp")
           cosp="$2" ; shift ; shift ;;
+      
+      "-sisvat")
+          sisvat="$2" ; shift ; shift ;;
+      
+      "-rrtm")
+          rrtm="$2" ; shift ; shift ;;
       
       "-mem")
@@ -276,4 +271,8 @@
 LIB="$LIB  ${archfileopt}"
 
+# add Include files defined in arch.fcm file for pre-processing
+archfileline=$( grep -i '^%FPP_FLAGS' arch.fcm )
+for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done
+
 if [[ "$physique" != "nophys" ]]
 then
@@ -306,5 +305,5 @@
   FLAG_PARA=''
 else
-  FLAG_PARA="par"
+  FLAG_PARA="$paramem"
 fi
 
@@ -351,28 +350,27 @@
 fi
 
-if [[ "$veget" == "orchidee2.0" ]]
-then
-# orchidee2.0 : 
-# Compile with ORCHIDEE 2.0 (or more recent)
+
+#==============================================================================
+if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" ]
+then
+
+   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
    CPP_KEY="$CPP_KEY CPP_VEGET"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}orchidee "
-elif [[ "$veget" == "orchidee1.9" ]]
-then
-# orchidee1.9 : 
-# Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
-   CPP_KEY="$CPP_KEY CPP_VEGET ORCHIDEE_NOOPENMP"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob"
-elif [[ "$veget" == "true" ]]
-then
-# true : 
-# Obsolete, for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
-# For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments
-   CPP_KEY="$CPP_KEY CPP_VEGET"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob"
-elif [[ "$veget" != "false" ]]
-then
+# temporary, for Orchidee versions 1.9.* (before openmp activation)
+   if [[ "$veget" == "orchidee1.9" ]] ; then
+      CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP"
+   fi
+   if [[ "$veget" == "orchidee2.0" ]] ; then
+      orch_libs="sechiba parameters stomate parallel orglob orchidee"
+   else
+      orch_libs="sechiba parameters stomate parallel orglob"
+   fi
+   LIB="${LIB} -L${ORCH_LIBDIR}"
+   for lib in ${orch_libs} ; do
+      if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then
+         LIB="${LIB} -l${LIBPREFIX}$lib "
+      fi
+   done
+elif [[ "$veget" != "false" ]] ; then
    echo "Option -v $veget does not exist"
    echo "Use ./makelmdz -h for more information"
@@ -380,4 +378,5 @@
 fi
 
+#===============================================================================
 if [[ $io == ioipsl ]]
 then
@@ -385,4 +384,10 @@
    INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}"
    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl"
+elif [[ $io == xios ]]
+then
+   # For now, xios implies also using ioipsl
+   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
+   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
+   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
 fi
 
@@ -396,4 +401,15 @@
    INCLUDE="$INCLUDE"' -I$(LIBF)/cosp'
 fi
+
+if [[ "$sisvat" == "true" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_SISVAT"
+fi
+
+if [[ "$rrtm" == "true" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_RRTM"
+fi
+
 
 INCLUDE="$INCLUDE ${NETCDF_INCDIR}"
@@ -453,66 +469,21 @@
 ########################################################################
 
-dimension=`echo $dim | wc -w`
-echo dimension $dimension
-
-if (( $dimension == 3 ))
-then
-  cd $LIBFGCM/grid
-  \rm fxyprim.h
-  cp -p fxy_${grille}.h fxyprim.h
+if (( $dimc == 3 )) ; then
+   cd $LIBFGCM/grid
+   \rm fxyprim.h
+   cp -p fxy_${grille}.h fxyprim.h
+   filtre="FILTRE=$filtre"
+   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common '
+elif (( $dimc == 2 )) ; then
+   filtre="FILTRE= L_FILTRE= "
+   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d'
+elif (( $dimc == 1 )) ; then
+   CPP_KEY="$CPP_KEY CPP_1D"
+   filtre="L_DYN= DYN= FILTRE= L_FILTRE= DIRMAIN=phy$physique "
+   INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre
 else
-  echo "Probleme dans les dimensions de la dynamique !!"
-  echo "Non reactive pour l'instant !!!"
-fi
-
-######################################################################
-# Gestion du filtre qui n'existe qu'en 3d.
-######################################################################
-
-if (( `expr $dimc \> 2` == 1 ))
-then
-   filtre="FILTRE=$filtre"
-else
-   filtre="FILTRE= L_FILTRE= "
-fi
-echo MACRO FILTRE $filtre
-
-echo $dimc
-
-######################################################################
-# Creation du suffixe de la configuration
-######################################################################
-
-
-SUFF_NAME=_${dim_full}
-SUFF_NAME=${SUFF_NAME}_phy${physique}
-
-if [[ "$parallel" != "none" ]]
-then
-  SUFF_NAME=${SUFF_NAME}_para
-  DYN=dyn${dimc}d${paramem}
-  if [[ "$paramem" == "mem" ]]
-  then
-   SUFF_NAME=${SUFF_NAME}_${paramem}
-  fi
-else
-  SUFF_NAME=${SUFF_NAME}_seq
-  DYN=dyn${dimc}d
-fi
-
-if [[ $veget != "false" ]]
-then
-  SUFF_NAME=${SUFF_NAME}_orch
-fi
-
-if [[ $couple != "false" ]]
-then
-  SUFF_NAME=${SUFF_NAME}_couple
-fi
-
-if [[ $chimie == "INCA" ]]
-then
-  SUFF_NAME=${SUFF_NAME}_inca
-fi
+   echo Dimension dimc=$dimc pas prevu ; exit
+fi
+
 
 cd $LMDGCM
@@ -531,7 +502,8 @@
 ########################################################################
 cd $LMDGCM
+
 find libf -name '*.[Fh]' -print > tmp77
 find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print > tmp90
-find libf -name '*.[Fh90]' -print >> tmp90
+find libf -name '*.F90' -print >> tmp90
 
 if [[ ! ( -r makefile ) || ! ( -r liste_des_sources_f90 ) || ! ( -r liste_des_sources_f77 ) || ` diff tmp77 liste_des_sources_f77 | wc -w ` -ne 0 || ` diff tmp90 liste_des_sources_f90 | wc -w ` -ne 0 ]]
@@ -557,13 +529,11 @@
 then
   source_code=${code}.F90
+elif [[ -r $LMDGCM/libf/phy$physique/${code}.F90 ]] ; then
+  source_code=${code}.F90
 fi
 
 # library directory name:
-if [[ "$parallel" == "none" ]]
-then 
-  nomlib=${arch}_${physique}_${dim_full}_${grille}_${compil_mod}
-else
-  nomlib=${arch}_${physique}_${dim_full}_${grille}_${compil_mod}_${FLAG_PARA}
-fi
+nomlib=`echo ${arch}_${physique}_${dim_full}_${grille}_${compil_mod}_parall${parallel}_${CPP_KEY}_${FLAG_PARA} | sed -e 's/ //g' -e 's/-//g ' | sed -e 's/CPP_//g'`
+echo $nomlib
 
 if [[ ! -d "${LIBOGCM}/${nomlib}" ]]
@@ -585,5 +555,5 @@
   INCLUDE="$INCLUDE"' -I$(LIBF)/phy'"$physique"
 fi
-INCLUDE="$INCLUDE"' -I$(LIBF)/dyn'${dimc}'d'$FLAG_PARA' -I'${LIBOGCM}/${nomlib}
+INCLUDE="$INCLUDE"' -I'${LIBOGCM}/${nomlib}
 
 # ranlib utility (check it exists or else default to ls)
@@ -645,5 +615,5 @@
 DIM=$dimc \
 FLAG_PARA=$FLAG_PARA \
-L_ADJNT="$adjnt" \
+L_ADJNT=$adjnt \
 L_COSP="$lcosp" \
 L_CHIMIE="$libchimie" \
@@ -660,4 +630,5 @@
 PROG=$code
 
+
 if [[ -r $LIBFGCM/grid/dimensions.h ]]
 then
Index: /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz_fcm
===================================================================
--- /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz_fcm	(revision 2070)
+++ /LMDZ5/branches/LMDZ5-DOFOCO/makelmdz_fcm	(revision 2071)
@@ -22,4 +22,6 @@
 couple=false
 veget=false
+sisvat=false
+rrtm=false
 chimie=false
 parallel=none
@@ -29,4 +31,6 @@
 LIBPREFIX=""
 cosp=false
+job=1
+full=''
 
 LMDGCM=`/bin/pwd`
@@ -63,5 +67,5 @@
 [-p PHYS]                  : set of physical parametrizations (in libf/phyPHYS), (default: lmd)
 [-prod / -dev / -debug]    : compilation mode production (default) / developement / debug
-[-c false/MPI1/MPI2]       : coupling with ocean model : MPI1/MPI2/false (default: false)
+[-c false/MPI1/OMCT]       : coupling with ocean model : MPI1/OMCT/false (default: false)
 [-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false)
           false       : no vegetation model
@@ -79,4 +83,6 @@
 [-filtre NOMFILTRE]        : use filtre from libf/NOMFILTRE (default: filtrez)
 [-link LINKS]              : additional links with other libraries
+[-j n]                     : active parallel compiling on ntask
+[-full]                    : full recompiling 
 [-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
 [-ext_src path]            : path to an additional set of routines to compile with the model
@@ -113,4 +119,10 @@
 	  veget="$2" ; shift ; shift ;;
 
+      "-sisvat")
+	  sisvat="$2" ; shift ; shift ;;
+
+      "-rrtm")
+	  rrtm="$2" ; shift ; shift ;;
+
       "-chimie")
 	  chimie="$2" ; shift ; shift ;;
@@ -147,4 +159,8 @@
       "-ext_src")
 	  EXT_SRC=$2 ; shift ; shift ;;
+      "-j")
+	  job=$2 ; shift ; shift ;;
+      "-full")
+	  full="-full" ; shift ;;
 
       "-arch")
@@ -219,7 +235,16 @@
 if [[ "$couple" != "false" ]]
 then
-   CPP_KEY="$CPP_KEY CPP_COUPLE"
-   INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
-   LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.${couple} -lmpp_io"
+    if [[ "$couple" == "MPI1" ]]
+    then
+	CPP_KEY="$CPP_KEY CPP_COUPLE"
+	export OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.MPI1
+	export OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib
+	INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
+	LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.MPI1 -lmpp_io"
+    else
+	CPP_KEY="$CPP_KEY CPP_COUPLE CPP_OMCT"
+	INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
+	LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.MPI1 -lscrip -lmct -lmpeu"
+    fi
 fi
 
@@ -248,28 +273,27 @@
 fi
 
-if [[ "$veget" == "orchidee2.0" ]]
-then
-# orchidee2.0 : 
-# Compile with ORCHIDEE 2.0 (or more recent)
+if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" ]
+then
+#NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
+#    For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments
+#    option orchidee1.9 : Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
+   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
    CPP_KEY="$CPP_KEY CPP_VEGET"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}orchidee "
-elif [[ "$veget" == "orchidee1.9" ]]
-then
-# orchidee1.9 : 
-# Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
-   CPP_KEY="$CPP_KEY CPP_VEGET ORCHIDEE_NOOPENMP"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob"
-elif [[ "$veget" == "true" ]]
-then
-# true : 
-# Obsolete, for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
-# For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments
-   CPP_KEY="$CPP_KEY CPP_VEGET"
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
-   LIB="${LIB} -L${ORCH_LIBDIR} -l${LIBPREFIX}sechiba -l${LIBPREFIX}parameters -l${LIBPREFIX}stomate -l${LIBPREFIX}parallel -l${LIBPREFIX}orglob"
-elif [[ "$veget" != "false" ]]
-then
+# temporary, for Orchidee versions 1.9.* (before openmp activation)
+   if [[ "$veget" == "orchidee1.9" ]] ; then
+      CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP"
+   fi
+   if [[ "$veget" == "orchidee2.0" ]] ; then
+      orch_libs="sechiba parameters stomate parallel orglob orchidee"
+   else
+      orch_libs="sechiba parameters stomate parallel orglob"
+   fi
+   LIB="${LIB} -L${ORCH_LIBDIR}"
+   for lib in ${orch_libs} ; do
+      if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then
+         LIB="${LIB} -l${LIBPREFIX}$lib "
+      fi
+   done
+elif [[ "$veget" != "false" ]] ; then
    echo "Option -v $veget does not exist"
    echo "Use ./makelmdz_fcm -h for more information"
@@ -277,4 +301,18 @@
 fi
 
+if [[ "$sisvat" == "true" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_SISVAT"
+   sed -e 's/^#src::sisvat/src::sisvat/' bld.cfg > bld.tmp
+   mv bld.tmp bld.cfg
+fi
+
+if [[ "$rrtm" == "true" ]]
+then
+   CPP_KEY="$CPP_KEY CPP_RRTM"
+   sed -e 's/^#src::rrtm/src::rrtm/' bld.cfg > bld.tmp
+   mv bld.tmp bld.cfg
+fi
+
 if [[ $io == ioipsl ]]
 then
@@ -282,5 +320,12 @@
    INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}"
    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl"
-fi
+elif [[ $io == xios ]]
+then
+   # For now, xios implies also using ioipsl
+   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
+   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
+   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
+fi
+
 if [[ "$cosp" == "true" ]]
 then
@@ -468,5 +513,5 @@
 
 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
-./build_gcm ${fcm_path}
+./build_gcm ${fcm_path} -j $job $full
 
 rm -rf tmp_src
@@ -475,4 +520,13 @@
 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src
 
+#eventual cleanup for SISVAT
+sed -e 's/^src::sisvat/#src::sisvat/' bld.cfg > bld.tmp
+mv bld.tmp bld.cfg
+
+#eventual cleanup for RRTM
+sed -e 's/^src::rrtm/#src::rrtm/' bld.cfg > bld.tmp
+mv bld.tmp bld.cfg
+
+
 if [[ -r $LIBFGCM/grid/dimensions.h ]]
 then
