Changeset 4405


Ignore:
Timestamp:
Jan 31, 2023, 12:08:44 AM (16 months ago)
Author:
fhourdin
Message:

Mise à jour de l'installation sur ~lmdz/pub

Nettoyage du répertoire ~/lmdz/pub
on met tous les scripts dans le répertoir script_install
géré sous svn sous "BOL".
pub/script_install devient donc le résultat d'un svn checkout.
On peut y faire directement des svn update.
Les scripts d'installationdes ordinateurs et de netcdf sont
maintenant gérés au même endroit.
Le script install_lmdz et modifié en conséquence et la gestion
de l'installation de netcdf dans ce script grandement allégée.

Location:
BOL/script_install
Files:
5 added
3 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r4398 r4405  
    4949    # Path on local computer where to look for the datafile
    5050    if [ -f /u/lmdz/WWW/LMDZ/pub/$1 ] ; then
    51         \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 .
     51        \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 .
    5252    elif [ -f ~/LMDZ/pub/$1 ] ; then
    53         \cp -f -p ~/LMDZ/pub/$1 .
     53        \cp -f -p ~/LMDZ/pub/$1 .
    5454    else
    55         wget --no-check-certificate -nv http://lmdz.lmd.jussieu.fr/pub/$1
    56         save_pub_locally=0
    57         if [ $save_pub_locally = 1 ] ; then # saving wget files on ~/LMDZ/pub
    58             dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir
    59             cp -r `basename $1` $dir
    60         fi
     55        wget --no-check-certificate -nv http://lmdz.lmd.jussieu.fr/pub/$1
     56        save_pub_locally=0
     57        if [ $save_pub_locally = 1 ] ; then # saving wget files on ~/LMDZ/pub
     58            dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir
     59            cp -r `basename $1` $dir
     60        fi
    6161    fi
    6262}
     
    141141do
    142142    case $1 in
    143         "-h") cat <<........fin
     143        "-h") cat <<........fin
    144144    $0 [ -v version ] [ -r svn_release ]
    145145           [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ]
     
    165165
    166166    -netcdf    0, 1 or PATH
    167                0: do not download NetCDF, look for it in standard locations
    168                1: download and compile NetCDF
    169                PATH: full path to an existing installed NetCDF library
     167                   0: do not download NetCDF, look for it in standard locations
     168               1: download and compile NetCDF
     169                   PATH: full path to an existing installed NetCDF library
    170170
    171171    -xios      also download and compile the XIOS library
     
    194194
    195195........fin
    196               exit ;;
    197         "-v") version=$2 ; shift ; shift ;;
    198         "-r") svn=$2 ; shift ; shift ;;
    199         "-compiler") compiler=$2
     196              exit ;;
     197        "-v") version=$2 ; shift ; shift ;;
     198        "-r") svn=$2 ; shift ; shift ;;
     199        "-compiler") compiler=$2
    200200                     case $compiler in
    201                         "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift
    202                                                      shift ;;
    203                         *) echo "Only gfortran , ifort or pgf90 for the " \
    204                                 "compiler option"
    205                             exit
     201                        "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift
     202                                                     shift ;;
     203                        *) echo "Only gfortran , ifort or pgf90 for the " \
     204                                "compiler option"
     205                            exit
    206206                     esac ;;
    207         "-d") grid_resolution=$2 ; shift ; shift ;;
    208         "-gprof") OPT_GPROF="-pg" ; shift ;;
    209         "-cosp") cosp=$2
    210                 case $cosp in
     207        "-d") grid_resolution=$2 ; shift ; shift ;;
     208        "-gprof") OPT_GPROF="-pg" ; shift ;;
     209        "-cosp") cosp=$2
     210                case $cosp in
    211211                     "none"|"v1"|"v2") cosp=$2 ; shift ; shift ;;
    212212                     *) echo Only none v1 v2 for cosp option ; exit
    213                 esac ;;
    214         "-nofcm") compile_with_fcm=0 ; echo This option will be reactivated soon '(promesse du 8dec2022)' ; exit 1 ;  shift ;;
    215         "-SCM") SCM=1 ; shift ;;
    216         "-opt_makelmdz") OPT_MAKELMDZ="$2" ; shift ; shift ;;
    217         "-rrtm") rrtm="$2"
    218                 if [ "$2" = "false" ] ; then
    219                      rad="oldrad"
    220                 else
    221                      rad="rrtm"
    222                 fi
    223                 shift ; shift ;;
    224         "-rad") rad=$2
    225                 case $rad in
     213                esac ;;
     214        "-nofcm") compile_with_fcm=0 ; echo This option will be reactivated soon '(promesse du 8dec2022)' ; exit 1 ;  shift ;;
     215        "-SCM") SCM=1 ; shift ;;
     216        "-opt_makelmdz") OPT_MAKELMDZ="$2" ; shift ; shift ;;
     217        "-rrtm") rrtm="$2"
     218                if [ "$2" = "false" ] ; then
     219                     rad="oldrad"
     220                else
     221                     rad="rrtm"
     222                fi
     223                shift ; shift ;;
     224        "-rad") rad=$2
     225                case $rad in
    226226                    "oldrad"|"rrtm"|"ecrad") rad=$2 ; shift ; shift ;;
    227227                    *) echo Only oldrad rrtm ecrad for rad option ; exit
    228                 esac ;;
    229         "-parallel") parallel=$2
     228                esac ;;
     229        "-parallel") parallel=$2
    230230                     case $parallel in
    231                         "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift
    232                                                        shift ;;
    233                         *) echo Only none mpi omp mpi_omp for the parallel \
    234                                 option
    235                             exit
     231                        "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift
     232                                                       shift ;;
     233                        *) echo Only none mpi omp mpi_omp for the parallel \
     234                                option
     235                            exit
    236236                     esac ;;
    237         "-bench") bench=$2 ; shift ; shift ;;
    238         "-debug") optim=-debug ; shift ;;
    239         "-name") MODEL=$2 ; shift ; shift ;;
    240         "-netcdf") case $2 in
     237        "-bench") bench=$2 ; shift ; shift ;;
     238        "-debug") optim=-debug ; shift ;;
     239        "-name") MODEL=$2 ; shift ; shift ;;
     240        "-netcdf") case $2 in
    241241                       0|1) netcdf=$2 ;;
    242242                       *) netcdf=`ls -d $2` ; if [ $? != 0 ] ; then echo No directory $2 ; exit 1 ; fi
    243243                   esac
    244244                   shift ; shift ;;
    245         "-physiq") physiq=$2 ; shift ; shift ;;
    246         "-xios") with_xios="y" ; shift ;;
    247         "-env_file") env_file=$2 ; shift ; shift ;;
    248         "-veget") veget=$2 ; shift ; shift ;;
    249         *) ./install_lmdz.sh -h ; exit
     245        "-physiq") physiq=$2 ; shift ; shift ;;
     246        "-xios") with_xios="y" ; shift ;;
     247        "-env_file") env_file=$2 ; shift ; shift ;;
     248        "-veget") veget=$2 ; shift ; shift ;;
     249        *) ./install_lmdz.sh -h ; exit
    250250    esac
    251251done
     
    273273    re='^[0-9]+$'
    274274    if ! [[ $veget =~ $re ]] ; then
    275         echo 'Valeur de l option veget non valable'
    276         exit
     275        echo 'Valeur de l option veget non valable'
     276        exit
    277277    fi
    278278fi
     
    331331
    332332    cicla|camel)   compiler="gfortran" ;
    333                    module purge
    334                    module load gnu/10.2.0
    335                    module load openmpi/4.0.5
    336                    module load hdf5/1.10.7-mpi
    337                    module load netcdf-c/4.7.4-mpi
    338                    module load netcdf-fortran/4.5.3-mpi
    339                    netcdf=/net/nfs/tools/PrgEnv/linux-scientific6-x86_64/gcc-10.2.0/netcdf-fortran-4.5.3-k3drgfqok3lip62hnm3tsyof4cjen5sk
    340                    module load svn/1.14.0
    341 
    342                    if [ $parallel != none ] ; then
    343                        root_mpi=/net/nfs/tools/meso-sl6/openmpi/4.0.5-gcc-10.2.0
    344                        path_mpi=$root_mpi/bin ;
    345                        par_comp=${path_mpi}/mpif90 ;
    346                        mpirun=${path_mpi}/mpirun ;
    347                    fi ;
    348                    arch=local  ;
    349                    make=make ;
    350                    o_ins_make="-t g95" ;;
     333                   module purge
     334                   module load gnu/10.2.0
     335                   module load openmpi/4.0.5
     336                   module load hdf5/1.10.7-mpi
     337                   module load netcdf-c/4.7.4-mpi
     338                   module load netcdf-fortran/4.5.3-mpi
     339                   netcdf=/net/nfs/tools/PrgEnv/linux-scientific6-x86_64/gcc-10.2.0/netcdf-fortran-4.5.3-k3drgfqok3lip62hnm3tsyof4cjen5sk
     340                   module load svn/1.14.0
     341
     342                   if [ $parallel != none ] ; then
     343                       root_mpi=/net/nfs/tools/meso-sl6/openmpi/4.0.5-gcc-10.2.0
     344                       path_mpi=$root_mpi/bin ;
     345                       par_comp=${path_mpi}/mpif90 ;
     346                       mpirun=${path_mpi}/mpirun ;
     347                   fi ;
     348                   arch=local  ;
     349                   make=make ;
     350                   o_ins_make="-t g95" ;;
    351351
    352352    *)       if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then
     
    358358                 fi
    359359             else
    360                 echo "Cannot find mpif90" ;
    361                 if [ $parallel = none ] ; then exit ; fi ;
     360                echo "Cannot find mpif90" ;
     361                if [ $parallel = none ] ; then exit ; fi ;
    362362             fi ;
    363363             if [ $parallel != none ] ; then
    364                 root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::)
    365                 path_mpi=$(which mpif90 | sed -e s:/mpif90::)
    366                 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
     364                root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::)
     365                path_mpi=$(which mpif90 | sed -e s:/mpif90::)
     366                export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
    367367             fi
    368368             par_comp=${path_mpi}/mpif90 ;
     
    378378    MPI_LD="-L${root_mpi}/lib -lmpi"
    379379    if [ "$compiler" = "gfortran" ] ; then
    380         # MPI_FLAGS are the flags needed for compilation with MPI
    381         MPI_FLAGS="-fcray-pointer"
    382         # OMP_FLAGS are the flags needed for compilation with OpenMP
    383         OMP_FLAGS="-fopenmp -fcray-pointer"
    384         # OMP_LD are the flags needed for linking with OpenMP
    385         OMP_LD="-fopenmp"
     380        # MPI_FLAGS are the flags needed for compilation with MPI
     381        MPI_FLAGS="-fcray-pointer"
     382        # OMP_FLAGS are the flags needed for compilation with OpenMP
     383        OMP_FLAGS="-fopenmp -fcray-pointer"
     384        # OMP_LD are the flags needed for linking with OpenMP
     385        OMP_LD="-fopenmp"
    386386    elif [ "$compiler" = "ifort" ] ; then
    387         MPI_FLAGS=""
    388         OMP_FLAGS="-openmp"
    389         OMP_LD="-openmp"
     387        MPI_FLAGS=""
     388        OMP_FLAGS="-openmp"
     389        OMP_LD="-openmp"
    390390    else # pgf90
    391         MPI_FLAGS=""
    392         OMP_FLAGS="-mp"
    393         OMP_LD="-mp"
     391        MPI_FLAGS=""
     392        OMP_FLAGS="-mp"
     393        OMP_LD="-mp"
    394394    fi
    395395fi
     
    408408   head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } '`
    409409    if [ $gfortranv -le 43 ] ; then
    410         echo ERROR : Your gfortran compiler is too old
    411         echo 'Please choose a new one (ifort) and change the line'
    412         echo compiler=xxx
    413         echo in the install_lmdz.sh script and rerun it
    414         if [ `which gfortran44 | wc -w` -ne 0 ] ; then
     410        echo ERROR : Your gfortran compiler is too old
     411        echo 'Please choose a new one (ifort) and change the line'
     412        echo compiler=xxx
     413        echo in the install_lmdz.sh script and rerun it
     414        if [ `which gfortran44 | wc -w` -ne 0 ] ; then
    415415            gfortran=gfortran44
    416         else
     416        else
    417417            echo gfotran trop vieux ; exit
    418         fi
     418        fi
    419419    fi
    420420    compiler=$gfortran
     
    475475    fmod='I '
    476476    if [ $real = r8 ] ; then
    477         OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
     477        OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
    478478    fi
    479479    export F90FLAGS=" -ffree-form $OPTIMNC"
     
    553553    use_shell="bash" # default
    554554    if [ "`which bash`" = "" ] ; then
    555         echo "no bash ; we will use ksh"
    556         use_shell="ksh"
    557         if [ "`which ksh`" = "" ] ; then
    558             echo "bash (or ksh) needed!! Install it!"
    559             exit
    560         fi
     555        echo "no bash ; we will use ksh"
     556        use_shell="ksh"
     557        if [ "`which ksh`" = "" ] ; then
     558            echo "bash (or ksh) needed!! Install it!"
     559            exit
     560        fi
    561561    fi
    562562
    563563    for logiciel in wget tar gzip make $compiler gcc cmake m4 c++ ; do
    564         if [ "`which $logiciel`" = "" ] ; then
    565             echo You must first install $logiciel on your system
    566             exit
    567         fi
     564        if [ "`which $logiciel`" = "" ] ; then
     565            echo You must first install $logiciel on your system
     566            exit
     567        fi
    568568    done
    569569
    570570    if [ $pclinux = 1 ] ; then
    571         cd $MODEL
    572         cat <<eod > tt.f90
     571        cd $MODEL
     572        cat <<eod > tt.f90
    573573print*,'coucou'
    574574end
    575575eod
    576         $compiler tt.f90 -o a.out
    577         ./a.out >| tt
    578         if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
    579             echo problem installing with compiler $compiler ; exit ; fi
    580         \rm tt a.out tt.f90
     576        $compiler tt.f90 -o a.out
     577        ./a.out >| tt
     578        if [ "`cat tt | sed -e 's/ //g' `" != "coucou" ] ; then
     579            echo problem installing with compiler $compiler ; exit ; fi
     580        \rm tt a.out tt.f90
    581581    fi
    582582fi
     
    600600###########################################################################
    601601if [ $netcdf = 1 ] ; then
    602     ###########################################################################
     602###########################################################################
    603603    cd $MODEL
    604604    netcdflog=`pwd`/netcdf.log
    605     echo '##########################################################'
     605    echo '----------------------------------------------------------'
    606606    echo Compiling the Netcdf library
    607     echo '##########################################################'
     607    echo '----------------------------------------------------------'
    608608    echo log file : $netcdflog
    609     if [[ "$with_xios" = "n" && ! -d $MODEL/netcdf4_hdf5_seq ]] ; then
    610         myget import/install_netcdf4_hdf5_seq.bash >> $netcdflog 2>&1
    611         chmod +x install_netcdf4_hdf5_seq.bash
    612 
    613         if [ "$compiler" = "gfortran" ]
    614         then
    615             ./install_netcdf4_hdf5_seq.bash -prefix $MODEL/netcdf4_hdf5_seq \
    616                                             -compiler gnu  >> $netcdflog 2>&1
    617         elif [ "$compiler" = "ifort" ]
    618         then
    619             ./install_netcdf4_hdf5_seq.bash -prefix $MODEL/netcdf4_hdf5_seq \
    620                                             -compiler intel  >> $netcdflog 2>&1
    621         else
    622             echo "unexpected compiler $compiler" ; exit
    623         fi
    624 
    625         # LF rajout d'une verrue, pour une raison non encore expliquee,
    626         # la librairie est parfois rangée dans lib64 et non dans lib
    627         # par certains compilateurs
    628         if [ ! -e lib -a -d lib64 ] ; then ln -s lib64 lib; fi
    629     elif [[ "$with_xios" = "y" && ! -d $MODEL/netcdf4_hdf5 ]]
    630     then
    631         # download and compile hdf5 and netcdf, etc. using the
    632         # install_netcdf4_hdf5.bash script
    633         myget import/install_netcdf4_hdf5.bash >> $netcdflog 2>&1
    634         chmod u=rwx install_netcdf4_hdf5.bash
    635         if [ "$compiler" = "gfortran" ] ; then
    636             ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc \
    637                         -FC gfortran -CXX g++ -MPI $root_mpi  >> $netcdflog 2>&1
    638         elif [ "$compiler" = "ifort" ] ; then
    639             ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc \
    640                           -FC ifort -CXX icpc -MPI $root_mpi  >> $netcdflog 2>&1
    641         elif [ "$compiler" = "pgf90" ] ; then
    642             ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc \
    643                           -FC pgf90 -CXX pgCC -MPI $root_mpi  >> $netcdflog 2>&1
    644         else
    645             echo "unexpected compiler $compiler" ; exit
    646         fi
    647     fi  # of if [ "$with_xios" = "n" ]
     609
     610    case $compiler in
     611      gfortran) opt1="-compiler gnu" ; opt2="-CC gcc -FC gfortran -CXX g++" ;;
     612      ifort)  opt1="-compiler intel" ; opt2="-CC icc -FC ifort -CXX icpc" ;;
     613      pgf90)  opt1="-compiler pgf90" ; opt2="-CC pgcc -FC pgf90 -CXX pgCC" ;;
     614      *)      echo "unexpected compiler $compiler" for netcdf ; exit 1
     615    esac
     616
     617    case $with_xios in
     618        n) script_install_netcdf=install_netcdf4_hdf5_seq.bash
     619           ncdfdir=$MODEL/netcdf4_hdf5_seq
     620           opt_=$opt1 ;;
     621        y) script_install_netcdf=install_netcdf4_hdf5.bash
     622           ncdfdir=$MODEL/netcdf4_hdf5
     623           opt_="$opt2 -MPI $root_mpi" ;;
     624        *) echo with_xios=$with_xios, should be n or y ; exit 1
     625    esac
     626         
     627    if [[ ! -d $ncdfdir ]] ; then
     628        myget import/$script_install_netcdf >> $netcdflog 2>&1
     629        chmod u=rwx $script_install_netcdf
     630        ./$script_install_netcdf -prefix $ncdfdir $opt_ >> $netcdflog 2>&1
     631    fi
     632
     633    #----------------------------------------------------------------------------
     634    # LF rajout d'une verrue, pour une raison non encore expliquee,
     635    # la librairie est parfois rangée dans lib64 et non dans lib
     636    # par certains compilateurs
     637    if [ ! -e lib -a -d lib64 ] ; then ln -s lib64 lib; fi
     638    #----------------------------------------------------------------------------
     639
    648640    echo install_lmdz.sh netcdf_OK `date`
    649 fi # of if [ $netcdf = 1 ]
    650 
    651 # ncdfdir contains the directory where netcdf is installed
    652 if [ $netcdf = 1 ] ; then
    653     if [ "$with_xios" = "y" ] ; then
    654         ncdfdir=$MODEL/netcdf4_hdf5
    655     else
    656         ncdfdir=$MODEL/netcdf4_hdf5_seq
    657     fi
    658 elif [ $netcdf = 0 ]
    659 then
     641
     642elif [ $netcdf = 0 ] ; then
    660643    ncdfdir=/usr
    661644else
     
    669652EOF
    670653
    671 $compiler -I$ncdfdir/include test_netcdf90.f90 -L$ncdfdir/lib -l netcdff \
    672           -lnetcdf -Wl,-rpath=$ncdfdir/lib && ./a.out
     654$compiler -I$ncdfdir/include test_netcdf90.f90 -L$ncdfdir/lib -lnetcdff \
     655          -lnetcdf -Wl,-rpath=$ncdfdir/lib && ./a.out
    673656   
    674657if (($? == 0))
     
    680663    echo "- check that you have NetCDF-Fortran installed in your system"
    681664    echo "- or specify an installation directory with option -netcdf of" \
    682         "install_lmdz.sh"
     665        "install_lmdz.sh"
    683666    echo "- or download and compile NetCDF-Fortran with option -netcdf 1 of" \
    684         "install_lmdz.sh"
     667        "install_lmdz.sh"
    685668    exit 1
    686669fi
     
    690673then
    691674    if [ $ioipsl = 1 ] ; then
    692         #=====================================================================
    693         echo OK ioipsl=$ioipsl
    694         echo '##########################################################'
    695         echo 'Installing MODIPSL, the installation package manager for the '
    696         echo 'IPSL models and tools'
    697         echo '##########################################################'
    698         echo `date`
    699 
    700         cd $MODEL/modipsl
    701         \rm -rf lib/*
    702         cd util
    703         cp AA_make.gdef AA_make.orig
    704         F_C="$compiler -c "
    705         if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ]
    706         then
    707             F_C="$compiler -c -cpp "
    708         fi
    709         if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi
    710         sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
    711         sed -e "s:F_L = g95:F_L = $compiler:" \
    712             -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
    713             -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
    714             -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
    715             -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
    716             -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
    717             -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
    718             -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
    719             tmp >| AA_make.gdef
    720 
    721         if [ $pcmac == 1 ]
    722         then
    723             cp AA_make.gdef tmp
    724             sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
    725         fi
    726 
    727 
    728         # We use lines for g95 even for the other compilers to run ins_make
    729         if [ "$use_shell" = "ksh" ] ; then
    730             ./ins_make $o_ins_make
    731         else # bash
    732             sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
    733             if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then
    734                 # Bidouille pour compiler sur ada des vieux modipsl.tar
    735                 echo 'Warning jean-zay not in AA_make.gdef'
    736                 echo 'Think about updating'
    737                 exit 1
    738             fi
    739 
    740             chmod u=rwx ins_make.bash
    741             ./ins_make.bash $o_ins_make
    742         fi # of if [ "$use_shell" = "ksh" ]
    743 
    744         echo install_lmdz.sh MODIPSL_OK `date`
    745 
    746         cd $MODEL/modipsl/modeles/IOIPSL/src
    747         ioipsllog=`pwd`/ioipsl.log
    748         echo '##########################################################'
    749         echo 'Compiling IOIPSL, the interface library with Netcdf'
    750         echo '##########################################################'
    751         echo `date`
    752         echo log file : $ioipsllog
    753 
    754         if [ "$use_shell" = "bash" ] ; then
    755             cp Makefile Makefile.ksh
    756             sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
    757         fi
    758         # if [ "$pclinux" = 1 ] ; then
    759         # Build IOIPSL modules and library
    760         $make clean
    761         $make > $ioipsllog 2>&1
    762         if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
    763             # copy module files to lib
    764             cp -f *.mod ../../../lib
    765         fi
    766         # Build IOIPSL tools (ie: "rebuild", if present)
    767         if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
    768             cd $MODEL/modipsl/modeles/IOIPSL/tools
    769             # adapt Makefile & rebuild script if in bash
    770             if [ "$use_shell" = "bash" ] ; then
    771                 cp Makefile Makefile.ksh
    772                 sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
    773                 cp rebuild rebuild.ksh
    774                 sed -e 's:/bin/ksh:/bin/bash:g' \
    775                     -e 's:print -u2:echo:g' \
    776                     -e 's:print:echo:g' rebuild.ksh > rebuild
    777             fi
    778             $make clean
    779             $make > $ioipsllog 2>&1
    780         fi
    781         # fi # of if [ "$pclinux" = 1 ]
     675        #=====================================================================
     676        echo OK ioipsl=$ioipsl
     677        echo '##########################################################'
     678        echo 'Installing MODIPSL, the installation package manager for the '
     679        echo 'IPSL models and tools'
     680        echo '##########################################################'
     681        echo `date`
     682
     683        cd $MODEL/modipsl
     684        \rm -rf lib/*
     685        cd util
     686        cp AA_make.gdef AA_make.orig
     687        F_C="$compiler -c "
     688        if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ]
     689        then
     690            F_C="$compiler -c -cpp "
     691        fi
     692        if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi
     693        sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
     694        sed -e "s:F_L = g95:F_L = $compiler:" \
     695            -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
     696            -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
     697            -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
     698            -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
     699            -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
     700            -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
     701            -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
     702            tmp >| AA_make.gdef
     703
     704        if [ $pcmac == 1 ]
     705        then
     706            cp AA_make.gdef tmp
     707            sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
     708        fi
     709
     710
     711        # We use lines for g95 even for the other compilers to run ins_make
     712        if [ "$use_shell" = "ksh" ] ; then
     713            ./ins_make $o_ins_make
     714        else # bash
     715            sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
     716            if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then
     717                # Bidouille pour compiler sur ada des vieux modipsl.tar
     718                echo 'Warning jean-zay not in AA_make.gdef'
     719                echo 'Think about updating'
     720                exit 1
     721            fi
     722
     723            chmod u=rwx ins_make.bash
     724            ./ins_make.bash $o_ins_make
     725        fi # of if [ "$use_shell" = "ksh" ]
     726
     727        echo install_lmdz.sh MODIPSL_OK `date`
     728
     729        cd $MODEL/modipsl/modeles/IOIPSL/src
     730        ioipsllog=`pwd`/ioipsl.log
     731        echo '##########################################################'
     732        echo 'Compiling IOIPSL, the interface library with Netcdf'
     733        echo '##########################################################'
     734        echo `date`
     735        echo log file : $ioipsllog
     736
     737        if [ "$use_shell" = "bash" ] ; then
     738            cp Makefile Makefile.ksh
     739            sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
     740        fi
     741        # if [ "$pclinux" = 1 ] ; then
     742        # Build IOIPSL modules and library
     743        $make clean
     744        $make > $ioipsllog 2>&1
     745        if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
     746            # copy module files to lib
     747            cp -f *.mod ../../../lib
     748        fi
     749        # Build IOIPSL tools (ie: "rebuild", if present)
     750        if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then
     751            cd $MODEL/modipsl/modeles/IOIPSL/tools
     752            # adapt Makefile & rebuild script if in bash
     753            if [ "$use_shell" = "bash" ] ; then
     754                cp Makefile Makefile.ksh
     755                sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
     756                cp rebuild rebuild.ksh
     757                sed -e 's:/bin/ksh:/bin/bash:g' \
     758                    -e 's:print -u2:echo:g' \
     759                    -e 's:print:echo:g' rebuild.ksh > rebuild
     760            fi
     761            $make clean
     762            $make > $ioipsllog 2>&1
     763        fi
     764        # fi # of if [ "$pclinux" = 1 ]
    782765
    783766    else # of if [ $ioipsl = 1 ]
    784         if [ ${hostname:0:5} = jean- ] ; then
    785             cd $MODEL/modipsl
    786             cd util
     767        if [ ${hostname:0:5} = jean- ] ; then
     768            cd $MODEL/modipsl
     769            cd util
    787770            if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then
    788                 echo 'Warning jean-zay not in AA_make.gdef'
    789                 echo 'Think about updating'
    790                 exit 1
     771                echo 'Warning jean-zay not in AA_make.gdef'
     772                echo 'Think about updating'
     773                exit 1
    791774            fi
    792775            ./ins_make $o_ins_make
    793             # Compile IOIPSL on jean-zay
     776            # Compile IOIPSL on jean-zay
    794777            cd $MODEL/modipsl/modeles/IOIPSL/src
    795778            gmake > ioipsl.log
     
    797780            gmake > ioipsl.log
    798781
    799         fi
    800         echo install_lmdz.sh ioipsl_OK `date`
     782        fi
     783        echo install_lmdz.sh ioipsl_OK `date`
    801784    fi # of if [ $ioipsl = 1 ]
    802785fi
     
    816799    chmod u=rwx install_xios.bash
    817800    if [ ${hostname:0:5} = jean- ] ; then
    818         svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 \
    819             XIOS
    820         cd XIOS/arch
    821         svn update
    822         cd ..
    823         echo "Compiling XIOS, start" `date` \
    824              "(it takes about 20 min on Jean-Zay)"
    825         echo "log file: $xioslog"
    826         ./make_xios --prod --arch $arch --job 4 > xios.log 2>&1
     801        svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 \
     802            XIOS
     803        cd XIOS/arch
     804        svn update
     805        cd ..
     806        echo "Compiling XIOS, start" `date` \
     807             "(it takes about 20 min on Jean-Zay)"
     808        echo "log file: $xioslog"
     809        ./make_xios --prod --arch $arch --job 4 > xios.log 2>&1
    827810    else
    828         ./install_xios.bash -prefix $MODEL/modipsl/modeles \
    829                             -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \
    830                             -MPI $root_mpi -arch $arch > xios.log 2>&1
     811        ./install_xios.bash -prefix $MODEL/modipsl/modeles \
     812                            -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \
     813                            -MPI $root_mpi -arch $arch > xios.log 2>&1
    831814    fi # of case Jean-Zay
    832815    if [ -f XIOS/lib/libxios.a ] ; then
    833         echo "XIOS library successfully generated"
    834         echo install_lmdz.sh XIOS_OK `date`
     816        echo "XIOS library successfully generated"
     817        echo install_lmdz.sh XIOS_OK `date`
    835818    fi
    836819fi
     
    842825    set +e ; svn upgrade ; set -e
    843826    if [ "$veget" = "CMIP6" ] ; then
    844         veget_version=orchidee2.0
    845         orchidee_rev=6592
     827        veget_version=orchidee2.0
     828        orchidee_rev=6592
    846829    else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches
    847         veget_version=orchidee2.1
    848         orchidee_rev=$veget
    849         if [ $veget -lt 4465 ] ; then
    850             echo 'Stopping, ORCHIDEE version too old, script needs work on ' \
    851                 'the CPP flags to pass to makelmdz'
    852             exit 1
    853         fi
    854         set +e
    855         # which branch is my version on?
    856         orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'`
    857         # switch to that branch
    858         echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at \
    859              orchidee-help@listes.ipsl.fr
    860         svn switch -r $veget --accept theirs-full \
    861             svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch
    862         svn log -r $veget | grep  $veget
    863         if [  $? -gt 0 ] ; then
     830        veget_version=orchidee2.1
     831        orchidee_rev=$veget
     832        if [ $veget -lt 4465 ] ; then
     833            echo 'Stopping, ORCHIDEE version too old, script needs work on ' \
     834                'the CPP flags to pass to makelmdz'
     835            exit 1
     836        fi
     837        set +e
     838        # which branch is my version on?
     839        orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'`
     840        # switch to that branch
     841        echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at \
     842             orchidee-help@listes.ipsl.fr
     843        svn switch -r $veget --accept theirs-full \
     844            svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch
     845        svn log -r $veget | grep  $veget
     846        if [  $? -gt 0 ] ; then
    864847            echo 'Cannot update ORCHIDEE as not on the right branch for ' \
    865                 'ORCHIDEE'
     848                'ORCHIDEE'
    866849            exit
    867         fi
    868         set -e
    869         set +e ; svn update -r $veget ; set -e
     850        fi
     851        set -e
     852        set +e ; svn update -r $veget ; set -e
    870853    fi
    871854    # Correctif suite debug Jean-Zay
    872855    sed -i -e 's/9010  FORMAT(A52,F17.14)/9010  FORMAT(A52,F20.14)/' \
    873         src_stomate/stomate.f90
     856        src_stomate/stomate.f90
    874857    opt_orc="-prod" ; if [ "$optim" = "-debug" ] ; then opt_orc="-debug" ; fi
    875858
     
    884867    xios_orchid="-noxios"
    885868    if [ "$with_xios" = "y" ] ; then
    886         xios_orchid="-xios"
     869        xios_orchid="-xios"
    887870    fi
    888871    if [ -d tools ] ; then
    889         ###################################################################
    890         # Pour les experts qui voudraient changer de version d'orchidee.
    891         # Attention : necessite d'avoir le password pour orchidee
    892 
    893         # Correctif suite debug Jean-Zay
    894         if [ -f src_global/time.f90 ] ; then
    895             sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90
    896         fi
    897         ###################################################################
    898         if [ "$veget_version" == "false" ] ; then
    899             veget_version=orchidee2.0
    900         fi
    901         cd arch
    902         sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
    903             -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
    904             -e s:"%FPP_FLAGS       .*.$":"%FPP_FLAGS           $fpp_flags":1 \
    905             -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
    906             -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
    907             -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
    908             -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
    909             -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
    910             -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
    911             arch-gfortran.fcm > arch-local.fcm
    912         echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \
    913              > arch-local.path
    914         echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path
    915         echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path
    916         echo "IOIPSL_LIBDIR=$ORCHPATH/../../lib" >> arch-local.path
    917         echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path
    918         echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path
    919         cd ../
    920 
    921         echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none \
    922              -arch $arch
    923         ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel none \
    924                            -arch $arch > $orchideelog 2>&1
    925         pwd
     872        ###################################################################
     873        # Pour les experts qui voudraient changer de version d'orchidee.
     874        # Attention : necessite d'avoir le password pour orchidee
     875
     876        # Correctif suite debug Jean-Zay
     877        if [ -f src_global/time.f90 ] ; then
     878            sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90
     879        fi
     880        ###################################################################
     881        if [ "$veget_version" == "false" ] ; then
     882            veget_version=orchidee2.0
     883        fi
     884        cd arch
     885        sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
     886            -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
     887            -e s:"%FPP_FLAGS       .*.$":"%FPP_FLAGS           $fpp_flags":1 \
     888            -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
     889            -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
     890            -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
     891            -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
     892            -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
     893            -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
     894            arch-gfortran.fcm > arch-local.fcm
     895        echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \
     896             > arch-local.path
     897        echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path
     898        echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path
     899        echo "IOIPSL_LIBDIR=$ORCHPATH/../../lib" >> arch-local.path
     900        echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path
     901        echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path
     902        cd ../
     903
     904        echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none \
     905             -arch $arch
     906        ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel none \
     907                           -arch $arch > $orchideelog 2>&1
     908        pwd
    926909    else # of "if [ -d tools ]"
    927         if [ -d src_parallel ] ; then
    928             liste_src="parallel parameters global stomate sechiba driver"
    929             if [ "$veget_version" == "false" ] ; then
    930                 veget_version=orchidee2.0
    931             fi
    932         fi
    933         for d in $liste_src ; do
    934             src_d=src_$d
    935             echo src_d $src_d
    936             echo ls ; ls
    937             if [ ! -d $src_d ] ; then
    938                 echo Problem orchidee : no $src_d ; exit
    939             fi
    940             cd $src_d ; \rm -f *.mod make ; $make clean
    941             $make > $orchideelog 2>&1
    942             if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
    943                 cp -f *.mod ../../../lib
    944             fi
    945             cd ..
    946         done
     910        if [ -d src_parallel ] ; then
     911            liste_src="parallel parameters global stomate sechiba driver"
     912            if [ "$veget_version" == "false" ] ; then
     913                veget_version=orchidee2.0
     914            fi
     915        fi
     916        for d in $liste_src ; do
     917            src_d=src_$d
     918            echo src_d $src_d
     919            echo ls ; ls
     920            if [ ! -d $src_d ] ; then
     921                echo Problem orchidee : no $src_d ; exit
     922            fi
     923            cd $src_d ; \rm -f *.mod make ; $make clean
     924            $make > $orchideelog 2>&1
     925            if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
     926                cp -f *.mod ../../../lib
     927            fi
     928            cd ..
     929        done
    947930    fi # of "if [ -d tools ]"
    948931    echo install_lmdz.sh orchidee_compil_seq_OK `date`
     
    974957    # arch-local.path file
    975958    echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \
    976         > arch-local.path
     959        > arch-local.path
    977960    echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
    978961    echo 'NETCDF95_INCDIR=$LMDGCM/../../include' >> arch-local.path
     
    986969
    987970    if [ $pcmac == 1 ] ; then
    988         BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib"
     971        BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib"
    989972    else
    990         BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib"
     973        BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib"
    991974    fi
    992975    # Arch-local.fcm file (adapted from arch-linux-32bit.fcm)
     
    994977    if [ $real = r8 ] ; then FPP_DEF=NC_DOUBLE ; else FPP_DEF="" ; fi
    995978    sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
    996         -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
    997         -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
    998         -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
    999         -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
    1000         -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
    1001         -e s:"%FPP_DEF         .*.$":"%FPP_DEF             $FPP_DEF":1 \
    1002         -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
    1003         -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
    1004         arch-linux-32bit.fcm > arch-local.fcm
     979        -e s:"%LINK            .*.$":"%LINK                $compiler":1 \
     980        -e s:"%PROD_FFLAGS     .*.$":"%PROD_FFLAGS         $OPTIM":1 \
     981        -e s:"%DEV_FFLAGS      .*.$":"%DEV_FFLAGS          $OPTDEV":1 \
     982        -e s:"%DEBUG_FFLAGS    .*.$":"%DEBUG_FFLAGS        $OPTDEB":1 \
     983        -e s:"%BASE_FFLAGS     .*.$":"%BASE_FFLAGS         $OPTPREC":1 \
     984        -e s:"%FPP_DEF         .*.$":"%FPP_DEF             $FPP_DEF":1 \
     985        -e s:"%BASE_LD         .*.$":"%BASE_LD             $BASE_LD":1 \
     986        -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
     987        arch-linux-32bit.fcm > arch-local.fcm
    1005988
    1006989    cd ..
     
    10261009    if [ $? = 0 ] ; then
    10271010        svn switch --relocate http://svn.lmd.jussieu.fr/LMDZ \
    1028             https://svn.lmd.jussieu.fr/LMDZ
     1011            https://svn.lmd.jussieu.fr/LMDZ
    10291012    fi
    10301013    svn update $svnopt
     
    10521035    oldrad) iflag_rrtm=0 ; NSW=2 ; opt_rad="" ;;
    10531036    rrtm)   iflag_rrtm=1 ; NSW=6
    1054             if [ $mysvn -le 4185 ] ; then
    1055                 opt_rad="-rrtm true"
    1056             else
    1057                 opt_rad="-rad rrtm"
    1058             fi ;;
     1037            if [ $mysvn -le 4185 ] ; then
     1038                opt_rad="-rrtm true"
     1039            else
     1040                opt_rad="-rad rrtm"
     1041            fi ;;
    10591042    ecrad)  iflag_rrtm=2 ; NSW=6 ; opt_rad="-rad ecrad" ;;
    10601043    *) echo Only oldrad rrtm ecrad for rad option ; exit
     
    10781061    cd build
    10791062    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$ncdfdir \
    1080           -DCMAKE_INSTALL_PREFIX=$MODEL/modipsl
     1063          -DCMAKE_INSTALL_PREFIX=$MODEL/modipsl
    10811064    make install
    10821065    cd $MODEL/modipsl/modeles/LMDZ*
     
    11041087    echo Sequential compilation command, saved in compile.sh:
    11051088    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \
    1106         "-d ${grid_resolution} -v $veget_version gcm "
     1089        "-d ${grid_resolution} -v $veget_version gcm "
    11071090    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \
    1108         "-d ${grid_resolution} -v $veget_version gcm " > compile.sh
     1091        "-d ${grid_resolution} -v $veget_version gcm " > compile.sh
    11091092    chmod +x ./compile.sh
    11101093    if [ $bench = 1 ] ; then
    1111         echo install_lmdz.sh start_lmdz_seq_compilation `date`
    1112         echo log file: $lmdzlog
    1113         ./compile.sh > $lmdzlog 2>&1
    1114         echo install_lmdz.sh end_lmdz_seq_compilation `date`
     1094        echo install_lmdz.sh start_lmdz_seq_compilation `date`
     1095        echo log file: $lmdzlog
     1096        ./compile.sh > $lmdzlog 2>&1
     1097        echo install_lmdz.sh end_lmdz_seq_compilation `date`
    11151098    fi
    11161099fi # fin sequential
     
    11311114    cd $ORCHPATH
    11321115    if [ -d src_parallel -a $veget != 'NONE' ] ; then
    1133         cd arch
    1134         sed  \
    1135             -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
    1136             -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
    1137             -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
    1138             -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
    1139             -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
    1140             -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
    1141             arch-local.fcm > tmp.fcm
    1142 
    1143         mv tmp.fcm arch-local.fcm
    1144         cd ../
    1145         echo Compiling ORCHIDEE in parallel mode `date`
    1146         echo logfile $orchideelog
    1147         echo "NOTE : to recompile it when necessary, use ./compile_orc.sh " \
    1148              "in modipsl/modeles/ORCHIDEE"
    1149         echo ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
    1150              -parallel $parallel -arch $arch > compile_orc.sh
    1151         echo ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc \
    1152              -parallel $parallel -arch $arch >> compile_orc.sh
    1153         echo echo Now you must also recompile LMDZ, by running ./compile.sh \
    1154              in modeles/LMDZ >> compile_orc.sh
    1155         chmod u+x compile_orc.sh
    1156         ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
    1157                            -parallel $parallel -arch $arch > $orchideelog 2>&1
    1158         ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel \
    1159                            -arch $arch >> $orchideelog 2>&1
    1160         echo End of ORCHIDEE compilation in parallel mode `date`
     1116        cd arch
     1117        sed  \
     1118            -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
     1119            -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
     1120            -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
     1121            -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
     1122            -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
     1123            -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
     1124            arch-local.fcm > tmp.fcm
     1125
     1126        mv tmp.fcm arch-local.fcm
     1127        cd ../
     1128        echo Compiling ORCHIDEE in parallel mode `date`
     1129        echo logfile $orchideelog
     1130        echo "NOTE : to recompile it when necessary, use ./compile_orc.sh " \
     1131             "in modipsl/modeles/ORCHIDEE"
     1132        echo ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
     1133             -parallel $parallel -arch $arch > compile_orc.sh
     1134        echo ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc \
     1135             -parallel $parallel -arch $arch >> compile_orc.sh
     1136        echo echo Now you must also recompile LMDZ, by running ./compile.sh \
     1137             in modeles/LMDZ >> compile_orc.sh
     1138        chmod u+x compile_orc.sh
     1139        ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
     1140                           -parallel $parallel -arch $arch > $orchideelog 2>&1
     1141        ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel \
     1142                           -arch $arch >> $orchideelog 2>&1
     1143        echo End of ORCHIDEE compilation in parallel mode `date`
    11611144    elif [ $veget != 'NONE' ] ; then
    1162         echo '##########################################################'
    1163         echo ' Orchidee version too old                                 '
    1164         echo ' Please update to new version                             '
    1165         echo '##########################################################'
    1166         exit
     1145        echo '##########################################################'
     1146        echo ' Orchidee version too old                                 '
     1147        echo ' Please update to new version                             '
     1148        echo '##########################################################'
     1149        exit
    11671150    fi # of [ -d src_parallel -a $veget != 'NONE' ]
    11681151
     
    11701153    cd $LMDZPATH
    11711154    if [ $arch = local ] ; then
    1172         cd arch
    1173         sed -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
    1174             -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
    1175             -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
    1176             -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
    1177             -e s:"%ARFLAGS.*.$":"%ARFLAGS          $ARFLAGS":1 \
    1178             -e s@"%BASE_LD.*.$"@"%BASE_LD             -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \
    1179             -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
    1180             -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
    1181             arch-local.fcm > tmp.fcm
    1182         mv tmp.fcm arch-local.fcm
    1183         cd ../
     1155        cd arch
     1156        sed -e s:"%COMPILER.*.$":"%COMPILER            $par_comp":1 \
     1157            -e s:"%LINK.*.$":"%LINK                $par_comp":1 \
     1158            -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS          $MPI_FLAGS":1 \
     1159            -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS          $OMP_FLAGS":1 \
     1160            -e s:"%ARFLAGS.*.$":"%ARFLAGS          $ARFLAGS":1 \
     1161            -e s@"%BASE_LD.*.$"@"%BASE_LD             -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \
     1162            -e s:"%MPI_LD.*.$":"%MPI_LD              $MPI_LD":1 \
     1163            -e s:"%OMP_LD.*.$":"%OMP_LD              $OMP_LD":1 \
     1164            arch-local.fcm > tmp.fcm
     1165        mv tmp.fcm arch-local.fcm
     1166        cd ../
    11841167    fi
    11851168    rm -f compile.sh
     
    11871170    if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then
    11881171
    1189         echo LMDZ compilation command in parallel mode, saved in compile.sh, \
    1190              is :
    1191         echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod " \
    1192              "n est pas corrige ! )"
    1193         # ATTENTION le probleme de cospv2 sur jean-zay en mode prod n
    1194         # est pas corrige
    1195         echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
    1196              $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
    1197              -parallel $parallel gcm >> compile.sh
    1198         echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
    1199              $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
    1200              -parallel $parallel gcm
     1172        echo LMDZ compilation command in parallel mode, saved in compile.sh, \
     1173             is :
     1174        echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod " \
     1175             "n est pas corrige ! )"
     1176        # ATTENTION le probleme de cospv2 sur jean-zay en mode prod n
     1177        # est pas corrige
     1178        echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
     1179             $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
     1180             -parallel $parallel gcm >> compile.sh
     1181        echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
     1182             $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
     1183             -parallel $parallel gcm
    12011184    else
    1202         echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
    1203              $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
    1204              -parallel $parallel gcm >> compile.sh
    1205         echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
    1206              $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
    1207              -parallel $parallel gcm
     1185        echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
     1186             $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
     1187             -parallel $parallel gcm >> compile.sh
     1188        echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
     1189             $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
     1190             -parallel $parallel gcm
    12081191    fi
    12091192    chmod +x ./compile.sh
    12101193
    12111194    if [ $bench = 1 ] ; then
    1212         echo Compiling LMDZ in parallel mode `date`,  LMDZ log file: $lmdzlog
    1213         ./compile.sh > $lmdzlog 2>&1
     1195        echo Compiling LMDZ in parallel mode `date`,  LMDZ log file: $lmdzlog
     1196        ./compile.sh > $lmdzlog 2>&1
    12141197    fi
    12151198
     
    12331216if [ "$gcm" = "" ] ; then
    12341217    if [ $bench = 1 ] ; then
    1235         echo 'Compilation failed !! Cannot run the benchmark;'
    1236         exit
     1218        echo 'Compilation failed !! Cannot run the benchmark;'
     1219        exit
    12371220    else
    1238         echo 'Compilation not done (only done when bench=1)'
     1221        echo 'Compilation not done (only done when bench=1)'
    12391222    fi
    12401223else
     
    12701253
    12711254    if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
    1272         cd BENCH${grid_resolution}
    1273         # copier les fichiers namelist input et output our COSP
    1274         cp ../DefLists/cosp*_input_nl.txt .
    1275         cp ../DefLists/cosp*_output_nl.txt .
    1276         # Activer la cles ok_cosp pour tourner avec COSP
    1277         sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp
    1278         \mv -f tmp config.def
    1279         cd ..
     1255        cd BENCH${grid_resolution}
     1256        # copier les fichiers namelist input et output our COSP
     1257        cp ../DefLists/cosp*_input_nl.txt .
     1258        cp ../DefLists/cosp*_output_nl.txt .
     1259        # Activer la cles ok_cosp pour tourner avec COSP
     1260        sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp
     1261        \mv -f tmp config.def
     1262        cd ..
    12801263    fi
    12811264
    12821265    if [ -n "$physiq" ]; then
    1283         cd BENCH${grid_resolution}
    1284         if [ -f physiq.def_${physiq} ]; then
    1285             cp physiq.def_${physiq} physiq.def
    1286             echo using physiq.def_${physiq}
    1287         else
    1288             echo using standard physiq.def
    1289         fi
    1290         cd ..
     1266        cd BENCH${grid_resolution}
     1267        if [ -f physiq.def_${physiq} ]; then
     1268            cp physiq.def_${physiq} physiq.def
     1269            echo using physiq.def_${physiq}
     1270        else
     1271            echo using standard physiq.def
     1272        fi
     1273        cd ..
    12911274    else
    1292         echo using standard physiq.def
     1275        echo using standard physiq.def
    12931276    fi
    12941277
    12951278    if [ "$with_xios" = "y" ] ; then
    1296         cd BENCH${grid_resolution}
    1297         cp ../DefLists/iodef.xml .
    1298         cp ../DefLists/context_lmdz.xml .
    1299         cp ../DefLists/field_def_lmdz.xml .
    1300         # A raffiner par la suite
    1301         echo A FAIRE : Copier les *xml en fonction de l option cosp
    1302         cp ../DefLists/field_def_cosp*.xml .
    1303         cp ../DefLists/file_def_hist*xml .
    1304         # adapt iodef.xml to use attached mode
    1305         sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' \
    1306             iodef.xml > tmp
    1307         \mv -f tmp iodef.xml
    1308 
    1309         # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
    1310         # except for histday
    1311         for histfile in file_def_hist*xml
    1312         do
    1313             if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then
    1314                 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' \
    1315                     $histfile > tmp
    1316                 \mv -f tmp $histfile
    1317                 sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile \
    1318                     > tmp
    1319                 \mv -f tmp $histfile
    1320                 sed -e 's@compression_level="2"@compression_level="0"@' \
    1321                     $histfile > tmp
    1322                 \mv -f tmp $histfile
    1323             else
    1324                 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
    1325                     $histfile > tmp
    1326                 \mv -f tmp $histfile
    1327             fi
    1328         done
    1329         # and add option "ok_all_xml=y" in config.def
    1330         echo "### XIOS outputs" >> config.def
    1331         echo 'ok_all_xml=.true.' >> config.def
    1332 
    1333         #activer les sorties pour Cosp
    1334         if [ "$cosp" = "v1" ] ; then
    1335             histfile=file_def_histdayCOSP_lmdz.xml
    1336             sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp
    1337             \mv -f tmp $histfile
    1338             sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp
    1339             \mv -f tmp $histfile
    1340             sed -e 's@compression_level="2"@compression_level="0"@' \
    1341                 $histfile > tmp
    1342             \mv -f tmp $histfile
    1343         fi
    1344         if [ "$cosp" = "v2" ] ; then
    1345             histfile=file_def_histdayCOSPv2_lmdz.xml
    1346             sed -e 's@compression_level="2"@compression_level="0"@' \
    1347                 $histfile > tmp
    1348             \mv -f tmp $histfile
    1349             contextfile=context_lmdz.xml
    1350             sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' \
    1351                 $contextfile > tmp
    1352             \mv -f tmp $contextfile
    1353             sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' \
    1354                 $contextfile > tmp
    1355             \mv -f tmp $contextfile
    1356             sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' \
    1357                 $contextfile > tmp
    1358             \mv -f tmp $contextfile
    1359             fieldfile=field_def_lmdz.xml
    1360             sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile \
    1361                 > tmp
    1362             \mv -f tmp $fieldfile
    1363         fi
    1364 
    1365         cd ..
     1279        cd BENCH${grid_resolution}
     1280        cp ../DefLists/iodef.xml .
     1281        cp ../DefLists/context_lmdz.xml .
     1282        cp ../DefLists/field_def_lmdz.xml .
     1283        # A raffiner par la suite
     1284        echo A FAIRE : Copier les *xml en fonction de l option cosp
     1285        cp ../DefLists/field_def_cosp*.xml .
     1286        cp ../DefLists/file_def_hist*xml .
     1287        # adapt iodef.xml to use attached mode
     1288        sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' \
     1289            iodef.xml > tmp
     1290        \mv -f tmp iodef.xml
     1291
     1292        # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
     1293        # except for histday
     1294        for histfile in file_def_hist*xml
     1295        do
     1296            if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then
     1297                sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' \
     1298                    $histfile > tmp
     1299                \mv -f tmp $histfile
     1300                sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile \
     1301                    > tmp
     1302                \mv -f tmp $histfile
     1303                sed -e 's@compression_level="2"@compression_level="0"@' \
     1304                    $histfile > tmp
     1305                \mv -f tmp $histfile
     1306            else
     1307                sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
     1308                    $histfile > tmp
     1309                \mv -f tmp $histfile
     1310            fi
     1311        done
     1312        # and add option "ok_all_xml=y" in config.def
     1313        echo "### XIOS outputs" >> config.def
     1314        echo 'ok_all_xml=.true.' >> config.def
     1315
     1316        #activer les sorties pour Cosp
     1317        if [ "$cosp" = "v1" ] ; then
     1318            histfile=file_def_histdayCOSP_lmdz.xml
     1319            sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp
     1320            \mv -f tmp $histfile
     1321            sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp
     1322            \mv -f tmp $histfile
     1323            sed -e 's@compression_level="2"@compression_level="0"@' \
     1324                $histfile > tmp
     1325            \mv -f tmp $histfile
     1326        fi
     1327        if [ "$cosp" = "v2" ] ; then
     1328            histfile=file_def_histdayCOSPv2_lmdz.xml
     1329            sed -e 's@compression_level="2"@compression_level="0"@' \
     1330                $histfile > tmp
     1331            \mv -f tmp $histfile
     1332            contextfile=context_lmdz.xml
     1333            sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' \
     1334                $contextfile > tmp
     1335            \mv -f tmp $contextfile
     1336            sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' \
     1337                $contextfile > tmp
     1338            \mv -f tmp $contextfile
     1339            sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' \
     1340                $contextfile > tmp
     1341            \mv -f tmp $contextfile
     1342            fieldfile=field_def_lmdz.xml
     1343            sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile \
     1344                > tmp
     1345            \mv -f tmp $fieldfile
     1346        fi
     1347
     1348        cd ..
    13661349    fi
    13671350
    13681351    # Cas Bensh avec ecrad
    13691352    if [ "$rad" = "ecrad" ] ; then
    1370         cd BENCH${grid_resolution}
    1371         cp  ../DefLists/namelist_ecrad .
    1372         cp -r ../libf/phylmd/ecrad/data .
    1373         cd ..
     1353        cd BENCH${grid_resolution}
     1354        cp  ../DefLists/namelist_ecrad .
     1355        cp -r ../libf/phylmd/ecrad/data .
     1356        cd ..
    13741357    fi
    13751358
     
    13771360    cd BENCH${grid_resolution}
    13781361    sed -e 's/iflag_rrtm=.*.$/iflag_rrtm='$iflag_rrtm'/' \
    1379         -e 's/NSW=.*.$/NSW='$NSW'/' physiq.def > tmpdef
     1362        -e 's/NSW=.*.$/NSW='$NSW'/' physiq.def > tmpdef
    13801363    \mv tmpdef physiq.def
    13811364    cd ..
     
    13881371
    13891372    if [ "$grid_resolution" = "48x36x39" ] ; then
    1390         echo On ne touche pas au bench.sh
    1391         # But we have to adapt "run_local.sh" for $mpirun
    1392         sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp
    1393         mv -f tmp run_local.sh
    1394         chmod u=rwx run_local.sh
     1373        echo On ne touche pas au bench.sh
     1374        # But we have to adapt "run_local.sh" for $mpirun
     1375        sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp
     1376        mv -f tmp run_local.sh
     1377        chmod u=rwx run_local.sh
    13951378    elif [ "${parallel:0:3}" = "mpi" ] ; then
    1396         # Lancement avec deux procs mpi et 2 openMP
    1397         echo "export OMP_STACKSIZE=800M" > bench.sh
    1398         if [ "${parallel:4:3}" = "omp" ] ; then
     1379        # Lancement avec deux procs mpi et 2 openMP
     1380        echo "export OMP_STACKSIZE=800M" > bench.sh
     1381        if [ "${parallel:4:3}" = "omp" ] ; then
    13991382            echo "export OMP_NUM_THREADS=2" >> bench.sh
    1400         fi
    1401         if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
     1383        fi
     1384        if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then
    14021385            if [ ${hostname:0:5} = jean- ] ; then
    1403                 chmod +x ../arch.env
    1404                 ../arch.env     
    1405                 echo "ulimit -s 2000000" >> bench.sh
     1386                   chmod +x ../arch.env
     1387                ../arch.env       
     1388                echo "ulimit -s 2000000" >> bench.sh
    14061389            else
    1407                 echo "ulimit -s 200000" >> bench.sh
    1408             fi 
    1409         else
     1390                echo "ulimit -s 200000" >> bench.sh
     1391            fi       
     1392        else
    14101393            echo "ulimit -s unlimited" >> bench.sh
    1411         fi
    1412         if [ ${hostname:0:5} = jean- ] ; then
     1394        fi
     1395        if [ ${hostname:0:5} = jean- ] ; then
    14131396            . ../arch/arch-${arch}.env
    14141397            echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing  2>&1" \
    1415                 >> bench.sh
    1416         else
     1398                >> bench.sh
     1399        else
    14171400            echo "$mpirun -np 2 gcm.e > listing  2>&1" >> bench.sh
    1418         fi
    1419         # Add rebuild, using reb.sh if it is there
    1420         echo 'if [ -f reb.sh ] ; then' >> bench.sh
    1421         echo '  ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ' \
    1422              './reb.sh histins ; ./reb.sh stomate_history ; ' \
    1423              './reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh
    1424         echo 'fi' >> bench.sh
     1401        fi
     1402        # Add rebuild, using reb.sh if it is there
     1403        echo 'if [ -f reb.sh ] ; then' >> bench.sh
     1404        echo '  ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ' \
     1405             './reb.sh histins ; ./reb.sh stomate_history ; ' \
     1406             './reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh
     1407        echo 'fi' >> bench.sh
    14251408    else
    1426         echo "./gcm.e > listing  2>&1" > bench.sh
     1409        echo "./gcm.e > listing  2>&1" > bench.sh
    14271410    fi
    14281411    # Getting orchidee stuff
    14291412    if [ $veget == 'CMIP6' ] ; then
    1430         #echo 'myget 3DBenchs/BENCHorch11.tar.gz'
    1431         #myget 3DBenchs/BENCHorch11.tar.gz
    1432         #tar xvzf BENCHorch11.tar.gz
    1433         echo 'myget 3DBenchs/BENCHCMIP6.tar.gz'
    1434         myget 3DBenchs/BENCHCMIP6.tar.gz
    1435         tar xvzf BENCHCMIP6.tar.gz
    1436         sed -e "s:VEGET=n:VEGET=y:" config.def > tmp
    1437         mv -f tmp config.def
    1438         if [ "$with_xios" = "y" ] ; then
     1413        #echo 'myget 3DBenchs/BENCHorch11.tar.gz'
     1414        #myget 3DBenchs/BENCHorch11.tar.gz
     1415        #tar xvzf BENCHorch11.tar.gz
     1416        echo 'myget 3DBenchs/BENCHCMIP6.tar.gz'
     1417        myget 3DBenchs/BENCHCMIP6.tar.gz
     1418        tar xvzf BENCHCMIP6.tar.gz
     1419        sed -e "s:VEGET=n:VEGET=y:" config.def > tmp
     1420        mv -f tmp config.def
     1421        if [ "$with_xios" = "y" ] ; then
    14391422            cp ../../ORCHIDEE/src_xml/context_orchidee.xml .
    14401423            echo '<context id="orchidee" src="./context_orchidee.xml"/>' \
    1441                 > add.tmp
     1424                > add.tmp
    14421425            cp ../../ORCHIDEE/src_xml/field_def_orchidee.xml .
    14431426            cp ../../ORCHIDEE/src_xml/file_def_orchidee.xml .
    14441427            cp ../../ORCHIDEE/src_xml/file_def_input_orchidee.xml .
    14451428            if [ -f ../../ORCHIDEE/src_xml/context_input_orchidee.xml ] ; then
    1446                 cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml .
    1447                 echo '<context id="orchidee" ' \
    1448                      'src="./context_input_orchidee.xml"/>' >> add.tmp
     1429                   cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml .
     1430                   echo '<context id="orchidee" ' \
     1431                     'src="./context_input_orchidee.xml"/>' >> add.tmp
    14491432            fi
    14501433            sed -e '/id="LMDZ"/r add.tmp' iodef.xml > tmp
    14511434            mv tmp iodef.xml
    14521435            sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' \
    1453                 file_def_orchidee.xml > tmp
    1454             \mv -f tmp file_def_orchidee.xml
     1436                file_def_orchidee.xml > tmp
     1437            \mv -f tmp file_def_orchidee.xml
    14551438            sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
    1456                 file_def_orchidee.xml > tmp
    1457             \mv -f tmp file_def_orchidee.xml
     1439                file_def_orchidee.xml > tmp
     1440            \mv -f tmp file_def_orchidee.xml
    14581441            sed -e 's@output_level="_AUTO_"@output_level="1"@' \
    1459                 file_def_orchidee.xml > tmp
    1460             \mv -f tmp file_def_orchidee.xml
     1442                file_def_orchidee.xml > tmp
     1443            \mv -f tmp file_def_orchidee.xml
    14611444            sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' \
    1462                 file_def_orchidee.xml > tmp
    1463             \mv -f tmp file_def_orchidee.xml
     1445                file_def_orchidee.xml > tmp
     1446            \mv -f tmp file_def_orchidee.xml
    14641447            sed -e 's@compression_level="4"@compression_level="0"@' \
    1465                 file_def_orchidee.xml > tmp
    1466             \mv -f tmp file_def_orchidee.xml
     1448                file_def_orchidee.xml > tmp
     1449            \mv -f tmp file_def_orchidee.xml
    14671450            sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' \
    1468                 orchidee.def > tmp
    1469             \mv -f tmp orchidee.def
    1470         fi
     1451                orchidee.def > tmp
     1452            \mv -f tmp orchidee.def
     1453        fi
    14711454    fi
    14721455
    14731456    if [[ -f ../arch.env ]]
    14741457    then
    1475         source ../arch.env
     1458        source ../arch.env
    14761459    fi
    14771460
     
    14881471    cat ../compile.sh
    14891472    if [ $parallel = "none" ] ; then
    1490         echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
    1491         echo 'or ./bench.sh'
     1473        echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e'
     1474        echo 'or ./bench.sh'
    14921475    else
    1493         echo 'You may re-run it with : '
    1494         echo 'cd ' `pwd` '; ./bench.sh'
    1495         #  echo 'ulimit -s unlimited'
    1496         #  echo 'export OMP_NUM_THREADS=2'
    1497         #  echo 'export OMP_STACKSIZE=800M'
    1498         #  echo "$mpirun -np 2 gcm.e "
     1476        echo 'You may re-run it with : '
     1477        echo 'cd ' `pwd` '; ./bench.sh'
     1478        #  echo 'ulimit -s unlimited'
     1479        #  echo 'export OMP_NUM_THREADS=2'
     1480        #  echo 'export OMP_STACKSIZE=800M'
     1481        #  echo "$mpirun -np 2 gcm.e "
    14991482    fi
    15001483    echo '##########################################################'
Note: See TracChangeset for help on using the changeset viewer.