Index: CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh
===================================================================
--- CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh	(revision 4407)
+++ CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh	(revision 4408)
@@ -9,6 +9,4 @@
 submitdir=$( pwd )
 modipsl=$submitdir/../..
-echo modipsl=$modipsl 
-echo submitdir=$submitdir
 arch_path=$submitdir/ARCH 
 export ROOT=$modipsl/modeles/DYNAMICO
@@ -30,4 +28,9 @@
 netcdf_lib=""
 
+# Output text file for compilation of each component
+outfile=$submitdir/out_compile_icolmdzor
+rm -f $outfile; echo > $outfile
+echo; echo "Text output from compilation will be stored in file out_compile_icolmdzor"; echo 
+
 #### Read arguments 
 # Loop over all arguments to modify default set up
@@ -98,4 +101,7 @@
 done
 
+echo "Following arguments are set in current compiling:" >> $outfile 
+echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag regular_latlon=$regular_latlon" >> $outfile 
+echo >> $outfile
 
 ### Read host dependent default values
@@ -125,13 +131,19 @@
 # The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement.
 if [ -f ARCH/arch-${fcm_arch}.env ] ; then
+    echo >> $outfile
+    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation."
+    echo "Note that this new environement will be kept after compilation."
+    echo "You might want to source again your personal environment after compilation. This must be done manually or by reconnection."
+    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile 
+    module list   >> $outfile 2>&1
+
     rm -f ARCH/arch.env
     ln -s arch-${fcm_arch}.env ARCH/arch.env
-    source ARCH/arch.env
-fi
-
-##### End host.sh
-echo
-echo "Following arguments are set in current compiling:"
-echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full_flag regular_latlon=$regular_latlon"
+    source ARCH/arch.env   >> $outfile 2>&1
+
+    echo >> $outfile
+    echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile 
+    module list   >> $outfile 2>&1
+fi
 
 #### 2 Do the compilation 
@@ -139,6 +151,8 @@
 cd $modipsl/modeles/IOIPSL
 echo; echo "NOW COMPILE IOIPSL"
-echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag
-./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag
+echo >> $outfile ; echo " NOW COMPILE IOIPSL"   >> $outfile 
+
+echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 
+     ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 2>&1
 # Test if compiling succeded 
 if [[ $? != 0 ]] ; then 
@@ -150,6 +164,7 @@
 cd $modipsl/modeles/XIOS
 echo; echo "NOW COMPILE XIOS"
-echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_flag
-./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag
+echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile 
+echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 
+     ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_flag   >> $outfile 2>&1
 # Test if compiling succeded 
 if [[ $? != 0 ]] ; then 
@@ -169,6 +184,8 @@
 cd $modipsl/modeles/ORCHIDEE
 echo; echo "NOW COMPILE ORCHIDEE"
-echo 	./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag
-./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag
+echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile 
+
+echo 	./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag    >> $outfile 
+        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag    >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -181,6 +198,8 @@
 # Compile LMDZ as library to couple to DYNAMICO
 echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"
-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_flag
-./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag
+echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile 
+
+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_flag    >> $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_flag    >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -191,8 +210,10 @@
 
 ## 2.5 Compile DYNAMICO
+cd $modipsl/modeles/DYNAMICO
 echo; echo "NOW COMPILE DYNAMICO "
-cd $modipsl/modeles/DYNAMICO
-echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag
-./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag
+echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile 
+
+echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag    >> $outfile 
+     ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag    >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -202,9 +223,10 @@
 
 ## 2.6 Compile interface ICOSA_LMDZ
+cd $modipsl/modeles/ICOSA_LMDZ
 echo; echo "NOW COMPILE ICOSA_LMDZ "
-cd $modipsl/modeles/ICOSA_LMDZ
-echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag
-
-./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag
+echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile 
+
+echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag    >> $outfile 
+     ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag    >> $outfile 2>&1
 # Test if compiling finished
 if [[ $? != 0 ]] ; then
@@ -228,6 +250,8 @@
     # Compile LMDZ regular lat-lon exectuable
     echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm_3d}"
-    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm
-    ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm
+    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm_3d}"   >> $outfile 
+
+    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm    >> $outfile 
+         ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm    >> $outfile 2>&1
     # Test if compiling finished
     if [[ $? != 0 ]] ; then
@@ -238,6 +262,8 @@
     # Compile ce0l initialization program for LMDZ regular lat-lon exectuable
     echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm_3d}"
-    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l
-    ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l
+    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm_3d}"   >> $outfile 
+
+    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l    >> $outfile 
+         ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l    >> $outfile 2>&1
     # Test if compiling finished
     if [[ $? != 0 ]] ; then
@@ -267,7 +293,6 @@
 
 
-echo 
-echo "ALL COMPILING FINISHED"
-echo
+echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
+echo; echo "ALL COMPILING FINISHED"
 
 exit
