|
| 1 | +<tool id="ccds_download_era5_af" name="Copernicus CDS Downloader for AquaINFRA marine model" version="1.0.0" profile="22.05"> |
| 2 | + <description> |
| 3 | + Download ERA5 data from the Copernicus Climate Data Store to provide as input to the AquaINFRA marine model. Products: ERA5 hourly data on single levels from 1940 to present, Reanalysis. |
| 4 | + </description> |
| 5 | + <creator> |
| 6 | + <organization name="EOSC AquaINFRA" url="https://aquainfra.eu/"/> |
| 7 | + </creator> |
| 8 | + <requirements> |
| 9 | + <requirement type="package" version="1.41.0">boto3</requirement> |
| 10 | + <requirement type="package" version="1.41.0">botocore</requirement> |
| 11 | + <requirement type="package" version="5.2.37">bash</requirement> |
| 12 | + <requirement type="package" version="3.14.0">python</requirement> |
| 13 | + <requirement type="package" version="2.3.3">pandas</requirement> |
| 14 | + <requirement type="package" version="0.7.7">cdsapi</requirement> |
| 15 | + <!--<credentials name="cds_api" version="1.0"> |
| 16 | + <variable name="token" inject_as_env="CDS_TOKEN" /> |
| 17 | + </credentials>--> |
| 18 | + </requirements> |
| 19 | + <command detect_errors="exit_code"><![CDATA[ |
| 20 | + bash '$cmems_credentials' && |
| 21 | +
|
| 22 | + bash '$__tool_directory__/ccds_download_era5_af.sh' \ |
| 23 | + "$min_lat" "$max_lat" \ |
| 24 | + "$min_lon" "$max_lon" \ |
| 25 | + "$start_date" "$end_date" |
| 26 | + ]]></command> |
| 27 | + <configfiles> |
| 28 | + <configfile name="cmems_credentials"> |
| 29 | +#import os |
| 30 | +#set $cmems_username = $__user__.extra_preferences.get('cmems_username', "") |
| 31 | +#set $cmems_password = $__user__.extra_preferences.get('cmems_password', "") |
| 32 | +#if $cmems_username == "" or $cmems_password == "" |
| 33 | + #set $cmems_username = os.getenv('CMEMS_USERNAME', '') |
| 34 | + #set $cmems_password = os.getenv('CMEMS_PASSWORD', '') |
| 35 | +#end if |
| 36 | +export CMEMS_USERNAME='$cmems_username' |
| 37 | +export CMEMS_PASSWORD='$cmems_password' |
| 38 | + </configfile> |
| 39 | + </configfiles> |
| 40 | + <inputs> |
| 41 | + <param name="min_lat" type="float" label="Min latitude (ºN)" min="-180" max="180" optional="false" help="Minimum latitude value for the data subset (southern boundary latitude)." /> |
| 42 | + <param name="max_lat" type="float" label="Max latitude (ºN)" min="-180" max="180" optional="false" help="Maximum latitude value for the data subset (northern boundary latitude)." /> |
| 43 | + <param name="min_lon" type="float" label="Min longitude (ºE)" min="-180" max="180" optional="false" help="Minimum longitude value for the data subset (western boundary longitude)." /> |
| 44 | + <param name="max_lon" type="float" label="Max longitude (ºE)" min="-180" max="180" optional="false" help="Maximum longitude value for the data subset (eastern boundary longitude)." /> |
| 45 | + <param name="start_date" type="text" label="Start date (YYYY-MM-DD)" optional="false" help="The start datetime of the temporal data subset."> |
| 46 | + <validator type="regex" message="Date must be in YYYY-MM-DD format">^\d{4}-\d{2}-\d{2}$</validator> |
| 47 | + </param> |
| 48 | + <param name="end_date" type="text" label="End date (YYYY-MM-DD)" optional="false" help="The end datetime of the temporal data subset."> |
| 49 | + <validator type="regex" message="Date must be in YYYY-MM-DD format">^\d{4}-\d{2}-\d{2}$</validator> |
| 50 | + </param> |
| 51 | + </inputs> |
| 52 | + <outputs> |
| 53 | + <data name="zip_output" format="zip" from_work_dir="ccds_era5_af_data.zip" label="ccds_era5_af_data.zip"/> |
| 54 | + </outputs> |
| 55 | + <tests> |
| 56 | + <test expect_failure="true"> |
| 57 | + <param name="min_lat" value="38.42"/> |
| 58 | + <param name="max_lat" value="43.60"/> |
| 59 | + <param name="min_lon" value="-0.46"/> |
| 60 | + <param name="max_lon" value="6.1728"/> |
| 61 | + <param name="start_date" value="2022-01-01"/> |
| 62 | + <param name="end_date" value="2022-01-02"/> |
| 63 | + <assert_stdout> |
| 64 | + <has_text text=">> startdate: 2022-01-01"/> |
| 65 | + </assert_stdout> |
| 66 | + </test> |
| 67 | + </tests> |
| 68 | + <help format="markdown"><![CDATA[ |
| 69 | + This tool downloads ERA5 data subsets from the **Copernicus Climate Data Store (ECMWF)** using the **CDSAPI** to provide later as input to the AquaINFRA marine model. |
| 70 | +
|
| 71 | + ### Requirements |
| 72 | + |
| 73 | + To use this tool, users must: |
| 74 | +
|
| 75 | + - Have a valid account on the Copernicus Climate Data Store: https://cds.climate.copernicus.eu |
| 76 | + - Have accepted the *Terms of Use* for the **ERA5 hourly data on single levels** dataset. This must be done manually on the dataset’s webpage (at the bottom of the download form). |
| 77 | +
|
| 78 | + ### Outputs |
| 79 | + |
| 80 | + The tool produces a ZIP file containing two NetCDF (`.nc`) files: |
| 81 | +
|
| 82 | + - `data_stream-oper_stepType-accum.nc` — accumulated variables |
| 83 | + - `data_stream-oper_stepType-instant.nc` — instantaneous variables |
| 84 | +
|
| 85 | + These files can be used as inputs for the AquaINFRA marine model tool.. |
| 86 | + ]]></help> |
| 87 | + <citations> |
| 88 | + <citation type="bibtex"> |
| 89 | + @misc{netcdf4, |
| 90 | + title={netcdf4}, |
| 91 | + author={Jeff Whitaker}, |
| 92 | + url={https://pypi.org/project/netCDF4/} |
| 93 | + } |
| 94 | + </citation> |
| 95 | + </citations> |
| 96 | +</tool> |
0 commit comments