Hello,
I am using Cylc version 7.9.3. I’ve come across a particular situation where I need particular tasks to run only once at the beginning of the suite, but only if the hour is a 00z or 12z. So if the initial cycle point is 20210806T06, then this task should only run once and it should only run on 20210806T12. So far, I have this:
Testing this, though, shows that stage_verify (which is the task I want to only run once), in fact runs every cycle point that ends in a 00Z or 12Z.
How do I get this to only run once during the course of the entire cycling but during the first instance of a 00Z or 12Z, whichever comes first relative to the initial cycle point?
Firstly, [[[R1/T00,T12]]] is equivalent to (separately) [[[R1/T00]]] and [[[T12]]](not R1/T12). So you should see, e.g. via cylc graph or at run time, that the tasks will run at the first T00 and T12 points, and every T12 after that.
So it should be [[[R1/T00, R1/T12]]] if you want to combine them.
R1/^+PT6H - run once, six hours after the initial cycle point
R1/T00 ! R1/^+PT6H - run once at the first instance of T00 UNLESS it is six hours after the initial cycle point.
R1/T00 ! ( R1/^+PT6H, R1/^+PT12H, R1/^+PT18H, R1/^+PT24H) - run once at the first instance of T00 UNLESS it is a multiple of six hours after the initial cycle point.
Chaining up long lists of exclusions (!) can increase the computational load of the scheduler, but in this case the recurrence is only run once (R1) so the impact won’t persist for the live of the workflow.
However, it is worth noting that there is also a Jinja2 solution using the strftime filter:
This is a specific scenario where verification must only be run on the 0z and 12z times, as we only have verifying data for these hours. However, the user might want to start forecasts on 6z or 18z. If this occurs, verification will not occur on 6z/18z but will occurs one cycle later (12z/0z, respectively)