- Timestamp:
- Feb 17, 2022, 1:03:40 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r4043 r4081 35 35 36 36 echo install_lmdz.sh DEBUT `date` 37 38 37 set -e 39 38 … … 42 41 ################################################################ 43 42 43 ################################################################ 44 44 # A function to fetch files either locally or on the internet 45 ################################################################ 45 46 function myget { #1st and only argument should be file name 46 47 # Path on local computer where to look for the datafile … … 51 52 else 52 53 wget -nv http://www.lmd.jussieu.fr/~lmdz/pub/$1 53 #dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir ; cp -r `basename $1` $dir 54 save_pub_locally=0 55 if [ $save_pub_locally = 1 ] ; then # saving wget files on ~/LMDZ/pub 56 dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir ; cp -r `basename $1` $dir 57 fi 54 58 fi 55 59 } … … 64 68 svn="" 65 69 #version=trunk 66 version=20211102.trunk 70 version=20220131.trunk 71 67 72 getlmdzor=1 68 73 netcdf=1 # 1 for automatic installation … … 223 228 done 224 229 225 #Option de compilation en fonction du code radiatif (-rad rrtm/ecrad) 226 if [ $rad = rrtm ] ; then 227 opt_rad="-rad rrtm" 228 elif [ $rad = ecrad ] ; then 229 opt_rad="-rad ecrad" 230 else 231 opt_rad="" 232 fi 233 234 if [ $cosp = v1 ] ; then 235 opt_cosp="-cosp true" 236 elif [ $cosp = v2 ] ; then 237 opt_cosp="-cospv2 true" 238 else 239 opt_cosp="" 240 fi 230 # Option de compilation du rayonnement 231 opt_rad="" 232 case $rad in 233 rrtm) opt_rad="-rad rrtm" ;; 234 ecrad) opt_rad="-rad ecrad" ;; 235 esac 236 237 238 # Option de compilation pour Cosp 239 opt_cosp="" 240 case cosp in 241 v1) opt_cosp="-cosp true" ;; 242 v2) opt_cosp="-cospv2 true" ;; 243 esac 241 244 242 245 # Check on veget version … … 543 546 544 547 ########################################################################### 545 if [ $getlmdzor = 1 ] ; then 546 echo '##########################################################' 547 echo Download a slightly modified version of LMDZ 548 echo '##########################################################' 549 cd $MODEL 550 myget src/modipsl_orc_cmip6.$version.tar.gz 551 echo install_lmdz.sh wget_OK `date` 552 gunzip modipsl_orc_cmip6.$version.tar.gz 553 tar xvf modipsl_orc_cmip6.$version.tar 554 \rm modipsl_orc_cmip6.$version.tar 555 fi 556 557 if [ $netcdf = 1 ] ; then 558 cd $MODEL 559 netcdflog=`pwd`/netcdf.log 560 echo '##########################################################' 561 echo Compiling the Netcdf library 562 echo '##########################################################' 563 echo log file : $netcdflog 564 if [ "$with_xios" = "n" ] ; then 565 # keep it simple 566 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz 567 myget import/netcdf-4.0.1.tar.gz 568 gunzip netcdf-4.0.1.tar.gz 569 tar xvf netcdf-4.0.1.tar 570 \rm -f netcdf-4.0.1.tar 571 572 cd netcdf-4.0.1 573 574 localdir=`pwd -P` 575 ./configure --prefix=$localdir --enable-shared --disable-cxx 576 #sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile 577 $make check > $netcdflog 2>&1 578 $make install >> $netcdflog 2>&1 579 #LF rajout d'une verrue, pour une raison non encore expliquee, la librairie est parfois rangée dans lib64 580 # et non dans lib par certains compilateurs 581 if [ ! -e lib -a -d lib64 ] ; then ln -s lib64 lib; fi 548 if [ $getlmdzor = 1 -a ! -d $MODEL/modipsl ] ; then 549 ########################################################################### 550 echo '##########################################################' 551 echo Download a slightly modified version of LMDZ 552 echo '##########################################################' 553 cd $MODEL 554 myget src/modipsl_orc_cmip6.$version.tar.gz 555 echo install_lmdz.sh wget_OK `date` 556 gunzip modipsl_orc_cmip6.$version.tar.gz 557 tar xvf modipsl_orc_cmip6.$version.tar 558 \rm modipsl_orc_cmip6.$version.tar 559 fi 560 561 ########################################################################### 562 if [ $netcdf = 1 -a ! -d $MODEL/netcdf ] ; then 563 ########################################################################### 564 cd $MODEL 565 netcdflog=`pwd`/netcdf.log 566 echo '##########################################################' 567 echo Compiling the Netcdf library 568 echo '##########################################################' 569 echo log file : $netcdflog 570 if [ "$with_xios" = "n" ] ; then 571 # keep it simple 572 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz 573 myget import/netcdf-4.0.1.tar.gz 574 gunzip netcdf-4.0.1.tar.gz 575 tar xvf netcdf-4.0.1.tar 576 \rm -f netcdf-4.0.1.tar 577 578 cd netcdf-4.0.1 579 580 localdir=`pwd -P` 581 ./configure --prefix=$localdir --enable-shared --disable-cxx 582 #sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile 583 $make check > $netcdflog 2>&1 584 $make install >> $netcdflog 2>&1 585 #LF rajout d'une verrue, pour une raison non encore expliquee, la librairie est parfois rangée dans lib64 586 # et non dans lib par certains compilateurs 587 if [ ! -e lib -a -d lib64 ] ; then ln -s lib64 lib; fi 588 else 589 # download and compile hdf5 and netcdf, etc. using the install_netcdf4_hdf5.bash script 590 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_netcdf4_hdf5.bash 591 myget import/install_netcdf4_hdf5.bash 592 chmod u=rwx install_netcdf4_hdf5.bash 593 if [ "$compiler" = "gfortran" ] ; then 594 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi > $netcdflog 2>&1 595 elif [ "$compiler" = "ifort" ] ; then 596 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi > $netcdflog 2>&1 597 elif [ "$compiler" = "pgf90" ] ; then 598 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi > $netcdflog 2>&1 599 else 600 echo "unexpected compiler $compiler" ; exit 601 fi 602 fi # of if [ "$with_xios" = "n" ] 603 echo install_lmdz.sh netcdf_OK `date` 604 fi # of if [ $netcdf = 1 ] 605 606 # ncdfdir contains the directory where netcdfd is installed 607 if [ $netcdf = 0 -o $netcdf = 1 ] ; then 608 if [ "$with_xios" = "y" ] ; then 609 ncdfdir=$MODEL/netcdf4_hdf5 610 else 611 ncdfdir=$MODEL/netcdf-4.0.1 612 fi 582 613 else 583 # download and compile hdf5 and netcdf, etc. using the install_netcdf4_hdf5.bash script 584 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_netcdf4_hdf5.bash 585 myget import/install_netcdf4_hdf5.bash 586 chmod u=rwx install_netcdf4_hdf5.bash 587 if [ "$compiler" = "gfortran" ] ; then 588 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi > $netcdflog 2>&1 589 elif [ "$compiler" = "ifort" ] ; then 590 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi > $netcdflog 2>&1 591 elif [ "$compiler" = "pgf90" ] ; then 592 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi > $netcdflog 2>&1 593 else 594 echo "unexpected compiler $compiler" ; exit 595 fi 596 fi # of if [ "$with_xios" = "n" ] 597 echo install_lmdz.sh netcdf_OK `date` 598 fi # of if [ $netcdf = 1 ] 599 600 #====================================================================================== 601 echo OK ioipsl=$ioipsl 602 echo '##########################################################' 603 echo 'Installing MODIPSL, the installation package manager for the ' 604 echo 'IPSL models and tools' 605 echo '##########################################################' 606 echo `date` 607 608 if [ $netcdf = 0 -o $netcdf = 1 ] ; then 609 if [ "$with_xios" = "y" ] ; then 610 ncdfdir=$MODEL/netcdf4_hdf5 611 else 612 ncdfdir=$MODEL/netcdf-4.0.1 613 fi 614 else 615 ncdfdir=$netcdf 616 fi 617 614 ncdfdir=$netcdf 615 fi 616 617 #========================================================================= 618 618 if [ $ioipsl = 1 ] ; then 619 cd $MODEL/modipsl 620 \rm -rf lib/* 621 622 cd util 623 624 cp AA_make.gdef AA_make.orig 625 F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi 626 if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi 627 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 628 sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \ 629 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ 630 -e 's:g95.*.NCDF_INC.*.$:g95 NCDF_INC= '"$ncdfdir"'/include:' \ 631 -e 's:g95.*.NCDF_LIB.*.$:g95 NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \ 632 -e 's:g95 L_O =:g95 L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \ 633 -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \ 634 -e 's:#-Q- g95 M_K = gmake:#-Q- g95 M_K = make:' \ 635 tmp >| AA_make.gdef 636 637 if [ $pcmac == 1 ] 638 then 639 cp AA_make.gdef tmp 640 sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef 641 fi 642 643 644 # We use lines for g95 even for the other compilers to run ins_make 645 if [ "$use_shell" = "ksh" ] ; then 646 ./ins_make $o_ins_make 647 else # bash 648 sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash 649 #if [ "`grep ada AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar 650 # \cp -f ~rdzt401/bin/AA_make.gdef . 651 #fi 652 if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar 653 echo 'Warning jean-zay not in AA_make.gdef' 654 echo 'Think about updating' 655 exit 1 656 fi 619 #========================================================================= 620 echo OK ioipsl=$ioipsl 621 echo '##########################################################' 622 echo 'Installing MODIPSL, the installation package manager for the ' 623 echo 'IPSL models and tools' 624 echo '##########################################################' 625 echo `date` 626 627 cd $MODEL/modipsl 628 \rm -rf lib/* 629 cd util 630 cp AA_make.gdef AA_make.orig 631 F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi 632 if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi 633 sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp 634 sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \ 635 -e 's/g95.*.w_w.*.(F_D)/g95 w_w = '"$OPTIMGCM"'/' \ 636 -e 's:g95.*.NCDF_INC.*.$:g95 NCDF_INC= '"$ncdfdir"'/include:' \ 637 -e 's:g95.*.NCDF_LIB.*.$:g95 NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \ 638 -e 's:g95 L_O =:g95 L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \ 639 -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \ 640 -e 's:#-Q- g95 M_K = gmake:#-Q- g95 M_K = make:' \ 641 tmp >| AA_make.gdef 642 643 if [ $pcmac == 1 ] 644 then 645 cp AA_make.gdef tmp 646 sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef 647 fi 648 649 650 # We use lines for g95 even for the other compilers to run ins_make 651 if [ "$use_shell" = "ksh" ] ; then 652 ./ins_make $o_ins_make 653 else # bash 654 sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash 655 if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar 656 echo 'Warning jean-zay not in AA_make.gdef' 657 echo 'Think about updating' 658 exit 1 659 fi 660 661 chmod u=rwx ins_make.bash 662 ./ins_make.bash $o_ins_make 663 fi # of if [ "$use_shell" = "ksh" ] 664 665 echo install_lmdz.sh MODIPSL_OK `date` 666 667 cd $MODEL/modipsl/modeles/IOIPSL/src 668 ioipsllog=`pwd`/ioipsl.log 669 echo '##########################################################' 670 echo 'Compiling IOIPSL, the interface library with Netcdf' 671 echo '##########################################################' 672 echo `date` 673 echo log file : $ioipsllog 674 675 if [ "$use_shell" = "bash" ] ; then 676 cp Makefile Makefile.ksh 677 sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile 678 fi 679 # if [ "$pclinux" = 1 ] ; then 680 # Build IOIPSL modules and library 681 $make clean 682 $make > $ioipsllog 2>&1 683 if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib 684 cp -f *.mod ../../../lib 685 fi 686 # Build IOIPSL tools (ie: "rebuild", if present) 687 if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then 688 cd $MODEL/modipsl/modeles/IOIPSL/tools 689 # adapt Makefile & rebuild script if in bash 690 if [ "$use_shell" = "bash" ] ; then 691 cp Makefile Makefile.ksh 692 sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile 693 cp rebuild rebuild.ksh 694 sed -e 's:/bin/ksh:/bin/bash:g' \ 695 -e 's:print -u2:echo:g' \ 696 -e 's:print:echo:g' rebuild.ksh > rebuild 697 fi 698 $make clean 699 $make > $ioipsllog 2>&1 700 fi 701 # fi # of if [ "$pclinux" = 1 ] 702 703 else # of if [ $ioipsl = 1 ] 704 if [ ${hostname:0:5} = jean- ] ; then 705 cd $MODEL/modipsl 706 cd util 707 if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then 708 echo 'Warning jean-zay not in AA_make.gdef' 709 echo 'Think about updating' 710 exit 1 711 fi 712 ./ins_make $o_ins_make 713 # Compile IOIPSL on jean-zay 714 cd $MODEL/modipsl/modeles/IOIPSL/src 715 gmake > ioipsl.log 716 cd $MODEL/modipsl/modeles/IOIPSL/tools 717 gmake > ioipsl.log 657 718 658 chmod u=rwx ins_make.bash 659 ./ins_make.bash $o_ins_make 660 fi # of if [ "$use_shell" = "ksh" ] 661 662 echo install_lmdz.sh MODIPSL_OK `date` 663 #======================================================================================= 664 cd $MODEL/modipsl/modeles/IOIPSL/src 665 ioipsllog=`pwd`/ioipsl.log 666 echo '##########################################################' 667 echo 'Compiling IOIPSL, the interface library with Netcdf' 668 echo '##########################################################' 669 echo `date` 670 echo log file : $ioipsllog 671 672 if [ "$use_shell" = "bash" ] ; then 673 cp Makefile Makefile.ksh 674 sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile 675 fi 676 # if [ "$pclinux" = 1 ] ; then 677 # Build IOIPSL modules and library 678 $make clean 679 $make > $ioipsllog 2>&1 680 if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib 681 cp -f *.mod ../../../lib 682 fi 683 # Build IOIPSL tools (ie: "rebuild", if present) 684 if [ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ] ; then 685 cd $MODEL/modipsl/modeles/IOIPSL/tools 686 # adapt Makefile & rebuild script if in bash 687 if [ "$use_shell" = "bash" ] ; then 688 cp Makefile Makefile.ksh 689 sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile 690 cp rebuild rebuild.ksh 691 sed -e 's:/bin/ksh:/bin/bash:g' \ 692 -e 's:print -u2:echo:g' \ 693 -e 's:print:echo:g' rebuild.ksh > rebuild 694 fi 695 $make clean 696 $make > $ioipsllog 2>&1 697 fi 698 # fi # of if [ "$pclinux" = 1 ] 699 700 else # of if [ $ioipsl = 1 ] 701 if [ ${hostname:0:5} = jean- ] ; then 702 cd $MODEL/modipsl 703 cd util 704 if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then 705 echo 'Warning jean-zay not in AA_make.gdef' 706 echo 'Think about updating' 707 exit 1 708 fi 709 ./ins_make $o_ins_make 710 # Compile IOIPSL on jean-zay 711 cd $MODEL/modipsl/modeles/IOIPSL/src 712 gmake > ioipsl.log 713 cd $MODEL/modipsl/modeles/IOIPSL/tools 714 gmake > ioipsl.log 715 716 fi 717 echo install_lmdz.sh ioipsl_OK `date` 719 fi 720 echo install_lmdz.sh ioipsl_OK `date` 718 721 fi # of if [ $ioipsl = 1 ] 719 722 # Saving ioipsl lib for possible parallel compile … … 721 724 tar cf ioipsl.tar lib/ bin/ 722 725 723 #========================================================================= ==726 #========================================================================= 724 727 if [ "$with_xios" = "y" ] ; then 725 728 echo '##########################################################' … … 924 927 echo '##################################################################' 925 928 echo "Preparing script compile.sh for LMDZ compilation" 926 echo "It will only be run automatically if bench=1 "929 echo "It will only be run automatically if bench=1/tuto" 927 930 echo Here bench=$bench 928 931 echo '##################################################################' … … 938 941 echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " >> compile.sh 939 942 chmod +x ./compile.sh 940 if [ $bench != 0] ; then943 if [ $bench = 1 ] ; then 941 944 echo install_lmdz.sh start_lmdz_seq_compilation `date` 942 945 echo log file: $lmdzlog … … 1022 1025 chmod +x ./compile.sh 1023 1026 1024 if [ $bench != 0 ] ; then 1025 echo Compiling LMDZ in parallel mode `date` 1026 echo LMDZ log file: $lmdzlog 1027 ./compile.sh > $lmdzlog 2>&1 1027 if [ $bench = 1 ] ; then 1028 echo Compiling LMDZ in parallel mode `date`, LMDZ log file: $lmdzlog ; ./compile.sh > $lmdzlog 2>&1 1028 1029 fi 1029 1030 … … 1042 1043 1043 1044 if [ "$gcm" = "" ] ; then 1044 if [ $bench != 0] ; then1045 if [ $bench = 1 ] ; then 1045 1046 echo 'Compilation failed !! Cannot run the benchmark;' 1046 1047 exit … … 1056 1057 1057 1058 ################################################################## 1058 # Below, we run a benchmark test (if bench=0)1059 # Below, we run a benchmark if bench=1 or tuto 1059 1060 ################################################################## 1060 1061 1061 if [ $bench != 0 ] ; then 1062 1063 echo '##########################################################' 1064 echo ' Running a test run ' 1065 echo '##########################################################' 1066 1067 \rm -rf BENCH${grid_resolution} 1068 bench=bench_lmdz_${grid_resolution} 1069 echo install_lmdz.sh before bench download `date` 1070 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz 1071 myget 3DBenchs/$bench.tar.gz 1072 echo install_lmdz.sh after bench download `date` 1073 tar xvf $bench.tar.gz 1074 1075 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1076 cd BENCH${grid_resolution} 1077 # copier les fichiers namelist input et output our COSP 1078 cp ../DefLists/cosp*_input_nl.txt . 1079 cp ../DefLists/cosp*_output_nl.txt . 1080 # Activer la cles ok_cosp pour tourner avec COSP 1081 sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp 1082 \mv -f tmp config.def 1083 cd .. 1084 fi 1085 1086 if [ -n "$physiq" ]; then 1087 cd BENCH${grid_resolution} 1088 if [ -f physiq.def_${physiq} ]; then 1089 cp physiq.def_${physiq} physiq.def 1090 echo using physiq.def_${physiq} 1091 else 1092 echo using standard physiq.def 1093 fi 1094 cd .. 1095 else 1096 echo using standard physiq.def 1097 fi 1098 1099 if [ "$with_xios" = "y" ] ; then 1100 cd BENCH${grid_resolution} 1101 cp ../DefLists/iodef.xml . 1102 cp ../DefLists/context_lmdz.xml . 1103 cp ../DefLists/field_def_lmdz.xml . 1104 # A raffiner par la suite 1105 echo A FAIRE : Copier les *xml en fonction de l option cosp 1106 cp ../DefLists/field_def_cosp*.xml . 1107 cp ../DefLists/file_def_hist*xml . 1108 # adapt iodef.xml to use attached mode 1109 sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp 1110 \mv -f tmp iodef.xml 1111 1112 # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE. 1113 # except for histday 1114 for histfile in file_def_hist*xml 1115 do 1116 if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then 1117 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile 1118 sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile 1119 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1120 else 1121 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile 1122 fi 1123 done 1124 # and add option "ok_all_xml=y" in config.def 1125 echo "### XIOS outputs" >> config.def 1126 echo 'ok_all_xml=.true.' >> config.def 1127 1128 #activer les sorties pour Cosp 1129 if [ "$cosp" = "v1" ] ; then 1130 histfile=file_def_histdayCOSP_lmdz.xml 1131 sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile 1132 sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile 1133 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1134 fi 1135 if [ "$cosp" = "v2" ] ; then 1136 histfile=file_def_histdayCOSPv2_lmdz.xml 1137 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1138 contextfile=context_lmdz.xml 1139 sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1140 sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1141 sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1142 fieldfile=field_def_lmdz.xml 1143 sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile 1144 fi 1145 1146 cd .. 1147 fi 1148 1149 # Cas Bensh avec ecrad 1150 if [ "$rad" = "ecrad" ] ; then 1151 cd BENCH${grid_resolution} 1152 cp ../DefLists/namelist_ecrad . 1153 cp -r ../libf/phylmd/ecrad/data . 1154 # Attention au cas ou ne 1 1155 sed -e 's@iflag_rrtm=1@iflag_rrtm=2@' physiq.def > tmp 1156 \mv -f tmp physiq.def 1157 cd .. 1158 fi 1159 1160 cp $gcm BENCH${grid_resolution}/gcm.e 1161 1162 cd BENCH${grid_resolution} 1163 # On cree le fichier bench.sh au besoin 1164 # Dans le cas 48x36x39 le bench.sh existe deja en parallele 1165 1166 if [ "$grid_resolution" = "48x36x39" ] ; then 1167 echo On ne touche pas au bench.sh 1168 # But we have to adapt "run_local.sh" for $mpirun 1169 sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp 1170 mv -f tmp run_local.sh 1171 chmod u=rwx run_local.sh 1172 elif [ "${parallel:0:3}" = "mpi" ] ; then 1173 # Lancement avec deux procs mpi et 2 openMP 1174 echo "export OMP_STACKSIZE=800M" > bench.sh 1175 if [ "${parallel:4:3}" = "omp" ] ; then 1176 echo "export OMP_NUM_THREADS=2" >> bench.sh 1062 if [ $bench = tuto ] ; then 1063 myget Training/tutorial.tar ; tar xvf tutorial.tar ; cd TUTORIAL ; ./init.sh 1064 1065 elif [ $bench = 1 ] ; then 1066 # TOUTE CETTE SECTION DEVRAIT DISPARAITRE POUR UNE COMMANDE 1067 # OU DES BENCHS PAR MOTS CLES COMME tuto 1068 1069 echo '##########################################################' 1070 echo ' Running a test run ' 1071 echo '##########################################################' 1072 1073 \rm -rf BENCH${grid_resolution} 1074 bench=bench_lmdz_${grid_resolution} 1075 echo install_lmdz.sh before bench download `date` 1076 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz 1077 myget 3DBenchs/$bench.tar.gz 1078 echo install_lmdz.sh after bench download `date` 1079 tar xvf $bench.tar.gz 1080 1081 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1082 cd BENCH${grid_resolution} 1083 # copier les fichiers namelist input et output our COSP 1084 cp ../DefLists/cosp*_input_nl.txt . 1085 cp ../DefLists/cosp*_output_nl.txt . 1086 # Activer la cles ok_cosp pour tourner avec COSP 1087 sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp 1088 \mv -f tmp config.def 1089 cd .. 1090 fi 1091 1092 if [ -n "$physiq" ]; then 1093 cd BENCH${grid_resolution} 1094 if [ -f physiq.def_${physiq} ]; then 1095 cp physiq.def_${physiq} physiq.def 1096 echo using physiq.def_${physiq} 1097 else 1098 echo using standard physiq.def 1099 fi 1100 cd .. 1101 else 1102 echo using standard physiq.def 1177 1103 fi 1178 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1179 if [ ${hostname:0:5} = jean- ] ; then 1180 chmod +x ../arch.env 1181 ../arch.env 1182 echo "ulimit -s 2000000" >> bench.sh 1104 1105 if [ "$with_xios" = "y" ] ; then 1106 cd BENCH${grid_resolution} 1107 cp ../DefLists/iodef.xml . 1108 cp ../DefLists/context_lmdz.xml . 1109 cp ../DefLists/field_def_lmdz.xml . 1110 # A raffiner par la suite 1111 echo A FAIRE : Copier les *xml en fonction de l option cosp 1112 cp ../DefLists/field_def_cosp*.xml . 1113 cp ../DefLists/file_def_hist*xml . 1114 # adapt iodef.xml to use attached mode 1115 sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp 1116 \mv -f tmp iodef.xml 1117 1118 # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE. 1119 # except for histday 1120 for histfile in file_def_hist*xml 1121 do 1122 if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then 1123 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile 1124 sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile 1125 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1126 else 1127 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile 1128 fi 1129 done 1130 # and add option "ok_all_xml=y" in config.def 1131 echo "### XIOS outputs" >> config.def 1132 echo 'ok_all_xml=.true.' >> config.def 1133 1134 #activer les sorties pour Cosp 1135 if [ "$cosp" = "v1" ] ; then 1136 histfile=file_def_histdayCOSP_lmdz.xml 1137 sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile 1138 sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile 1139 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1140 fi 1141 if [ "$cosp" = "v2" ] ; then 1142 histfile=file_def_histdayCOSPv2_lmdz.xml 1143 sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile 1144 contextfile=context_lmdz.xml 1145 sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1146 sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1147 sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile 1148 fieldfile=field_def_lmdz.xml 1149 sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile 1150 fi 1151 1152 cd .. 1153 fi 1154 1155 # Cas Bensh avec ecrad 1156 if [ "$rad" = "ecrad" ] ; then 1157 cd BENCH${grid_resolution} 1158 cp ../DefLists/namelist_ecrad . 1159 cp -r ../libf/phylmd/ecrad/data . 1160 # Attention au cas ou ne 1 1161 sed -e 's@iflag_rrtm=1@iflag_rrtm=2@' physiq.def > tmp 1162 \mv -f tmp physiq.def 1163 cd .. 1164 fi 1165 1166 cp $gcm BENCH${grid_resolution}/gcm.e 1167 1168 cd BENCH${grid_resolution} 1169 # On cree le fichier bench.sh au besoin 1170 # Dans le cas 48x36x39 le bench.sh existe deja en parallele 1171 1172 if [ "$grid_resolution" = "48x36x39" ] ; then 1173 echo On ne touche pas au bench.sh 1174 # But we have to adapt "run_local.sh" for $mpirun 1175 sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp 1176 mv -f tmp run_local.sh 1177 chmod u=rwx run_local.sh 1178 elif [ "${parallel:0:3}" = "mpi" ] ; then 1179 # Lancement avec deux procs mpi et 2 openMP 1180 echo "export OMP_STACKSIZE=800M" > bench.sh 1181 if [ "${parallel:4:3}" = "omp" ] ; then 1182 echo "export OMP_NUM_THREADS=2" >> bench.sh 1183 fi 1184 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1185 if [ ${hostname:0:5} = jean- ] ; then 1186 chmod +x ../arch.env 1187 ../arch.env 1188 echo "ulimit -s 2000000" >> bench.sh 1189 else 1190 echo "ulimit -s 200000" >> bench.sh 1191 fi 1183 1192 else 1184 echo "ulimit -s 200000" >> bench.sh 1185 fi 1193 echo "ulimit -s unlimited" >> bench.sh 1194 fi 1195 if [ ${hostname:0:5} = jean- ] ; then 1196 . ../arch/arch-${arch}.env 1197 echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing 2>&1" >> bench.sh 1198 else 1199 echo "$mpirun -np 2 gcm.e > listing 2>&1" >> bench.sh 1200 fi 1201 # Add rebuild, using reb.sh if it is there 1202 echo 'if [ -f reb.sh ] ; then' >> bench.sh 1203 echo ' ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ./reb.sh histins ; ./reb.sh stomate_history ; ./reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh 1204 echo 'fi' >> bench.sh 1186 1205 else 1187 echo " ulimit -s unlimited" >> bench.sh1206 echo "./gcm.e > listing 2>&1" > bench.sh 1188 1207 fi 1189 if [ ${hostname:0:5} = jean- ] ; then 1190 . ../arch/arch-${arch}.env 1191 echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing 2>&1" >> bench.sh 1208 # Getting orchidee stuff 1209 if [ $veget == 'CMIP6' ] ; then 1210 #echo 'myget 3DBenchs/BENCHorch11.tar.gz' 1211 #myget 3DBenchs/BENCHorch11.tar.gz 1212 #tar xvzf BENCHorch11.tar.gz 1213 echo 'myget 3DBenchs/BENCHCMIP6.tar.gz' 1214 myget 3DBenchs/BENCHCMIP6.tar.gz 1215 tar xvzf BENCHCMIP6.tar.gz 1216 sed -e "s:VEGET=n:VEGET=y:" config.def > tmp 1217 mv -f tmp config.def 1218 if [ "$with_xios" = "y" ] ; then 1219 cp ../../ORCHIDEE/src_xml/context_orchidee.xml . 1220 echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp 1221 cp ../../ORCHIDEE/src_xml/field_def_orchidee.xml . 1222 cp ../../ORCHIDEE/src_xml/file_def_orchidee.xml . 1223 cp ../../ORCHIDEE/src_xml/file_def_input_orchidee.xml . 1224 if [ -f ../../ORCHIDEE/src_xml/context_input_orchidee.xml ] ; then 1225 cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml . 1226 echo '<context id="orchidee" src="./context_input_orchidee.xml"/>' >> add.tmp 1227 fi 1228 sed -e '/id="LMDZ"/r add.tmp' iodef.xml > tmp 1229 mv tmp iodef.xml 1230 sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1231 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1232 sed -e 's@output_level="_AUTO_"@output_level="1"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1233 sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1234 sed -e 's@compression_level="4"@compression_level="0"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1235 sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' orchidee.def > tmp ; \mv -f tmp orchidee.def 1236 fi 1237 fi 1238 echo EXECUTION DU BENCH 1239 set +e 1240 date ; ./bench.sh > out.bench 2>&1 ; date 1241 set -e 1242 tail listing 1243 1244 1245 echo '##########################################################' 1246 echo 'Simulation finished in' `pwd` 1247 echo 'You have compiled with:' 1248 cat ../compile.sh 1249 if [ $parallel = "none" ] ; then 1250 echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e' 1251 echo 'or ./bench.sh' 1192 1252 else 1193 echo "$mpirun -np 2 gcm.e > listing 2>&1" >> bench.sh 1253 echo 'You may re-run it with : ' 1254 echo 'cd ' `pwd` '; ./bench.sh' 1255 # echo 'ulimit -s unlimited' 1256 # echo 'export OMP_NUM_THREADS=2' 1257 # echo 'export OMP_STACKSIZE=800M' 1258 # echo "$mpirun -np 2 gcm.e " 1194 1259 fi 1195 # Add rebuild, using reb.sh if it is there 1196 echo 'if [ -f reb.sh ] ; then' >> bench.sh 1197 echo ' ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ./reb.sh histins ; ./reb.sh stomate_history ; ./reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh 1198 echo 'fi' >> bench.sh 1199 else 1200 echo "./gcm.e > listing 2>&1" > bench.sh 1201 fi 1202 # Getting orchidee stuff 1203 if [ $veget == 'CMIP6' ] ; then 1204 #echo 'myget 3DBenchs/BENCHorch11.tar.gz' 1205 #myget 3DBenchs/BENCHorch11.tar.gz 1206 #tar xvzf BENCHorch11.tar.gz 1207 echo 'myget 3DBenchs/BENCHCMIP6.tar.gz' 1208 myget 3DBenchs/BENCHCMIP6.tar.gz 1209 tar xvzf BENCHCMIP6.tar.gz 1210 sed -e "s:VEGET=n:VEGET=y:" config.def > tmp 1211 mv -f tmp config.def 1212 if [ "$with_xios" = "y" ] ; then 1213 cp ../../ORCHIDEE/src_xml/context_orchidee.xml . 1214 echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp 1215 cp ../../ORCHIDEE/src_xml/field_def_orchidee.xml . 1216 cp ../../ORCHIDEE/src_xml/file_def_orchidee.xml . 1217 cp ../../ORCHIDEE/src_xml/file_def_input_orchidee.xml . 1218 if [ -f ../../ORCHIDEE/src_xml/context_input_orchidee.xml ] ; then 1219 cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml . 1220 echo '<context id="orchidee" src="./context_input_orchidee.xml"/>' >> add.tmp 1221 fi 1222 sed -e '/id="LMDZ"/r add.tmp' iodef.xml > tmp 1223 mv tmp iodef.xml 1224 sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1225 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1226 sed -e 's@output_level="_AUTO_"@output_level="1"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1227 sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1228 sed -e 's@compression_level="4"@compression_level="0"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml 1229 sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' orchidee.def > tmp ; \mv -f tmp orchidee.def 1230 fi 1231 fi 1232 echo EXECUTION DU BENCH 1233 set +e 1234 date ; ./bench.sh > out.bench 2>&1 ; date 1235 set -e 1236 tail listing 1237 1238 1239 echo '##########################################################' 1240 echo 'Simulation finished in' `pwd` 1241 echo 'You have compiled with:' 1242 cat ../compile.sh 1243 if [ $parallel = "none" ] ; then 1244 echo 'You may re-run it with : cd ' `pwd` ' ; gcm.e' 1245 echo 'or ./bench.sh' 1246 else 1247 echo 'You may re-run it with : ' 1248 echo 'cd ' `pwd` '; ./bench.sh' 1249 # echo 'ulimit -s unlimited' 1250 # echo 'export OMP_NUM_THREADS=2' 1251 # echo 'export OMP_STACKSIZE=800M' 1252 # echo "$mpirun -np 2 gcm.e " 1253 fi 1254 echo '##########################################################' 1260 echo '##########################################################' 1255 1261 1256 1262 fi # bench
Note: See TracChangeset
for help on using the changeset viewer.