forked from os-climate/hazard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hazard_workflow.cwl
180 lines (169 loc) · 4.77 KB
/
hazard_workflow.cwl
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
cwlVersion: v1.2
$graph:
- class: Workflow
id: produce-hazard-indicator
label: produce hazard indicator
doc: Produce a hazard indicator with os_climate_hazard
requirements:
ResourceRequirement:
coresMax: 2
ramMax: 4096
inputs:
ceda_ftp_username:
type: string
default: ""
ceda_ftp_password:
type: string
default: ""
ceda_ftp_url:
type: string
default: ""
source_dataset:
type: string
source_dataset_kwargs:
type: string
default: "{}"
gcm_list:
type: string
scenario_list:
type: string
threshold_list:
type: string
default: "[]"
threshold_temperature:
type: float
default: 0
central_year_list:
type: string
central_year_historical:
type: int
window_years:
type: int
indicator:
type: string
default: "days_tas_above_indicator"
store:
type: string
default: "./indicator"
inventory_format:
type: string
default: "osc"
write_xarray_compatible_zarr:
type: boolean
default: false
dask_cluster_kwargs:
type: string
default: "{'n_workers': 1, 'threads_per_worker': 1}"
outputs:
- id: indicator-result
type: Directory
outputSource:
- indicator-step/indicator-results
steps:
indicator-step:
run: "#indicator-command"
in:
ceda_ftp_username: ceda_ftp_username
ceda_ftp_password: ceda_ftp_password
ceda_ftp_url: ceda_ftp_url
source_dataset: source_dataset
source_dataset_kwargs: source_dataset_kwargs
gcm_list: gcm_list
scenario_list: scenario_list
threshold_list: threshold_list
threshold_temperature: threshold_temperature
central_year_list: central_year_list
central_year_historical: central_year_historical
window_years: window_years
indicator: indicator
store: store
inventory_format: inventory_format
write_xarray_compatible_zarr: write_xarray_compatible_zarr
dask_cluster_kwargs: dask_cluster_kwargs
out:
- indicator-results
- class: CommandLineTool
id: indicator-command
hints:
DockerRequirement:
dockerPull: public.ecr.aws/c9k5s3u3/os-hazard-indicator:ed6f5d1
requirements:
ResourceRequirement:
coresMax: 2
ramMax: 4096
NetworkAccess:
networkAccess: true
EnvVarRequirement:
envDef:
CEDA_FTP_USERNAME: $(inputs.ceda_ftp_username)
CEDA_FTP_URL: $(inputs.ceda_ftp_url)
CEDA_FTP_PASSWORD: $(inputs.ceda_ftp_password)
inputs:
ceda_ftp_username:
type: string
ceda_ftp_password:
type: string
ceda_ftp_url:
type: string
source_dataset:
type: string
source_dataset_kwargs:
type: string
gcm_list:
type: string
scenario_list:
type: string
threshold_list:
type: string
threshold_temperature:
type: float
central_year_list:
type: string
central_year_historical:
type: int
window_years:
type: int
indicator:
type: string
store:
type: string
inventory_format:
type: string
write_xarray_compatible_zarr:
type: boolean
dask_cluster_kwargs:
type: string
outputs:
indicator-results:
type: Directory
outputBinding:
glob: $(inputs.store)
baseCommand: os_climate_hazard
arguments:
- valueFrom: $(inputs.indicator)
- prefix: --store
valueFrom: $(inputs.store)
- prefix: --source_dataset
valueFrom: $(inputs.source_dataset)
- prefix: --source_dataset_kwargs
valueFrom: $(inputs.source_dataset_kwargs)
- prefix: --gcm_list
valueFrom: $(inputs.gcm_list)
- prefix: --scenario_list
valueFrom: $(inputs.scenario_list)
- prefix: --threshold_list
valueFrom: $(inputs.threshold_list)
- prefix: --threshold_temperature
valueFrom: $(inputs.threshold_temperature)
- prefix: --central_year_list
valueFrom: $(inputs.central_year_list)
- prefix: --central_year_historical
valueFrom: $(inputs.central_year_historical)
- prefix: --window_years
valueFrom: $(inputs.window_years)
- prefix: --inventory_format
valueFrom: $(inputs.inventory_format)
- prefix: --write_xarray_compatible_zarr
valueFrom: $(inputs.write_xarray_compatible_zarr)
- prefix: --dask_cluster_kwargs
valueFrom: $(inputs.dask_cluster_kwargs)