1 | #!/bin/bash |
---|
2 | # script to download and install the latest version of IOIPSL on occigen |
---|
3 | # |
---|
4 | |
---|
5 | #0. Preliminary stuff |
---|
6 | module purge |
---|
7 | #module load intel/15.6.233 |
---|
8 | #module load intelmpi/5.1.3.258 |
---|
9 | #module load hdf5/1.8.14 |
---|
10 | #module load netcdf/4.3.3-rc2_fortran-4.4.1 |
---|
11 | module load intel/17.0 |
---|
12 | module load intelmpi/2017.0.098 |
---|
13 | module load hdf5/1.8.17 |
---|
14 | module load netcdf/4.4.0_fortran-4.4.2 |
---|
15 | |
---|
16 | whereami=`pwd -P` |
---|
17 | |
---|
18 | # 1. Get IOIPSL (via modipsl) |
---|
19 | svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl |
---|
20 | cd modipsl/util |
---|
21 | |
---|
22 | ./model IOIPSL_PLUS |
---|
23 | |
---|
24 | # 2. Set correct settings: |
---|
25 | # add a "occigen" configuration to AA_make.gdef |
---|
26 | echo "#-Q- occigen #- Global definitions for Occigen at CINES, ifort" >> AA_make.gdef |
---|
27 | echo "#-Q- occigen M_K = make" >> AA_make.gdef |
---|
28 | echo "#-Q- occigen P_C = cpp" >> AA_make.gdef |
---|
29 | echo '#-Q- occigen P_O = -P -C $(P_P)' >> AA_make.gdef |
---|
30 | echo "#-Q- occigen F_C = ifort -mcmodel=medium -shared-intel -c" >> AA_make.gdef |
---|
31 | echo "#-Q- occigen #-D- MD F_D = -g" >> AA_make.gdef |
---|
32 | echo "#-Q- occigen #-D- MN F_D =" >> AA_make.gdef |
---|
33 | echo "#-Q- occigen #-P- I4R4 F_P = -integer-size 32" >> AA_make.gdef |
---|
34 | echo "#-Q- occigen #-P- I4R8 F_P = -integer-size 32 -real-size 64" >> AA_make.gdef |
---|
35 | echo "#-Q- occigen #-P- I8R8 F_P = -integer-size 64 -real-size 64" >> AA_make.gdef |
---|
36 | echo '#-Q- occigen F_O = -O $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)' >> AA_make.gdef |
---|
37 | echo "#-Q- occigen F_L = ifort" >> AA_make.gdef |
---|
38 | echo "#-Q- occigen M_M = 0" >> AA_make.gdef |
---|
39 | echo "#-Q- occigen L_X = 0" >> AA_make.gdef |
---|
40 | echo "#-Q- occigen L_O =" >> AA_make.gdef |
---|
41 | echo "#-Q- occigen A_C = ar -r" >> AA_make.gdef |
---|
42 | echo "#-Q- occigen A_G = ar -x" >> AA_make.gdef |
---|
43 | echo "#-Q- occigen C_C = icc -c" >> AA_make.gdef |
---|
44 | echo "#-Q- occigen C_O =" >> AA_make.gdef |
---|
45 | echo "#-Q- occigen C_L = icc" >> AA_make.gdef |
---|
46 | echo "#-Q- occigen #-" >> AA_make.gdef |
---|
47 | echo "#-Q- occigen NCDF_INC = ${NETCDFF_INCDIR}" >> AA_make.gdef |
---|
48 | echo "#-Q- occigen NCDF_LIB = -L${NETCDFF_LIBDIR} -lnetcdff" >> AA_make.gdef |
---|
49 | echo "#-Q- occigen #-" >> AA_make.gdef |
---|
50 | |
---|
51 | # set default working precision for IOIPSL: |
---|
52 | ./ins_make -t occigen -p I4R8 |
---|
53 | |
---|
54 | ## 3. build ioipsl: |
---|
55 | cd ../modeles/IOIPSL/src |
---|
56 | make |
---|
57 | ## Compile the rebuild tool: |
---|
58 | cd ../tools |
---|
59 | make |
---|
60 | |
---|
61 | if [[ -f ${whereami}/modipsl/lib/libioipsl.a ]] |
---|
62 | then |
---|
63 | echo "OK: ioipsl library is in ${whereami}/modipsl/lib" |
---|
64 | else |
---|
65 | echo "Something went wrong..." |
---|
66 | fi |
---|