Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Horizontal Navigation Bar


Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Advanced+Topics
Button Hyperlink
titleUp
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Advanced+Topics
Button Hyperlink
titleNext
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Limits


It is sometimes useful to repeat the same task or family several times,
looping on a specific value. You can do that by defining a repeat attribute.
You can iterate over sequences of:
  • strings
  • integers
  • dates
  • arbitrary list of dates
A sequence of integers or dates is created by specifying the
first and last element, with an optional increment (the default is one).
An ecFlow variable, whose name corresponds to the name of the repeat,
will be generated. This can be used in scripts or trigger expressions.

Repeat with day/date

The behaviour of day/date attribute under a repeat has changed from ecflow 4.0. Take the example below.

In ecflow 4.0, if task t1 took longer than 1 hour task t2 would not run.

In ecflow 5.0, once the day monday is free on family f1, its stays free until the automatic re-queue caused by the parent repeat. The net effect being that task t2 will still run, even if we have strayed into Tuesday.

...

Code Block
suite s1
  family f
    repeat integer rep 0 1
    family f1
       day monday  
       time 23:00
       task t1
       task t2 
            trigger t1 == complete
 ...

   

...

Ecf Script

We will add a new task /test/f4/f5/t1.
Create new ecf script file $HOME/course/test/f4/f5/t1.ecf to use these variables.


Code Block
languagebash
title $HOME/course/test/f4/f5/t1.ecf
%include <head.h>
ecflow_client --label=info "My name is '%NAME%' " " My value is '%VALUE%' " " My date is '%DATE%' "
# Note the use of repeat date generated variables DATE_YYYY, DATE_MM, DATE_DD, DATE_DOW to automatically reference year,month,day of the month,day of the week 
# These can also be used in trigger expression.
ecflow_client --label=date "year(%DATE_YYYY%) month(%DATE_MM%) day of month(%DATE_DD%) day of week(%DATE_DOW%)"  
sleep %SLEEP%
%include <tail.h>


...