I really struggle to figure out the date syntax, I would like to run once per quarter on dates 2/1,5/1,8/1,11/1 for years 1958 to present. Here is what I have to run once per year in Feb, can anyone help me to get to where I want to go?
# Change the run start and end dates here
initial cycle point = "1958-02-01"
final cycle point = "2021-02-01"
[[dependencies]]
# run needs to finish, not necessarily successfully for next step to start
[[[R/P1Y]]]
graph = """
st_archive<member>[-P1Y] => build_model => run_family:finish-all
postprocess_family:finish-all => dispose
run<member> => st_archive<member> => postprocess<member>
"""
[cylc]
cycle point format = "%Y-%m-%d"
[scheduling]
initial cycle point = "1958-02-01"
final cycle point = "2021-02-01"
# must start Feb 01, any year:
initial cycle point constraints = "0201T00"
[[dependencies]]
[[[R/P3M]]] # 3-month cycle
graph = foo # etc.
A more complex approach which can be useful if you need to decouple this recurrence from the initial cycle point is to use min():
[scheduling]
initial cycle point = now
[[dependencies]]
# every three months starting at the first 0201, 0501, 0801, 1101
# that occurs AFTER the initial cycle point
[[[min(0201T00, 0501T00, 0801T00, 1101T00)/P3M]]]
graph = foo
Thank you very much, this is really helpful. One more question - I need to parse out part of the date to use as a string. I found this in an example somewhere but it doesn’t seem to work - what am I missing?
[cylc]
cycle point format = "%Y-%m-%d"
[[environment]]
CYLC_TASK_CYCLE_DATE = $(cylc cyclepoint --template=%Y-%m)
[scheduling]
initial cycle point = "1958-02-01"
final cycle point = "2021-02-01"
# must start Feb 01, any year:
initial cycle point constraints = "0201T00"
[[dependencies]]
[[[R/P3M]]] # 3-month cycle
graph = foo # etc.
[runtime]
[[foo]]
script = """
echo $CYLC_TASK_CYCLE_DATE
"""
The result I get is:
Suite : cylctest
Task Job : 1958-02-01/foo/01 (try 1)
User@Host: jedwards@cheyenne4
$(cylc cyclepoint --template=%Y-%m)
2021-02-04T09:34:17-07:00 INFO - started
2021-02-04T09:34:18-07:00 INFO - succeeded
To explain that, your first example is setting a variable in the scheduler environment, when the scheduler starts up. “Cycle point” is not a concept that makes any sense in that context because Cylc has no global cycle loop. Only individual task instances have cycle points - and you’re correctly setting the variable in the task job environment in your second example.