Index: /CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh
===================================================================
--- /CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh	(revision 6079)
+++ /CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh	(revision 6080)
@@ -19,5 +19,10 @@
 # Resolution if compiling LMDZ in regular mode without DYNAMICO
 # Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79"
-regular_latlon=no
+resol_atm=144x142x79
+#choose if we want to compile only grid ico, grid reg. If no for both of them, we will compile the two grids
+ico_only=no
+reg_only=no
+#choose if we want to compile only create_etat0_limit
+ce0l_only=no
 # fcm_arch
 fcm_arch=default
@@ -55,5 +60,5 @@
 Options: -full, -regular_latlon, -debug, -dev, -prod(default)
 
-Example 1: Default compilation of DYNAMICO-LMDZ-ORCHIDEE with XIOS and IOIPSL
+Example 1: Default compilation of [DYNAMICO-LMDZ-ORCHIDEE with XIOS and IOIPSL] and [LMDZ-ORCHIDEE with XIOS and IOIPSL] and [create_etat0_limit]
 ./compile_icolmdzor.sh
 
@@ -64,7 +69,16 @@
 ./compile_icolmdzor.sh -full
 
-Example 4: Compilation of LMDZ in regular lat-lon for dimension 144x142x79. 
-The dimension can be changed to any other 3d dimension. DYNAMICO is also compiled as default.
-./compile_icolmdzor.sh -regular_latlon 144x142x79
+Example 4: Define dimension for regular grid (default one is  144x142x79)
+The dimension can be changed to any other 3d dimension - in this example DYNAMICO is also compiled as default.
+./compile_icolmdzor.sh -regular_latlon 256x256x79
+
+Example 5: Compile only ico grid 
+./compile_icolmdzo.sh -ico_only
+
+Example 6: Compile only regular grid with default resolution (144x142x79)
+./compile_icolmdzor.sh -reg_only
+
+Example 7: compile only create_etat0_limt for reg and ico 
+./compile_icolmdzor.sh -ce0l_only
 
 end_help
@@ -83,4 +97,7 @@
 	"-full_orch")       full_orch="-full"  ; shift ;;
 	"-full_dyna")       full_dyna="-full"  ; shift ;;
+	"-ico_only")        ico_only=yes  ; shift ;;
+	"-reg_only")        reg_only=yes  ; shift ;;
+	"-ce0l_only")       ce0l_only=yes  ; shift ;;
         "-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;;
 	*)       	    echo "unknown option "$1" , exiting..." ;  exit 
@@ -89,5 +106,6 @@
 
 echo "Following options are set in current compiling:" >> $outfile 
-echo "   regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile 
+echo "   ico_only=${ico_only}, reg_only=${reg_only}, ce0l_only=${ce0l_only}" >> $outfile
+echo "   regular_latlon=${resol_atm} (use to create executable on regular grid)" >> $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_dyna=$full_dyna" >> $outfile 
@@ -214,95 +232,12 @@
 
 ## 2.4 Compile lmdz
-cd $modipsl/modeles/LMDZ
-# Compile LMDZ as library to couple to DYNAMICO
-echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"
-echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile 
-
-# Check if the compilation of LMDZ was previsouly interupted prematured. 
-# In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 
-# to ask question and wait for interactivly answer from the user.
-if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
-  echo >> $outfile
-  echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
-  echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
-  echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
-  echo >> $outfile
-  rm -f libf/grid/dimensions.h
-  rm -f .lock
-fi
-
-echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 
-     ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1
-# Test if compiling finished
-if [[ $? != 0 ]] ; then
-    echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP"
-    exit
-fi
-
-
-## 2.5 Compile DYNAMICO
-cd $modipsl/modeles/DYNAMICO
-echo; echo "NOW COMPILE DYNAMICO "
-echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile 
-
-if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO ] ; then
-    cd $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO
-    for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do
-	for file in $( find $dir -type f ! -path '*.svn*' ); do
-	    echo cp $file $modipsl/modeles/DYNAMICO/$file >> $outfile 
-	    cp $file $modipsl/modeles/DYNAMICO/$file  >> $outfile 2>&1
-	done
-    done
-    cd $modipsl/modeles/DYNAMICO
-fi
-
-echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 
-     ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1
-# Test if compiling finished
-if [[ $? != 0 ]] ; then
-    echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP"
-    exit
-fi
-
-## 2.6 Compile interface ICOSA_LMDZ
-cd $modipsl/modeles/ICOSA_LMDZ
-echo; echo "NOW COMPILE ICOSA_LMDZ "
-echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile 
-
-if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ ] ; then
-    cd $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ
-    for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do
-	for file in $( find $dir -type f ! -path '*.svn*' ); do
-	    echo cp $file $modipsl/modeles/ICOSA_LMDZ/$file >> $outfile 
-	    cp $file $modipsl/modeles/ICOSA_LMDZ/$file  >> $outfile 2>&1
-	done
-    done
-    cd $modipsl/modeles/ICOSA_LMDZ
-fi
-
-echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 
-     ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1
-# Test if compiling finished
-if [[ $? != 0 ]] ; then
-    echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP"
-    exit
-fi
-# Move executables to modipsl/bin
-if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 
-    mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe
-else
-    echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP"
-    exit
-fi
-
-
-
-## 2.7 Compile LMDZ for regular latlon configuration
-if [ $regular_latlon = yes ] ; then
+
+if [ $reg_only = no ] && [ $ce0l_only = no ]; then 
 
     cd $modipsl/modeles/LMDZ
