- Timestamp:
- May 13, 2024, 3:57:20 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/install_lmdz.sh
r4939 r4941 38 38 ### Functions 39 39 40 function myget { # Get a file from LMDZ repository 40 function myget { 41 # Get a file from LMDZ repository, make it executable if .(ba)sh 41 42 local url=$1 42 43 … … 73 74 74 75 cosp="none" 76 aerosols=0 77 inlandsis=0 75 78 76 79 make_j=8 80 clean_install=1 77 81 78 82 # Check if on a Mac /!\ Probably doesn't work anymore, to fix one day... … … 144 148 145 149 -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) 146 152 147 153 ........fin … … 181 187 "-inlandsis") inlandsis=1; shift;; 182 188 "-make_j") make_j=$2; shift; shift;; 189 "-noclean") clean_install=0; shift;; 183 190 *) bash install_lmdz.sh -h; exit 1 184 191 esac … … 308 315 309 316 function download_model { 317 if [[ $clean_install = 1 ]]; then rm -rf "$MODEL"; fi 318 310 319 mkdir -p "$MODEL" 311 320 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 326 334 } 327 335 … … 558 566 echo "branch is $orcbranch" 559 567 if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi 560 \rm -rf "$MODEL/modipsl/modeles/ORCHIDEE"561 568 echo "IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr" 562 569 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) 566 571 cd - 567 572 fi 568 569 573 570 574 # Check parallel LMDZ+ORCH … … 628 632 echo "Fetching LMDZ $svn_lmdz from the repository" 629 633 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"631 634 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) 635 636 cd - 636 637 else # get svn from info
Note: See TracChangeset
for help on using the changeset viewer.