Changeset 4914


Ignore:
Timestamp:
Apr 22, 2024, 2:53:30 PM (7 months ago)
Author:
abarral
Message:

Move fetching orch and lmdz earlier in the code
Allow lmdz version switch
Add check for lmdz version if orch in parallel
Remove explicit pgf90/ifort support
Add lmdz version to tests

Location:
BOL/script_install_amaury
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/install_lmdz.sh

    r4909 r4914  
    2626# minimal configuration.
    2727#
    28 # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ...
     28# Prerequisites : gfortran, bash or ksh, wget, gunzip, tar, ...
    2929#
    3030# Modif 18/11/2011
     
    5050function set_default_params {
    5151    # Valeur par défaut des parametres
    52     svn=""
     52    svn_lmdz=""
    5353    version="20231022.trunk"
    5454
     
    108108        -v       "version" like 20150828.trunk, see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk (default <$version>)
    109109
    110         -r       "svn_release" : either the svn release number or "last" (default <$svn>)
     110        -r       "svn_release" : either the svn release number or "last" (default <$svn_lmdz>)
    111111
    112112        -parallel parallel support: mpi, omp, mpi_omp (mpi with openMP) or none (default: <$parallel>)
     
    147147                  exit 1;;
    148148            "-v") version=$2; shift; shift;;
    149             "-r") svn=$2; shift; shift;;
     149            "-r") svn_lmdz=$2; shift; shift;;
    150150            "-d") grid_resolution=$2; shift; shift;;
    151151            "-unstable"|"-testing") trusting=$(echo "$1" | cut -c2-); shift;;
     
    211211
    212212    #Chemin pour placer le modele
    213     if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn$optim_debug"; fi
     213    if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn_lmdz$optim_debug"; fi
    214214
    215215    ## if also compiling XIOS, parallel must be mpi_omp
     
    350350
    351351        # Convert non-basic compiler
    352         case $compiler in  # TODO test with pgf90
    353             mpif90) ncdf_compiler=$($compiler 2> <(head -n 1 | cut -f 1 -d ":"))
     352        case $compiler in
     353            mpif90) ncdf_compiler=$($compiler 2>&1 >/dev/null | head -n 1 | cut -f 1 -d ":")
    354354        esac
    355355
    356356        case $ncdf_compiler in
    357357            gfortran) opt1="-compiler gnu"; opt2="-CC gcc -FC gfortran -CXX g++";;
    358             ifort)  opt1="-compiler intel"; opt2="-CC icc -FC ifort -CXX icpc";;
    359             pgf90)  opt1="-compiler pgf90"; opt2="-CC pgcc -FC pgf90 -CXX pgCC";;
    360358            *)      echo "unexpected compiler $ncdf_compiler for netcdf"; exit 1
    361359        esac
     
    505503    if [[ -n $fetch_rev ]]; then
    506504        echo "Fetching orch $fetch_rev from the repository"
    507         orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$fetch_rev" |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}')
     505        orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$fetch_rev" | grep ORCHIDEE | head -1 | sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}')
    508506        echo "branch is $orcbranch"
    509507        if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi
     
    516514        cd -
    517515    fi
     516
     517
     518    # Check parallel LMDZ+ORCH
     519    if [[ (! $veget = "none") && (! $parallel = "none") && ($used_lmdz_rev -lt 4894) ]]; then
     520        echo "LMDZ revision must be >=4894 for orchidee with parallel support"; exit 1
     521    fi
    518522}
    519523
    520524function compile_orchidee {
    521     get_orchidee_version
    522525    install_arch "ORCHIDEE"
    523526
     
    568571    lmdzlog="$(pwd)/lmdz.log"
    569572
    570     set +e
    571     svn upgrade
    572     if [[ $svn = "last" ]]; then
    573         svnopt=""
    574     else
    575         svnopt="-r $svn"
    576     fi
    577     if [[ $svn != "" ]]; then
    578         if svn info | grep -q 'https:'; then svn switch --relocate https://svn.lmd.jussieu.fr/LMDZ http://svn.lmd.jussieu.fr/LMDZ; fi
    579         svn update "$svnopt"
    580     fi
    581     mysvn=$(svnversion . | grep -E -o "[0-9]+" 2>/dev/null)
    582     set -e
    583 
    584     if [[ $mysvn = "" ]]; then mysvn=$(grep 'Revision: [0-9]' "$MODEL"/Read*.md | awk ' { print $2 } ' 2>/dev/null); fi
    585     if [[ $mysvn = "" ]]; then mysvn=4190; fi
     573    used_lmdz_rev=$svn_lmdz
     574    if [[ -n $svn_lmdz ]]; then
     575        local lmdzbranch
     576        echo "Fetching LMDZ $svn_lmdz from the repository"
     577        lmdzbranch=$(svn log -v -q https://svn.lmd.jussieu.fr/LMDZ -r "$svn_lmdz" | grep LMDZ | head -1 | sed -e 's:trunk/.*$:trunk:' | awk '{print $2}')
     578        \rm -rf "$MODEL/modipsl/modeles/LMDZ"
     579        cd "$MODEL/modipsl/modeles"
     580        set +e
     581        svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ
     582        set -e
     583        cd -
     584    else  # get svn from info
     585         used_lmdz_rev=$(svn info | grep "Last Changed Rev" | cut -c 19-)
     586    fi
    586587}
    587588
    588589function compile_lmdz {
    589     get_lmdz_version
    590590    install_arch "LMDZ"
     591    cd "$LMDZPATH"
    591592
    592593    exe_name="bin/gcm_${grid_resolution}_phylmd_${rad}${suff_exe}${suff_orc}.e"
     
    596597        oldrad) iflag_rrtm=0; NSW=2; opt_rad="";;
    597598        rrtm)   iflag_rrtm=1; NSW=6
    598             if [[ $mysvn -le 4185 ]]; then
     599            if [[ $used_lmdz_rev -le 4185 ]]; then
    599600                opt_rad="-rrtm true"
    600601            else
     
    604605        *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
    605606    esac
    606     if [[ $mysvn -le 4185 && $rad = "ecrad" ]]; then
     607    if [[ $used_lmdz_rev -le 4185 && $rad = "ecrad" ]]; then
    607608        echo "ecrad only available for LMDZ rev starting with 4186 "; exit 1
    608609    fi
     
    841842init_arch
    842843check_available_software
     844get_lmdz_version
     845get_orchidee_version
    843846install_netcdf
    844847install_IOIPSL
  • BOL/script_install_amaury/test_compils.sh

    r4909 r4914  
    1414        args="$args-parallel"
    1515    fi
    16     args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios"
     16    args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios $lmdzrev"
     17    # trim
     18    args=$(echo "$args" | xargs)
    1719
    1820    logfile="test_logs/$args.out"
     
    3840    for veget in "none" "orch2.0" "orch2.2"; do
    3941    for xios in "" "-xios"; do
    40         if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
     42    if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
     43    for lmdzrev in "" "-r 4894"; do
    4144        do_one_test
     45    done
    4246    done
    4347    done
Note: See TracChangeset for help on using the changeset viewer.