<span  id="index-0"></span><div  id="operational-suite-solution">
<span id="operational-suite-soln"></span>
<p>One possible solution:</p>
<div ><div ><pre><span >#!/usr/bin/env python2.5</span>
<span >import</span> <span >os</span>
<span >import</span> <span >ecflow</span> 
   
<span >defs</span> <span >=</span> <span >ecflow</span><span >.</span><span >Defs</span><span >()</span>
<span >suite</span> <span >=</span> <span >defs</span><span >.</span><span >add_suite</span><span >(</span><span >&quot;operation_suite&quot;</span><span >)</span>
<span >suite</span><span >.</span><span >add_repeat</span><span >(</span> <span >ecflow</span><span >.</span><span >RepeatDay</span><span >(</span><span >1</span><span >)</span> <span >)</span>
<span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;ECF_HOME&quot;</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >&quot;HOME&quot;</span><span >)</span> <span >+</span> <span >&quot;/course&quot;</span><span >)</span>
<span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;ECF_INCLUDE&quot;</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >&quot;HOME&quot;</span><span >)</span> <span >+</span> <span >&quot;/course&quot;</span><span >)</span>
<span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;ECF_FILES&quot;</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >&quot;HOME&quot;</span><span >)</span> <span >+</span> <span >&quot;/course/oper&quot;</span><span >)</span>
  
<span ># Defines the triggers for the first cycle</span>
<span >cycle_triggers</span> <span >=</span> <span >&quot;1&quot;</span>
<span >for</span> <span >cycle</span> <span >in</span> <span >(</span> <span >0</span> <span >,</span> <span >12</span> <span >):</span>

    <span >if</span> <span >cycle</span> <span >==</span> <span >12</span> <span >:</span>
        <span >last_step</span> <span >=</span> <span >240</span>
    <span >else</span><span >:</span>
        <span >last_step</span> <span >=</span> <span >24</span>
 
    <span >fcycle_fam</span> <span >=</span>  <span >suite</span><span >.</span><span >add_family</span><span >(</span><span >str</span><span >(</span><span >cycle</span><span >))</span>
    <span >fcycle_fam</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;CYCLE&quot;</span><span >,</span><span >cycle</span><span >)</span>
    <span >fcycle_fam</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;LAST_STEP&quot;</span><span >,</span><span >last_step</span><span >)</span>
      
    <span >if</span> <span >cycle_triggers</span> <span >!=</span> <span >&quot;1&quot;</span> <span >:</span>
        <span >fcycle_fam</span><span >.</span><span >add_trigger</span><span >(</span><span >cycle_triggers</span><span >)</span>
                 
    <span >analysis_fam</span> <span >=</span> <span >fcycle_fam</span><span >.</span><span >add_family</span><span >(</span><span >&quot;analysis&quot;</span><span >)</span>
    <span >analysis_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;get_observations&quot;</span><span >)</span>
    <span >analysis_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;run_analysis&quot;</span><span >)</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;get_observations == complete&quot;</span><span >)</span>
    <span >analysis_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;post_processing&quot;</span><span >)</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;run_analysis == complete&quot;</span><span >)</span>
 
    <span >forecast_fam</span> <span >=</span> <span >fcycle_fam</span><span >.</span><span >add_family</span><span >(</span><span >&quot;forecast&quot;</span><span >)</span>
    <span >forecast_fam</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;analysis == complete&quot;</span><span >)</span>
    <span >forecast_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;get_input_data&quot;</span><span >)</span> 
    <span >run_forecast_task</span> <span >=</span> <span >forecast_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;run_forecast&quot;</span><span >)</span> 
    <span >run_forecast_task</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;get_input_data == complete&quot;</span><span >)</span>
    <span >run_forecast_task</span><span >.</span><span >add_meter</span><span >(</span><span >&quot;step&quot;</span><span >,</span><span >0</span><span >,</span><span >last_step</span><span >,</span><span >last_step</span><span >)</span>
 
    <span >archive_fam</span> <span >=</span> <span >fcycle_fam</span><span >.</span><span >add_family</span><span >(</span><span >&quot;archive&quot;</span><span >)</span>
    <span >fam_analsis</span> <span >=</span> <span >archive_fam</span><span >.</span><span >add_family</span><span >(</span><span >&quot;analysis&quot;</span><span >)</span>
    <span >fam_analsis</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;TYPE&quot;</span><span >,</span><span >&quot;analysis&quot;</span><span >)</span>
    <span >fam_analsis</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;STEP&quot;</span><span >,</span><span >&quot;0&quot;</span><span >)</span>
    <span >fam_analsis</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;../analysis/run_analysis == complete&quot;</span><span >)</span>
    <span >fam_analsis</span><span >.</span><span >add_task</span><span >(</span><span >&quot;save&quot;</span><span >)</span>
    
    <span >for</span> <span >i</span> <span >in</span> <span >range</span><span >(</span><span >6</span><span >,</span><span >last_step</span><span >,</span><span >6</span><span >):</span>  
        <span >step_fam</span> <span >=</span> <span >fam_analsis</span><span >.</span><span >add_family</span><span >(</span><span >&quot;step_&quot;</span> <span >+</span> <span >str</span><span >(</span><span >i</span><span >))</span>     
        <span >step_fam</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;TYPE&quot;</span><span >,</span><span >&quot;forecast&quot;</span><span >)</span>  
        <span >step_fam</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;STEP&quot;</span><span >,</span><span >i</span><span >)</span>  
        <span >step_fam</span><span >.</span><span >add_trigger</span><span >(</span><span >&quot;../forecast/run_forecast:step ge &quot;</span> <span >+</span> <span >str</span><span >(</span><span >i</span><span >))</span>
        <span >step_fam</span><span >.</span><span >add_task</span><span >(</span><span >&quot;save&quot;</span><span >)</span>

    <span ># Defines the triggers for the next cycle</span>
    <span >cycle_triggers</span> <span >=</span> <span >&quot;./&quot;</span> <span >+</span> <span >str</span><span >(</span><span >cycle</span><span >)</span> <span >+</span> <span >&quot; == complete&quot;</span>
    
</pre></div>
</div>
</div>