Index: /LMDZ5/branches/testing/build_gcm
===================================================================
--- /LMDZ5/branches/testing/build_gcm	(revision 1751)
+++ /LMDZ5/branches/testing/build_gcm	(revision 1752)
@@ -1,3 +1,7 @@
 #!/bin/bash
+# Usage:
+# ./build_gcm [path]
+# where 'path' is an optional argument to this script specifying
+# the full path to where the 'fcm' command is to be found
 
 if test -f '.lock' 
@@ -8,6 +12,12 @@
     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 ouinon
-    if [[ $ouinon == "oui" ]] 
+    if [[ $ouinon == "oui" || $ouinon == "yes" ]] 
 	then
 	echo OK 
@@ -16,12 +26,23 @@
     fi
 else
-    echo "compilation en cours..." > '.lock'
+    echo "compiling..." > '.lock'
 fi
 
-#set arch=$1
+dirname="" #path to where the fcm command will be found
+if (( $# >= 1 )) ; then
+  dirname=$1
+  # check that "dirname" exists and is a directory
+  if [[ ! -d $dirname ]] ; then
+    echo "$0 error : $dirname is not a directory"
+    exit
+  fi
+  # add a trailing "/" to $dirname
+  dirname=${dirname}"/"
+fi
 
+# run "fcm build" command
+${dirname}fcm build
 
-fcm build
-
+# cleanup
 \rm -f '.lock' 
 
Index: /LMDZ5/branches/testing/makelmdz
===================================================================
--- /LMDZ5/branches/testing/makelmdz	(revision 1751)
+++ /LMDZ5/branches/testing/makelmdz	(revision 1752)
@@ -405,6 +405,12 @@
   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" ]]
+  if [[ $reponse == "oui" || $reponse == "yes" ]]
   then
     \rm -f $LIBFGCM/grid/dimensions.h
Index: /LMDZ5/branches/testing/makelmdz_fcm
===================================================================
--- /LMDZ5/branches/testing/makelmdz_fcm	(revision 1751)
+++ /LMDZ5/branches/testing/makelmdz_fcm	(revision 1752)
@@ -158,10 +158,15 @@
 
 ###############################################################
-# mettre le chemin du fcm dans le path
+# path to fcm 
 ###############################################################
-export PATH=${fcm_path}:${PATH}
-
-echo "Chemin du fcm utlise :" 
-which fcm
+# handle case when provided path to fcm was given as a relative
+# path (from makelmdz_fcm script directory) and not an absolute path
+if [[ ${fcm_path:0:1} != "/" ]] ; then
+  # prepend with makelmdz_fcm location
+  fcm_path=$(cd $(dirname $0) ; pwd)"/"${fcm_path}
+fi
+
+echo "Path to fcm:"
+echo ${fcm_path}
 
 ###############################################################
@@ -291,6 +296,12 @@
   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" ]]
+  if [[ $reponse == "oui" || $reponse == "yes" ]]
   then
     \rm -f $LIBFGCM/grid/dimensions.h
@@ -433,5 +444,5 @@
 
 rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock
-./build_gcm
+./build_gcm ${fcm_path}
 
 rm -rf tmp_src
