Debian Codegraph @

cylc/flow/etc/tutorial/cylc-forecasting-workflow/flow.cylc

raw
1 #!jinja2
2
3 {# Generate 5 forecasts at 60 minute intervals. #}
4 {% set FORECAST_LENGTH = 60 %}
5 {% set FORECAST_COUNT = 5 %}
6
7 [task parameters]
8 # A list of the weather stations we will be fetching observations from.
9 station = aldergrove, camborne, heathrow, shetland
10 # A list of the sites we will be generating forecasts for.
11 site = exeter, edinburgh
12
13 [scheduling]
14 # Start the workflow 7 hours before now ignoring minutes and seconds
15 # * previous(T-00) takes the current time ignoring minutes and seconds.
16 # * - PT7H subtracts 7 hours from the time.
17 initial cycle point = previous(T-00) - PT7H
18 # Stop the workflow 6 hours after the initial cycle point.
19 final cycle point = +PT6H
20 [[graph]]
21 # Repeat every three hours starting at the initial cycle point.
22 PT3H = """
23 get_observations<station> => consolidate_observations
24 """
25
26 # Repeat every six hours starting six hours after the initial
27 # cycle point.
28 +PT6H/PT6H = """
29 consolidate_observations => forecast
30 consolidate_observations[-PT3H] => forecast
31 consolidate_observations[-PT6H] => forecast
32 get_rainfall => forecast => post_process<site>
33 """
34
35 # Repeat every six hours starting twelve hours after the initial
36 # cycle point.
37 +PT12H/PT6H = """
38 forecast[-PT6H] => forecast
39 """
40
41 [runtime]
42 [[root]]
43 # These environment variables will be available to all tasks.
44 [[[environment]]]
45 # The dimensions of each grid cell in degrees.
46 RESOLUTION = 0.2
47
48 # The area to generate forecasts for (lng1, lat1, lng2, lat2)
49 DOMAIN = -12,46,12,61 # Do not change!
50
51
52 [[get_observations<station>]]
53 script = get-observations
54
55 [[get_observations<station=aldergrove>]]
56 [[[environment]]]
57 SITE_ID = 3917
58 [[get_observations<station=camborne>]]
59 [[[environment]]]
60 SITE_ID = 3808
61 [[get_observations<station=heathrow>]]
62 [[[environment]]]
63 SITE_ID = 3772
64 [[get_observations<station=shetland>]]
65 [[[environment]]]
66 SITE_ID = 3005
67
68 [[consolidate_observations]]
69 script = consolidate-observations
70
71 [[get_rainfall]]
72 script = get-rainfall
73
74 [[forecast]]
75 script = forecast {{ FORECAST_LENGTH }} {{ FORECAST_COUNT }} # Generate 5 forecasts at 60 minute intervals.
76 [[[environment]]]
77 # The path to the files containing wind data (the {variables} will
78 # get substituted in the forecast script).
79 WIND_FILE_TEMPLATE = $CYLC_WORKFLOW_WORK_DIR/{cycle}/consolidate_observations/wind_{xy}.csv
80 # Offset in hours to cycles to process wind data from.
81 WIND_CYCLES = 0, -3, -6
82 # The path to the rainfall file.
83 RAINFALL_FILE = $CYLC_WORKFLOW_WORK_DIR/$CYLC_TASK_CYCLE_POINT/get_rainfall/rainfall.csv
84 # Create the html map file in the task's log directory.
85 MAP_FILE = "${CYLC_TASK_LOG_ROOT}-map.html"
86 # The path to the template file used to generate the html map.
87 MAP_TEMPLATE = "$CYLC_WORKFLOW_RUN_DIR/lib/template/map.html"
88
89 [[post_process<site>]]
90 # Generate a weather report for [length * count] minutes in the future for <site>
91 script = post-process $CYLC_TASK_PARAM_site {{ FORECAST_LENGTH * FORECAST_COUNT }}
92
93 {% include 'etc/python-job.settings' %}