Changeset 5521


Ignore:
Timestamp:
Feb 3, 2025, 4:45:21 PM (5 hours ago)
Author:
fhourdin
Message:

Gestion des anciens compilo fortran<=v9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install/install_lmdz.sh

    r5407 r5521  
    3838### Functions
    3939
     40#-----------------------------------------------------------------------------
    4041function myget {
     42#-----------------------------------------------------------------------------
    4143  # Get a file from LMDZ repository, make it executable if .(ba)sh
    4244  local url=$1
     
    4951}
    5052
     53#-----------------------------------------------------------------------------
    5154function do_compile_sh {
     55#-----------------------------------------------------------------------------
    5256  local component=$1
    5357  local command=$2
     
    6468}
    6569
     70#-----------------------------------------------------------------------------
    6671function get_svn_branch {
     72#-----------------------------------------------------------------------------
    6773  local url=$1
    6874  local rev=$2
     
    8086}
    8187
     88#-----------------------------------------------------------------------------
    8289function set_default_params {
     90#-----------------------------------------------------------------------------
    8391    # Valeur par défaut des parametres
    8492    svn_lmdz=""
     
    133141}
    134142
     143#-----------------------------------------------------------------------------
    135144function read_cmdline_args {
     145#-----------------------------------------------------------------------------
    136146    while (($# > 0)); do
    137147        case $1 in
     
    312322}
    313323
     324#-----------------------------------------------------------------------------
    314325function ensure_correct_option_combinations {
     326#-----------------------------------------------------------------------------
    315327    # Check on veget version
    316328    if [[ $veget != 'none' && $veget != "CMIP6" && $veget != "orch2.0" && $veget != "orch2.2" ]]; then
     
    354366}
    355367
     368#-----------------------------------------------------------------------------
    356369function check_available_software {
     370#-----------------------------------------------------------------------------
    357371    local required_soft=("wget" "tar" "gzip" "make" "gcc" "cmake" "m4" "c++")
    358372    echo "Checking if required software is available (${required_soft[*]})"
     
    364378}
    365379
     380#-----------------------------------------------------------------------------
    366381function download_modipsl_tar {
     382#-----------------------------------------------------------------------------
    367383    if [[ $clean_install = 1 && -d $MODEL ]]; then
    368384      local ans
     
    393409}
    394410
     411#-----------------------------------------------------------------------------
    395412function init_arch {
     413#-----------------------------------------------------------------------------
    396414    cd "$local"
    397415    set +e; arch_dir=$(readlink -f "$arch_dir"); set -e  # full path. readlink must be called *after* the path is created
     
    410428      fi
    411429    done
     430
    412431    default_fcm_path=$fcm_path
    413432    default_path_path=$path_path
     
    416435    # check compiler
    417436    compiler=$(< "$default_fcm_path" grep "%COMPILER" | sed -e "s/%COMPILER\s*//")
     437
     438    # ------------------------------------------------------------------------------------------
     439    # Specific problem with fortran version changes
     440    # Introduit le 1er fevrier 2025 par FH. A retravailler
     441    # Could be generaized to download a arch tar file if the arch is not available in the current
     442    # distribution of LMDZ
     443    # ------------------------------------------------------------------------------------------
     444    echo QUOI $compiler
     445    if [ $compiler = gfortran -o $compiler = mpif90 ] ; then
     446       echo QUOI on est la
     447       if [ $( gfortran --version | head -1  | awk ' { print $NF } ' | cut -d. -f1 ) -le 9 ] ; then
     448          echo QUOI faire qqchose
     449          arch_dir=$PWD/arch
     450          if [ $parallel = none ] ; then
     451             arch=local-gfortran9
     452          else
     453             arch=local-gfortran9-parallel
     454          fi
     455          if [ ! -f $arch_dir/arch-local-gfortran9.fcm ] ; then
     456             wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/LMDZ/arch-local-gfortran9.tar
     457             tar xvf arch-local-gfortran9.tar
     458          fi
     459          default_fcm_path=$arch_dir/arch-${arch}.fcm
     460          default_path_path=$arch_dir/arch-${arch}.path
     461          default_env_path=$arch_dir/arch-${arch}.env
     462       fi
     463    fi
     464    # ------------------------------------------------------------------------------------------
    418465
    419466    # load env
     
    431478}
    432479
     480#-----------------------------------------------------------------------------
    433481function check_compiler {
     482#-----------------------------------------------------------------------------
    434483  # Must be called after init_arch to know which compiler to use
    435484    cat <<eod > tt.f90
     
    445494}
    446495
     496#-----------------------------------------------------------------------------
    447497function install_arch {
     498#-----------------------------------------------------------------------------
    448499    local component=$1
    449500
     
    471522}
    472523
     524#-----------------------------------------------------------------------------
    473525function install_netcdf {
     526#-----------------------------------------------------------------------------
    474527    echo "Installing Netcdf"
    475528    local ncdf_compiler="$compiler"
     
    577630}
    578631
     632#-----------------------------------------------------------------------------
    579633function install_IOIPSL {
     634#-----------------------------------------------------------------------------
    580635    install_arch "IOIPSL"
    581636
     
    594649}
    595650
     651#-----------------------------------------------------------------------------
    596652function install_XIOS {
     653#-----------------------------------------------------------------------------
    597654    if [[ $with_xios = 1 ]]; then
    598655        cd "$MODEL/modipsl/modeles"
     
    616673}
    617674
     675#-----------------------------------------------------------------------------
    618676function get_orchidee_version {  # Set / Check ORCHIDEE version
     677#-----------------------------------------------------------------------------
    619678    echo "Checking Orchidee source version"
    620679    local fetch_rev=""
     
    653712}
    654713
     714#-----------------------------------------------------------------------------
    655715function compile_orchidee {
     716#-----------------------------------------------------------------------------
    656717    install_arch "ORCHIDEE"
    657718
     
    673734}
    674735
     736#-----------------------------------------------------------------------------
    675737function get_lmdz_version {
     738#-----------------------------------------------------------------------------
    676739    echo "Checking LMDZ source version"
    677740    LMDZPATH=$(readlink -e -f "$MODEL/modipsl/modeles/LMD"*)
     
    703766}
    704767
     768#-----------------------------------------------------------------------------
    705769function compile_lmdz {
     770#-----------------------------------------------------------------------------
    706771    install_arch "LMDZ"
    707772    cd "$LMDZPATH"
     
    742807}
    743808
     809#-----------------------------------------------------------------------------
    744810function get_dynamico_icosa_version {
     811#-----------------------------------------------------------------------------
    745812  if [[ $icolmdz = 1 ]]; then
    746813    echo "Checking DYNAMICO source version"
     
    762829}
    763830
     831#-----------------------------------------------------------------------------
    764832function compile_icolmdzor {
     833#-----------------------------------------------------------------------------
    765834    if [[ $icolmdz = 1 ]]; then
    766835      install_arch "ICOSA_LMDZ"
     
    795864}
    796865
     866#-----------------------------------------------------------------------------
    797867function run_bench {
     868#-----------------------------------------------------------------------------
    798869    local bench_cmd="./bench.sh"
    799870
     
    10341105}
    10351106
     1107#-----------------------------------------------------------------------------
    10361108function run_bench_icosa {
     1109#-----------------------------------------------------------------------------
    10371110    local bench_cmd="./bench.sh"
    10381111
     
    10721145echo "install_lmdz.sh DEBUT $(date)"
    10731146
     1147#-----------------------------------------------------------------------------
    10741148function wrapper_run_all() {
     1149#-----------------------------------------------------------------------------
    10751150    # This is a wrapper to catch any "unexpected" error due to set -e and avoid abrupt stoppage which may confuse the user
    10761151    set_default_params
Note: See TracChangeset for help on using the changeset viewer.