Index: LMDZ6/branches/Ocean_skin/makelmdz_fcm
===================================================================
--- LMDZ6/branches/Ocean_skin/makelmdz_fcm	(revision 4013)
+++ LMDZ6/branches/Ocean_skin/makelmdz_fcm	(revision 4368)
@@ -25,5 +25,5 @@
 inlandsis=false
 rrtm=false
-rad="old"
+rad="oldrad"
 dust=false
 strataer=false
@@ -44,4 +44,6 @@
 diagiso=false
 isotrac=false
+force_compile=false
+cplocninca=false
 
 arch_defined="FALSE"
@@ -93,11 +95,13 @@
 [-prod / -dev / -debug]    : compilation mode production (default) / developement / debug
 [-c false/MPI1/OMCT]       : coupling with ocean model : MPI1/OMCT/false (default: false)
-[-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false)
+[-v false/orchideetrunk/orchidee2.1/orchidee2.0/orchidee1.9] : version of the vegetation model to include (default: false)
           false       : no vegetation model
-          orchidee2.1 : compile using ORCHIDEE 2.1 (or more recent version)
+          orchideetrunk : compile using ORCHIDEE trunk from revision 7757 or higher
+          orchidee2.1 : compile using ORCHIDEE 2.1 until 4.1 included or until revision 7757 on the trunk
           orchidee2.0 : compile using ORCHIDEE 2.0
           orchidee1.9 : compile using ORCHIDEE up to the version including OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
           true        : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6
 [-chimie INCA/false]       : with INCA chemistry model or without (default: false)
+[-cplocninca ]        : allow transfer of species from PISCES to INCA (default: false)
 [-cosp true/false]    : compile with/without cosp package (default: false)
 [-cosp2 true/false]    : compile with/without cosp2 package (default: false)
@@ -105,5 +109,5 @@
 [-inlandsis true/false]  : compile with/without inlandsis package (default: false)
 [-rrtm true/false]    : compile with/without rrtm package (default: false)
-[-rad old/rrtm/ecrad]    : compile with old/rrtm/ecrad radiatif code (default: old)
+[-rad oldrad/rrtm/ecrad]    : compile with oldrad/rrtm/ecrad radiatif code (default: oldrad)
 [-dust true/false]    : compile with/without the dust package by Boucher and co (default: false)
 [-strataer true/false]    : compile with/without the strat aer package by Boucher and co (default: false)
@@ -127,4 +131,5 @@
 [-ext_src path]            : path to an additional set of routines to compile with the model
 [-arch_path path]          : path to architecture files (default: $arch_default_path)
+[-force_compile]           : recompile although there seems to be an on-going compilation
  -arch nom_arch            : target architecture 
  exec                      : executable to build
@@ -163,5 +168,5 @@
 
       "-rrtm")
-          rrtm="$2" ; if [ "$2" = "false" ] ; then rad="old" ; else rad="rrtm" ; fi ; shift ; shift ;;
+          rrtm="$2" ; if [ "$2" = "false" ] ; then rad="oldrad" ; else rad="rrtm" ; fi ; shift ; shift ;;
 
       "-rad")
@@ -176,4 +181,7 @@
       "-chimie")
 	  chimie="$2" ; shift ; shift ;;
+
+     "-cplocninca")
+          cplocninca=TRUE ; shift ;;
 
       "-isotopes")
@@ -242,4 +250,7 @@
       "-arch_path")
 	  arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
+
+      "-force_compile")
+	  force_compile=true ; shift ;;
 
       *)
@@ -423,5 +434,5 @@
 fi
 
-if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" -o "$veget" = "orchidee2.1" ]
+if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" -o "$veget" = "orchidee2.1" -o "$veget" = "orchideetrunk" ]
 then
 #NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
@@ -438,5 +449,8 @@
       CPP_KEY="$CPP_KEY ORCHIDEE_NOUNSTRUCT"
    elif [[ "$veget" == "orchidee2.1" ]] ; then
+      CPP_KEY="$CPP_KEY ORCHIDEE_NOLIC"
       orch_libs="sechiba parameters stomate parallel orglob orchidee"
+   elif [[ "$veget" == "orchideetrunk" ]] ; then
+      orch_libs="orchidee"
    else
       orch_libs="sechiba parameters stomate parallel orglob"
@@ -524,4 +538,8 @@
 fi
 
+if [[ "$cplocninca" == "TRUE" ]]
+then
+    CPP_KEY="${CPP_KEY} CPP_CPLOCNINCA"
+fi
 
 
@@ -551,22 +569,14 @@
 if [[ -f dimensions.h ]]
 then
-  echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs'
-  echo "Attendez que la premiere compilation soit terminee pour relancer la suivante."
-  echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs,"
-  echo  vous pouvez continuer en repondant oui.
-  echo "Voulez-vous vraiment continuer?"
-  echo ""
-  echo "WARNING: you are probably already compiling the model somewhere else."
-  echo "Wait until the first compilation is finished before launching this one."
-  echo "If you are sure that you are not compiling elsewhere, just answer "
-  echo "yes (or 'oui') to the question below to proceed."
-  echo "Do you wish to continue?"
-  read reponse
-  if [[ $reponse == "oui" || $reponse == "yes" ]]
-  then
-    \rm -f $LIBFGCM/grid/dimensions.h
-  else
-    exit
-  fi
+    if [[ $force_compile == true ]]
+    then
+	\rm -f $LIBFGCM/grid/dimensions.h
+    else
+	echo "WARNING: you are probably already compiling the model somewhere else."
+	echo "Wait until the first compilation is finished before launching this one."
+	echo "If you are sure that you are not compiling elsewhere, "
+	echo "run makelmdz_fcm with option -force_compile"
+	exit 1
+    fi
 fi
 
@@ -598,6 +608,4 @@
 then
   CPP_KEY="$CPP_KEY CPP_1D"
-##in 1D, add dyn3d to include path (because main prog is in physics)
-  INCLUDE="$INCLUDE -Ilibf/dyn3d -Ilibf/dyn3d_common"
 ## no filtre in 1d:
   FILTRE_PATH=$LMDGCM/.void_dir
@@ -652,5 +660,5 @@
 
 SUFF_NAME=_${dim_full}
-SUFF_NAME=${SUFF_NAME}_phy${physique}
+SUFF_NAME=${SUFF_NAME}_phy${physique}_${rad}
 
 if [[ "$parallel" != "none" ]]
@@ -773,6 +781,9 @@
 fi
 
+set +e
+
 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
 ./build_gcm ${fcm_path} -j $job $full
+build_status=$?
 
 err=$?
@@ -793,2 +804,4 @@
   \rm -f $LIBFGCM/grid/dimensions.h
 fi
+
+exit $build_status
