Index: /BOL/script_install_amaury/install_lmdz.sh
===================================================================
--- /BOL/script_install_amaury/install_lmdz.sh	(revision 4861)
+++ /BOL/script_install_amaury/install_lmdz.sh	(revision 4862)
@@ -36,261 +36,392 @@
 ###########################################################################
 
-echo install_lmdz.sh DEBUT "$(date)"
-
-################################################################
-# Choice of installation options
-################################################################
-
-################################################################
-# A function to fetch files either locally or on the internet
-################################################################
-function myget { #1st and only argument should be file name
+### Functions
+
+function myget {
+    # A function to fetch files either locally or on the internet
+
+    local file_name=$1
     # Path on local computer where to look for the datafile
-    if [[ -f /u/lmdz/WWW/LMDZ/pub/$1 ]]; then
-        \cp -f -p "/u/lmdz/WWW/LMDZ/pub/$1" .
-    elif [[ -f ~/LMDZ/pub/$1 ]]; then
-        \cp -f -p ~"/LMDZ/pub/$1" .
+    if [[ -f "/u/lmdz/WWW/LMDZ/pub/$file_name" ]]; then
+        \cp -f -p "/u/lmdz/WWW/LMDZ/pub/$file_name" .
+    elif [[ -f ~"/LMDZ/pub/$file_name" ]]; then
+        \cp -f -p ~"/LMDZ/pub/$file_name" .
     else
-        wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$1"
-        save_pub_locally=0
-        if [[ $save_pub_locally = 1 ]]; then # saving wget files on ~/LMDZ/pub
-            dir=~"/LMDZ/pub/$(dirname "$1")"; mkdir -p "$dir"
-            cp -r "$(basename "$1")" "$dir"
-        fi
+        wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$file_name"
     fi
 }
 
-# 04_2021 : tester si r4 marche encore !
-real="r8"  # ou "r4"
-
-
-#########################################################################
-# Valeur par défaut des parametres
-#########################################################################
-svn=""
-version="20231022.trunk"
-
-getlmdzor=1
-netcdf=1   #  1: for automatic installation;
-#          or 0: do not install NetCDF and look for it in standard locations;
-#          or absolute path: look for NetCDF there
-check_software_linux=1
-ioipsl=1
-bench=1
-pclinux=1
-pcmac=0 # default: not on a Mac
-compiler="gfortran"
-if [[ $(gfortran -dumpversion | cut -d. -f1) -ge 10 ]]; then allow_arg_mismatch="-fallow-argument-mismatch"; fi
-SCM=0
-# surface/vegetation scheme treatment
-# controlled by the single variable veget which can have the following values
-# - NONE: bucket scheme (default)
-# - CMIP6: orchidee version used in CMIP exercise, rev 5661
-# - number: orchidee version number
-veget="NONE"
-# choose the resolution for the bench runs
-# grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
-#                  96x71x19  standard configuration
-grid_resolution="144x142x79"
-grid_resolution="96x95x39"
-grid_resolution="48x36x19"
-grid_resolution="32x32x39"
-# choose the physiq version you want to test
-#physiq=NPv6.0.14splith
-physiq=""
-
-## parallel can take the values none/mpi/omp/mpi_omp
-parallel="mpi_omp"
-parallel="none"
-idris_acct="lmd"
-trusting="testing"
-OPT_GPROF=""
-OPT_MAKELMDZ=""
-MODEL=""
-
-## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no
-with_xios="n"
-opt_makelmdz_xios=""
-
-## compile with oldrad/rrtm/ecrad radiatif code (Default=rrtm)
-rad="rrtm"
-
-## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0)
-compile_with_fcm=1
-
-#Compilation with Cosp (cosp=NONE/v1/v2; default=NONE)
-cosp="NONE"
-opt_cosp=""
-
-# Check if on a Mac
-if [[ $(uname) = "Darwin" ]]; then
-    pcmac=1
-    export MAKE=make
-fi
-
-env_file=""
-optim=""
-
-#########################################################################
-#  Options interactives
-#########################################################################
-while (($# > 0))
-do
-    case $1 in
-        "-h") cat <<........fin
-    $0 [ -v version ] [ -r svn_release ]
-           [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ]
-           [-name LOCAL_MODEL_NAME] [-gprof] [-opt_makelmdz] [-rad RADIATIF]
-
-    -v       "version" like 20150828.trunk
-             see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk
-
-    -r       "svn_release" : either the svn release number or "last"
-
-    -compiler gfortran|ifort|pgf90 (default: gfortran)
-
-    -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential)
-
-    -d        GRID_RESOLUTION should be among the available benchs if -bench 1
-              among which : 48x36x19, 48x36x39
-              if wanting to run a bench simulation in addition to compilation
-              default : 48x36x19
-
-    -bench     activating the bench or not (0/1). Default 1
-
-    -testing/unstable 
-
-    -name      LOCAL_MODEL_NAME : default = LMDZversion.release
-
-    -netcdf    0, 1 or PATH
-                   0: do not download NetCDF, look for it in standard locations
-               1: download and compile NetCDF
-                   PATH: full path to an existing installed NetCDF library
-
-    -xios      also download and compile the XIOS library
-               (requires the NetCDF4-HDF5 library, also installed by default)
-               (requires to also have -parallel mpi_omp)
-
-    -gprof     to compile with -pg to enable profiling with gprof
-
-    -cosp      to run without our with cospv1 or cospv2 [none/v1/v2]
-
-    -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code
-
-    -nofcm     to compile without fcm
-
-    -SCM        install 1D version automatically
-
-    -debug      compile everything in debug mode
-
-    -opt_makelmdz     to call makelmdz or makelmdz_fcm with additional options
-
-    -physiq    to choose which physics package to use
-
-    -env_file  specify an arch.env file to overwrite the existing one
-
-    -veget surface model to run [NONE/CMIP6/xxxx]
+function set_default_params {
+    # Valeur par défaut des parametres
+
+    # 04_2021 : tester si r4 marche encore !
+    real="r8"  # ou "r4"
+
+    svn=""
+    version="20231022.trunk"
+
+    getlmdzor=1
+    netcdf=1   #  1: for automatic installation;
+    #          or 0: do not install NetCDF and look for it in standard locations;
+    #          or absolute path: look for NetCDF there
+    check_software_linux=1
+    ioipsl=1
+    bench=1
+    pclinux=1
+    pcmac=0 # default: not on a Mac
+    compiler="gfortran"
+    if [[ $(gfortran -dumpversion | cut -d. -f1) -ge 10 ]]; then allow_arg_mismatch="-fallow-argument-mismatch"; fi
+    SCM=0
+    # surface/vegetation scheme treatment
+    # controlled by the single variable veget which can have the following values
+    # - NONE: bucket scheme (default)
+    # - CMIP6: orchidee version used in CMIP exercise, rev 5661
+    # - number: orchidee version number
+    veget="NONE"
+    # choose the resolution for the bench runs
+    # grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
+    #                  96x71x19  standard configuration
+    grid_resolution="32x32x39"  # "48x36x19", "96x95x39", "144x142x79"
+    # choose the physiq version you want to test
+    #physiq=NPv6.0.14splith
+    physiq=""
+
+    ## parallel can take the values none/mpi/omp/mpi_omp
+    parallel="none"  # "mpi_omp"
+    idris_acct="lmd"
+    trusting="testing"
+    OPT_GPROF=""
+    OPT_MAKELMDZ=""
+    MODEL=""
+
+    ## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no
+    with_xios="n"
+    opt_makelmdz_xios=""
+
+    ## compile with oldrad/rrtm/ecrad radiatif code (Default=rrtm)
+    rad="rrtm"
+
+    ## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0)
+    compile_with_fcm=1
+
+    #Compilation with Cosp (cosp=NONE/v1/v2; default=NONE)
+    cosp="NONE"
+    opt_cosp=""
+
+    # Check if on a Mac
+    if [[ $(uname) = "Darwin" ]]; then
+        pcmac=1
+        export MAKE="make"
+    fi
+
+    env_file=""
+    optim=""
+    arch="local"
+
+    local mpi_file
+    mpi_file=$(readlink -f "$(which mpif90)")
+    path_mpi=$(dirname "$mpi_file")
+    root_mpi=$(dirname "$path_mpi")
+}
+
+function read_cmdline_args {
+    while (($# > 0)); do
+        case $1 in
+            "-h") cat <<........fin
+        $0 [ -v version ] [ -r svn_release ]
+               [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ]
+               [-name LOCAL_MODEL_NAME] [-gprof] [-opt_makelmdz] [-rad RADIATIF]
+
+        -v       "version" like 20150828.trunk
+                 see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk
+
+        -r       "svn_release" : either the svn release number or "last"
+
+        -compiler gfortran|ifort|pgf90 (default: gfortran)
+
+        -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential)
+
+        -d        GRID_RESOLUTION should be among the available benchs if -bench 1
+                  among which : 48x36x19, 48x36x39
+                  if wanting to run a bench simulation in addition to compilation
+                  default : 48x36x19
+
+        -bench     activating the bench or not (0/1). Default 1
+
+        -testing/unstable
+
+        -name      LOCAL_MODEL_NAME : default = LMDZversion.release
+
+        -netcdf    0, 1 or PATH
+                       0: do not download NetCDF, look for it in standard locations
+                   1: download and compile NetCDF
+                       PATH: full path to an existing installed NetCDF library
+
+        -xios      also download and compile the XIOS library
+                   (requires the NetCDF4-HDF5 library, also installed by default)
+                   (requires to also have -parallel mpi_omp)
+
+        -gprof     to compile with -pg to enable profiling with gprof
+
+        -cosp      to run without our with cospv1 or cospv2 [none/v1/v2]
+
+        -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code
+
+        -nofcm     to compile without fcm
+
+        -SCM        install 1D version automatically
+
+        -debug      compile everything in debug mode
+
+        -opt_makelmdz     to call makelmdz or makelmdz_fcm with additional options
+
+        -physiq    to choose which physics package to use
+
+        -env_file  specify an arch.env file to overwrite the existing one
+
+        -veget surface model to run [NONE/CMIP6/xxxx]
 
 ........fin
-              exit 1;;
-        "-v") version=$2; shift; shift;;
-        "-r") svn=$2; shift; shift;;
-        "-compiler") compiler=$2
-                     case $compiler in
-                         "gfortran"|"ifort"|"pgf90") compiler=$2; shift
-                                                     shift;;
-                         *) echo "Only gfortran , ifort or pgf90 for the " \
-                                 "compiler option"
-                            exit 1
+                  exit 1;;
+            "-v") version=$2; shift; shift;;
+            "-r") svn=$2; shift; shift;;
+            "-compiler") compiler=$2
+                         case $compiler in
+                             "gfortran"|"ifort"|"pgf90") compiler=$2; shift
+                                                         shift;;
+                             *) echo "Only gfortran , ifort or pgf90 for the " \
+                                     "compiler option"
+                                exit 1
+                         esac;;
+            "-d") grid_resolution=$2; shift; shift;;
+            "-gprof") OPT_GPROF="-pg"; shift;;
+            "-unstable"|"-testing") trusting=$(echo "$1" | cut -c2-) ; shift;;
+            "-cosp") cosp=$2
+                     case $cosp in
+                         "none"|"v1"|"v2") cosp=$2; shift; shift;;
+                         *) echo "Only none v1 v2 for cosp option"; exit 1
                      esac;;
