-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflow.cylc
217 lines (202 loc) · 6.98 KB
/
flow.cylc
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#!jinja2
########################
# Items that may need changed
{% set EXPS = 'EP5r1, EP6' %}
{% set DATES = 'R2/2018-01-04T00/P7D' %}
{% set ICE_VARS = "aice, hi" %}
{% set ENS_MEMBERS = 10 %}
{% set PARSE_DATA = True %}
{% set MAIL_ADDRESS = "[email protected]" %}
########################
# DATES
# SFS 'R5/1994-05-01/T00/P1Y, R5/1994-11-01/T00/P1Y'
# EP miniset 'R8/2018-01-03T00/P7D, R8/2018-08-01T00/P7D'
# EPr miniset 'R8/2018-01-04T00/P7D, R8/2018-08-02T00/P7D'
# GFS Dates 'R29/2019-12-03T00/P3D, R31/2020-06-01T00/P3D'
# GFS/HR Hurricane 'R81/2020-09-01T00/P1D'
# GDAS dates from Lydia 'R13/2021-07-03T00/P1D'
####################################
# define suite
# hopefully user does not have to edit anything below here
{% set ICP = '19940101T00' %}
{% set FCP = '20341231T12' %}
[meta]
title = "grab and analyize CICE output"
[scheduler]
UTC mode = True
[[events]]
mail events = stall, abort, submission failed, fail
[[mail]]
to = {{ MAIL_ADDRESS }}
[task parameters]
cice_vars = {{ ICE_VARS }}
experiment = {{ EXPS }}
mem = 0..{{ ENS_MEMBERS }}
poles = 'north', 'south'
[scheduling]
initial cycle point = {{ ICP }}
final cycle point = {{ FCP }}
runahead limit = P10
[[queues]]
[[[default]]]
limit = 42
################################################
# download data if needed from HPSS
[[graph]]
R1 = """
{% if PARSE_DATA %}
GRAB_OBS
{% else %}
POST_PARSE
{% endif %} # if PARSE_DATA
"""
{% if PARSE_DATA %}
{{ DATES }} = """
GRAB_EXPS:succeed-all => PARSE_OUTPUT_CICE
PARSE_OUTPUT_CICE:succeed-all => ENSEMBLE_COMBINE
ENSEMBLE_COMBINE:succeed-all => POST_PARSE
"""
{% endif %} # if PARSE_DATA
R1/{{ FCP }} = """
POST_PARSE => CALC_ICE_EXTENT
POST_PARSE => INTERP_ICE
CALC_ICE_EXTENT:succeed-all => plot_ice_extent
INTERP_ICE:succeed-all => CALC_IIEE
CALC_IIEE:succeed-all => plot_iiee
INTERP_ICE:succeed-all => MAPS_ICE_CON
"""
################################################
# tasks
[runtime]
[[root]]
#platform = localhost
platform = slurm_local
execution retry delays = 3*PT10M
init-script = """
umask 022
declare -rx PS4='+ $(basename ${BASH_SOURCE[0]:-${FUNCNAME[0]:-"Unknown"}})[${LINENO}]'"${id}: "
set -eux
export SCRIPT_DIR=${CYLC_RUN_DIR}/${CYLC_WORKFLOW_NAME}/_cylc-install/source/SCRIPTS
source ${SCRIPT_DIR}/modules.sh
unset ESMFMKFILE
"""
[[[environment]]]
ICE_VARS = {{ ICE_VARS }}
DTG = $(cylc cycle-point --template=%Y%m%d%H)
EXPS = {{ EXPS }}
ENS_MEMBERS = {{ ENS_MEMBERS }}
[[[directives]]]
--account = marine-cpu
--ntasks = 1
--time = 00:30:00
--mem = 0
#--qos = debug
####################################
# grab experiments and obs
[[HPSS]]
[[[directives]]]
--partition = service
[[GRAB_EXPS]]
platform = localhost
inherit = HPSS
[[grab<experiment>_from_hpss]]
inherit = GRAB_EXPS
script = """
EXP=${CYLC_TASK_PARAM_experiment}
${SCRIPT_DIR}/GRAB_exps_from_hpss.sh ${DTG} ${EXP} ${ENS_MEMBERS}
"""
[[GRAB_OBS]]
platform = localhost
inherit = HPSS
[[grab_sea_ice_extents]]
inherit = GRAB_OBS
script = """
${SCRIPT_DIR}/GRAB_obs_from_hpss.sh ice_extent
"""
[[grab_sea_ice_concentrations]]
inherit = GRAB_OBS
script = """
${SCRIPT_DIR}/GRAB_obs_from_hpss.sh ice_concentration
"""
################################################
# parse data
[[PARSE_OUTPUT_CICE]]
platform = localhost
[[parse_output<experiment><mem><cice_vars>]]
inherit = PARSE_OUTPUT_CICE
script = """
VAR=${CYLC_TASK_PARAM_cice_vars}
EXP=${CYLC_TASK_PARAM_experiment}
MEM=${CYLC_TASK_PARAM_mem}
source ${SCRIPT_DIR}/experiment_options.sh ${EXP} ${DTG}
${SCRIPT_DIR}/CICE_parse_output.sh ${DTG} ${VAR}_${CICE_SUFFIX} ${EXP} ${MEM} ${ENS_MEMBERS}
"""
[[ENSEMBLE_COMBINE]]
[[ensemble_combine<experiment><cice_vars>]]
inherit = ENSEMBLE_COMBINE
script = """
VAR=${CYLC_TASK_PARAM_cice_vars}
EXP=${CYLC_TASK_PARAM_experiment}
${SCRIPT_DIR}/ENS_combine_files.sh ${DTG} ${VAR} ${EXP}
"""
[[POST_PARSE]]
platform = localhost
script = """
echo "POST_PARSE is a dummy task"
"""
################################################
# diagnostics
[[CALC_ICE_EXTENT]]
[[calc_ice_extent<experiment>]]
inherit = CALC_ICE_EXTENT
script = """
EXP=${CYLC_TASK_PARAM_experiment}
source ${SCRIPT_DIR}/experiment_options.sh ${EXP} ${DTG}
${SCRIPT_DIR}/CALC_ice_extent.py -d ${TOPDIR_OUTPUT}/${EXP} -v ${ICE_VAR}_${CICE_SUFFIX}
"""
[[[directives]]]
--time = 04:00:00
#--qos = debug
[[plot_ice_extent]]
script = """
source ${SCRIPT_DIR}/experiment_options.sh DUMMY ${DTG}
${SCRIPT_DIR}/PLOT_ice_extent.py -d ${TOPDIR_OUTPUT} -e ${EXPS} -v ${ICE_VAR}_${CICE_SUFFIX} -fd ${TOPDIR_FIGURES} -od ${TOPDIR_OBS}
"""
[[INTERP_ICE]]
[[interp_ice<experiment>]]
inherit = INTERP_ICE
script = """
EXP=${CYLC_TASK_PARAM_experiment}
source ${SCRIPT_DIR}/experiment_options.sh ${EXP} ${DTG}
${SCRIPT_DIR}/INTERP_iiee.py -d ${TOPDIR_OUTPUT}/${EXP} -v ${ICE_VAR}_${CICE_SUFFIX} -od ${TOPDIR_OBS}
"""
[[[directives]]]
--time = 08:00:00
[[CALC_IIEE]]
[[calc_iiee<experiment>]]
inherit = CALC_IIEE
script = """
EXP=${CYLC_TASK_PARAM_experiment}
source ${SCRIPT_DIR}/experiment_options.sh ${EXP} ${DTG}
${SCRIPT_DIR}/CALC_iiee.py -d ${TOPDIR_OUTPUT}/${EXP} -v ${ICE_VAR}_${CICE_SUFFIX} -od ${TOPDIR_OBS}
"""
[[[directives]]]
--time = 08:00:00
[[plot_iiee]]
script = """
source ${SCRIPT_DIR}/experiment_options.sh DUMMY ${DTG}
${SCRIPT_DIR}/PLOT_iiee.py -d ${TOPDIR_OUTPUT} -v ${ICE_VAR}_${CICE_SUFFIX} -e ${EXPS} -fd ${TOPDIR_FIGURES}
"""
[[MAPS_ICE_CON]]
[[maps_ice_concentration<poles><experiment>]]
inherit = MAPS_ICE_CON
script = """
EXP=${CYLC_TASK_PARAM_experiment}
POLE=${CYLC_TASK_PARAM_poles}
source ${SCRIPT_DIR}/experiment_options.sh ${EXP} ${DTG}
${SCRIPT_DIR}/CICE_maps.py -d ${TOPDIR_OUTPUT}/${EXP} -e ${EXP} -v ${ICE_VAR}_${CICE_SUFFIX} -p ${POLE} -fd ${TOPDIR_FIGURES} -od ${TOPDIR_OBS}
"""
[[[directives]]]
--time = 08:00:00
--qos = batch
--mem = 0