Index: CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh
===================================================================
--- CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh	(revision 6209)
+++ CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh	(revision 6210)
@@ -28,4 +28,7 @@
 # Also compile ce0l subprogram to LMDZ (y/n)
 ce0l=n
+# choose radiative code compilation option 
+rad=rrtm
+opt_rad=""
 
 # Optimization mode
@@ -94,4 +97,8 @@
 ./compile_ipslcm6.sh MR025 -debug -full
 
+Example 7: choose radiative schema for LMDZ (oldrad/rrtm/ecrad). Default is rrtm
+./compile_ipslcm6.sh MR025 -rad ecrad
+
+
 end_help
 exit;;
@@ -104,4 +111,5 @@
 	"ESMCO2AER")   esmco2=y; esmaer=y; shift ;;
 	"CE0L")        ce0l=y ; shift ;;
+	"-rad")        rad=$2; shift;;
 	"-parallel")   parallel=$2 ; shift ; shift ;; 
 	"-arch")       fcm_arch="$2" ; shift ; shift ;;
@@ -362,4 +370,6 @@
 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 
+# Retrieve the final svn release number, needed for radiative code suffix of executable
+lmdzsvn=`svnversion . | egrep -o "[0-9]+"  | awk 'NR==1'`
 
 # Check if the compilation of LMDZ was previsouly interupted prematured. 
@@ -376,11 +386,19 @@
 fi
 
+# Need to define the proper option for radiative code compilation. By default, we use rrtm
+case $rad in
+    oldrad) opt_rad="" ;;
+    rrtm)   if [ $lmdzsvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;;
+    ecrad)  opt_rad="-rad ecrad" ;;
+    *) echo Only oldrad rrtm ecrad for rad option ; exit
+esac
+
 if [ ${esmaer} == n ] ;  then
-    echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -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 -cosp true -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
+    echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true $opt_rad -$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 -cosp true $opt_rad -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
 else
     #in esm aer case add chemistry option to lmdz compilation
-    echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -rrtm true -$optmode -mem -parallel $parallel -chimie INCA -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 -cosp true -rrtm true -$optmode -mem -parallel $parallel -chimie INCA -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
+    echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true $opt_rad -$optmode -mem -parallel $parallel -chimie INCA -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 -cosp true $opt_rad -$optmode -mem -parallel $parallel -chimie INCA -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
 fi
 
@@ -391,4 +409,7 @@
 fi
 
+
+
+
 # Move executables to modipsl/bin folder
 echo >> $outfile
@@ -397,9 +418,15 @@
 ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
 echo >> $outfile
+
+
+suffix=_${resol_atm}_phylmd
+if [ $lmdzsvn -ge 4186 ] ; then suffix=${suffix}_${rad} ; fi
+suffix=${suffix}_para_mem_orch_couple
 if [ ${esmaer} == n ] ;  then 
-    suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e
+    suffix=${suffix}.e
 else
-    suffix=_${resol_atm}_phylmd_para_mem_orch_couple_inca.e
-fi
+    suffix=${suffix}_inca.e
+fi
+
 echo gcm suffix = $suffix
 
@@ -417,4 +444,7 @@
 
 
+
+
+
 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable
 if [ $ce0l == y ] ; then
@@ -422,6 +452,11 @@
     echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
     
-    echo ./makelmdz_fcm -d ${resol_atm} -rrtm true -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
-    ./makelmdz_fcm -d ${resol_atm} -rrtm true -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
+    ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+
+# 1er aout - remove xios from ce0l compilation #
+#    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
+#    ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+
     # Test if compiling finished
     if [[ $? != 0 ]] ; then
@@ -437,6 +472,7 @@
     ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
     echo >> $outfile
-#    suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e
+
     suffix=_${resol_atm}_phylmd_seq.e
+    if [ $lmdzsvn -ge 4186 ] ; then suffix=_${resol_atm}_phylmd_${rad}_seq.e ; fi
     echo ce0l suffix = $suffix
 
