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