-        "-d") grid_resolution=$2; shift; shift;;
-        "-gprof") OPT_GPROF="-pg"; shift;;
-        "-unstable"|"-testing") trusting=$(echo "$1" | cut -c2-) ; shift;;
-        "-cosp") cosp=$2
-                 case $cosp in
-                     "none"|"v1"|"v2") cosp=$2; shift; shift;;
-                     *) echo Only none v1 v2 for cosp option; exit 1
-                 esac;;
-        "-nofcm") compile_with_fcm=0; echo This option will be reactivated soon '(promesse du 8dec2022)'; exit 1;  shift;;
-        "-SCM") SCM=1; shift;;
-        "-opt_makelmdz") OPT_MAKELMDZ="$2"; shift; shift;;
-        "-rrtm") if [[ $2 = "false" ]]; then
-                     rad="oldrad"
-                 else
-                     rad="rrtm"
-                 fi
-                 shift; shift;;
-        "-rad") rad=$2
-                case $rad in
-                    "oldrad"|"rrtm"|"ecrad") rad=$2; shift; shift;;
-                    *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
-                esac;;
-        "-parallel") parallel=$2
-                     case $parallel in
-                         "none"|"mpi"|"omp"|"mpi_omp") parallel=$2; shift
-                                                       shift;;
-                         *) echo "Only none mpi omp mpi_omp for the parallel option"
-                            exit 1
-                     esac;;
-        "-bench") bench=$2; shift; shift;;
-        "-debug") optim=-debug; shift;;
-        "-name") MODEL=$2; 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;;
-        *)  bash install_lmdz.sh -h; exit 1
+            "-nofcm") compile_with_fcm=0; echo "This option will be reactivated soon (promesse du 8dec2022)"; exit 1;  shift;;
+            "-SCM") SCM=1; shift;;
+            "-opt_makelmdz") OPT_MAKELMDZ="$2"; shift; shift;;
+            "-rrtm") if [[ $2 = "false" ]]; then
+                         rad="oldrad"
+                     else
+                         rad="rrtm"
+                     fi
+                     shift; shift;;
+            "-rad") rad=$2
+                    case $rad in
+                        "oldrad"|"rrtm"|"ecrad") rad=$2; shift; shift;;
+                        *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
+                    esac;;
+            "-parallel") parallel=$2
+                         case $parallel in
+                             "none"|"mpi"|"omp"|"mpi_omp") parallel=$2; shift; shift;;
+                             *) echo "Only none mpi omp mpi_omp for the parallel option"; exit 1
+                         esac;;
+            "-bench") bench=$2; shift; shift;;
+            "-debug") optim=-debug; shift;;
+            "-name") MODEL=$2; 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;;
+            *)  bash install_lmdz.sh -h; exit 1
+        esac
+    done
+
+    # Option de compilation pour Cosp
+    case $cosp in
+        v1) opt_cosp="-cosp true";;
+        v2) opt_cosp="-cospv2 true";;
+        *) opt_cosp=""
     esac
