Index: CONFIG/UNIFORM/v6/LMDZOR_v6.2/compile_lmdzor.sh
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.2/compile_lmdzor.sh	(revision 6685)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.2/compile_lmdzor.sh	(revision 6787)
@@ -43,4 +43,8 @@
 netcdf_lib=""
 
+## Arguments in order to compress temporary files after compilation
+tar=no
+comp_tar=yes
+
 # Output text file for compilation of each component
 datestr=`LC_ALL=C date +"%Y%m%dT%H%M"`
@@ -61,5 +65,11 @@
 ./compile_config [Options] 
 
-Options: -full, -resol_atm, -debug, -dev, -prod(default)
+Options: 
+  [-full]: full recompilation of all components 
+  [-debug], [-dev], [-prod](default): use compilation options for debug, dev or production mode, only one option can be used
+  [-resol_atm]: set resolution of LMDZ in regular mode
+  [-tar]: option to compress XIOS and/or LMDZ/libo repositories that takes many inodes without compilation
+  [-comp_tar]: option to compile and compress XIOS and LMDZ/libo repositories if compilation succed (default option)
+  [-notar]: do not compress XIOS and LMDZ/libo repositories
 
 Example 1: Default compilation of LMDZ-ORCHIDEE with XIOS and IOIPSL
@@ -75,4 +85,7 @@
 The dimension can be changed to any other 3d dimension.
 ./compile_lmdzor.sh -resol_atm 96x95x79
+
+Example 5: Compile without compressing XIOS and LMDZ/libo in tar files
+./compile_lmdzor.sh -notar
 
 end_help
@@ -94,4 +107,7 @@
 	"-full_orch")       full_orch="-full"  ; shift ;;
 	"-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;;
+	"-tar")             tar=yes ; shift ;;
+	"-comp_tar")        comp_tar=yes ; shift ;;
+	"-notar")           comp_tar=no ; shift ;;
 	*)	            echo "unknown option "$1" , exiting..." ; exit 
     esac
@@ -103,4 +119,5 @@
 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" >> $outfile 
+echo "   tar=$tar, comp_tar=$comp_tar" >> $outfile
 echo >> $outfile
 
@@ -112,4 +129,36 @@
     opt_cosp=""
 fi
+
+
+# Compress XIOS and LMDZ/libo without compiling if tar=yes
+if [ $tar == yes ] ; then
+    echo "Option tar activated to compress XIOS and LMDZ/libo. No compilation will be done."
+    echo >> $outfile
+    echo "Option tar activated to compress XIOS and LMDZ/libo. No compilation will be done." >> $outfile
+    if [[ -d $modipsl/modeles/XIOS ]] ; then
+        echo " Now tar XIOS repository"
+        echo " Now tar XIOS repository" >> $outfile
+        tar -cf $modipsl/modeles/XIOS.tar $modipsl/modeles/XIOS
+        rm -rf $modipsl/modeles/XIOS
+    else
+        echo " No XIOS repository to compress"
+        echo " No XIOS repository to compress" >> $outfile
+    fi
+
+    if [[ -d $modipsl/modeles/LMDZ/libo ]] ; then
+        echo "Now tar LMDZ/libo repository"
+        echo "Now tar LMDZ/libo repository" >> $outfile
+        tar -cf $modipsl/modeles/LMDZ/libo.tar $modipsl/modeles/LMDZ/libo
+        rm -rf $modipsl/modeles/LMDZ/libo
+    else
+        echo " No LMDZ/libo repository to compress"
+        echo " No LMDZ/libo repository to compress" >> $outfile
+    fi
+        
+    echo "END OF SCRIPT"
+    echo "END OF SCRIPT" >> $outfile
+    exit
+fi
+
 ### Read host dependent default values
 ### These variables will not be changed if they were set as argument
@@ -181,4 +230,5 @@
 fi
 
+
 #### 2 Do the compilation 
 ## 2.1 Compile ioipsl
@@ -203,4 +253,39 @@
 
 ## 2.2 Compile xios
