{
    "version":"0.1.0",
    "id":"tordera-gloria",
    "use_case":"Catalunya Inland",
    "title":"SWAT, Soil and Water Assessment Tool",
    "description":"The Soil and Water Assessment Tool (SWAT) is a hydrological model used to simulate processes such as surface runoff, groundwater flow, and water quality across watersheds of varying scales. It evaluates the effects of land use, management practices, and climate scenarios on water resources. SWAT is widely used for studying soil erosion, non-point source pollution, and watershed management (https://swat.tamu.edu/) .The tool allows users to upload custom TextInOut folders to model any watershed of interest in SWAT+ or SWAT 2012 model version format. Users can define model parameters, the simulation time range, calibration settings, output variables, and temporal resolution. By default, the tool is configured to simulate the hydrological behavior of the La Tordera Basin from 2000 to 2022 using SWAT+. The default tool settings generate daily outputs of flow, water temperature, and nutrient levels at the mouth of La Tordera River between July 2019 and December 2020, allowing for an assessment of river flow parameters during Storm Gloria (19 January 2020). The default La Tordera Basin model is calibrated through a two-step calibration process: an initial soft calibration based on a qualitative evaluation of annual average outputs, followed by an automatic calibration by landscape units using observed gauge data from the Catalan Water Agency (Ag\u00e8ncia Catalana de l'Aigua, https://aca.gencat.cat/). This tool SWAT using SWATrunR ( https://github.com/chrisschuerz/SWATplusR ) with executables   rev60.5.7_64rel_linux (for SWAT+) and rev688_64rel_linux (for SWAT2012) .",
    "jobControlOptions":[
        "sync-execute",
        "async-execute"
    ],
    "keywords":[
        "tordera use case",
        "AquaINFRA",
        "R",
        "SWAT+",
        "SWAT2012",
        "watershed model"
    ],
    "links":[
        {
            "type":"text/html",
            "rel":"about",
            "title":"GitHub repo",
            "href":"https://github.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"about",
            "is_oer":"yes",
            "title":"How to use a OGC processing service with R",
            "href":"https://github.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"about",
            "is_oer":"yes",
            "title":"How to use a OGC processing service with python",
            "href":"https://github.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"self",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/tordera-gloria?f=json",
            "title":"Process description as JSON",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"alternate",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/tordera-gloria?f=html",
            "title":"Process description as HTML",
            "hreflang":"en-US"
        },
        {
            "type":"text/html",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/job-list",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/jobs?f=html",
            "title":"Jobs list as HTML",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/job-list",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/jobs?f=json",
            "title":"Jobs list as JSON",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/execute",
            "href":"https://aquainfra.ogc.igb-berlin.de/pygeoapi/processes/tordera-gloria/execution?f=json",
            "title":"Execution for this process as JSON",
            "hreflang":"en-US"
        }
    ],
    "inputs":{
        "swatversion":{
            "title":"SWAT version",
            "description":"Define the SWAT model version 'swatplus' or 'swat2012' . AquaINFRA has integrated the executable version rev60.5.7_64rel_linux for SWAT+ and rev688_64rel_linux for SWAT2012. Defaults to: \u201cswatplus\u201d",
            "schema":{
                "type":"string"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "TextInOut_URL":{
            "title":"URL to project folder",
            "description":"To model a watershed other than the Tordera Basin, users can add a URL to their own zipped project folder. Important: Do not include the SWAT executable to that folder \u2014 AquaINFRA has integrated the executable version rev60.5.7_64rel_linux for SWAT+ and rev688_64rel_linux for SWAT2012. Defaults to: https://raw.githubusercontent.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel/refs/heads/main/example_inputs/project.zip",
            "schema":{
                "type":"object",
                "contentMediaType":"application/zip"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "par_cal":{
            "title":"Parameter inputs",
            "description":"JSON file including the parameter value change as defined by SWATrunR documentation (https://chrisschuerz.github.io/SWATrunR/articles/SWATrunR.html#parameter-inputs). Defaults to: https://raw.githubusercontent.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel/refs/heads/main/example_inputs/par_cal.json",
            "schema":{
                "type":"object",
                "contentMediaType":"application/json"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "unit":{
            "title":"Output Spatial unit",
            "description":"Specify the spatial unit for which to generate output. This corresponds to the ID of a river reach, HRU (Hydrologic Response Unit), or LSU (Landscape Unit) as defined in the SWAT+ watershed delineation. The value can be entered as a single number (e.g., 1), a range (e.g., 1:10), or a list of values (e.g., (1, 3, 25, 40)). The default unit for the La Tordera SWAT+ model is 1.",
            "schema":{
                "type":"integer"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "file":{
            "title":"SWAT Output File",
            "description":"Enter output file according to SWAT version. For SWAT+, the output file name consists of three elements separated by underscores (_): spatial unit, output category, and time step. For example, 'channel_sd_day'. The spatial unit defines the scale of the output and can be basin, hru, lsunit, channel, aquifer, or reservoir. The output category specifies the type of data such as wb (water balance), nb (nutrient balance), ls (losses), pw (plant and weather), or sd (streamflow and sediment in channels). The time step indicates the temporal resolution and can be day (daily), mon (monthly), yr (yearly), or aa (annual average). Combining these elements forms the output file name. For more details, refer to the SWAT+ OUTPUT FILES section in the SWAT+ documentation (https://swatplus.gitbook.io/io-docs) and SWATrunR documentation (https://chrisschuerz.github.io/SWATrunR/reference/run_swatplus.html). For SWAT2012 output files, valid inputs are 'rch', 'sub', 'hru', and 'sed', followed by '_', and the required output interval as a character string ('d' for daily, 'm' for monthly, or 'y' for yearly), for example: rch_m.  For more details, refer to the SWAT2012 OUTPUT FILES chapter in the SWAT documentation (https://swat.tamu.edu/media/116601/ch32_output.pdf), and SWATrunR documentation (https://chrisschuerz.github.io/SWATrunR/reference/run_swat2012.html). Defaults to: \"channel_sd_day\"",
            "schema":{
                "type":"string"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "variable":{
            "title":"SWAT Variable",
            "description":"Variable to simulate. Example: \"flo_out\". For more details and extended capabilities, refer to the SWAT+ OUTPUT FILES section in the SWAT+ documentation (https://swatplus.gitbook.io/io-docs), or SWAT2012 OUTPUT FILES chapter in the SWAT documentation (https://swat.tamu.edu/media/116601/ch32_output.pdf). For one variable, enter the variable name. For multiple variables, enter them separated by a comma. Defaults to: \"flo_out,water_temp\"",
            "schema":{
                "type":"string"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "start_date":{
            "title":"Start Date",
            "description":"Start date of the simulation in the format yyyymmdd. Defaults to: 20160101. Earliest possible date for the default input project: 20000101.",
            "schema":{
                "type":"integer"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "years_skip":{
            "title":"Number of years of warm-up time ",
            "description":"(optional) Integer value to define the number of simulation years that are skipped before writing SWAT model outputs. Default value: 2.",
            "schema":{
                "type":"integer"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        },
        "end_date":{
            "title":"End Date",
            "description":"End date of the simulation in the format yyyymmdd. Defaults to: 20201231. Latest possible date for the default input project: 20221231.",
            "schema":{
                "type":"integer"
            },
            "minOccurs":0,
            "maxOccurs":1,
            "keywords":[]
        }
    },
    "outputs":{
        "swat_output_summary":{
            "title":"SWAT+ run summary",
            "description":"SQLite database (inputs.sqlite) containing all the parameters used in the executed SWAT+ run",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-sqlite3"
            }
        },
        "swat_output_file":{
            "title":"SWAT+ Variable Outputs Database",
            "description":"SQLite database (thread_1.sqlite) storing the simulated output values based on the defined time range and time step (daily, monthly, yearly, or annual average).",
            "schema":{
                "type":"object",
                "contentMediaType":"application/x-sqlite3"
            }
        }
    },
    "example":{
        "inputs":{
            "swatversion":"swatplus",
            "TextInOut_URL":"https://raw.githubusercontent.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel/refs/heads/main/example_inputs/project.zip",
            "par_cal":"https://raw.githubusercontent.com/AmandaBatlle/AquaINFRA_CaseUse_MedInlandModel/refs/heads/main/example_inputs/par_cal.json",
            "unit":1,
            "file":"channel_sd_day",
            "variable":"flo_out,water_temp",
            "start_date":20160101,
            "end_date":20201231,
            "years_skip":2
        }
    },
    "outputTransmission":[
        "value"
    ]
}