Changeset 4994 for BOL


Ignore:
Timestamp:
Jun 26, 2024, 2:00:43 PM (10 days ago)
Author:
abarral
Message:

add new JEANZAY arch
fix env supplied in modipsl/config
bugfix related to modipsl/config arch retrieval
fix orcbranch only computed if svn rev doesnt match current
fix orc&lmdz svn retrieval

Location:
BOL/script_install_amaury
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/install_lmdz.sh

    r4992 r4994  
    358358    arch_dir=$(readlink -e -f "$arch_dir")  # full path. readlink must be called *after* the path is created
    359359    if [[ ! -d $arch_dir ]]; then
    360         echo "Error: no arch dir $arch_dir"; exit 1
    361     elif [[ ! -f $arch_dir/arch-$arch.path ]]; then
    362         echo "Error: no arch-$arch.path in $arch_dir"; exit 1
     360        echo "STOP: no arch dir $arch_dir"; exit 1
    363361    fi
    364362
     
    369367        fcm_path="$MODEL/modipsl/modeles/LMDZ/arch/arch-$arch.fcm"
    370368        if [[ ! -f $fcm_path ]]; then
    371             echo "Error: no $fcm_path"; exit 1
     369            echo "STOP: no $fcm_path"; exit 1
     370        fi
     371    fi
     372
     373    local env_path
     374    if [[ -f $arch_dir/arch-$arch.env ]]; then
     375        env_path="$arch_dir/arch-$arch.env"
     376    else
     377        env_path="$MODEL/modipsl/modeles/LMDZ/arch/arch-$arch.env"
     378        if [[ ! -f $env_path ]]; then
     379            echo "STOP: no $env_path"; exit 1
    372380        fi
    373381    fi
     
    377385
    378386    # load env
    379     local env_path=${fcm_path/.fcm/.env}
    380387    # shellcheck disable=SC1090
    381388    if [[ -f $env_path ]]; then source "$env_path"; fi
     
    385392    local component=$1
    386393
    387     if [[ ! -f "$MODEL/modipsl/modeles/$component/arch/arch-$arch.fcm" ]]; then
    388         cp -f "$arch_dir/arch-$arch."{fcm,path,env} "$MODEL/modipsl/modeles/$component/arch"
     394    if [[ -f "$arch_dir/arch-$arch.env" ]]; then
     395        cp -f "$arch_dir/arch-$arch."{fcm,path,env} "$MODEL/modipsl/modeles/$component/arch" &> /dev/null || true  # allow failure if doesn't exist
    389396
    390397        if [[ $component = "XIOS" ]]; then
     
    548555
    549556    if [[ -n $fetch_rev ]]; then
    550         echo "Fetching orch $fetch_rev from the repository"
     557        local curr_rev
     558        curr_rev=$(svn info "$MODEL/modipsl/modeles/ORCHIDEE" | grep Revision: | cut -d ":" -f 2 | cut -c 2-)
    551559        orcbranch=$(svn log -v -q svn://forge.ipsl.fr/orchidee/ -r "$fetch_rev" | grep ORCHIDEE | head -1 | sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}')
    552         echo "branch is $orcbranch"
    553         if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi
    554         echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr"
    555         cd "$MODEL/modipsl/modeles"
    556         svn co -r "$fetch_rev" "svn://forge.ipsl.fr/orchidee/$orcbranch" || (rm -rf ORCHIDEE && svn co -r "$fetch_rev" "svn://forge.ipsl.fr/orchidee/$orcbranch")  # if orch dir exists and is from a different branch, need to delete it first (but we don't want to do this all the time, as it would require a recompile for the same code)
    557         cd -
     560        if [[ $fetch_rev != "$curr_rev" ]]; then
     561            echo "Fetching orch $fetch_rev from the repository (curr: $curr_rev)"
     562            echo "branch is $orcbranch"
     563            if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi
     564            echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr"
     565            cd "$MODEL/modipsl/modeles"
     566            rm -rf ORCHIDEE
     567            svn co -r "$fetch_rev" "svn://forge.ipsl.fr/orchidee/$orcbranch"
     568            cd - > /dev/null
     569        fi
    558570    fi
    559571
     
    609621    lmdzlog="$(pwd)/lmdz.log"
    610622
    611     used_lmdz_rev=$svn_lmdz
    612623    if [[ -n $svn_lmdz ]]; then
    613         local lmdzbranch
    614         echo "Fetching LMDZ $svn_lmdz from the repository"
    615         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}')
    616         cd "$MODEL/modipsl/modeles"
    617         svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ || (rm -rf LMD* && svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ)  # if lmdz dir exists and is from a different branch, need to delete it first (but we don't want to do this all the time, as it would require a recompile for the same code)
    618         cd -
     624      local curr_rev
     625      curr_rev=$(svn info "$MODEL/modipsl/modeles/LMD"* | grep Revision: | cut -d ":" -f 2)
     626      if [[ $svn_lmdz != "$curr_rev" ]]; then
     627          local lmdzbranch
     628          echo "Fetching LMDZ $svn_lmdz from the repository"
     629          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}')
     630          cd "$MODEL/modipsl/modeles"
     631          rm -rf LMD*
     632          svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ
     633          cd - > /dev/null
     634      fi
    619635    else  # get svn from info
    620636         set +e; used_lmdz_rev=$(svn info | grep "Last Changed Rev" | cut -c 19-); set -e
Note: See TracChangeset for help on using the changeset viewer.