<tool id="redelacSticsComputeAclim" name="redelacSticsComputeAclim" version="1.0.1">
  <description>to compute aclim on Stics climate</description>
  <requirements>
    <container type="singularity">docker://registry.forge.inrae.fr/redelac/redelac-toolbox/sticsrpacks:5337507635242b3ad0f3559a1a6b666512ecf002
    </container>
  </requirements>
  <command detect_errors="aggressive">
    <![CDATA[
	     mkdir Climat &&
	     unzip -d ./Climat ${Climat} &&
	     Rscript --verbose  $__tool_directory__/redelacComputeAclim.R ./Climat "
	     #for $i, $h in enumerate($horizons)
	     ${h.name} ${h.min} ${h.max}, 
	     #end for
	     " ./output.rds ./output.csv ./output1.png ./output2.png &&
	     cp ./output.csv ${aclim} &&
	     cp ./output.rds ${output} &&
	     cp ./output1.png ${output1} &&
	     cp ./output2.png ${output1}
     ]]>
  </command>
  <inputs>
    <repeat name ="horizons" min="1" title="Specify a horizon">
      <param name="name" type="text" value="ref" label="The horizon name"/>
      <param name="min" type="integer" value="1990" label="The horizon lower range year"/>
      <param name="max" type="integer" value="2025" label="The horizon upper range year"/>
    </repeat>

    <param name="Climat" type="data" format="zip" label="Select a climat scenario (zip file)"/>    
  </inputs>
  <outputs>
    <data format="csv" name="aclim"
          label="aclimValuesPerHorizon">
    </data>
    <data format="rds" name="output"
          label="output">
    </data>
    <data format="png" name="output1"
          label="output1">
    </data>
    <data format="png" name="output2"
          label="output2">
    </data>
  </outputs>
  <tests>
  </tests>
  <help>
*The usage of this tool is restricted to the user of the redelac_authorized group.*

*To be granted, apply to the REDELAC Project Team and then request to SIWAA*

Documentation
-------------
A tool to compute AClim for REDELAC

Credits
-------
-  Wrapped Tool Author: https://www6.paca.inrae.fr/stics_eng/About-us/Project-Stics-Team
-  Stics Site: https://www6.paca.inra.fr/stics_eng
-  Galaxy Tool Maintainer: Patrick Chabrier patrick.chabrier@inrae.fr
-  Copyright: INRAE
  </help>
</tool>
