Index: CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh
===================================================================
--- CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh	(revision 4638)
+++ CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh	(revision 4641)
@@ -24,4 +24,6 @@
 # Version ESM CO2: CO2 interactif ocean/atmosphere (y/n)
 esmco2=n
+# Also compile ce0l subprogram to LMDZ (y/n)
+ce0l=n
 
 # Optimization mode
@@ -35,6 +37,9 @@
 full_flag=""
 full_nemo=n
-# Default netcdf_lib is used for XIOS but can be change by argument
-netcdf_lib=""
+full_xios=""
+full_lmdz=""
+full_orch=""
+
+
 
 # Output text file for compilation of each component
@@ -42,5 +47,5 @@
 outfile=$submitdir/out_compile_ipslcm6.$datestr
 echo > $outfile
-echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6"; echo 
+echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6.$datestr"; echo 
 
 #### Read arguments 
@@ -48,6 +53,5 @@
 while (($# > 0)) ; do
     case $1 in
-	"-h") cat <<fin
-
+	"-h") cat <<end_help
 ########################################################################
 # Usage of the script compile_ipslcm6.sh
@@ -85,56 +89,33 @@
 ./compile_ipslcm6.sh MR025 -debug -full
 
-fin
-	    exit;;
-
-   "VLR")
-        resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;;
-
-    "LR")
-        resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;;
-
-    "MR1")
-        resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;;
-
-    "MR025")
-        resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n;   shift ;;
-
-    "ESMCO2")
-	    esmco2=y;  shift ;; 
-
-	"-parallel")
-	    parallel=$2 ; shift ; shift ;; 
-	
-	"-arch")
-	    fcm_arch="$2" ; shift ; shift ;;
-	
-	"-debug")
-	    optmode=debug ; shift ;;
-
-	"-dev")
-	    optmode=dev ; shift ;;
-
-	"-prod")
-	    optmode=prod ; shift ;;
-
-    "-full")
-        full_flag="-full"; full_nemo=y ; shift ;;
-
-    "-cleannemo")
-        full_nemo=y ; shift ;;
-	
-        "-netcdf_lib_seq")
-            netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;;
-
-	*)
-	    echo "unknown option "$2" , exiting..."
-	    exit 
+end_help
+exit;;
+	"VLR")         resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;;
+	"LR")          resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;;
+	"MR1")         resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;;
+	"MR025")       resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n;   shift ;;
+	"ESMCO2")      esmco2=y;  shift ;; 
+	"CE0L")        ce0l=y ; shift ;;
+	"-parallel")   parallel=$2 ; shift ; shift ;; 
+	"-arch")       fcm_arch="$2" ; shift ; shift ;;
+	"-debug")      optmode=debug ; shift ;;
+	"-dev")	       optmode=dev ; shift ;;
+	"-prod")       optmode=prod ; shift ;;
+	"-full")       full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;;
+	"-full_xios")  full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full
+	"-full_lmdz")  full_lmdz="-full"  ; shift ;;
+	"-full_orch")  full_orch="-full"  ; shift ;;
+	"-full_nemo")  full_nemo=y ; shift ;;
+	"-cleannemo")  full_nemo=y ; shift ;;
+	*)	       echo "unknown option "$2" , exiting..." ; exit
     esac
 done
 
-echo "Following options are set in current compiling:" >> $outfile 
-echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, withpisces=${pisces}" >> $outfile 
+echo "Following options are set in current compiling:" >> $outfile
+echo "   resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, oceanbio=${oceanbio}" >> $outfile 
 echo "   esmco2=${esmco2}" >> $outfile 
-echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag" >> $outfile 
+echo "   ce0l=${ce0l}" >> $outfile 
+echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile 
+echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo," >> $outfile 
 echo >> $outfile
 
@@ -218,6 +199,6 @@
 echo; echo "NOW COMPILE XIOS"
 echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile 
-echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 
-     ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 2>&1
+echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile 
+     ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile 2>&1
 # Test if compiling succeded 
 if [[ $? != 0 ]] ; then 
@@ -239,6 +220,6 @@
 echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile 
 
-echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag   >> $outfile 
-        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_flag   >> $outfile 2>&1
+echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile 
+        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -288,5 +269,5 @@
 
 if [ $full_nemo == y ] ; then
-   # To make a full compilation, first clean all what has been produced during previous compilation
+   # To make a full compilation, first make a clean to remove all files produced during previous compilation
    echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean   >> $outfile
    echo >> $outfile
@@ -333,6 +314,6 @@
 fi
 
-echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm    >> $outfile 
-     ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm    >> $outfile 2>&1
+echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
+     ./makelmdz_fcm -d ${resol_atm} -c OMCT -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -341,34 +322,53 @@
 fi
 
-# Compile ce0l initialization program for LMDZ regular lat-lon exectuable
-echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
-echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
-    
-echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag ce0l    >> $outfile 
-./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag ce0l    >> $outfile 2>&1
-# Test if compiling finished
-if [[ $? != 0 ]] ; then
-    echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
-    exit
-fi
-
-# Find executable suffix
-if [ $parallel == seq ] || [ $parallel == none ] ; then
-    suffix=_${resol_atm}_phylmd_seq_orch
-else
-    suffix=_${resol_atm}_phylmd_para_mem_orch
-fi
-echo suffix = $suffix
-
 # Move executables to modipsl/bin folder
 echo >> $outfile
-echo "Move gcm.e and ce0l executable to modipsl/bin" >> $outfile
+echo "Move gcm.e executable to modipsl/bin" >> $outfile
 echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
 ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
 echo >> $outfile
-
-if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix}_couple.e ] ;  then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}_couple.e $modipsl/bin/gcm_${resol_atm}_${optmode}.e ; fi
-if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e $modipsl/bin/ce0l_${resol_atm}_${optmode}.e ; fi
-
+suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e
+echo gcm.e suffix = $suffix
+
+if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
+    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e
+else
+    echo "ERROR gcm${suffix} executable does not exist." 
+    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+    exit
+fi  
+
+
+# Compile ce0l initialization program for LMDZ regular lat-lon exectuable
+if [ $ce0l == y ] ; then
+    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
+    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
+    
+    echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
+    ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi
+
+
+    # Move executables to modipsl/bin folder
+    echo >> $outfile
+    echo "Move ce0l.e executable to modipsl/bin" >> $outfile
+    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
+    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
+    echo >> $outfile
+    suffix=_${resol_atm}_phylmd_para_mem_orch.e
+    echo ce0l suffix = $suffix
+
+    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then 
+	mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
+    else
+	echo "ERROR ce0l${suffix} executable does not exist." 
+	echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi  
+fi
 
 echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
