- Timestamp:
- Jun 1, 2021, 6:25:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r3921 r3922 5 5 # Usage : install_lmdz.sh -help 6 6 # 7 # bash installation script of the LMDZ model on a Linux PC. 8 # the model is downloaded in the following direcory tree 7 # bash installation script of the LMDZ model on different computer types : 8 # Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS) 9 # 10 # The model is downloaded in the following directory tree 9 11 # $MODEL/modipsl/modeles/... 10 12 # using the "modipsl" infrastructure created by the "IPSL" … … 15 17 # 16 18 # The sources of the models can be found in the "modeles" directory. 17 # In the present case, LMDZ 5, ORCHIDEE and IOIPSL(handling of input-outputs18 # using the NetCDF library .19 # In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of input-outputs 20 # using the NetCDF library). 19 21 # 20 22 # The script downloads various source files (including a version of NetCDF) 21 23 # and utilities, compiles the model, and runs a test simulation in a 22 # m unimal configuration.24 # minimal configuration. 23 25 # 24 # Prerequisites : pgf90/gfortran, wget , gunzip, tar, ...26 # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ... 25 27 # 26 28 # Modif 18/11/2011 27 29 # changes for option real 8. 28 # We com opile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM30 # We compile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM 29 31 # but with -r4 for netcdf. Variable real must be set to 30 32 # r4 or r8 at the beginning of the script below. … … 53 55 } 54 56 55 57 # 04_2021 : tester si r4 marche encore ! 56 58 #real=r4 57 59 real=r8 58 59 # WARNING !!!! For versions before october 2009, use60 # install.v2.sh instead of install.sh61 60 62 61 ######################################################################### … … 64 63 ######################################################################### 65 64 svn="" 66 version=trunk 65 #version=trunk 66 version=20210320.trunk 67 67 getlmdzor=1 68 68 netcdf=1 # 1 for automatic installation … … 72 72 check_linux=1 73 73 ioipsl=1 74 veget=175 orchidee_rev="" # default revision of ORCHIDEE76 74 bench=1 77 75 pclinux=1 … … 79 77 compiler=gfortran 80 78 SCM=0 81 # use the old orchidee interface without the calculation of z0h82 no_z0h_orc=1 83 # orchidee_version: defined to use the CMIP6 version of ORCHIDEE84 # (and eventually anyother)85 # values=CMIP686 orchidee_version="" 79 # surface/vegetation scheme treatment 80 # controlled by the single variable veget which can have the following values 81 # - NONE: bucket scheme (default) 82 # - CMIP6: orchidee version used in CMIP exercise, rev 5661 83 # - number: orchidee version number (not yet implemented) 84 veget=NONE 87 85 # choose the resolution for the bench runs 88 86 # grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE) … … 163 161 -gprof to compile with -pg to enable profiling with gprof 164 162 165 -orchidee_rev "svn_release" : upgrade included ORCHIDEE model to166 given svn release number (default: $orchidee_rev)167 (only valid for orchidee2.0 and later)168 169 163 -cosp to compile with cosp(v1) 170 164 … … 185 179 -env_file specify an arch.env file to overwrite the existing one 186 180 187 - orc_version to chose some tagged ORCHIDEE version (CMIP6 only for the present)181 -veget surface model to run [NONE/CMIP6/xxxx] 188 182 189 183 ........fin … … 201 195 "-cosp2") cosp2=1 ; opt_cosp2="-cosp2 true" ; shift ;; 202 196 "-cospv2") cospv2=1 ; opt_cospv2="-cospv2 true" ; shift ;; 203 "-orchidee_rev") orchidee_rev=$2 ; shift ; shift ;;204 197 "-nofcm") compile_with_fcm=0 ; shift ;; 205 198 "-SCM") SCM=1 ; shift ;; … … 217 210 "-xios") with_xios="y" ; shift ;; 218 211 "-env_file") env_file=$2 ; shift ; shift ;; 219 "- orc_version") orchidee_version=$2 ; shift ; shift ;;212 "-veget") veget=$2 ; shift ; shift ;; 220 213 *) ./install_lmdz.sh -h ; exit 221 214 esac 222 215 done 223 216 224 if [ $parallel = none ] ; then sequential=1 ; else sequential=0 ; fi 217 # Check on veget version 218 #if [ "$veget" != 'NONE' -a "$veget" != "CMIP6" -a "$veget" != +([0-9]) ] ; then 219 if [ $veget != 'NONE' -a $veget != "CMIP6" ] ; then 220 re='^[0-9]+$' 221 if ! [[ $veget =~ $re ]] ; then 222 echo 'Valeur de l option veget non valable' 223 exit 224 fi 225 fi 226 227 #Define veget-related suffix for gcm name 228 if [ "$veget" = 'NONE' ] ; then 229 suff_orc='' 230 #For use with tutorial, orchidee_rev is also defined (will be written in surface_env at the end of the script) 231 orchidee_rev='' 232 else 233 suff_orc='_orch' 234 fi 235 236 237 if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi 225 238 226 239 #Chemin pour placer le modele … … 271 284 o_ins_make="-t g95" ;; 272 285 273 # *) if [ $parallel = none -o ] ; then 274 *) if [ $parallel = none ] ; then 286 *) if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then 275 287 path_mpi=`which mpif90 | sed -e s:/mpif90::` ; 276 288 if [ -d /usr/lib64/openmpi ] ; then … … 279 291 root_mpi="/usr" 280 292 fi 281 # Ehouarn: but why do we need path_mpi and root_mpi 282 # if not in parallel ? 293 # For Scientifique Linux with gfortran at LMD : 294 elif [ -f /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90 -a $compiler = "gfortran" ] ; then 295 path_mpi=/usr/lib64/openmpi/1.4.5-gfortran/bin ; 296 root_mpi=/usr/lib64/openmpi/1.4.5-gfortran ; 297 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 298 # For Scientifique Linux with ifort at LMD : 299 elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a $compiler = "ifort" ] ; then 300 path_mpi=/usr/lib64/openmpi/1.4.5-ifort/bin ; 301 root_mpi=/usr/lib64/openmpi/1.4.5-ifort ; 302 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 303 # For Scientifique Linux with pgf90 at LMD : 304 elif [ -f /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90 -a $compiler = "pgf90" ] ; then 305 path_mpi=/usr/lib64/openmpi/1.4.5-pgf/bin ; 306 root_mpi=/usr/lib64/openmpi/1.4.5-pgf ; 307 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 283 308 else 284 path_mpi=`which mpif90 | sed -e s:/mpif90::` ; 285 root_mpi=`which mpif90 | sed -e s:/bin/mpif90::` ; 286 if [ ! -x ${path_mpi}/mpif90 ] ; then 287 echo "Error: cannot find mpif90" ; 288 exit ; 289 fi ; 290 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 309 echo "Cannot find mpif90" ; 310 if [ $parallel = none ] ; then exit ; fi ; 291 311 fi ; 292 312 par_comp=${path_mpi}/mpif90 ; … … 468 488 469 489 ########################################################################## 470 # If installing on know machines such as IBM x3750 (Ada)471 # at IDRIS, don't check for available software and don"t install netcdf490 # If installing on known machines such as Jean-Zay at IDRIS, 491 # don't check for available software and don't install netcdf 472 492 if [ ${hostname:0:5} = jean- ] ; then 473 493 netcdf=0 # no need to recompile netcdf, alreday available … … 485 505 486 506 487 488 507 mkdir -p $MODEL 489 508 echo $MODEL 490 509 MODEL=`( cd $MODEL ; pwd )` # to get absolute path, if necessary 491 492 493 494 # Option -fendian=big is only to be used with ARPEGE1D.495 # The -r8 should probably be avoided if running on 32 bit machines496 # Option r8 is not mandatory and generates larger executables.497 # It is however mandatory if using ARPEGE1D498 # Better optimization options might be a better choice (e.g. -O3)499 510 500 511 … … 504 515 echo '################################################################' 505 516 506 #### Ehouarn: test if ksh and/or bash are available 507 #use_shell="ksh" # default: use ksh 508 #if [ "`which ksh`" = "" ] ; then 509 # echo "no ksh ... we will use bash" 510 use_shell="bash" 511 if [ "`which bash`" = "" ] ; then 512 echo "bash needed!! Install it!" 513 fi 514 #fi 515 517 #### Ehouarn: test if the required shell is available 518 #### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh 519 use_shell="bash" # default 520 if [ "`which bash`" = "" ] ; then 521 echo "no bash ; we will use ksh" 522 use_shell="ksh" 523 if [ "`which ksh`" = "" ] ; then 524 echo "bash (or ksh) needed!! Install it!" 525 exit 526 fi 527 fi 516 528 517 529 for logiciel in wget tar gzip make $compiler gcc ; do … … 542 554 echo '##########################################################' 543 555 cd $MODEL 544 myget src/modipsl .$version.tar.gz556 myget src/modipsl_orc_cmip6.$version.tar.gz 545 557 echo install.sh wget_OK `date` 546 gunzip modipsl.$version.tar.gz 547 tar xvf modipsl.$version.tar 548 \rm modipsl.$version.tar 549 558 gunzip modipsl_orc_cmip6.$version.tar.gz 559 tar xvf modipsl_orc_cmip6.$version.tar 560 \rm modipsl_orc_cmip6.$version.tar 550 561 fi 551 562 … … 569 580 cd netcdf-4.0.1 570 581 571 # seds to possibly use gfortran44 obsolete nowdays (Ehouarn: 10/2017)572 #sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure573 582 localdir=`pwd -P` 574 583 ./configure --prefix=$localdir --enable-shared --disable-cxx … … 748 757 #============================================================================ 749 758 veget_version=false 750 if [ "$veget" = 1] ; then759 if [ "$veget" != 'NONE' ] ; then 751 760 cd $MODEL/modipsl/modeles/ORCHIDEE 752 if [ "$orchidee_version" = "CMIP6" ] ; then 753 set +e 754 svn upgrade 755 svn switch -r 5661 --accept theirs-full svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_2_0/ORCHIDEE 756 orchidee_rev=5661 757 veget_version=orchidee2.0 758 no_z0h_orc=0 759 set -e 761 set +e ; svn upgrade ; set -e 762 if [ "$veget" = "CMIP6" ] ; then 763 veget_version=orchidee2.0 764 orchidee_rev=6592 765 else # specific orchidee revision 766 set +e 767 svn log -r $veget | grep $veget 768 if [ $? -gt 0 ] ; then 769 echo 'Cannot update ORCHIDEE as not on the right branch for ORCHIDEE' 770 exit 771 fi 772 set -e 773 set +e ; svn update -r $veget ; set -e 760 774 fi 761 775 # Correctif suite debug Jean-Zay … … 773 787 # Pour les experts qui voudraient changer de version d'orchidee. 774 788 # Attention : necessite d'avoir le password pour orchidee 775 set +e ; svn upgrade ; set -e 776 if [ "$orchidee_rev" != "" ] ; then 777 # test qu'on est sur la bonne branche pour faire le update 778 set +e 779 svn log -r $orchidee_rev | grep $orchidee_rev 780 if [ $? -gt 0 ] ; then 781 echo 'Cannot update ORCHIDEE as not on the right branch for ORCHIDEE' 782 exit 783 fi 784 set -e 785 set +e ; svn update -r $orchidee_rev ; set -e 786 fi 789 787 790 # Correctif suite debug Jean-Zay 788 791 if [ -f src_global/time.f90 ] ; then sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90 ; fi … … 815 818 liste_src="parallel parameters global stomate sechiba driver" 816 819 if [ "$veget_version" == "false" ] ; then veget_version=orchidee2.0 ; fi 817 else818 # Obsolete, for ORCHIDEE_beton only819 liste_src="parameters stomate sechiba "820 # A trick to compile ORCHIDEE depending on if we are using real*4 or real*8821 cd src_parameters ; \cp reqdprec.$real reqdprec.f90 ; cd ..822 if [ "$veget_version" == "false" ] ; then veget_version=orchidee1.9 ; fi823 820 fi 824 821 for d in $liste_src ; do src_d=src_$d … … 836 833 837 834 #============================================================================ 838 # Ehouarn: it may be directory LMDZ4 or LMDZ5 depending ontar file...835 # Ehouarn: the directory name LMDZ* depends on version/tar file... 839 836 if [ -d $MODEL/modipsl/modeles/LMD* ] ; then 840 837 echo '##########################################################' … … 901 898 ################################################################## 902 899 903 set +e ; svn upgrade 900 901 set +e ; svn upgrade ; set -e 904 902 if [ "$svn" = "last" ] ; then svnopt="" ; else svnopt="-r $svn" ; fi 905 903 if [ "$svn" != "" ] ; then … … 921 919 echo install.sh avant_compilation `date` 922 920 if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm $optim -arch $arch -j 8 " ; else makelmdz="makelmdz $optim -arch $arch" ; fi 923 924 # use the orchidee interface that has no z0h925 if [ "$no_z0h_orc" = 1 ] ; then926 veget_version="$veget_version -cpp ORCHIDEE_NOZ0H"927 fi928 921 929 922 # sequential compilation and bench … … 953 946 # 954 947 cd $ORCHPATH 955 if [ -d src_parallel -a $veget = 1] ; then948 if [ -d src_parallel -a $veget != 'NONE' ] ; then 956 949 cd arch 957 950 sed \ … … 972 965 echo ./makeorchidee_fcm -j 8 -clean -noxios $opt_orc -parallel $parallel -arch $arch 973 966 echo ./makeorchidee_fcm -j 8 -noxios $opt_orc -parallel $parallel -arch $arch 974 elif [ $veget = 1] ; then967 elif [ $veget != 'NONE' ] ; then 975 968 echo '##########################################################' 976 969 echo ' Orchidee version too old ' … … 1011 1004 fi # of if [ $parallel != "none" ] 1012 1005 1013 #echo LLLLLLLLLLLLLLLLLLLLLLLLLLL1014 if [ "$gfortran" = "gfortran44" ] ; then1015 echo Your gfortran compiler was too old so that the model was automatically1016 echo compiled with gfortran44 instead. It can not be used in parallel mode.1017 echo You can change the compiler at the begining of the install.sh1018 echo script and reinstall.1019 fi1020 1006 1021 1007 ################################################################## … … 1025 1011 # Recherche de l'executable dont le nom a change au fil du temps ... 1026 1012 gcm="" 1027 for exe in gcm.e bin/gcm_${grid_resolution}_phylmd_seq_orch.e bin/gcm_${grid_resolution}_phylmd_seq.e bin/gcm_${grid_resolution}_phylmd_para_mem_orch.e bin/gcm_${grid_resolution}_phylmd_para_mem.e ; do1028 if [ -f $exe ] ; then gcm=$exe ; fi1013 #for exe in gcm.e bin/gcm_${grid_resolution}_phylmd_seq_orch.e bin/gcm_${grid_resolution}_phylmd_seq.e bin/gcm_${grid_resolution}_phylmd_para_mem_orch.e bin/gcm_${grid_resolution}_phylmd_para_mem.e ; do 1014 for exe in gcm.e bin/gcm_${grid_resolution}_phylmd${suff_exe}${suff_orc}.e ; do if [ -f $exe ] ; then gcm=$exe ; fi 1029 1015 done 1030 1016 … … 1161 1147 fi 1162 1148 if [ ${hostname:0:5} = jean- ] ; then 1149 . ../arch/arch-${arch}.env 1163 1150 echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing 2>&1" >> bench.sh 1164 1151 else … … 1167 1154 # Add rebuild, using reb.sh if it is there 1168 1155 echo 'if [ -f reb.sh ] ; then' >> bench.sh 1169 echo ' ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ./re h.sh histins' >> bench.sh1156 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 1170 1157 echo 'fi' >> bench.sh 1171 1158 else 1172 1159 echo "./gcm.e > listing 2>&1" > bench.sh 1160 fi 1161 # Getting orchidee stuff 1162 if [ $veget == 'CMIP6' ] ; then 1163 #echo 'myget 3DBenchs/BENCHorch11.tar.gz' 1164 #myget 3DBenchs/BENCHorch11.tar.gz 1165 #tar xvzf BENCHorch11.tar.gz 1166 echo 'myget 3DBenchs/BENCHCMIP6.tar.gz' 1167 myget 3DBenchs/BENCHCMIP6.tar.gz 1168 tar xvzf BENCHCMIP6.tar.gz 1169 sed -e "s:VEGET=n:VEGET=y:" config.def > tmp 1170 mv -f tmp config.def 1173 1171 fi 1174 1172 echo EXECUTION DU BENCH … … 1196 1194 echo '##########################################################' 1197 1195 1198 fi 1196 fi # bench 1199 1197 1200 1198 … … 1211 1209 ./run.sh 1212 1210 fi 1211 set -vx 1212 1213 ################################################################# 1214 # sauvegarde des options veget pour utilisation eventuelle tutorial_prod 1215 ################################################################# 1216 cd $MODEL/modipsl/modeles 1217 echo surface_env file created in $MODEL 1218 echo 'veget='$veget > surface_env 1219 #opt_veget="-v $veget_version" 1220 #echo 'opt_veget="'$opt_veget\" >> surface_env 1221 echo 'opt_veget="'-v $veget_version\" >> surface_env 1222 echo 'orchidee_rev='$orchidee_rev >> surface_env 1223 echo 'suforch='$suff_orc >> surface_env 1224 1225 1226 1227
Note: See TracChangeset
for help on using the changeset viewer.