Index: BOL/script_install/install_lmdz.sh
===================================================================
--- BOL/script_install/install_lmdz.sh	(revision 4542)
+++ BOL/script_install/install_lmdz.sh	(revision 4546)
@@ -242,14 +242,10 @@
         "-debug") optim=-debug ; shift ;;
         "-name") MODEL=$2 ; shift ; shift ;;
-        "-netcdf") case $2 in
-                       0|1) netcdf=$2 ;;
-                       *) netcdf=`ls -d $2` ; if [ $? != 0 ] ; then echo No directory $2 ; exit 1 ; fi
-                   esac
-                   shift ; shift ;;
+        "-netcdf") netcdf=$2 ; shift ; shift ;;
         "-physiq") physiq=$2 ; shift ; shift ;;
         "-xios") with_xios="y" ; shift ;;
         "-env_file") env_file=$2 ; shift ; shift ;;
         "-veget") veget=$2 ; shift ; shift ;;
-        *) ./install_lmdz.sh -h ; exit
+        *)  bash install_lmdz.sh -h ; exit
     esac
 done
@@ -604,12 +600,12 @@
 
 ###########################################################################
-if [ $netcdf = 1 ] ; then
+echo Installing Netcdf
 ###########################################################################
+
+if [ $netcdf = 0 ] ; then
+    ncdfdir=/usr
+
+else
     cd $MODEL
-    netcdflog=`pwd`/netcdf.log
-    echo '----------------------------------------------------------'
-    echo Compiling the Netcdf library
-    echo '----------------------------------------------------------'
-    echo log file : $netcdflog
 
     case $compiler in
@@ -622,13 +618,24 @@
     case $with_xios in
         n) script_install_netcdf=install_netcdf4_hdf5_seq.bash
-           ncdfdir=$MODEL/netcdf4_hdf5_seq
+           ncdfdir=netcdf4_hdf5_seq
            opt_=$opt1 ;;
         y) script_install_netcdf=install_netcdf4_hdf5.bash
-           ncdfdir=$MODEL/netcdf4_hdf5
+           ncdfdir=netcdf4_hdf5
            opt_="$opt2 -MPI $root_mpi" ;;
         *) echo with_xios=$with_xios, should be n or y ; exit 1
     esac
+    if [ $netcdf = 1 ] ; then
+       ncdfdir=$MODEL/$ncdfdir
+    else
+       mkdir -p $netcdf ; ncdfdir=$netcdf/$ncdfdir
+    fi
          
-    if [[ ! -d $ncdfdir ]] ; then
+    echo Repertoire netcdf $ncdfdir
+    if [ ! -d $ncdfdir ] ; then
+        netcdflog=`pwd`/netcdf.log
+        echo '----------------------------------------------------------'
+        echo Compiling the Netcdf library
+        echo '----------------------------------------------------------'
+        echo log file : $netcdflog
         myget script_install/$script_install_netcdf >> $netcdflog 2>&1
         chmod u=rwx $script_install_netcdf
@@ -645,8 +652,4 @@
     echo install_lmdz.sh netcdf_OK `date`
 
-elif [ $netcdf = 0 ] ; then
-    ncdfdir=/usr
-else
-    ncdfdir=$netcdf
 fi
 
