Changeset 4941


Ignore:
Timestamp:
May 13, 2024, 3:57:20 PM (3 weeks ago)
Author:
abarral
Message:

(WIP)
add option top resume install from existing directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/install_lmdz.sh

    r4939 r4941  
    3838### Functions
    3939
    40 function myget { # Get a file from LMDZ repository
     40function myget {
     41  # Get a file from LMDZ repository, make it executable if .(ba)sh
    4142  local url=$1
    4243
     
    7374
    7475    cosp="none"
     76    aerosols=0
     77    inlandsis=0
    7578
    7679    make_j=8
     80    clean_install=1
    7781
    7882    # Check if on a Mac /!\ Probably doesn't work anymore, to fix one day...
     
    144148
    145149        -make_j     number of processes to parallelize installations (default <$make_j>)
     150
     151        -noclean    will only download necessary files (but no thorough check is made on the integrity of existing files), and will recompile everything (very quick if it's already been compiled before)
    146152
    147153........fin
     
    181187            "-inlandsis") inlandsis=1; shift;;
    182188            "-make_j") make_j=$2; shift; shift;;
     189            "-noclean") clean_install=0; shift;;
    183190            *)  bash install_lmdz.sh -h; exit 1
    184191        esac
     
    308315
    309316function download_model {
     317    if [[ $clean_install = 1 ]]; then rm -rf "$MODEL"; fi
     318
    310319    mkdir -p "$MODEL"
    311320    MODEL=$(readlink -e -f "$MODEL"); echo "$MODEL"  # absolute path
    312 
    313     rm -rf "$MODEL/modipsl"
    314 
    315     echo "##########################################################"
    316     echo "Download a slightly modified version of  LMDZ"
    317     echo "##########################################################"
    318     cd "$MODEL"
    319     getlog="$(pwd)/get.log"
    320     echo "logfile : $getlog"
    321     myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1
    322     echo "install_lmdz.sh wget_OK $(date)"
    323     gunzip "modipsl.$version.tar.gz" >> get.log 2>&1
    324     tar xf "modipsl.$version.tar" >> get.log 2>&1
    325     \rm "modipsl.$version.tar"
     321    if [[ ! -f "$MODEL/modipsl" ]]; then
     322        echo "##########################################################"
     323        echo "Download a slightly modified version of  LMDZ"
     324        echo "##########################################################"
     325        cd "$MODEL"
     326        getlog="$(pwd)/get.log"
     327        echo "logfile : $getlog"
     328        myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1
     329        echo "install_lmdz.sh wget_OK $(date)"
     330        gunzip "modipsl.$version.tar.gz" >> get.log 2>&1
     331        tar xf "modipsl.$version.tar" >> get.log 2>&1
     332        \rm "modipsl.$version.tar"
     333    fi
    326334}
    327335
     
    558566        echo "branch is $orcbranch"
    559567        if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi
    560         \rm -rf "$MODEL/modipsl/modeles/ORCHIDEE"
    561568        echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr"
    562569        cd "$MODEL/modipsl/modeles"
    563         set +e
    564         svn co -r "$fetch_rev" "svn://forge.ipsl.fr/orchidee/$orcbranch"
    565         set -e
     570        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)
    566571        cd -
    567572    fi
    568 
    569573
    570574    # Check parallel LMDZ+ORCH
     
    628632        echo "Fetching LMDZ $svn_lmdz from the repository"
    629633        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         \rm -rf "$MODEL/modipsl/modeles/LMDZ"
    631634        cd "$MODEL/modipsl/modeles"
    632         set +e
    633         svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ
    634         set -e
     635        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)
    635636        cd -
    636637    else  # get svn from info
Note: See TracChangeset for help on using the changeset viewer.