+
+echo; echo "NOW DECOMPRESS XIOS IF NEEDED"
+# First check if XIOS needs to be decompressed
+# In priority search for modeles/XIOS_${optmode}.tar but if it doesn't exist take
+# the first which is found. 
+if [[ -d $modipsl/modeles/XIOS ]] ; then
+    echo "Found XIOS -> no decompress needs to be do";  >> $outfile
+elif [[ -f $modipsl/modeles/XIOS_${optmode}.tar ]]; then
+    echo >> $outfile
+    echo "Found XIOS_${optmode}.tar -> decompress repository" >> $outfile
+    # Do not write "tar -xf ... -C $modipsl/modeles because it's modeles/XIOS that is compressed, not only XIOS/
+    tar -xf $modipsl/modeles/XIOS_${optmode}.tar -C $modipsl/ >> $outfile 2>&1
+elif [[ -f $modipsl/modeles/XIOS_prod.tar ]]; then
+    echo >> $outfile
+    echo "Found XIOS_prod.tar -> decompress repository" >> $outfile
+    tar -xf $modipsl/modeles/XIOS_prod.tar -C $modipsl/ >> $outfile 2>&1
+elif [[ -f $modipsl/modeles/XIOS_debug.tar ]]; then
+    echo >> $outfile
+    echo "Found XIOS_debug.tar -> decompress repository" >> $outfile
+    tar -xf $modipsl/modeles/XIOS_debug.tar -C $modipsl/ >> $outfile 2>&1
+elif [[ -f $modipsl/modeles/XIOS_dev.tar ]]; then
+    echo >> $outfile
+    echo "Found XIOS_dev.tar -> decompress repository" >> $outfile
+    tar -xf $modipsl/modeles/XIOS_dev.tar -C $modipsl/ >> $outfile 2>&1
+elif [[ -f $modipsl/modeles/XIOS.tar ]]; then
+    echo >> $outfile
+    echo "Found XIOS.tar -> decompress repository" >> $outfile
+    tar -xf $modipsl/modeles/XIOS.tar -C $modipsl/ >> $outfile 2>&1
+else
+    echo "XIOS source code was not found. Exit"
+    echo "XIOS source code was not found. Exit" >> $outfile
+    exit
+fi
+
+
 cd $modipsl/modeles/XIOS
 echo; echo "NOW COMPILE XIOS"
@@ -255,4 +340,18 @@
 ## 2.4 Compile LMDZ for regular latlon configuration
 cd $modipsl/modeles/LMDZ
+
+# First check if LMDZ/libo exist or if it could be decompressed
+# If neither LMDZ/libo or LMDZ/libo_${optmode}.tar exists, nothing is done. It'll be created
+# during the compilation.
+echo; echo "NOW DECOMPRESS LMDZ/libo IF NEEDED"
+if [[ -d $modipsl/modeles/LMDZ/libo ]] ; then
+    echo "Found LMDZ/libo -> no decompress needs to be done"; >> $outfile
+elif [[ -f $modipsl/modeles/LMDZ/libo_${optmode}.tar ]]; then
+    echo "Found LMDZ/libo_${optmode}.tar -> decompress repository"; >> $outfile
+    echo >> $outfile
+    tar -xf $modipsl/modeles/LMDZ/libo_${optmode}.tar -C $modipsl/ >> $outfile 2>&1
+fi
+
+
 # Compile LMDZ regular lat-lon executable
 echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
@@ -352,4 +451,13 @@
 fi
 
+# Compress XIOS and LMDZ/libo
+if [ $comp_tar == yes ] && [ -d $modipsl/modeles/XIOS ] ; then
+    echo "Option comp_tar activated, now compress XIOS and LMDZ/libo"
+    echo "Option comp_tar activated, now compress XIOS and LMDZ/libo" >> $outfile 
+    tar -cf $modipsl/modeles/XIOS_${optmode}.tar $modipsl/modeles/XIOS
+    rm -rf $modipsl/modeles/XIOS
+    tar -cf $modipsl/modeles/LMDZ/libo_${optmode}.tar $modipsl/modeles/LMDZ/libo
+    rm -rf $modipsl/modeles/LMDZ/libo
+fi
 
 echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
