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