Changeset 5336 for BOL/script_install_amaury/install_lmdz.sh
- Timestamp:
- Nov 18, 2024, 4:53:17 PM (3 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/install_lmdz.sh
r5332 r5336 49 49 } 50 50 51 function do_compile_sh { 52 local component=$1 53 local command=$2 54 local log 55 56 log="$(pwd)/$component.log" 57 echo "$command" > compile.sh 58 echo "Compiling $component using $(\cat compile.sh) (log: $log) $(date)" 59 chmod +x ./compile.sh 60 if ! ./compile.sh &> "$log"; then 61 echo "STOP: $component compilation failed, exiting"; exit 1 62 fi 63 echo "Finished $component compilation $(date)" 64 } 65 51 66 function get_svn_branch { 52 67 local url=$1 … … 88 103 89 104 icolmdz=0 90 DYNAMICO_VERS=374a3c66105 dynamico_commit="11001689" 91 106 92 107 rad="rrtm" … … 101 116 make_j=8 102 117 clean_install=1 118 local="$(pwd)" 103 119 104 120 # Check if on a Mac /!\ Probably doesn't work anymore, to fix one day... … … 354 370 } 355 371 356 function download_mod el{372 function download_modipsl_tar { 357 373 if [[ $clean_install = 1 ]]; then rm -rf "$MODEL"; fi 358 374 … … 370 386 tar xf "modipsl.$version.tar" &>> get.log 371 387 rm "modipsl.$version.tar" 372 373 cd - &> /dev/null374 ## checkout DYNAMICO and icosa interface in modipsl/modeles if needed375 if [[ $icolmdz = 1 ]]; then376 TMPLOCDIR=$(pwd)377 cd "$MODEL/modipsl/modeles/"378 getlog="$(pwd)/get.log"379 git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git DYNAMICO ; cd DYNAMICO ; git checkout master; cd .. &>> get.log380 svn checkout http://svn.lmd.jussieu.fr/LMDZ/ICOSA_LMDZ &>> get.log381 cd "$TMPLOCDIR" &> /dev/null382 fi383 388 fi 384 389 } 385 390 386 391 function init_arch { 392 cd "$local" 387 393 set +e; arch_dir=$(readlink -f "$arch_dir"); set -e # full path. readlink must be called *after* the path is created 388 394 … … 578 584 579 585 install_arch "XIOS" 580 581 echo "$jobcmd ./make_xios --job $make_j --arch $arch" > compile.sh 582 chmod +x compile.sh 583 echo "$(date) Compiling XIOS using $(\cat compile.sh) (log in $xioslog)" 584 if ! ./compile.sh &> "$xioslog"; then 585 echo "STOP: XIOS compilation failed, exiting"; exit 1 586 fi 587 588 echo "Compiled XIOS $(date)" 586 do_compile_sh "XIOS" "$jobcmd ./make_xios --job $make_j --arch $arch" 589 587 fi 590 588 } … … 633 631 cd "$MODEL/modipsl/modeles/ORCHIDEE" 634 632 635 orchideelog="$(pwd)/orchidee.log"636 echo "Compiling ORCHIDEE, the continental surface model (log $orchideelog) $(date)"637 638 633 local xios_orchid 639 634 if [[ $with_xios = 1 ]]; then … … 646 641 echo "STOP: Orchidee version too old for parallel support"; exit 1 647 642 fi 648 echo "$jobcmd ./makeorchidee_fcm -j $make_j $xios_orchid $optim_flag -parallel $parallel -arch $arch" > compile.sh 649 chmod +x compile.sh 650 echo "Compiling ORCHIDEE using $(\cat compile.sh)" 651 if ! ./compile.sh &> "$orchideelog"; then 652 echo "STOP: ORCHIDEE compilation failed, exiting"; exit 1 653 fi 654 echo "Compiled ORCHIDEE $(date)" 643 do_compile_sh "ORCHIDEE" "$jobcmd ./makeorchidee_fcm -j $make_j $xios_orchid $optim_flag -parallel $parallel -arch $arch" 655 644 fi 656 645 } … … 660 649 LMDZPATH=$(readlink -e -f "$MODEL/modipsl/modeles/LMD"*) 661 650 cd "$LMDZPATH" 662 lmdzlog="$(pwd)/lmdz.log"663 664 651 665 652 if [[ -n $svn_lmdz ]]; then … … 713 700 714 701 # Compile 715 makelmdz="makelmdz_fcm $optim_flag -arch $arch -j $make_j"702 local makelmdz="makelmdz_fcm $optim_flag -arch $arch -j $make_j" 716 703 local para_compile_opt="-mem -parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi 717 echo "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_strataer $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt $fortran_file" > compile.sh 718 echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)" 719 chmod +x ./compile.sh 720 if ! ./compile.sh &> "$lmdzlog"; then 721 echo "STOP: LMDZ compilation failed, exiting"; exit 1 722 fi 723 echo "Finished LMDZ compilation $(date)" 704 do_compile_sh "LMDZ" "$jobcmd ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_strataer $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt $fortran_file" 724 705 725 706 # Check executable … … 731 712 } 732 713 714 function get_dynamico_icosa_version { 715 if [[ $icolmdz = 1 ]]; then 716 echo "Checking DYNAMICO source version" 717 cd "$MODEL/modipsl/modeles" 718 if [[ ! -d DYNAMICO ]]; then 719 git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git DYNAMICO 720 fi 721 cd DYNAMICO 722 git checkout master && git checkout $dynamico_commit 723 cd - > /dev/null 724 725 echo "Checking ICOSA_LMDZ source version" 726 if [[ ! -d ICOSA_LMDZ ]]; then 727 svn checkout http://svn.lmd.jussieu.fr/LMDZ/ICOSA_LMDZ 728 fi 729 cd ICOSA_LMDZ 730 svn up -r 5320 731 fi 732 } 733 733 734 function compile_icolmdzor { 734 735 if [[ $icolmdz = 1 ]]; then 735 736 # install_arch "DYNAMICO"737 736 install_arch "ICOSA_LMDZ" 738 739 cd "$LMDZPATH"740 737 local para_compile_opt="-parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi 741 738 742 739 # LMDZ physics package library already available in LMDZ/config/lib directory 740 743 741 # Compile DYNAMICO 744 cd ../DYNAMICO 742 cd "$MODEL/modipsl/modeles/DYNAMICO" 743 744 # Need to get rather than install the archs as DYNAMICO uses FCMv2 that does not understand the makefile syntax ($shell) 745 745 cd arch 746 # Need to get rather than install the archs as DYNAMICO uses FCMv2 that does not understand the makefile syntax ($shell) 747 wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.env 748 wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.fcm 749 wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.path 746 wget "http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.env" 747 wget "http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.fcm" 748 wget "http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-$arch.path" 750 749 cd .. 751 750 752 dynamicolog="$(pwd)/dynamico.log" 753 echo "Compile DYNAMICO" 754 echo "$jobcmd ./make_icosa $optim_flag -arch $arch -job $make_j $para_compile_opt -external_ioipsl -with_xios" > compile.sh 755 chmod +x ./compile.sh 756 if ! ./compile.sh &> "$dynamicolog"; then 757 echo "STOP: DYNAMICO compilation failed, exiting"; exit 1 758 fi 759 echo "Finished DYNAMICO compilation $(date)" 751 do_compile_sh "DYNAMICO" "$jobcmd ./make_icosa $optim_flag -arch $arch -job $make_j $para_compile_opt -external_ioipsl -with_xios" 760 752 761 753 # Compile icosa_lmdz 762 echo "Bin PATH before icosalmdz" $PATH 763 cd ../ICOSA_LMDZ 764 icosalog="$(pwd)/icosa.log" 765 echo "Compile interface ICOSA_LMDZ" 766 echo "$jobcmd ./make_icosa_lmdz -arch $arch -j $make_j -nodeps -p lmd $optim_flag $para_compile_opt -with_orchidee" > compile.sh 767 chmod +x ./compile.sh 768 if ! ./compile.sh &> "$icosalog"; then 769 echo "STOP: ICOSA_LMDZ compilation failed, exiting"; exit 1 770 fi 771 echo "Finished ICOSA_LMDZ compilation $(date)" 754 echo "Bin PATH before icosalmdz" "$PATH" 755 cd "$MODEL/modipsl/modeles/ICOSA_LMDZ" 756 do_compile_sh "ICOSA_LMDZ" "$jobcmd ./make_icosa_lmdz -arch $arch -j $make_j -nodeps -p lmd $optim_flag $para_compile_opt -with_orchidee" 772 757 echo "# Running environment for icosa_lmdz" > icosalmdz.env 773 758 echo "# " >> icosalmdz.env … … 1024 1009 cd "$MODEL/modipsl/modeles/ICOSA_LMDZ" 1025 1010 if [[ $bench = 1 ]]; then 1026 namebench=bench_icolmdz_nbp10_79 1011 namebench="bench_icolmdz_nbp10_79" 1012 rm -rf $namebench 1027 1013 myget "3DBenchs/$namebench.tar.gz" 1028 mkdir $namebench1014 mkdir -p $namebench 1029 1015 tar xf "$namebench.tar.gz" -C "$namebench" --strip-components=1 1030 1016 cd $namebench … … 1058 1044 read_cmdline_args "$@" 1059 1045 ensure_correct_option_combinations 1060 download_mod el1046 download_modipsl_tar 1061 1047 init_arch 1062 1048 check_available_software 1063 1049 get_lmdz_version 1050 get_dynamico_icosa_version 1064 1051 get_orchidee_version 1065 1052 install_netcdf … … 1070 1057 compile_icolmdzor 1071 1058 run_bench 1072 if [ ! $? = 0 ]; then exit 1; fi1073 1059 run_bench_icosa
Note: See TracChangeset
for help on using the changeset viewer.