@@ -21,62 +21,69 @@ set -e
21
21
22
22
if (( $# < 1 ))
23
23
then
24
- echo " The output case directory must be set."
25
- echo " usage: FROM THE TOP LEVEL DIRECTORY run: bash ./ u-dales/tools/hpc_gather.sh <PATH_TO_OUTPUT_CASE >"
24
+ echo " The experiment directory must be set."
25
+ echo " usage: FROM THE TOP LEVEL DIRECTORY run: u-dales/tools/hpc_gather.sh <PATH_TO_CASE >"
26
26
exit 1
27
27
fi
28
28
29
- # # go to output case directory
29
+ # # go to experiment directory
30
30
pushd $1
31
- outdir =$( pwd)
31
+ inputdir =$( pwd)
32
32
33
33
# # set experiment number via path
34
- exp=" ${outdir : -3} "
34
+ exp=" ${inputdir : -3} "
35
35
36
36
echo " experiment number: $exp "
37
37
38
38
# # read in additional variables
39
39
if [ -f config.sh ]; then
40
40
source config.sh
41
41
else
42
- echo " config.sh must be there inside $outdir "
42
+ echo " config.sh must be there inside $inputdir "
43
43
exit 1
44
44
fi
45
45
46
46
# # check if required variables are set
47
+ if [ -z $DA_WORKDIR ]; then
48
+ echo " Script directory DA_WORKDIR must be set inside $inputdir /config.sh"
49
+ exit 1
50
+ fi ;
47
51
if [ -z $DA_TOOLSDIR ]; then
48
- echo " Script directory DA_TOOLSDIR must be set inside $outdir /config.sh"
52
+ echo " Script directory DA_TOOLSDIR must be set inside $inputdir /config.sh"
49
53
exit 1
50
54
fi ;
51
55
if [ -z $NNODE ]; then
52
- echo " Script directory NNODE must be set inside $outdir /config.sh"
56
+ echo " Script directory NNODE must be set inside $inputdir /config.sh"
53
57
exit 1
54
58
fi ;
55
59
if [ -z $NCPU ]; then
56
- echo " Script directory NCPU must be set inside $outdir /config.sh"
60
+ echo " Script directory NCPU must be set inside $inputdir /config.sh"
57
61
exit 1
58
62
fi ;
59
63
if [ -z $WALLTIME ]; then
60
- echo " Script directory WALLTIME must be set inside $outdir /config.sh"
64
+ echo " Script directory WALLTIME must be set inside $inputdir /config.sh"
61
65
exit 1
62
66
fi ;
63
67
if [ -z $MEM ]; then
64
- echo " Script directory MEM must be set inside $outdir /config.sh"
68
+ echo " Script directory MEM must be set inside $inputdir /config.sh"
65
69
exit 1
66
70
fi ;
67
71
72
+ # # set the output directory
73
+ outdir=$DA_WORKDIR /$exp
74
+
75
+ echo " writing post-job.$exp ."
76
+
68
77
# # write post-job.exp file for HPC
69
78
cat << EOF > post-job.$exp
70
79
#!/bin/bash
71
80
#PBS -l walltime=${WALLTIME}
72
81
#PBS -l select=${NNODE} :ncpus=${NCPU} :mem=${MEM}
73
- module load intel/2024a netCDF/4.9.2-iimpi-2023a netCDF-Fortran/4.6.1-iimpi-2023a NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
82
+ module load NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
74
83
$DA_TOOLSDIR /gather_outputs.sh $outdir
75
84
EOF
76
85
77
86
# # submit post-job.exp file to queue
78
87
qsub post-job.$exp
79
88
80
89
echo " post-job.$exp submitted."
81
-
82
- popd
0 commit comments