-done
-
-# Option de compilation du rayonnement : depend de $mysvn ><= r4185,
-# sera donc definie plus bas
-
-#opt_rad=""
-#case $rad in
-#   rrtm) opt_rad="-rad rrtm";;
-#   ecrad) opt_rad="-rad ecrad";;
-#esac
-
-
-# Option de compilation pour Cosp
-opt_cosp=""
-case $cosp in
-    v1) opt_cosp="-cosp true";;
-    v2) opt_cosp="-cospv2 true";;
-esac
-
-# Check on veget version
-if [[ $veget != 'NONE' && $veget != "CMIP6" ]]; then
-    re='^[0-9]+$'
-    if ! [[ $veget =~ $re ]]; then
-        echo 'Valeur de l option veget non valable'
+
+    # Check on veget version
+    if [[ $veget != 'NONE' && $veget != "CMIP6" ]]; then
+        re='^[0-9]+$'
+        if ! [[ $veget =~ $re ]]; then
+            echo 'Valeur de l option veget non valable'; exit 1
+        fi
+    fi
+
+    #Define veget-related suffix for gcm name
+    if [[ $veget = 'NONE' ]]; then
+        suff_orc=''
+        #For use with tutorial, orchidee_rev is also defined (will be
+        #written in surface_env at the end of the script)
+        orchidee_rev=''
+    else
+        suff_orc='_orch'
+    fi
+
+
+    if [[ $parallel = "none" ]]; then
+        sequential=1; suff_exe='_seq'
+    else
+        sequential=0; suff_exe='_para_mem'
+    fi
+
+    #Chemin pour placer le modele
+    if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn$optim"; fi
+
+    ## if also compiling XIOS, parallel must be mpi_omp
+    if [[ $with_xios = "y" && $parallel != "mpi_omp" ]]; then
+        echo "Error, you must set -parallel mpi_omp if you want XIOS"; exit 1
+    fi
+
+    if [[ $with_xios = "y" ]]; then
+        opt_makelmdz_xios="-io xios"
+    fi
+
+    if [[ $cosp = "v2" && $with_xios = "n" ]]; then
+        echo "Error, Cospv2 cannot run without Xios"; exit 1
+    fi
+}
+
+function check_available_software {
+    if [[ $check_software_linux = 1 ]]; then
+        echo "################################################################"
+        echo "Check if required software is available"
+        echo "################################################################"
+
+        for logiciel in wget tar gzip make $compiler gcc cmake m4 c++; do
+            if [[ $(which "$logiciel") = "" ]]; then
+                echo "You must first install $logiciel on your system"; exit 1
+            fi
+        done
+
+        cat <<eod > tt.f90
+    print*,'coucou'
+    end
+eod
+        $compiler tt.f90 || a.out
+        ./a.out >| tt
+        if [[ $(< tt sed -e 's/ //g' ) != "coucou" ]]; then
+            echo "problem installing with compiler $compiler"; exit 1; fi
+        \rm tt a.out tt.f90
+    fi
+}
+
+function download_model {
+    mkdir -p "$MODEL"
+    MODEL=$(readlink -f "$MODEL"); echo "$MODEL"  # absolute path
+
+    if [[ $getlmdzor = 1 && ! -d $MODEL/modipsl ]]; then
+        echo "##########################################################"
+        echo "Download a slightly modified version of  LMDZ"
+        echo "##########################################################"
+        cd "$MODEL"
+        getlog="$(pwd)/get.log"
+        echo "logfile : $getlog"
+        myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1
+        echo "install_lmdz.sh wget_OK $(date)"
+        gunzip "modipsl.$version.tar.gz" >> get.log 2>&1
+        tar xf "modipsl.$version.tar" >> get.log 2>&1
+        \rm "modipsl.$version.tar"
+    fi
+}
+
+function install_netcdf {
+    echo "Installing Netcdf"
+
+    if [[ $netcdf = 0 ]]; then
+        ncdfdir=$(nc-config --prefix)
+    else
+        cd "$MODEL"
+
+        case $compiler in
+          gfortran) opt1="-compiler gnu"; opt2="-CC gcc -FC gfortran -CXX g++";;
+          ifort)  opt1="-compiler intel"; opt2="-CC icc -FC ifort -CXX icpc";;
+          pgf90)  opt1="-compiler pgf90"; opt2="-CC pgcc -FC pgf90 -CXX pgCC";;
+          *)      echo "unexpected compiler $compiler" for netcdf; exit 1
+        esac
+
+        case $with_xios in
+            n) script_install_netcdf="install_netcdf4_hdf5_seq.bash"
+               ncdfdir="netcdf4_hdf5_seq"
+               opt_="$opt1";;
+            y) script_install_netcdf="install_netcdf4_hdf5.bash"
+               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
+
+        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
+            # shellcheck disable=SC2086
+            ./$script_install_netcdf -prefix "$ncdfdir" $opt_ >> "$netcdflog" 2>&1
+        fi
+
+        #----------------------------------------------------------------------------
+        # LF rajout d'une verrue, pour une raison non encore expliquee,
+        # la librairie est parfois rangée dans lib64 et non dans lib
+        # par certains compilateurs
+        if [[ ! -e lib && -d lib64 ]]; then ln -s lib64 lib; fi
+        #----------------------------------------------------------------------------
+
+        echo "install_lmdz.sh netcdf_OK $(date)"
+    fi
+
+    cat >test_netcdf90.f90 <<EOF
+    use netcdf
+    print *, "NetCDF library version: ", nf90_inq_libvers()
+    end
+EOF
+
+    if $compiler -I"$ncdfdir"/include test_netcdf90.f90 -L"$ncdfdir"/lib -lnetcdff \
+              -lnetcdf -Wl,-rpath="$ncdfdir"/lib && ./a.out
+    then
+        \rm test_netcdf90.f90 a.out
+    else
+        cat <<EOF
+Failed test program using NetCDF-Fortran. You can:
+- check that you have NetCDF-Fortran installed in your system
+- or specify an installation directory with option -netcdf of install_lmdz.sh
+- or download and compile NetCDF-Fortran with option -netcdf 1 of nstall_lmdz.sh
+EOF
         exit 1
     fi
