LISFLOOD Hydrological Model

repository·master·Indexed 41 days ago

https://github.com/ec-jrc/lisflood-code

A spatially distributed, physically based hydrological rainfall-runoff-routing model provided by the European Commission Joint Research Centre (JRC). It supports flood simulation, forecasting, and water resources assessment across scales from 100-meter resolution to global applications. Distributed as a Python package (lisflood-model), it can be executed via CLI, Conda, or the official Docker image (jrce1/lisflood), requiring PCRaster and GDAL dependencies.

Tokens
123.5K
Snippets
150
Records
283
Agent score
48%

What's inside LISFLOOD

  1. Overview of LISFLOOD settings and options

    master

    The LISFLOOD settings are configured via an XML file. The configuration is organized into several key sections that define how the model behaves, what variables the user must provide, and what the model produces.

    Key configuration sections include:

    • lfoptions: Switches used to activate optional modules and specify optional output formats (such as time series or specific map formats).
    • lfuser: Variables that are typically defined by the user to control model execution.
    • lfbinding: The core model variables used during simulation.
    • initial variables: The specific values or maps required to initialize the model, distinguishing between requirements for 'cold start' and 'warm start' during both the prerun and run phases.
  2. Overview of LISFLOOD model capabilities

    master

    LISFLOOD is a spatially distributed, physically based, hydrological rainfall-runoff-routing model. It is designed with a modular structure that allows for temporal and spatial flexibility, enabling users to control model inputs, outputs, and specific module selection.

    Key Capabilities:

    • Applications: Flood simulation and forecasting, water resources assessment, land use change impact analysis, river regulation planning, and climate change analysis.
    • Scalability: Supports grid-based applications ranging from 100-meter resolution for medium catchments to kilometer-scale for continental/global applications.
    • Temporal Resolution: Capable of long-term water balance simulations (climatology) and individual flood event simulations using hourly to daily time steps.
    • Output Flexibility: Primary output is channel discharge, but internal rate and state variables (e.g., soil moisture) can also be exported. Outputs can be formatted as grids or time series at user-defined points or areas to optimize disk space and CPU usage.
  3. Test hydrological module activation via lfoptions

    master

    In LISFLOOD, hydrological modules are activated or deactivated by setting a value of 1 or 0 in the lfoptions section of the input XML settings file.

    To verify module activation, tests check if specific functions (like loadmap) are called within the expected modules. For example, if only riceIrrigation is enabled, the test asserts that loadmap is called by the riceirrigation module but not by other modules like reservoir.

    # Example logic for testing module activation
    from unittest.mock import call
    import lisflood
    
    def test_rice_only(self):
        # ... setup ...
        calls = [call('RiceFlooding'), call('RicePercolation'), call('RicePlantingDay1'), call('RiceHarvestDay1'), call('RicePlantingDay2'), call('RiceHarvestDay2')]
        lisflood.hydrological_modules.riceirrigation.loadmap.assert_has_calls(calls)
        assert not lisflood.hydrological_modules.reservoir.loadmap.called
  4. Understand the LISFLOOD time convention

    master

    LISFLOOD follows an "end of timestep" naming convention for both input (forcings) and output data.

    Every timestamp or time step refers to the END of the time interval. For example, a daily accumulated rainfall timestamp of 02/01/2017 06:00 represents the accumulation that occurred between 01/01/2017 06:00 and 02/01/2017 06:00. Similarly, an output timestamp of 02/01/2017 06:00 represents the average discharge over that same period.

  5. Understand LISFLOOD output file types

    master

    LISFLOOD generates two primary types of output files:

    1. Time Series: Stored as .tss files, representing data at specific points.
    2. Maps: Stored in NetCDF format.

    Note that some output files are specific to optional modules (e.g., reservoir simulation). While users can change the file names in the settings, it is generally not recommended.

  6. Configure LISFLOOD settings via lfoptions and lfuser XML sections

    master

    LISFLOOD settings are configured using XML files. The configuration is primarily organized into two sections within the OS LISFLOOD settings XML:

    1. lfoptions: Contains the core model setting options.
    2. lfuser: Contains user-defined settings and inputs.

    Refer to the specific tables in the documentation to find the exact keys and values required for your simulation setup.

  7. How LISFLOOD results are tested (Black-box testing)

    master

    The repository includes black-box tests in the tests/ directory that execute the development version of LISFLOOD using predefined XML settings. These tests compare the model output against a reference dataset (test oracle).

    Key characteristics:

    • Scope: Uses a test catchment (Po basin) clipped from the EFAS domain with specific Meteo netCDF forcings.
    • Sensitivity: These tests will fail if the hydrological model logic changes between the reference version and the version currently under test.
    • Activated Modules: Most result tests run with the following modules enabled:
      • SplitRouting
      • simulateReservoirs
      • groundwaterSmooth
      • drainedIrrigation
      • openwaterevapo
      • riceIrrigation
      • indicator
  8. Understand soil depth layer definitions and constraints

    master

    LISFLOOD uses three distinct soil depth layers. The depth values are constrained as follows:

    1. Layer 1 (Superficial layer): Assumed constant at 50 mm globally.
    2. Layer 2 (Upper layer): Must be ≥ 50 mm. If the calculated value is lower than 50 mm, it is set to 50 mm to account for data uncertainty.
    3. Layer 3 (Lower layer): Calculated as the remaining depth after layers 1 and 2 are subtracted from the absolute depth to bedrock.

    Total soil depth is determined by the minimum of the 'absolute depth to bedrock' and the 'groundwater table depth'.

  9. Understand soil hydraulic parameters in LISFLOOD

    master

    LISFLOOD uses the Van Genuchten equation to describe the relationship between soil moisture, suction pressure (water retention curve), and hydraulic conductivity. To implement this, the model requires five specific soil hydraulic parameters.

    Note that LISFLOOD differentiates water dynamics based on land cover for the topsoil (the first two layers: surface and middle). For these layers, parameters are assigned separately for forested areas and non-forested (others) areas. The third layer (bottom layer) does not differentiate by land cover type.

  10. Structure of the OS LISFLOOD settings.xml file

    master

    The settings.xml file is the primary configuration interface for OS LISFLOOD. It uses a specific XML structure composed of three main functional elements wrapped in a root <lfsettings> tag.

    Each element serves a distinct purpose in how parameters and files are linked to the model:

    1. <lfoptions>: Controls model switches (on/off).
    2. <lfuser>: Defines user-specific variables and paths for easy modification.
    3. <lfbinding>: Contains the actual model parameter values and file bindings used by the core code.
    <lfsettings>
      <lfoptions>
        <!-- LISFLOOD options (switches) -->
      </lfoptions>
      <lfuser>
        <!-- User's specific parameters and settings -->
      </lfuser>
      <lfbinding>
        <!-- LISFLOOD model general settings -->
      </lfbinding>
    </lfsettings>