-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
executable file
·72 lines (58 loc) · 2.57 KB
/
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#
# Jul 2024: Creating steering script with sourced config files
# J. Streffind, E. Tourigny, M. Athanase
#
#
################################################################
#
# Warning: This steering script needs to be modified for each
# platform/HPC. Please edit required lines, as
# indicated by comments "USER EDIT REQUIRED".
#
################################################################
## USER EDIT REQUIRED ##
#source config/ecmwf_hpc2020.sh
source config/dkrz_levante.sh
cd ${TMPPATH}
${LOAD_ENV}
## USER EDIT REQUIRED ##
## Comment/uncomment the line below to create template file for a given resolution, run only once for a new resolution
#bash ${SCRIPTPATH}/create_template_OIFS.sh $RES $EXPID $FESOM_MESH ${INPATH_TEMPLATE} $TEMPLATES $CDO
#exit 0
## use this script to format data used at AWI instead of downloading from mars using get_inputdata_mars.sh script
## this could be replaced by (untested)
#grib_copy -w dataTime=0/6/12/18 E5ml00_1H_${year}-${month}-*_{129,130,138,152,155} [dataDate][dataTime].sp
#grib_copy -w dataTime=0/6/12/18 E5ml00_1H_${year}-${month}-*_133 [dataDate][dataTime].gp
#bash ${SCRIPTPATH}/preprocess_inputdata_year.sh ${CDO} ${SCRIPTPATH} ${POOL} ${INPATH} ${DATA_SET} ${BYEAR} ${EYEAR}
## New workflow calling scripts for individual months directly at ECMWF
for CYEAR in `seq ${BYEAR} ${EYEAR}`
do
for mon in `seq ${BMONTH} ${EMONTH}`
do
MONTH=$(printf "%02d" $mon)
script="int_${DATA_SET}${RES}_${CYEAR}${MONTH}.sh"
rm -f ${script}
if [ "$DATASOURCE" == "MARS" ]; then
echo "Data source is MARS"
cat > ${script} <<EOF
#!/bin/bash
export SUBMIT='bash'
export LOAD_ENV='${LOAD_ENV}'
bash ${SCRIPTPATH}/get_inputdata_mars.sh ${INPATH} ${DATA_SET} ${CYEAR} ${MONTH}
bash ${SCRIPTPATH}/int_cdo.sh ${CDO} ${TEMPLATES}/template.oifs${RES} ${DATA_SET} ${SCRIPTPATH} ${RES} ${INPATH}/${DATA_SET}${CYEAR}${MONTH} ${OUTPATH}/${RES} ${TMPPATH}/${DATA_SET}${CYEAR}${MONTH}/tmp_${DATA_SET}${RES}
EOF
elif [ "$DATASOURCE" == "POOL" ]; then
echo "Data source is POOL"
cat > ${script} <<EOF
#!/bin/bash
export SUBMIT='bash'
export LOAD_ENV='${LOAD_ENV}'
bash ${SCRIPTPATH}/get_inputdata_pool.sh ${CDO} ${SCRIPTPATH} ${POOL} ${INPATH}/${DATA_SET}${CYEAR}${MONTH} ${DATA_SET} ${CYEAR} ${MONTH}
bash ${SCRIPTPATH}/int_cdo.sh ${CDO} ${TEMPLATES}/template.oifs${RES} ${DATA_SET} ${SCRIPTPATH} ${RES} ${INPATH}/${DATA_SET}${CYEAR}${MONTH} ${OUTPATH}/${RES} ${TMPPATH}/${DATA_SET}${CYEAR}${MONTH}/tmp_${DATA_SET}${RES}
#rm ${INPATH}/${DATA_SET}${CYEAR}${MONTH}
EOF
fi
${SUBMIT} ${script}
done
done