- Timestamp:
- Jul 20, 2022, 5:54:06 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r4198 r4204 8 8 # 9 9 # bash installation script of the LMDZ model on different computer types : 10 # Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS) 10 # Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS) 11 11 # 12 12 # The model is downloaded in the following directory tree … … 20 20 # The sources of the models can be found in the "modeles" directory. 21 21 # In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of input-outputs 22 # using the NetCDF library). 22 # using the NetCDF library). 23 23 # 24 24 # The script downloads various source files (including a version of NetCDF) … … 26 26 # minimal configuration. 27 27 # 28 # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ... 28 # Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ... 29 29 # 30 30 # Modif 18/11/2011 31 31 # changes for option real 8. 32 32 # We compile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM 33 # but with -r4 for netcdf. Variable real must be set to 33 # but with -r4 for netcdf. Variable real must be set to 34 34 # r4 or r8 at the beginning of the script below. 35 35 # … … 40 40 41 41 ################################################################ 42 # Choice of installation options 42 # Choice of installation options 43 43 ################################################################ 44 44 … … 149 149 150 150 -r "svn_release" : either the svn release number or "last" 151 151 152 152 -compiler gfortran|ifort|pgf90 (default: gfortran) 153 153 … … 164 164 165 165 -netcdf PATH : full path to an existing installed NetCDF library 166 (without -netcdf: also download and install the NetCDF library) 167 166 (without -netcdf: also download and install the NetCDF library) 167 168 168 -xios also download and compile the XIOS library 169 169 (requires the NetCDF4-HDF5 library, also installed by default) … … 173 173 174 174 -cosp to run without our with cospv1 or cospv2 [none/v1/v2] 175 175 176 176 -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code 177 177 … … 201 201 "-d") grid_resolution=$2 ; shift ; shift ;; 202 202 "-gprof") OPT_GPROF="-pg" ; shift ;; 203 "-cosp") cosp=$2 203 "-cosp") cosp=$2 204 204 case $cosp in 205 205 "none"|"v1"|"v2") cosp=$2 ; shift ; shift ;; … … 246 246 v2) opt_cosp="-cospv2 true" ;; 247 247 esac 248 248 249 249 # Check on veget version 250 250 #if [ "$veget" != 'NONE' -a "$veget" != "CMIP6" -a "$veget" != +([0-9]) ] ; then … … 252 252 re='^[0-9]+$' 253 253 if ! [[ $veget =~ $re ]] ; then 254 echo 'Valeur de l option veget non valable' 254 echo 'Valeur de l option veget non valable' 255 255 exit 256 256 fi … … 262 262 #For use with tutorial, orchidee_rev is also defined (will be written in surface_env at the end of the script) 263 263 orchidee_rev='' 264 else 265 suff_orc='_orch' 266 fi 267 268 269 if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi 264 else 265 suff_orc='_orch' 266 fi 267 268 269 if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi 270 270 271 271 #Chemin pour placer le modele … … 315 315 make=make ; 316 316 o_ins_make="-t g95" ;; 317 317 318 318 *) if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then 319 319 path_mpi=`which mpif90 | sed -e s:/mpif90::` ; … … 389 389 390 390 ## if also compiling XIOS, parallel must be mpi_omp 391 if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then 391 if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then 392 392 echo "Error, you must set -parallel mpi_omp if you want XIOS" 393 393 exit … … 517 517 518 518 #### Ehouarn: test if the required shell is available 519 #### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh 519 #### Maj FH-LF-AS 2021-04 : default=bash ; if bash missing, use ksh 520 520 use_shell="bash" # default 521 521 if [ "`which bash`" = "" ] ; then … … 628 628 echo '##########################################################' 629 629 echo `date` 630 630 631 631 cd $MODEL/modipsl 632 632 \rm -rf lib/* … … 644 644 -e 's:#-Q- g95 M_K = gmake:#-Q- g95 M_K = make:' \ 645 645 tmp >| AA_make.gdef 646 646 647 647 if [ $pcmac == 1 ] 648 648 then … … 650 650 sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef 651 651 fi 652 653 652 653 654 654 # We use lines for g95 even for the other compilers to run ins_make 655 655 if [ "$use_shell" = "ksh" ] ; then … … 662 662 exit 1 663 663 fi 664 664 665 665 chmod u=rwx ins_make.bash 666 666 ./ins_make.bash $o_ins_make 667 667 fi # of if [ "$use_shell" = "ksh" ] 668 668 669 669 echo install_lmdz.sh MODIPSL_OK `date` 670 670 671 671 cd $MODEL/modipsl/modeles/IOIPSL/src 672 672 ioipsllog=`pwd`/ioipsl.log … … 676 676 echo `date` 677 677 echo log file : $ioipsllog 678 678 679 679 if [ "$use_shell" = "bash" ] ; then 680 680 cp Makefile Makefile.ksh … … 703 703 $make > $ioipsllog 2>&1 704 704 fi 705 # fi # of if [ "$pclinux" = 1 ] 706 705 # fi # of if [ "$pclinux" = 1 ] 706 707 707 else # of if [ $ioipsl = 1 ] 708 708 if [ ${hostname:0:5} = jean- ] ; then … … 720 720 cd $MODEL/modipsl/modeles/IOIPSL/tools 721 721 gmake > ioipsl.log 722 722 723 723 fi 724 724 echo install_lmdz.sh ioipsl_OK `date` … … 763 763 set +e ; svn upgrade ; set -e 764 764 if [ "$veget" = "CMIP6" ] ; then 765 veget_version=orchidee2.0 765 veget_version=orchidee2.0 766 766 orchidee_rev=6592 767 else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches 767 else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches 768 768 veget_version=orchidee2.1 769 769 orchidee_rev=$veget … … 776 776 orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'` 777 777 # switch to that branch 778 echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr 778 echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr 779 779 svn switch -r $veget --accept theirs-full svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch 780 780 svn log -r $veget | grep $veget … … 784 784 fi 785 785 set -e 786 set +e ; svn update -r $veget ; set -e 786 set +e ; svn update -r $veget ; set -e 787 787 fi 788 788 # Correctif suite debug Jean-Zay … … 811 811 ################################################################### 812 812 if [ "$veget_version" == "false" ] ; then veget_version=orchidee2.0 ; fi 813 cd arch 813 cd arch 814 814 sed -e s:"%COMPILER .*.$":"%COMPILER $compiler":1 \ 815 815 -e s:"%LINK .*.$":"%LINK $compiler":1 \ … … 828 828 echo 'XIOS_INCDIR=${ORCHDIR}/../XIOS/inc' >> arch-local.path 829 829 echo 'XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"' >> arch-local.path 830 cd ../ 830 cd ../ 831 831 832 832 echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none -arch $arch … … 846 846 cd .. 847 847 done 848 fi # of "if [ -d tools ]" 848 fi # of "if [ -d tools ]" 849 849 echo install_lmdz.sh orchidee_compil_seq_OK `date` 850 fi # of if [ "$veget" != 'NONE' ] 850 fi # of if [ "$veget" != 'NONE' ] 851 851 852 852 … … 948 948 949 949 echo '##################################################################' 950 echo "Preparing script compile.sh for LMDZ compilation" 951 echo "It will only be run automatically if bench=1/tuto" 950 echo "Preparing script compile.sh for LMDZ compilation" 951 echo "It will only be run automatically if bench=1/tuto" 952 952 echo Here bench=$bench 953 953 echo '##################################################################' … … 957 957 if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm $optim -arch $arch -j 8 " ; else makelmdz="makelmdz $optim -arch $arch" ; fi 958 958 959 # sequential compilation 959 # sequential compilation 960 960 if [ "$sequential" = 1 ] ; then 961 961 echo Sequential compilation command, saved in compile.sh: … … 963 963 echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " >> compile.sh 964 964 chmod +x ./compile.sh 965 if [ $bench = 1 ] ; then 965 if [ $bench = 1 ] ; then 966 966 echo install_lmdz.sh start_lmdz_seq_compilation `date` 967 967 echo log file: $lmdzlog 968 ./compile.sh > $lmdzlog 2>&1 968 ./compile.sh > $lmdzlog 2>&1 969 969 echo install_lmdz.sh end_lmdz_seq_compilation `date` 970 970 fi … … 981 981 \rm -rf bin/ lib/ 982 982 tar xf ioipsl.tar 983 # 983 # 984 984 # Orchidee 985 985 # … … 1035 1035 echo resol=${grid_resolution} >> compile.sh 1036 1036 if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then 1037 1038 echo LMDZ compilation command in parallel mode, saved in compile.sh, is : 1037 1038 echo LMDZ compilation command in parallel mode, saved in compile.sh, is : 1039 1039 echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige ! )" 1040 1040 # ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige 1041 1041 echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh 1042 echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 1043 else 1042 echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 1043 else 1044 1044 echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh 1045 echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 1046 fi 1045 echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm 1046 fi 1047 1047 chmod +x ./compile.sh 1048 1048 … … 1050 1050 echo Compiling LMDZ in parallel mode `date`, LMDZ log file: $lmdzlog ; ./compile.sh > $lmdzlog 2>&1 1051 1051 fi 1052 1052 1053 1053 fi # of if [ $parallel != "none" ] 1054 1054 … … 1094 1094 echo ' Running a test run ' 1095 1095 echo '##########################################################' 1096 1096 1097 1097 \rm -rf BENCH${grid_resolution} 1098 1098 bench=bench_lmdz_${grid_resolution} … … 1102 1102 echo install_lmdz.sh after bench download `date` 1103 1103 tar xvf $bench.tar.gz 1104 1104 1105 1105 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1106 1106 cd BENCH${grid_resolution} … … 1112 1112 \mv -f tmp config.def 1113 1113 cd .. 1114 fi 1115 1114 fi 1115 1116 1116 if [ -n "$physiq" ]; then 1117 1117 cd BENCH${grid_resolution} … … 1126 1126 echo using standard physiq.def 1127 1127 fi 1128 1128 1129 1129 if [ "$with_xios" = "y" ] ; then 1130 1130 cd BENCH${grid_resolution} … … 1139 1139 sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp 1140 1140 \mv -f tmp iodef.xml 1141 1141 1142 1142 # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE. 1143 1143 # except for histday … … 1155 1155 echo "### XIOS outputs" >> config.def 1156 1156 echo 'ok_all_xml=.true.' >> config.def 1157 1157 1158 1158 #activer les sorties pour Cosp 1159 if [ "$cosp" = "v1" ] ; then 1159 if [ "$cosp" = "v1" ] ; then 1160 1160 histfile=file_def_histdayCOSP_lmdz.xml 1161 1161 sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile … … 1173 1173 sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile 1174 1174 fi 1175 1175 1176 1176 cd .. 1177 1177 fi 1178 1178 1179 1179 # Cas Bensh avec ecrad 1180 1180 if [ "$rad" = "ecrad" ] ; then … … 1190 1190 \mv tmpdef physiq.def 1191 1191 cd .. 1192 1192 1193 1193 cp $gcm BENCH${grid_resolution}/gcm.e 1194 1194 1195 1195 cd BENCH${grid_resolution} 1196 1196 # On cree le fichier bench.sh au besoin 1197 1197 # Dans le cas 48x36x39 le bench.sh existe deja en parallele 1198 1198 1199 1199 if [ "$grid_resolution" = "48x36x39" ] ; then 1200 1200 echo On ne touche pas au bench.sh … … 1209 1209 echo "export OMP_NUM_THREADS=2" >> bench.sh 1210 1210 fi 1211 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1212 if [ ${hostname:0:5} = jean- ] ; then 1211 if [ "$cosp" = "v1" -o "$cosp" = "v2" ] ; then 1212 if [ ${hostname:0:5} = jean- ] ; then 1213 1213 chmod +x ../arch.env 1214 1214 ../arch.env 1215 1215 echo "ulimit -s 2000000" >> bench.sh 1216 1216 else 1217 echo "ulimit -s 200000" >> bench.sh 1217 echo "ulimit -s 200000" >> bench.sh 1218 1218 fi 1219 1219 else … … 1221 1221 fi 1222 1222 if [ ${hostname:0:5} = jean- ] ; then 1223 . ../arch/arch-${arch}.env 1223 . ../arch/arch-${arch}.env 1224 1224 echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing 2>&1" >> bench.sh 1225 1225 else … … 1268 1268 set -e 1269 1269 tail listing 1270 1271 1270 1271 1272 1272 echo '##########################################################' 1273 1273 echo 'Simulation finished in' `pwd` … … 1310 1310 #echo surface_env file created in $MODEL 1311 1311 echo 'veget='$veget > surface_env 1312 #opt_veget="-v $veget_version" 1312 #opt_veget="-v $veget_version" 1313 1313 #echo 'opt_veget="'$opt_veget\" >> surface_env 1314 1314 echo 'opt_veget="'-v $veget_version\" >> surface_env 1315 1315 echo 'orchidee_rev='$orchidee_rev >> surface_env 1316 1316 echo 'suforch='$suff_orc >> surface_env 1317 1318 1319 1320 1317 1318 1319 1320
Note: See TracChangeset
for help on using the changeset viewer.