Index: /LMDZ5/trunk/makelmdz
===================================================================
--- /LMDZ5/trunk/makelmdz	(revision 2742)
+++ /LMDZ5/trunk/makelmdz	(revision 2743)
@@ -31,4 +31,8 @@
 strataer=false
 full=""
+
+arch_defined="FALSE"
+arch_path="arch"
+arch_default_path="arch"
 
 # guess a default 'arch'
@@ -127,4 +131,5 @@
 [-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
 [-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)
  -arch nom_arch            : target architecture 
  exec                      : executable to build
@@ -204,5 +209,8 @@
 
       "-arch")
-	  arch=$2 ; shift ; shift ;;
+	  arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
+
+      "-arch_path")
+	  arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
 
       *)
@@ -218,21 +226,44 @@
 rm -rf .void_dir
 mkdir .void_dir
-rm -f arch.path
-if [[ -r arch/arch-${arch}.path ]]
-then
-  ln -s arch/arch-${arch}.path ./arch.path
+
+if [[ "$arch_defined" == "TRUE" ]]
+then
+  rm -f arch.path
+  rm -f arch.fcm
+  rm -f arch.env
+
+  if test -f $arch_path/arch-${arch}.path
+  then
+    ln -s $arch_path/arch-${arch}.path arch.path
+  elif test -f $arch_default_path/arch-${arch}.path
+  then
+    ln -s $arch_default_path/arch-${arch}.path arch.path
+  fi
+        
+  if test -f $arch_path/arch-${arch}.fcm
+  then
+    ln -s $arch_path/arch-${arch}.fcm arch.fcm
+  elif test -f $arch_default_path/arch-${arch}.fcm
+  then
+    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
+  fi
+
+  if test -f $arch_path/arch-${arch}.env
+  then
+    ln -s $arch_path/arch-${arch}.env arch.env
+  elif test -f $arch_default_path/arch-${arch}.env
+  then
+    ln -s $arch_default_path/arch-${arch}.env arch.env
+  else
+    ln -s .void_file arch.env
+  fi
+  # source architecture PATH and ENV files
+  source arch.env
   source arch.path
 else
-  echo "Error: missing arch/arch-${arch}.path file !"
-  exit
-fi
-rm -f arch.fcm
-if [[ -r arch/arch-${arch}.fcm ]]
-then
-  ln -s arch/arch-${arch}.fcm arch.fcm
-else
-  echo "Error: missing arch/arch-${arch}.fcm file !"
-  exit
-fi
+  echo "You must define a target architecture"
+  exit 1
+fi
+
 ########################################################################
 # Definition des clefs CPP, des chemins des includes et modules
Index: /LMDZ5/trunk/makelmdz_fcm
===================================================================
--- /LMDZ5/trunk/makelmdz_fcm	(revision 2742)
+++ /LMDZ5/trunk/makelmdz_fcm	(revision 2743)
@@ -37,4 +37,8 @@
 full=''
 libphy=false
+
+arch_defined="FALSE"
+arch_path="arch"
+arch_default_path="arch"
 
 LMDGCM=`/bin/pwd`
@@ -107,4 +111,5 @@
 [-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
 [-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)
  -arch nom_arch            : target architecture 
  exec                      : executable to build
@@ -196,5 +201,8 @@
 
       "-arch")
-	  arch=$2 ; shift ; shift ;;
+	  arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
+
+      "-arch_path")
+	  arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
 
       *)
@@ -226,7 +234,43 @@
 rm -rf .void_dir
 mkdir .void_dir
-rm -f arch.path
-ln -s arch/arch-${arch}.path ./arch.path
-source arch.path
+
+if [[ "$arch_defined" == "TRUE" ]]
+then
+  rm -f arch.path
+  rm -f arch.fcm
+  rm -f arch.env
+
+  if test -f $arch_path/arch-${arch}.path
+  then
+    ln -s $arch_path/arch-${arch}.path arch.path
+  elif test -f $arch_default_path/arch-${arch}.path
+  then
+    ln -s $arch_default_path/arch-${arch}.path arch.path
+  fi
+        
+  if test -f $arch_path/arch-${arch}.fcm
+  then
+    ln -s $arch_path/arch-${arch}.fcm arch.fcm
+  elif test -f $arch_default_path/arch-${arch}.fcm
+  then
+    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
+  fi
+
+  if test -f $arch_path/arch-${arch}.env
+  then
+    ln -s $arch_path/arch-${arch}.env arch.env
+  elif test -f $arch_default_path/arch-${arch}.env
+  then
+    ln -s $arch_default_path/arch-${arch}.env arch.env
+  else
+    ln -s .void_file arch.env
+  fi
+  # source architecture PATH and ENV files
+  source arch.env
+  source arch.path
+else
+  echo "You must define a target architecture"
+  exit 1
+fi
 
 ########################################################################
