1 | |
---|
2 | export TARGETMODE=${target_mode} |
---|
3 | |
---|
4 | # echo ' ' |
---|
5 | if [ "$MAKETARGET" = all ]; then |
---|
6 | echo 'The model will be updated.' |
---|
7 | echo ' Target mode: '$TARGETMODE |
---|
8 | echo ' Message passing : '$CHAN |
---|
9 | elif [ "$MAKETARGET" = lib ]; then |
---|
10 | echo 'The model library will be created; no executable.' |
---|
11 | echo ' Target mode: '$TARGETMODE |
---|
12 | elif [ "$MAKETARGET" = clean ]; then |
---|
13 | echo 'The model build directory and model libraries will be cleaned.' |
---|
14 | elif [ "$MAKETARGET" = tar ]; then |
---|
15 | echo 'A tar-file of the model including all necessary ' |
---|
16 | echo 'libraries will be created.' |
---|
17 | fi |
---|
18 | echo ' ' |
---|
19 | |
---|
20 | if [ $CHAN = NONE ]; then |
---|
21 | export COUPLER=NONE |
---|
22 | fi |
---|
23 | |
---|
24 | export SUBMOD1="" |
---|
25 | export SUBMOD1LIB="" |
---|
26 | |
---|
27 | # |
---|
28 | # Version acronyms must start with "_" |
---|
29 | # |
---|
30 | |
---|
31 | vers_pref=` echo ${model_version} | cut -c1-1 ` |
---|
32 | if [ ! "${vers_pref}" = "_" ] && [ ! "${vers_pref}" = "" ]; then |
---|
33 | echo ERROR: The compile script does not have a valid model version. |
---|
34 | echo ' A model version acronym must start with an underscore.' |
---|
35 | echo ' The compilation is stopped!' |
---|
36 | exit 1 |
---|
37 | fi |
---|
38 | |
---|
39 | export MODVERS=${model_version} |
---|
40 | |
---|
41 | # |
---|
42 | # check against list of possible partner models: |
---|
43 | # |
---|
44 | |
---|
45 | for cpl_mod in ${cpl_to}; do |
---|
46 | cpl_to_ok=not_ok |
---|
47 | for poss_cpl_mod in ${poss_cpl_mods}; do |
---|
48 | if [ ${cpl_mod} = ${poss_cpl_mod} ] || [ ${cpl_mod} = ${MODEL_DIR} ];then |
---|
49 | cpl_to_ok=ok |
---|
50 | fi |
---|
51 | done |
---|
52 | if [ "${cpl_to_ok}" = "not_ok" ]; then |
---|
53 | echo ERROR: Model ${cpl_mod} specified in the list of partner models |
---|
54 | echo ' does not appear in the list of possible partner models.' |
---|
55 | echo ' Check the lists and try again.' |
---|
56 | echo 'The compilation is stopped.' |
---|
57 | exit 1 |
---|
58 | fi |
---|
59 | done |
---|
60 | |
---|
61 | echo '***********************************************************************' |
---|
62 | echo '*' |
---|
63 | if [ "${cpl_to}" = "" ] || [ "${cpl_to}" = " " ] || \ |
---|
64 | [ "${cpl_to}" = ${MODEL_DIR} ]; then |
---|
65 | echo '* The model is prepared for an uncoupled constellation.' |
---|
66 | else |
---|
67 | echo '* The model is prepared for a coupled model constellation with :' |
---|
68 | for cpl_mod in ${cpl_to}; do |
---|
69 | echo '* '${cpl_mod} |
---|
70 | done |
---|
71 | fi |
---|
72 | echo '*' |
---|
73 | echo '***********************************************************************' |
---|
74 | |
---|
75 | if [ ! $CHAN = NONE ] && [ ! $MODEL_DIR = "oasis3" ] && [ "${cpl_to}" = " " ]; then |
---|
76 | echo '***********************************************************************' |
---|
77 | echo '*' |
---|
78 | echo '* Message passing MPI1/2 without partner model is not possible!' |
---|
79 | echo '* The compilation is stopped!' |
---|
80 | echo '*' |
---|
81 | echo '***********************************************************************' |
---|
82 | exit 1 |
---|
83 | fi |
---|