Index: BOL/script_install/install.sh
===================================================================
--- BOL/script_install/install.sh	(revision 1777)
+++ BOL/script_install/install.sh	(revision 1800)
@@ -43,5 +43,5 @@
 # install.v2.sh instead of install.sh
 
-#version=20110921.trunk
+version=20130716.trunk
 version=testing
 
@@ -80,6 +80,6 @@
 
 ## compile_with_fcm=1 : use makelmdz_fcm, possible a of version 20111103.trunk (LMDZ5/trunk rev 1578)
-## compile_with_fcm=0 : use makegcm
-compile_with_fcm=1
+## compile_with_fcm=0 : use makelmdz
+compile_with_fcm=0
 
 OPTPREC=""
@@ -259,14 +259,5 @@
    echo unexpected compiler $compilo ; exit
 fi
-## end of if [ $netcdf = 1 ]
-#cd src
-
-### Correction d'un petit probleme de netcdf
-##sed -e '83s/^$/\#define f2cFortran/' cfortran.h >| tmp ; \mv tmp cfortran.h
-
-# Compilation
-# Modif du 6 juillet 2009. Plantage quand on essaie de compiler netcdf avec
-# gcc plutÃ´t que c++
-##sed -e 's/ c++/ gcc/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure
+
 localdir=`pwd -P`
 ./configure --prefix=$localdir
@@ -275,4 +266,5 @@
 fi # of if [ $netcdf = 1 ]
 
+#=======================================================================================
 echo OK2 ioipsl=$ioipsl
 echo '##########################################################'
@@ -303,6 +295,7 @@
   fi
   cp AA_make.gdef AA_make.orig
+  F_C="$compilo -c " ; if [ $compilo = gfortran ] ; then F_C="$compilo -c -cpp " ; fi
   sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
-  sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $compilo -c": \
+  sed -e "s:F_L = g95:F_L = $compilo:" -e "s:F_C = g95 -c:F_C = $F_C": \
   -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
   -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
@@ -338,4 +331,8 @@
   if [ "$pclinux" = 1 ] ; then
     # Build IOIPSL modules and library
+    if [ $compilo = g95 ] ; then
+       cp restcom.f90 restcom.f90.orig
+       sed -e 's:cmode=or(NF90_NOCLOBBER,NF90_64BIT_OFFSET):cmode=NF90_NOCLOBBER:' restcom.f90.orig > restcom.f90  
+    fi
     make clean
     make
@@ -389,4 +386,5 @@
 fi # of if [ $ioipsl = 1 ]
 
+#============================================================================
 if [ "$veget" = 1 ] ; then
   echo '########################################################'
@@ -394,43 +392,38 @@
   echo '########################################################'
   cd $MODEL/modipsl/modeles/ORCHIDEE
-  cd src_parameters
-  # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
-
-  \cp reqdprec.$real reqdprec.f90
-  make
-  if [ $compilo = gfortran ] ; then # copy module files to lib
-    cp -f *.mod ../../../lib
+  echo OKpwd ; pwd
+  if [ -d src_parallel ] ; then
+     liste_src="parallel parameters global stomate sechiba driver"
+  else
+     # Obsolete, for ORCHIDEE_beton only
+     liste_src="parameters stomate sechiba "
+     # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8
+     cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..
   fi
-  cd ../src_stomate
-  make
-  if [ $compilo = gfortran ] ; then # copy module files to lib
-    cp -f *.mod ../../../lib
-  fi
-  cd ../src_sechiba
-  make
-  if [ $compilo = gfortran ] ; then # copy module files to lib
-    cp -f *.mod ../../../lib
-  fi
+  echo liste_strc $liste_src
+
+  for d in $liste_src ; do src_d=src_$d
+      echo src_d $src_d
+      echo ls ; ls
+      if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
+      cd $src_d ; \rm -f *.mod make ; make clean
+      make ; if [ $compilo = gfortran ] ; then cp -f *.mod ../../../lib ; fi
+      cd ..
+  done
 fi # of if [ "$veget" = 1 ]
 
+#============================================================================
 # Ehouarn: it may be directory LMDZ4 or LMDZ5 depending on tar file...
-if [[ -d $MODEL/modipsl/modeles/LMDZ4 ]] ; then
+if [ -d $MODEL/modipsl/modeles/LMDZ[45] ] ; then
   echo '##########################################################'
-  echo 'Compiling LMDZ4'
+  echo 'Compiling LMDZ'
   echo '##########################################################'
-  cd $MODEL/modipsl/modeles/LMDZ4
-else
-  if [[ -d $MODEL/modipsl/modeles/LMDZ5 ]] ; then
-    echo '##########################################################'
-    echo 'Compiling LMDZ5'
-    echo '##########################################################'
-    cd $MODEL/modipsl/modeles/LMDZ5
-  else
-    echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
-    exit
-  fi
-fi
-
-##########################################################
+  cd $MODEL/modipsl/modeles/LMDZ[45]
+else
+  echo "ERROR: No LMDZ4 (or LMDZ5) directory !!!"
+  exit
+fi
+
+#============================================================================
 # Traitement momentanne a cause d'un bug dans makegcm
 cp create_make_gcm create_make_gcm.orig
@@ -592,18 +585,10 @@
 ok_veget=false
 if [ "$veget" = 1 ] ; then $ok_veget = true ; fi
-if [ $compile_with_fcm = 1 ] ; then
-# Compile with makelmdz_fcm
-   if [ "$pclinux" = 1 ] ; then
-	./makelmdz_fcm -d ${grid_resolution} -arch local -v $ok_veget gcm
-   else
+if [ $compile_with_fcm = 1 ] ; then makelmdz=makelmdz_fcm ; else makelmdz=makelmdz ; fi
+if [ "$pclinux" = 1 ] ; then
+	./$makelmdz -d ${grid_resolution} -arch local -v $ok_veget gcm
+else
    # we are on Ada
-        ./makelmdz_fcm -d ${grid_resolution} -arch X64_ADA -v $ok_veget gcm
-   fi
-else
-# Comple with makegcm:
-#       3 times! because some dependecies are not well resolved with makegcm
-	./makegcm -d ${grid_resolution} -v $ok_veget gcm
-	./makegcm -d ${grid_resolution} -v $ok_veget gcm
-	./makegcm -d ${grid_resolution} -v $ok_veget gcm
+    ./$makelmdz -d ${grid_resolution} -arch X64_ADA -v $ok_veget gcm
 fi
 
@@ -659,3 +644,2 @@
 echo 'or ./bench.sh'
 echo '##########################################################'
-