-    # Compile LMDZ regular lat-lon exectuable
-    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
-    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
+
+    # Compile LMDZ as library to couple to DYNAMICO
+    echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"
+    echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile 
 
     # Check if the compilation of LMDZ was previsouly interupted prematured. 
@@ -318,4 +253,101 @@
 	rm -f .lock
     fi
+
+    echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 
+    ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP"
+	exit
+    fi
+
+
+    ## 2.5 Compile DYNAMICO
+    cd $modipsl/modeles/DYNAMICO
+    echo; echo "NOW COMPILE DYNAMICO "
+    echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile 
+    
+    if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO ] ; then
+	cd $modipsl/config/ICOLMDZOR_v7/SOURCES/DYNAMICO
+	for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do
+	    for file in $( find $dir -type f ! -path '*.svn*' ); do
+		echo cp $file $modipsl/modeles/DYNAMICO/$file >> $outfile 
+		cp $file $modipsl/modeles/DYNAMICO/$file  >> $outfile 2>&1
+	    done
+	done
+	cd $modipsl/modeles/DYNAMICO
+    fi
+
+    echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 
+    ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP"
+	exit
+    fi
+
+    ## 2.6 Compile interface ICOSA_LMDZ
+    cd $modipsl/modeles/ICOSA_LMDZ
+    echo; echo "NOW COMPILE ICOSA_LMDZ "
+    echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile 
+    
+    if [ -d $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ ] ; then
+	cd $modipsl/config/ICOLMDZOR_v7/SOURCES/ICOSA_LMDZ
+	for dir in $( find . -mindepth 1 -maxdepth 1 -type d ); do
+	    for file in $( find $dir -type f ! -path '*.svn*' ); do
+		echo cp $file $modipsl/modeles/ICOSA_LMDZ/$file >> $outfile 
+		cp $file $modipsl/modeles/ICOSA_LMDZ/$file  >> $outfile 2>&1
+	    done
+	done
+	cd $modipsl/modeles/ICOSA_LMDZ
+    fi
+    
+    echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 
+    ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP"
+	exit
+    fi
+    # Move executables to modipsl/bin
+    if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 
+	mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe
+    else
+	echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP"
+	exit
+    fi
+    
+fi 
+
+## 2.7 Compile LMDZ for regular latlon configuration
+
+# Find executable suffix
+if [ $parallel == seq ] || [ $parallel == none ] ; then
+    suffix=_${resol_atm}_phylmd_seq_orch.e
+else
+    suffix=_${resol_atm}_phylmd_para_mem_orch.e
+fi
+echo gcm suffix = $suffix
+
+
+if [ $ico_only = no ] && [ $ce0l_only = no ]; then
+
+    cd $modipsl/modeles/LMDZ
+    # Compile LMDZ regular lat-lon exectuable
+    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
+    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
+
+    # Check if the compilation of LMDZ was previsouly interupted prematured. 
+    # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 
+    # to ask question and wait for interactivly answer from the user.
+    if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
+	echo >> $outfile
+	echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
+	echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
+	echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
+	echo >> $outfile
+	rm -f libf/grid/dimensions.h
+	rm -f .lock
+    fi
     echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile 
          ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile 2>&1
@@ -326,4 +358,22 @@
     fi
 
+
+    # Move executables to modipsl/bin folder
+    echo "Move gcm.e  executable to modipsl/bin"
+    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
+
+fi 
+
+
+if [ $ce0l_only = yes ] || [ $ico_only = no ] && [ $reg_only = no ] ; then 
+
+    cd $modipsl/modeles/LMDZ
+
     # Compile ce0l initialization program for LMDZ regular lat-lon exectuable
     echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
@@ -338,22 +388,6 @@
     fi
 
-    # Find executable suffix
-    if [ $parallel == seq ] || [ $parallel == none ] ; then
-	suffix=_${resol_atm}_phylmd_seq_orch.e
-    else
-	suffix=_${resol_atm}_phylmd_para_mem_orch.e
-    fi
-    echo gcm suffix = $suffix
-    
     # Move executables to modipsl/bin folder
-    echo "Move gcm.e and ce0l executable to modipsl/bin"
-    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
-
+    echo "Move ce0l.e  executable to modipsl/bin"
     if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then
 	mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
@@ -363,5 +397,7 @@
 	exit
     fi
-fi
+
+fi 
+
 
 