-fi
-
-#Define veget-related suffix for gcm name
-if [[ $veget = 'NONE' ]]; then
-    suff_orc=''
-    #For use with tutorial, orchidee_rev is also defined (will be
-    #written in surface_env at the end of the script)
-    orchidee_rev=''
-else
-    suff_orc='_orch'
-fi
-
-
-if [[ $parallel = none ]]; then
-    sequential=1; suff_exe='_seq'
-else
-    sequential=0; suff_exe='_para_mem'
-fi
-
-#Chemin pour placer le modele
-if [[ $MODEL = "" ]]; then MODEL=./LMDZ$version$svn$optim; fi
-
-
-arch=local
+}
+
+function install_IOIPSL {  # via fcm
+  if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]]; then
+    cd "$MODEL/modipsl/modeles/IOIPSL"
+    ioipsllog="$(pwd)/ioipsl.log"
+    echo "Compiling IOIPSL, the interface library with Netcdf $(date) (log: $ioipsllog)"
+
+    if ! ./makeioipsl_fcm -job 8 > "$ioipsllog" 2>&1; then
+      echo "IOIPSL compile failed, exiting"; exit 1
+    fi
+    cp lib/* ../../lib
+    echo "IOIPSL compiled $(date)"
+  fi
+}
+
+echo "install_lmdz.sh DEBUT $(date)"
+
+set_default_params
+read_cmdline_args "$@"
+check_available_software
+download_model
+install_netcdf
+install_IOIPSL
+
+
+
 
 ################################################################
@@ -299,443 +430,136 @@
 
 hostname=$(hostname)
-if [[ $pclinux = 1 ]]; then o_ins_make="-t g95"; else o_ins_make=""; fi
-
-case ${hostname:0:5} in
-
-    jean-)   compiler="mpiifort";
-             par_comp="mpiifort";
-             o_ins_make="-t jeanzay";
-             make=gmake;
-             module purge
-             module load intel-compilers/19.0.4;
-             module load hdf5/1.10.5-mpi;
-             module load netcdf/4.7.2-mpi;
-             module load netcdf-fortran/4.5.2-mpi;
-             module load subversion/1.9.7;
-	           module load cmake
-             export NETCDF_LIBDIR=./
-             export NETCDFFORTRAN_INCDIR=./
-             export NETCDFFORTRAN_LIBDIR=./
-             arch=X64_JEANZAY;;
-
-    cicla|camel)   compiler="gfortran";
-                   module purge
-                   module load gnu/10.2.0
-                   module load openmpi/4.0.5
-                   module load hdf5/1.10.7-mpi
-                   module load netcdf-c/4.7.4-mpi
-                   module load netcdf-fortran/4.5.3-mpi
-                   netcdf=/net/nfs/tools/PrgEnv/linux-scientific6-x86_64/gcc-10.2.0/netcdf-fortran-4.5.3-k3drgfqok3lip62hnm3tsyof4cjen5sk
-                   module load svn/1.14.0
-
-                   if [[ $parallel != none ]]; then
-                       root_mpi=/net/nfs/tools/meso-sl6/openmpi/4.0.5-gcc-10.2.0
-                       path_mpi=$root_mpi/bin;
-                       par_comp=${path_mpi}/mpif90;
-                       mpirun=${path_mpi}/mpirun;
-                   fi;
-                   arch="local" ;
-                   make="make";
-                   o_ins_make="-t g95";;
-
-    *)       if [[ $parallel = none || -f /usr/bin/mpif90 ]]; then
-                 path_mpi=$(which mpif90 | sed -e s:/mpif90::);
-                 if [[ -d /usr/lib64/openmpi ]]; then
-                     root_mpi="/usr/lib64/openmpi"
-                 else
-                     root_mpi="/usr"
-                 fi
-             else
-                 echo "Cannot find mpif90";
-                 if [[ $parallel = none ]]; then exit 1; fi;
-             fi;
-             if [[ $parallel != none ]]; then
-                 root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::)
-                 path_mpi=$(which mpif90 | sed -e s:/mpif90::)
-                 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
-             fi
-             par_comp=${path_mpi}/mpif90;
-             mpirun=${path_mpi}/mpirun;
-             arch="local" ;
-             make="make";
-             o_ins_make="-t g95"
-esac
-
-# Flags for parallelism:
-if [[ $parallel != none ]]; then
-    # MPI_LD are the flags needed for linking with MPI
-    MPI_LD="-L${root_mpi}/lib -lmpi"
-    if [[ "$compiler" = "gfortran" ]]; then
-        # MPI_FLAGS are the flags needed for compilation with MPI
-        MPI_FLAGS="-fcray-pointer"
-        # OMP_FLAGS are the flags needed for compilation with OpenMP
-        OMP_FLAGS="-fopenmp -fcray-pointer"
-        # OMP_LD are the flags needed for linking with OpenMP
-        OMP_LD="-fopenmp"
-    elif [[ "$compiler" = "ifort" ]]; then
-        MPI_FLAGS=""
-        OMP_FLAGS="-openmp"
-        OMP_LD="-openmp"
-    else # pgf90
-        MPI_FLAGS=""
-        OMP_FLAGS="-mp"
-        OMP_LD="-mp"
-    fi
-fi
-
-## if also compiling XIOS, parallel must be mpi_omp
-if [[ $with_xios = "y" && $parallel != "mpi_omp" ]]; then
-    echo "Error, you must set -parallel mpi_omp if you want XIOS"
-    exit 1
-fi
-
-if [[ $with_xios = "y" ]]; then
-    opt_makelmdz_xios="-io xios"
-fi
-
-if [[ $cosp = "v2" && $with_xios = "n" ]]; then
-    echo "Error, Cospv2 cannot run without Xios"
-    exit 1
-fi
-
-echo "################################################################"
-echo  "Choix des options de compilation"
-echo "################################################################"
-
-export FC=$compiler
-export F90=$compiler
-export F77=$compiler
-export CPPFLAGS=
-OPTIMNC=""
-BASE_LD="$OPT_GPROF"
-OPTPREC="$OPT_GPROF"
-ARFLAGS="rs"
-if [[ $(lsb_release -i -s) = "Ubuntu" ]]; then
-    if [[ $(lsb_release -r -s | cut -d. -f1) -ge 16 ]]; then
-        ARFLAGS="rU"
-    fi
-fi
-
-if [[ $compiler = "gfortran" ]]; then
-   OPTIM="-O3 $allow_arg_mismatch"
-   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan  $allow_arg_mismatch"
-   OPTDEV="-Wall -fbounds-check  $allow_arg_mismatch"
-   fmod="I "
-   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
-   if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE"; fi
-   export F90FLAGS=" -ffree-form $OPTIMNC"
-   export FFLAGS=" $OPTIMNC"
-   export CC=gcc
-   export CXX=g++
-   export fpp_flags="-P -C -traditional -ffreestanding"
-
-elif [[ $compiler = mpif90 ]]; then
-    OPTIM="-O3"
-    OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
-    OPTDEV="-Wall -fbounds-check"
-    BASE_LD="$BASE_LD -lblas"
-    fmod="I "
-    if [[ $real = r8 ]]; then
-        OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
-    fi
-    export F90FLAGS=" -ffree-form $OPTIMNC"
-    export FFLAGS=" $OPTIMNC"
-    export CC=gcc
-    export CXX=g++
-
-elif [[ $compiler = pgf90 ]]; then
-    OPTIM="-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align"
-    OPTDEB="-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback"
-    OPTDEV="-g -Mbounds -Ktrap=fp -traceback"
-    fmod="module "
-    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE"; fi
-    export CPPFLAGS="-DpgiFortran"
-    export CC=pgcc
-    export CFLAGS="-O2 -Msignextend"
-    export CXX=pgCC
-    export CXXFLAGS="-O2 -Msignextend"
-    export FFLAGS="-O2 $OPTIMNC"
-    export F90FLAGS="-O2 $OPTIMNC"
-    compile_with_fcm=1
-
-elif [[ $compiler = ifort || $compiler = mpiifort ]]; then
-    OPTIM="-O2 -fp-model strict -ip -align all "
-    OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
-    OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
-    fmod='module '
-    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE"; fi
-    export CPP="icc -E"
-    export FFLAGS="-O2 -ip -fpic -mcmodel=large"
-    export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
-    export CC=icc
-    export CFLAGS="-O2 -ip -fpic -mcmodel=large"
-    export CXX=icpc
-    export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
-    export fpp_flags="-P -traditional"
-    # Pourquoi forcer la compilation fcm. Marche mieux sans
-    #compile_with_fcm=1
-else
-    echo "unexpected compiler $compiler"; exit 1
-fi
-
-OPTIMGCM="$OPTIM $OPTPREC"
-
-hostname=$(hostname)
-
-##########################################################################
-# If installing on known machines such as Jean-Zay at IDRIS,
-# don't check for available software and don't install netcdf
-if [[ ${hostname:0:5} = "jean-" ]]; then
-    netcdf=0 # no need to recompile netcdf, alreday available
-    check_software_linux=0
-    pclinux=0
-    ioipsl=0 # no need to recompile ioipsl, already available
-    #netcdf="/smplocal/pub/NetCDF/4.1.3"
-    compiler="mpiifort"
-    fmod='module '
-    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -i4 -r8 -DNC_DOUBLE"; fi
-    OPTIM="-auto -align all -O2 -fp-model strict -xHost "
-    OPTIMGCM="$OPTIM $OPTPREC"
-fi
-##########################################################################
-
-
-mkdir -p "$MODEL"
-echo "$MODEL"
-MODEL=$( cd "$MODEL"; pwd ) # to get absolute path, if necessary
-
-
-if [[ $check_software_linux = 1 ]]; then
-    echo "################################################################"
-    echo "Check if required software is available"
-    echo "################################################################"
-
-    for logiciel in wget tar gzip make $compiler gcc cmake m4 c++; do
-        if [[ $(which $logiciel) = "" ]]; then
-            echo "You must first install $logiciel on your system"
-            exit 1
-        fi
-    done
-
-    cd "$MODEL"
-    cat <<eod > tt.f90
-print*,'coucou'
-end
-eod
-    $compiler tt.f90 || a.out
-    ./a.out >| tt
-    if [[ $(< tt sed -e 's/ //g' ) != "coucou" ]]; then
-        echo "problem installing with compiler $compiler"; exit 1; fi
-    \rm tt a.out tt.f90
-fi
-
-###########################################################################
-if [[ $getlmdzor = 1 && ! -d $MODEL/modipsl ]]; then
-###########################################################################
-   echo "##########################################################"
-   echo "Download a slightly modified version of  LMDZ"
-   echo "##########################################################"
-   cd "$MODEL"
-   getlog=$(pwd)/get.log
-   echo logfile : "$getlog"
-   myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1
-   echo install_lmdz.sh wget_OK "$(date)"
-   gunzip "modipsl.$version.tar.gz" >> get.log 2>&1
-   tar xf "modipsl.$version.tar" >> get.log 2>&1
-   \rm "modipsl.$version.tar"
-fi
-
-###########################################################################
-echo "Installing Netcdf"
-###########################################################################
-
-if [[ $netcdf = 0 ]]; then
-    ncdfdir=/usr
-
-else
-    cd "$MODEL"
-
-    case $compiler in
-      gfortran) opt1="-compiler gnu"; opt2="-CC gcc -FC gfortran -CXX g++";;
-      ifort)  opt1="-compiler intel"; opt2="-CC icc -FC ifort -CXX icpc";;
-      pgf90)  opt1="-compiler pgf90"; opt2="-CC pgcc -FC pgf90 -CXX pgCC";;
-      *)      echo "unexpected compiler $compiler" for netcdf; exit 1
-    esac
-
-    case $with_xios in
-        n) script_install_netcdf=install_netcdf4_hdf5_seq.bash
-           ncdfdir=netcdf4_hdf5_seq
-           opt_=$opt1;;
-        y) script_install_netcdf=install_netcdf4_hdf5.bash
-           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
-         
-    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
-        # shellcheck disable=SC2086
-        ./$script_install_netcdf -prefix "$ncdfdir" $opt_ >> "$netcdflog" 2>&1
-    fi
-
-    #----------------------------------------------------------------------------
-    # LF rajout d'une verrue, pour une raison non encore expliquee,
-    # la librairie est parfois rang�e dans lib64 et non dans lib
-    # par certains compilateurs
-    if [[ ! -e lib && -d lib64 ]]; then ln -s lib64 lib; fi
-    #----------------------------------------------------------------------------
-
-    echo install_lmdz.sh netcdf_OK "$(date)"
-
-fi
-
-cat >test_netcdf90.f90 <<EOF
-use netcdf
-print *, "NetCDF library version: ", nf90_inq_libvers()
-end
-EOF
-
-if $compiler -I"$ncdfdir"/include test_netcdf90.f90 -L"$ncdfdir"/lib -lnetcdff \
-          -lnetcdf -Wl,-rpath="$ncdfdir"/lib && ./a.out
-then
-    rm test_netcdf90.f90 a.out
-else
-    echo "Failed test program using NetCDF-Fortran."
-    echo "You can:"
-    echo "- check that you have NetCDF-Fortran installed in your system"
-    echo "- or specify an installation directory with option -netcdf of" \
-         "install_lmdz.sh"
-    echo "- or download and compile NetCDF-Fortran with option -netcdf 1 of" \
-         "install_lmdz.sh"
-    exit 1
-fi
-
-if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]]
-then
-    if [[ $ioipsl = 1 ]]; then
-        cat <<EOF
-OK ioipsl=$ioipsl
-##########################################################
-Installing MODIPSL, the installation package manager for the
-IPSL models and tools
-##########################################################
-$(date)
-EOF
-        cd "$MODEL/modipsl"
-        \rm -rf lib/*
-        cd util
-        cp AA_make.gdef AA_make.orig
-        F_C="$compiler -c "
-        if [[ $compiler = "gfortran" || $compiler = "mpif90" ]]
-        then
-            F_C="$compiler -c -cpp "
-        fi
-        if [[ $compiler = "pgf90" ]]; then F_C="$compiler -c -Mpreprocess"; fi
-        sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
-        sed -e "s:F_L = g95:F_L = $compiler:" \
-            -e "s:F_C = g95 -c -cpp: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:' \
-            -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
-            -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
-            -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
-            -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
-            tmp >| AA_make.gdef
-
-        if [[ $pcmac == 1 ]]
-        then
-            cp AA_make.gdef tmp
-            sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
-        fi
-
-        # We use lines for g95 even for the other compilers to run ins_make
-        sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash  # Note Amaury: the case where the default shell isn't bash should be handled directly in ins_make (via ./ and #! directives)
-
-        chmod u=rwx ins_make.bash
-        # shellcheck disable=SC2086
-        ./ins_make.bash $o_ins_make
-
-        echo "install_lmdz.sh MODIPSL_OK $(date)"
-
-        cd "$MODEL/modipsl/modeles/IOIPSL/src"
-        ioipsllog=$(pwd)/ioipsl.log
-        echo '##########################################################'
-        echo 'Compiling IOIPSL, the interface library with Netcdf'
-        echo '##########################################################'
-        echo "log file : $ioipsllog   $(date)"
-
-        cp Makefile Makefile.ksh
-        sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
-
-        # Build IOIPSL modules and library
-        $make clean
-        $make > "$ioipsllog" 2>&1
-        if [[ $compiler = "gfortran" || $compiler = "mpif90" ]]; then
-            # copy module files to lib
-            cp -f -- *.mod ../../../lib
-        fi
-        # Build IOIPSL tools (ie: "rebuild", if present)
-        # For IOIPSLv_2_2_2, "rebuild" files are in IOIPSL/tools
-        rebuild_dir=""
-        if [[ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ]]; then 
-            rebuild_dir=$MODEL/modipsl/modeles/IOIPSL/tools
-	      elif [[ -d $MODEL/modipsl/modeles/IOIPSL/rebuild ]]; then
-            rebuild_dir=$MODEL/modipsl/modeles/IOIPSL/rebuild
-        fi
-        if [[ $rebuild_dir != "" ]]; then
-	          cd "$rebuild_dir"
-            # adapt Makefile & rebuild script if in bash
-            cp Makefile Makefile.ksh
-            sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
-            cp rebuild rebuild.ksh
-            sed -e 's:/bin/ksh:/bin/bash:g' \
-                -e 's:print -u2:echo:g' \
-                -e 's:print:echo:g' rebuild.ksh > rebuild
-            $make clean
-            $make > "$ioipsllog" 2>&1
-        fi
-
-    else # of if [[ $ioipsl = 1 ]]
-        if [[ ${hostname:0:5} = jean- ]]; then
-            cd "$MODEL/modipsl"
-            cd util
-            if [[ $(grep jeanzay AA_make.gdef) = "" ]]; then
-                echo 'Warning jean-zay not in AA_make.gdef'
-                echo 'Think about updating'
-                exit 1
-            fi
-            ./ins_make "$o_ins_make"
-            # Compile IOIPSL on jean-zay
-            cd "$MODEL/modipsl/modeles/IOIPSL/src"
-            gmake > ioipsl.log
-	    # For IOIPSLv_2_2_2, "rebuild" files are in IOIPSL/tools, so "gmake" in IOIPSL/tools is enough
-	    # For IOIPSLv_2_2_5, "rebuild" files are in a separate IOIPSL/rebuild folder , while "tools" only contains "FCM"
-	    if [[ -f $MODEL/modipsl/modeles/IOIPSL/tools/Makefile ]]; then
-              cd "$MODEL/modipsl/modeles/IOIPSL/tools"
-              gmake > ioipsl.log
-            fi
-            if [[ -d $MODEL/modipsl/modeles/IOIPSL/rebuild ]]; then
-              cd "$MODEL/modipsl/modeles/IOIPSL/rebuild"
-              gmake > ioipsl.log
-            fi
-
-        fi
-        echo "install_lmdz.sh ioipsl_OK $(date)"
-    fi # of if [[ $ioipsl = 1 ]]
-fi # of if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]]
-
-#=========================================================================
+#case ${hostname:0:5} in
+#    *)       if [[ $parallel = none || -f /usr/bin/mpif90 ]]; then
+#                 path_mpi=$(which mpif90 | sed -e s:/mpif90::);
+#                 if [[ -d /usr/lib64/openmpi ]]; then
+#                     root_mpi="/usr/lib64/openmpi"
+#                 else
+#                     root_mpi="/usr"
+#                 fi
+#             else
+#                 echo "Cannot find mpif90";
+#                 if [[ $parallel = none ]]; then exit 1; fi;
+#             fi;
+#             if [[ $parallel != none ]]; then
+#                 root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::)
+#                 path_mpi=$(which mpif90 | sed -e s:/mpif90::)
+#                 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
+#             fi
+#             par_comp=${path_mpi}/mpif90;
+#             mpirun=${path_mpi}/mpirun;
+#             arch="local" ;
+#             make="make";
+#             o_ins_make="-t g95"
+#esac
+
+## Flags for parallelism:
+#if [[ $parallel != none ]]; then
+#    # MPI_LD are the flags needed for linking with MPI
+#    MPI_LD="-L${root_mpi}/lib -lmpi"
+#    if [[ $compiler = "gfortran" ]]; then
+#        # MPI_FLAGS are the flags needed for compilation with MPI
+#        MPI_FLAGS="-fcray-pointer"
+#        # OMP_FLAGS are the flags needed for compilation with OpenMP
+#        OMP_FLAGS="-fopenmp -fcray-pointer"
+#        # OMP_LD are the flags needed for linking with OpenMP
+#        OMP_LD="-fopenmp"
+#    elif [[ $compiler = "ifort" ]]; then
+#        MPI_FLAGS=""
+#        OMP_FLAGS="-openmp"
+#        OMP_LD="-openmp"
+#    else # pgf90
+#        MPI_FLAGS=""
+#        OMP_FLAGS="-mp"
+#        OMP_LD="-mp"
+#    fi
+#fi
+#
+#
+#echo "################################################################"
+#echo  "Choix des options de compilation"
+#echo "################################################################"
+#
+#export FC=$compiler
+#export F90=$compiler
+#export F77=$compiler
+#export CPPFLAGS=
+#OPTIMNC=""
+#BASE_LD="$OPT_GPROF"
+#OPTPREC="$OPT_GPROF"
+#ARFLAGS="rs"
+#if [[ $(lsb_release -i -s) = "Ubuntu" ]]; then
+#    if [[ $(lsb_release -r -s | cut -d. -f1) -ge 16 ]]; then
+#        ARFLAGS="rU"
+#    fi
+#fi
+#
+#if [[ $compiler = "gfortran" ]]; then
+#   OPTIM="-O3 $allow_arg_mismatch"
+#   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan  $allow_arg_mismatch"
+#   OPTDEV="-Wall -fbounds-check  $allow_arg_mismatch"
+#   fmod="I "
+#   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
+#   if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE"; fi
+#   export F90FLAGS=" -ffree-form $OPTIMNC"
+#   export FFLAGS=" $OPTIMNC"
+#   export CC=gcc
+#   export CXX=g++
+#   export fpp_flags="-P -C -traditional -ffreestanding"
+#
+#elif [[ $compiler = mpif90 ]]; then
+#    OPTIM="-O3"
+#    OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
+#    OPTDEV="-Wall -fbounds-check"
+#    BASE_LD="$BASE_LD -lblas"
+#    fmod="I "
+#    if [[ $real = r8 ]]; then
+#        OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
+#    fi
+#    export F90FLAGS=" -ffree-form $OPTIMNC"
+#    export FFLAGS=" $OPTIMNC"
+#    export CC=gcc
+#    export CXX=g++
+#
+#elif [[ $compiler = pgf90 ]]; then
+#    OPTIM="-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align"
+#    OPTDEB="-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback"
+#    OPTDEV="-g -Mbounds -Ktrap=fp -traceback"
+#    fmod="module "
+#    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE"; fi
+#    export CPPFLAGS="-DpgiFortran"
+#    export CC=pgcc
+#    export CFLAGS="-O2 -Msignextend"
+#    export CXX=pgCC
+#    export CXXFLAGS="-O2 -Msignextend"
+#    export FFLAGS="-O2 $OPTIMNC"
+#    export F90FLAGS="-O2 $OPTIMNC"
+#    compile_with_fcm=1
+#
+#elif [[ $compiler = ifort || $compiler = mpiifort ]]; then
+#    OPTIM="-O2 -fp-model strict -ip -align all "
+#    OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
+#    OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
+#    fmod='module '
+#    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE"; fi
+#    export CPP="icc -E"
+#    export FFLAGS="-O2 -ip -fpic -mcmodel=large"
+#    export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
+#    export CC=icc
+#    export CFLAGS="-O2 -ip -fpic -mcmodel=large"
+#    export CXX=icpc
+#    export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
+#    export fpp_flags="-P -traditional"
+#    # Pourquoi forcer la compilation fcm. Marche mieux sans
+#    #compile_with_fcm=1
+#else
+#    echo "unexpected compiler $compiler"; exit 1
+#fi
+#
+#OPTIMGCM="$OPTIM $OPTPREC"
+
+
+
+
 if [[ "$with_xios" = "y" ]]; then
     echo '##########################################################'
