Changeset 3056
- Timestamp:
- Nov 2, 2017, 2:00:05 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r3044 r3056 89 89 MODEL="" 90 90 91 ## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no 92 with_xios="n" 93 opt_makelmdz_xios="" 94 91 95 ######################################################################### 92 96 # Options interactives … … 116 120 -name LOCAL_MODEL_NAME : default = LMDZversion.release 117 121 122 -netcdf PATH : full path to an existing installed NetCDF library 123 (without -netcdf: also download and install the NetCDF library) 124 125 -xios also download and compile the XIOS library 126 (requires the NetCDF4-HDF5 library, also installed by default) 127 (requires to also have -parallel mpi_omp) 128 118 129 -gprof to compile with -pg to enable profiling with gprof 130 119 131 -SCM install 1D version automatically 132 120 133 -opt_makelmdz to call makelmdz or makelmdz_fcm with additional options 121 134 ........fin … … 134 147 "-bench") bench=$2 ; shift ; shift ;; 135 148 "-name") MODEL=$2 ; shift ; shift ;; 149 "-netcdf") netcdf=$2 ; shift ; shift ;; 150 "-xios") with_xios="y" ; shift ;; 136 151 *) ./install_lmdz.sh -h ; exit 137 152 esac … … 169 184 arch=X64_ADA ;; 170 185 186 cicla) compilo="gfortran" ; 187 if [ $parallel != none ] ; then 188 module load openmpi/1.4.5-gfortran ; 189 root_mpi=$MPI_HOME ; 190 path_mpi=$root_mpi/bin ; 191 par_comp=${path_mpi}/mpif90 ; 192 mpirun=${path_mpi}/mpirun ; 193 fi ; 194 arch=local ; 195 make=make ; 196 o_ins_make="-t g95" ;; 197 171 198 *) compilo="gfortran" ; 172 199 if [ $parallel = none -o -f /usr/bin/mpif90 ] ; then 173 200 path_mpi="" ; 174 # Pour les installations Scientifique Linux LMD ou ciclad : 201 if [ -d /usr/lib64/openmpi ] ; then 202 root_mpi="/usr/lib64/openmpi" 203 else 204 root_mpi="/usr" 205 fi 206 # For Scientifique Linux at LMD : 175 207 elif [ -f /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90 ] ; then 176 path_mpi=/usr/lib64/openmpi/1.4.5-gfortran/bin/ ; 208 path_mpi=/usr/lib64/openmpi/1.4.5-gfortran/bin ; 209 root_mpi=/usr/lib64/openmpi/1.4.5-gfortran ; 210 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH 177 211 else 178 echo Je ne trouve pas mpif90;212 echo "Cannot find mpif90" ; 179 213 exit ; 180 214 fi ; 181 par_comp=${path_mpi} mpif90 ;182 mpirun=${path_mpi} mpirun ;215 par_comp=${path_mpi}/mpif90 ; 216 mpirun=${path_mpi}/mpirun ; 183 217 arch=local ; 184 218 make=make ; … … 188 222 189 223 # MPI_FLAGS are the flags needed for compilation with MPI 190 MPI_FLAGS="-I/usr/include/openmpi-x86_64 -fcray-pointer"224 #MPI_FLAGS="-I/usr/include/openmpi-x86_64 -fcray-pointer" 191 225 MPI_FLAGS="-fcray-pointer" 192 226 # MPI_LD are the flags needed for linking with MPI … … 195 229 OMP_FLAGS="-fopenmp -fcray-pointer" 196 230 # OMP_LD are the flags needed for linking with OpenMP 197 OMP_LD="-fopenmp -L/usr/lib64 -lnuma"231 #OMP_LD="-fopenmp -L/usr/lib64 -lnuma" 198 232 OMP_LD="-fopenmp" 199 233 … … 226 260 ##################################################################### 227 261 228 262 ## if also compiling XIOS, parallel must be mpi_omp 263 if [ "$with_xios" = "y" -a "$parallel" != "mpi_omp" ] ; then 264 echo "Error, you must set -parallel mpi_omp if you want XIOS" 265 exit 266 fi 267 if [ "$with_xios" = "y" ] ; then 268 opt_makelmdz_xios="-io xios" 269 fi 229 270 230 271 echo '################################################################' … … 394 435 echo '##########################################################' 395 436 cd $MODEL 396 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz 397 myget netcdf-4.0.1.tar.gz 398 gunzip netcdf-4.0.1.tar.gz 399 tar xvf netcdf-4.0.1.tar 400 \rm -f netcdf-4.0.1.tar 401 402 cd netcdf-4.0.1 403 404 sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure 405 localdir=`pwd -P` 406 ./configure --prefix=$localdir --enable-shared --disable-cxx 407 sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile 408 $make check 409 $make install 437 if [ "$with_xios" = "n" ] ; then 438 # keep it simple 439 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/netcdf-4.0.1.tar.gz 440 myget netcdf-4.0.1.tar.gz 441 gunzip netcdf-4.0.1.tar.gz 442 tar xvf netcdf-4.0.1.tar 443 \rm -f netcdf-4.0.1.tar 444 445 cd netcdf-4.0.1 446 447 # seds to possibly use gfortran44 obsolete nowdays (Ehouarn: 10/2017) 448 #sed -e 's/gfortran/'$gfortran'/g' configure >| tmp ; mv -f tmp configure ; chmod +x configure 449 localdir=`pwd -P` 450 ./configure --prefix=$localdir --enable-shared --disable-cxx 451 #sed -e 's/gfortran/'$gfortran'/g' Makefile >| tmp ; mv -f tmp Makefile 452 $make check 453 $make install 454 else 455 # download and compile hdf5 and netcdf, etc. using the install_netcdf4_hdf5.bash script 456 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_netcdf4_hdf5.bash 457 myget install_netcdf4_hdf5.bash 458 chmod u=rwx install_netcdf4_hdf5.bash 459 if [ "$compilo" = "gfortran" ] ; then 460 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi 461 elif [ "$compilo" = "ifort" ] ; then 462 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi 463 elif [ "$compilo" = "pgf90" ] ; then 464 ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi 465 else 466 echo "unexpected compiler $compilo" ; exit 467 fi 468 fi # of if [ "$with_xios" = "n" ] 410 469 echo install.sh netcdf_OK `date` 411 470 fi # of if [ $netcdf = 1 ] … … 420 479 421 480 if [ $netcdf = 0 -o $netcdf = 1 ] ; then 422 ncdfdir=$MODEL/netcdf-4.0.1 481 if [ "$with_xios" = "y" ] ; then 482 ncdfdir=$MODEL/netcdf4_hdf5 483 else 484 ncdfdir=$MODEL/netcdf-4.0.1 485 fi 423 486 else 424 ncdfdir=$netcdf487 ncdfdir=$netcdf 425 488 fi 426 489 … … 523 586 cd $MODEL/modipsl 524 587 tar cf ioipsl.tar lib/ bin/ 588 589 #=========================================================================== 590 if [ "$with_xios" = "y" ] ; then 591 echo '##########################################################' 592 echo 'Compiling XIOS' 593 echo '##########################################################' 594 cd $MODEL/modipsl/modeles 595 #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_xios.bash 596 myget install_xios.bash 597 chmod u=rwx install_xios.bash 598 ./install_xios.bash -prefix $MODEL/modipsl/modeles \ 599 -netcdf ${ncdfdir} -hdf5 ${ncdfdir} \ 600 -MPI $root_mpi -arch $arch 601 fi 525 602 526 603 #============================================================================ … … 632 709 633 710 634 cd $MODEL/modipsl/modeles/LMD *711 cd $MODEL/modipsl/modeles/LMDZ* 635 712 636 713 ################################################################## 637 # Mise a jour eventuelle de LMDZ en cas de specification de la release svn714 # Possibly update LMDZ if a specific svn release is requested 638 715 ################################################################## 639 716 … … 666 743 # compiling in parallel mode 667 744 if [ $parallel != "none" ] ; then 668 echo '##########################################################'669 echo ' Parallel compile '670 echo '##########################################################'671 # saving the sequential libs and binaries672 cd $MODEL/modipsl673 tar cf sequential.tar bin/ lib/674 \rm -rf bin/ lib/675 tar xf ioipsl.tar676 #677 # Orchidee678 #679 cd $ORCHPATH680 if [ -d src_parallel ] ; then745 echo '##########################################################' 746 echo ' Parallel compile ' 747 echo '##########################################################' 748 # saving the sequential libs and binaries 749 cd $MODEL/modipsl 750 tar cf sequential.tar bin/ lib/ 751 \rm -rf bin/ lib/ 752 tar xf ioipsl.tar 753 # 754 # Orchidee 755 # 756 cd $ORCHPATH 757 if [ -d src_parallel ] ; then 681 758 cd arch 682 759 sed \ … … 691 768 mv tmp.fcm arch-local.fcm 692 769 cd ../ 693 # compiling ORCHIDEE parallel mode770 # compiling ORCHIDEE parallel mode 694 771 ./makeorchidee_fcm -j 8 -clean -noxios -prod -parallel $parallel -arch $arch 695 772 ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch … … 697 774 echo ./makeorchidee_fcm -j 8 -noxios -prod -parallel $parallel -arch $arch 698 775 echo deuxieme compilation orchidee ; pwd 699 else 700 echo '##########################################################' 701 echo ' Orchidee version too old ' 702 echo ' Please update to new version ' 703 echo '##########################################################' 704 exit 705 fi 706 # LMDZ 707 cd $LMDZPATH 708 if [ $arch = local ] ; then 709 cd arch 710 sed -e s:"%COMPILER.*.$":"%COMPILER $par_comp":1 \ 711 -e s:"%LINK.*.$":"%LINK $par_comp":1 \ 712 -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS $MPI_FLAGS":1 \ 713 -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS $OMP_FLAGS":1 \ 714 -e s:"%MPI_LD.*.$":"%MPI_LD $MPI_LD":1 \ 715 -e s:"%OMP_LD.*.$":"%OMP_LD $OMP_LD":1 \ 716 arch-local.fcm > tmp.fcm 717 mv tmp.fcm arch-local.fcm 718 cd ../ 719 fi 720 rm -f compile.sh 721 if [ ${hostname:0:5} = ada33 ] ; then echo "module load intel/2013.0" > compile.sh ; fi 722 echo resol=${grid_resolution} >> compile.sh 723 echo ./$makelmdz $OPT_MAKELMDZ -rrtm true -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh 724 chmod +x ./compile.sh ; ./compile.sh 725 726 echo Compilation finished 727 728 fi 776 else 777 echo '##########################################################' 778 echo ' Orchidee version too old ' 779 echo ' Please update to new version ' 780 echo '##########################################################' 781 exit 782 fi # of if [ -d src_parallel ] 783 # LMDZ 784 cd $LMDZPATH 785 if [ $arch = local ] ; then 786 cd arch 787 sed -e s:"%COMPILER.*.$":"%COMPILER $par_comp":1 \ 788 -e s:"%LINK.*.$":"%LINK $par_comp":1 \ 789 -e s:"%MPI_FFLAG.*.$":"%MPI_FFLAGS $MPI_FLAGS":1 \ 790 -e s:"%OMP_FFLAG.*.$":"%OMP_FFLAGS $OMP_FLAGS":1 \ 791 -e s@"%BASE_LD.*.$"@"%BASE_LD -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib"@1 \ 792 -e s:"%MPI_LD.*.$":"%MPI_LD $MPI_LD":1 \ 793 -e s:"%OMP_LD.*.$":"%OMP_LD $OMP_LD":1 \ 794 arch-local.fcm > tmp.fcm 795 mv tmp.fcm arch-local.fcm 796 cd ../ 797 fi 798 rm -f compile.sh 799 if [ ${hostname:0:5} = ada33 ] ; then echo "module load intel/2013.0" > compile.sh ; fi 800 echo resol=${grid_resolution} >> compile.sh 801 echo ./$makelmdz $OPT_MAKELMDZ -rrtm true $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh 802 chmod +x ./compile.sh ; ./compile.sh 803 804 echo "Compilation finished" 805 806 fi # of if [ $parallel != "none" ] 729 807 730 808 echo LLLLLLLLLLLLLLLLLLLLLLLLLLL … … 748 826 if [ "$gcm" = "" ] ; then 749 827 echo 'Compilation failed !!' 750 exit 828 # Ehouarn : temporary, do not exit and let job finish (to set up bench case) 829 #exit 830 set +e 751 831 else 752 832 echo '##########################################################' … … 774 854 tar xvf $bench.tar.gz 775 855 856 if [ "$with_xios" = "y" ] ; then 857 cd BENCH${grid_resolution} 858 cp ../DefLists/iodef.xml . 859 cp ../DefLists/context_lmdz.xml . 860 cp ../DefLists/field_def_lmdz.xml . 861 cp ../DefLists/file_def_hist*xml . 862 # adapt iodef.xml to use attached mode 863 sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp 864 \mv -f tmp iodef.xml 865 # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE. 866 # except for histday 867 for histfile in file_def_hist*xml 868 do 869 if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then 870 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile 871 else 872 sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile 873 fi 874 done 875 # and add option "ok_all_xml=y" in config.def 876 echo "### XIOS outputs" >> config.def 877 echo 'ok_all_xml=.true.' >> config.def 878 cd .. 879 fi 880 776 881 cp $gcm BENCH${grid_resolution}/gcm.e 777 778 882 779 883 cd BENCH${grid_resolution}
Note: See TracChangeset
for help on using the changeset viewer.