1 | #!/bin/bash |
---|
2 | ########################################################################## |
---|
3 | # Author : Simona Flavoni for NEMO |
---|
4 | # Contact : sflod@locean-ipsl.upmc.fr |
---|
5 | # |
---|
6 | # ---------------------------------------------------------------------- |
---|
7 | # NEMO/SETTE , NEMO Consortium (2010) |
---|
8 | # Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
9 | # ---------------------------------------------------------------------- |
---|
10 | # |
---|
11 | # Some scripts called by sette.sh |
---|
12 | # prepare_exe_dir.sh : script prepares execution directory for test |
---|
13 | ########################################################################## |
---|
14 | #set -x |
---|
15 | set -o posix |
---|
16 | #set -u |
---|
17 | #set -e |
---|
18 | #+ |
---|
19 | # |
---|
20 | # ================== |
---|
21 | # prepare_exe_dir.sh |
---|
22 | # ================== |
---|
23 | # |
---|
24 | # ---------------------------------------------- |
---|
25 | # Set of functions used by sette.sh (NEMO tests) |
---|
26 | # ---------------------------------------------- |
---|
27 | # |
---|
28 | # SYNOPSIS |
---|
29 | # ======== |
---|
30 | # |
---|
31 | # :: |
---|
32 | # |
---|
33 | # $ ./prepare_exe_dir.sh |
---|
34 | # |
---|
35 | # DESCRIPTION |
---|
36 | # =========== |
---|
37 | # |
---|
38 | # prepare_exe_dir.sh creates execution directory takes name of TEST_NAME defined in every test in sette.sh |
---|
39 | # |
---|
40 | # it is necessary to define in sette.sh TEST_NAME ( example : export TEST_NAME="LONG") to create execution directory in where run test. |
---|
41 | # |
---|
42 | # NOTE : each test has to run in its own directory ( of execution), if not existing files are re-written (for example namelist) |
---|
43 | # |
---|
44 | # EXAMPLES |
---|
45 | # ======== |
---|
46 | # |
---|
47 | # :: |
---|
48 | # |
---|
49 | # $ ./prepare_exe_dir.sh |
---|
50 | # |
---|
51 | # |
---|
52 | # TODO |
---|
53 | # ==== |
---|
54 | # |
---|
55 | # option debug |
---|
56 | # |
---|
57 | # |
---|
58 | # EVOLUTIONS |
---|
59 | # ========== |
---|
60 | # |
---|
61 | # $Id: $ |
---|
62 | # |
---|
63 | # * creation |
---|
64 | #- |
---|
65 | |
---|
66 | |
---|
67 | cd ${CONFIG_DIR} |
---|
68 | mkdir -p ${NEW_CONF}/${TEST_NAME} |
---|
69 | |
---|
70 | # PREPARE EXEC_DIR |
---|
71 | #================== |
---|
72 | export EXE_DIR=${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME} |
---|
73 | |
---|
74 | cp -RL ${CONFIG_DIR}/${NEW_CONF}/EXP00/* ${EXE_DIR}/. |
---|
75 | #cat ${SETTE_DIR}/iodef_sette.xml | sed -e"s;DEF_SHARED;${CONFIG_DIR0}/SHARED;" > ${EXE_DIR}/iodef.xml |
---|
76 | cd ${EXE_DIR} |
---|
77 | # |
---|
78 | # Add summary of the sette.sh set-up used and the current list of keys added or deleted |
---|
79 | COMP_KEYS="`cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | sed -e 's/.*fppkeys *//'`" |
---|
80 | echo "Summary of sette environment" > ./sette_config |
---|
81 | echo "----------------------------" >> ./sette_config |
---|
82 | echo "requested by the command : "$cmd $cmdargs >> ./sette_config |
---|
83 | printf "%-33s : %s\n" USING_TIMING $USING_TIMING >> ./sette_config |
---|
84 | printf "%-33s : %s\n" USING_ICEBERGS $USING_ICEBERGS >> ./sette_config |
---|
85 | printf "%-33s : %s\n" USING_EXTRA_HALO $USING_EXTRA_HALO >> ./sette_config |
---|
86 | printf "%-33s : %s\n" USING_TILING $USING_TILING >> ./sette_config |
---|
87 | printf "%-33s : %s\n" USING_COLLECTIVES $USING_COLLECTIVES >> ./sette_config |
---|
88 | printf "%-33s : %s\n" USING_QCO $USING_QCO >> ./sette_config |
---|
89 | printf "%-33s : %s\n" USING_LOOP_FUSION $USING_LOOP_FUSION >> ./sette_config |
---|
90 | printf "%-33s : %s\n" USING_XIOS $USING_XIOS >> ./sette_config |
---|
91 | printf "%-33s : %s\n" USING_MPMD $USING_MPMD >> ./sette_config |
---|
92 | printf "%-33s : %s\n" USING_RK3 $USING_RK3 >> ./sette_config |
---|
93 | printf "%-33s : %s\n" "Common compile keys added" "$ADD_KEYS" >> ./sette_config |
---|
94 | printf "%-33s : %s\n" "Common compile keys deleted" "$DEL_KEYS" >> ./sette_config |
---|
95 | printf "%-33s : %s\n" "Compile keys actually used" "${COMP_KEYS}" >> ./sette_config |
---|
96 | |
---|
97 | # Remove previously generated output files used for test evaluation |
---|
98 | # (if any) |
---|
99 | [ -f ./ocean.output ] && mv ./ocean.output ./ocean.output.old |
---|
100 | [ -f ./run.stat ] && mv ./run.stat ./run.stat.old |
---|
101 | [ -f ./tracer.stat ] && mv ./tracer.stat ./tracer.stat.old |
---|