Index: CONFIG/UNIFORM/v6/LMDZREPR_v6/compile_lmdzrepr.sh
===================================================================
--- CONFIG/UNIFORM/v6/LMDZREPR_v6/compile_lmdzrepr.sh	(revision 6243)
+++ CONFIG/UNIFORM/v6/LMDZREPR_v6/compile_lmdzrepr.sh	(revision 6252)
@@ -20,4 +20,7 @@
 # Also compile ce0l subprogram to LMDZ (y/n)
 ce0l=n
+# choose radiative code compilation option 
+rad=rrtm
+opt_rad=""
 # Without REPROBUS (y/n)
 no_repr=n
@@ -83,4 +86,7 @@
 ./compile_lmdzrepr.sh -custom_suffix my_suffix
 
+Example 7: choose radiative schema for LMDZ (oldrad/rrtm/ecrad). Default is rrtm
+./compile_lmdzrepr.sh -rad ecrad
+
 end_help
 exit;;
@@ -93,4 +99,5 @@
 	"-resol_atm")	    resol_atm=$2 ; shift ; shift ;;
 	"CE0L")             ce0l=y ; shift ;;
+    "-rad")             rad=$2; shift ; shift;;
 	"-full")            full_flag="-full"; 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
@@ -243,4 +250,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. 
@@ -257,14 +266,25 @@
 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 [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi
+
+
 if [ $no_repr == y ] ; then
     echo "COMPILING LMDZ ONLY (no Reprobus)"
     echo >> $outfile ; echo "COMPILING LMDZ (no Reprobus)"   >> $outfile
-    echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
-    ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
+    echo ./makelmdz_fcm -d ${resol_atm} -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
+    ./makelmdz_fcm -d ${resol_atm} -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
 else
     echo "COMPILING LMDZ WITH REPROBUS"
     echo >> $outfile ; echo "COMPILING LMDZ WITH REPROBUS"  >> $outfile
-    echo ./makelmdz_fcm -ext_src ../REPROBUS -cpp REPROBUS -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
-    ./makelmdz_fcm -ext_src ../REPROBUS -cpp REPROBUS -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
+    echo ./makelmdz_fcm -ext_src ../REPROBUS -cpp REPROBUS -d ${resol_atm} -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
+    ./makelmdz_fcm -ext_src ../REPROBUS -cpp REPROBUS -d ${resol_atm} -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -cosp true -v false -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
 fi
 # Test if compiling finished
@@ -282,8 +302,10 @@
 
 # Find executable suffix
+suffix=_${resol_atm}_phylmd
+if [ $lmdzsvn -ge 4186 ] ; then suffix=${suffix}_${rad} ; fi
 if [ $parallel == seq ] || [ $parallel == none ] ; then
-    suffix=_${resol_atm}_phylmd_seq.e
+    suffix=${suffix}_seq.e
 else
-    suffix=_${resol_atm}_phylmd_para_mem.e
+    suffix=${suffix}_para_mem.e
 fi
 echo gcm suffix = $suffix
@@ -303,4 +325,5 @@
 
 # Compile ce0l initialization program for LMDZ regular lat-lon exectuable
+# NOT TESTED YET!!!
 if [ $ce0l == y ] ; then
     echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
