Changeset 5521
- Timestamp:
- Feb 3, 2025, 4:45:21 PM (5 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r5407 r5521 38 38 ### Functions 39 39 40 #----------------------------------------------------------------------------- 40 41 function myget { 42 #----------------------------------------------------------------------------- 41 43 # Get a file from LMDZ repository, make it executable if .(ba)sh 42 44 local url=$1 … … 49 51 } 50 52 53 #----------------------------------------------------------------------------- 51 54 function do_compile_sh { 55 #----------------------------------------------------------------------------- 52 56 local component=$1 53 57 local command=$2 … … 64 68 } 65 69 70 #----------------------------------------------------------------------------- 66 71 function get_svn_branch { 72 #----------------------------------------------------------------------------- 67 73 local url=$1 68 74 local rev=$2 … … 80 86 } 81 87 88 #----------------------------------------------------------------------------- 82 89 function set_default_params { 90 #----------------------------------------------------------------------------- 83 91 # Valeur par défaut des parametres 84 92 svn_lmdz="" … … 133 141 } 134 142 143 #----------------------------------------------------------------------------- 135 144 function read_cmdline_args { 145 #----------------------------------------------------------------------------- 136 146 while (($# > 0)); do 137 147 case $1 in … … 312 322 } 313 323 324 #----------------------------------------------------------------------------- 314 325 function ensure_correct_option_combinations { 326 #----------------------------------------------------------------------------- 315 327 # Check on veget version 316 328 if [[ $veget != 'none' && $veget != "CMIP6" && $veget != "orch2.0" && $veget != "orch2.2" ]]; then … … 354 366 } 355 367 368 #----------------------------------------------------------------------------- 356 369 function check_available_software { 370 #----------------------------------------------------------------------------- 357 371 local required_soft=("wget" "tar" "gzip" "make" "gcc" "cmake" "m4" "c++") 358 372 echo "Checking if required software is available (${required_soft[*]})" … … 364 378 } 365 379 380 #----------------------------------------------------------------------------- 366 381 function download_modipsl_tar { 382 #----------------------------------------------------------------------------- 367 383 if [[ $clean_install = 1 && -d $MODEL ]]; then 368 384 local ans … … 393 409 } 394 410 411 #----------------------------------------------------------------------------- 395 412 function init_arch { 413 #----------------------------------------------------------------------------- 396 414 cd "$local" 397 415 set +e; arch_dir=$(readlink -f "$arch_dir"); set -e # full path. readlink must be called *after* the path is created … … 410 428 fi 411 429 done 430 412 431 default_fcm_path=$fcm_path 413 432 default_path_path=$path_path … … 416 435 # check compiler 417 436 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 # ------------------------------------------------------------------------------------------ 418 465 419 466 # load env … … 431 478 } 432 479 480 #----------------------------------------------------------------------------- 433 481 function check_compiler { 482 #----------------------------------------------------------------------------- 434 483 # Must be called after init_arch to know which compiler to use 435 484 cat <<eod > tt.f90 … … 445 494 } 446 495 496 #----------------------------------------------------------------------------- 447 497 function install_arch { 498 #----------------------------------------------------------------------------- 448 499 local component=$1 449 500 … … 471 522 } 472 523 524 #----------------------------------------------------------------------------- 473 525 function install_netcdf { 526 #----------------------------------------------------------------------------- 474 527 echo "Installing Netcdf" 475 528 local ncdf_compiler="$compiler" … … 577 630 } 578 631 632 #----------------------------------------------------------------------------- 579 633 function install_IOIPSL { 634 #----------------------------------------------------------------------------- 580 635 install_arch "IOIPSL" 581 636 … … 594 649 } 595 650 651 #----------------------------------------------------------------------------- 596 652 function install_XIOS { 653 #----------------------------------------------------------------------------- 597 654 if [[ $with_xios = 1 ]]; then 598 655 cd "$MODEL/modipsl/modeles" … … 616 673 } 617 674 675 #----------------------------------------------------------------------------- 618 676 function get_orchidee_version { # Set / Check ORCHIDEE version 677 #----------------------------------------------------------------------------- 619 678 echo "Checking Orchidee source version" 620 679 local fetch_rev="" … … 653 712 } 654 713 714 #----------------------------------------------------------------------------- 655 715 function compile_orchidee { 716 #----------------------------------------------------------------------------- 656 717 install_arch "ORCHIDEE" 657 718 … … 673 734 } 674 735 736 #----------------------------------------------------------------------------- 675 737 function get_lmdz_version { 738 #----------------------------------------------------------------------------- 676 739 echo "Checking LMDZ source version" 677 740 LMDZPATH=$(readlink -e -f "$MODEL/modipsl/modeles/LMD"*) … … 703 766 } 704 767 768 #----------------------------------------------------------------------------- 705 769 function compile_lmdz { 770 #----------------------------------------------------------------------------- 706 771 install_arch "LMDZ" 707 772 cd "$LMDZPATH" … … 742 807 } 743 808 809 #----------------------------------------------------------------------------- 744 810 function get_dynamico_icosa_version { 811 #----------------------------------------------------------------------------- 745 812 if [[ $icolmdz = 1 ]]; then 746 813 echo "Checking DYNAMICO source version" … … 762 829 } 763 830 831 #----------------------------------------------------------------------------- 764 832 function compile_icolmdzor { 833 #----------------------------------------------------------------------------- 765 834 if [[ $icolmdz = 1 ]]; then 766 835 install_arch "ICOSA_LMDZ" … … 795 864 } 796 865 866 #----------------------------------------------------------------------------- 797 867 function run_bench { 868 #----------------------------------------------------------------------------- 798 869 local bench_cmd="./bench.sh" 799 870 … … 1034 1105 } 1035 1106 1107 #----------------------------------------------------------------------------- 1036 1108 function run_bench_icosa { 1109 #----------------------------------------------------------------------------- 1037 1110 local bench_cmd="./bench.sh" 1038 1111 … … 1072 1145 echo "install_lmdz.sh DEBUT $(date)" 1073 1146 1147 #----------------------------------------------------------------------------- 1074 1148 function wrapper_run_all() { 1149 #----------------------------------------------------------------------------- 1075 1150 # This is a wrapper to catch any "unexpected" error due to set -e and avoid abrupt stoppage which may confuse the user 1076 1151 set_default_params
Note: See TracChangeset
for help on using the changeset viewer.