1 | #!/bin/bash |
---|
2 | # script to download and install the latest version of IOIPSL on Jean Zay |
---|
3 | # |
---|
4 | |
---|
5 | #0. Preliminary stuff |
---|
6 | |
---|
7 | if (( $# == 0 )) |
---|
8 | then |
---|
9 | # default behavior: get latest version of IOIPSL |
---|
10 | rev="HEAD" |
---|
11 | else |
---|
12 | # but otherwise the first argument of the script can be the version to use |
---|
13 | if (( $# == 1 )) |
---|
14 | then |
---|
15 | rev=$1 |
---|
16 | else |
---|
17 | echo "Error, invalid script arguments" |
---|
18 | echo "Usage:" |
---|
19 | echo "$0 rev" |
---|
20 | echo " where optional rev is the IOIPSL revision number" |
---|
21 | exit |
---|
22 | fi |
---|
23 | fi |
---|
24 | |
---|
25 | # cleanup possible previous attempt: |
---|
26 | \rm -rf ../../IOIPSL modipsl |
---|
27 | |
---|
28 | # 1. Get IOIPSL |
---|
29 | # move up at same level as LMDZ.COMMON , etc. |
---|
30 | cd ../.. |
---|
31 | svn co --username icmc_users --password icmc2022 --non-interactive --revision $rev http://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/trunk IOIPSL |
---|
32 | |
---|
33 | # 2. Set correct settings: copy over arch.* files |
---|
34 | cd IOIPSL |
---|
35 | cp -f ../LMDZ.COMMON/arch/arch-BAO_YGG.env arch |
---|
36 | cp -f ../LMDZ.COMMON/arch/arch-BAO_YGG.path arch |
---|
37 | cp -f ../LMDZ.COMMON/arch/arch-BAO_YGG.fcm arch |
---|
38 | |
---|
39 | # 2.1 Switch ksh to bash in IOIPSL |
---|
40 | sed -i -e s:'/bin/ksh':"/bin/bash":1 ins_m_prec |
---|
41 | |
---|
42 | ## 3. build ioipsl: |
---|
43 | ./makeioipsl_fcm -arch BAO_YGG -job 8 > makeioipsl.out 2>&1 |
---|
44 | |
---|
45 | ## 4. Check if the library was indeed built: |
---|
46 | whereami=`pwd -P` |
---|
47 | if [[ -f lib/libioipsl.a ]] |
---|
48 | then |
---|
49 | echo "OK: ioipsl library is in ${whereami}/lib" |
---|
50 | else |
---|
51 | echo "Something went wrong... check messages in ${whereami}/makeioipsl.out" |
---|
52 | exit |
---|
53 | fi |
---|
54 | |
---|
55 | ## 5. Comply with old setup and make appropriate links |
---|
56 | cd ../LMDZ.COMMON/ioipsl |
---|
57 | mkdir modipsl |
---|
58 | cd modipsl |
---|
59 | # lib + module files |
---|
60 | mkdir lib |
---|
61 | cd lib |
---|
62 | ln -s ../../../../IOIPSL/lib/libioipsl.a . |
---|
63 | ln -s ../../../../IOIPSL/inc/* . |
---|
64 | cd .. |
---|
65 | # rebuild utility |
---|
66 | mkdir bin |
---|
67 | cd bin |
---|
68 | ln -s ../../../../IOIPSL/bin/* . |
---|
69 | |
---|