Skip to main content

SUMMA plugin for eWaterCycle

Project description

ewatercycle-summa

SUMMA (Structure for Unifying Multiple Modeling Alternatives) plugin for eWaterCycle.

Runs the standard SUMMA executable from CH-Earth/summa inside a Docker container via a subprocess BMI wrapper served by grpc4bmi. Works with any existing SUMMA domain setup (e.g. from SYMFLUENCE).

Installation

pip install ewatercycle-summa

Usage

from ewatercycle.models import SUMMA
from ewatercycle.parameter_sets import ParameterSet

from ewatercycle_summa.forcing import SUMMAForcing

# Point to pre-prepared SUMMA forcing
forcing = SUMMAForcing(
    directory="/path/to/forcing",
    forcing_file="forcing.nc",
    start_time="2000-01-01T00:00:00Z",
    end_time="2001-01-01T00:00:00Z",
)

# Point to SUMMA parameter set (settings, attributes, cold state, etc.)
parameter_set = ParameterSet(
    name="summa_test",
    directory="/path/to/parameter_set",
    config="settings/SUMMA/fileManager.txt",
    target_model="SUMMA",
)

# Create and run the model
model = SUMMA(forcing=forcing, parameter_set=parameter_set)
cfg_file, cfg_dir = model.setup()
model.initialize(cfg_file)

while model.time < model.end_time:
    model.update()

model.finalize()

Parameter Set Structure

A SUMMA parameter set for eWaterCycle should contain:

parameter_set_dir/
  settings/SUMMA/
    fileManager.txt        # SUMMA file manager (paths are remapped at runtime)
    modelDecisions.txt     # Process-model decisions
    outputControl.txt      # Output variable selection
    basinParamInfo.txt     # GRU-level parameter metadata
    localParamInfo.txt     # HRU-level parameter metadata
    TBL_GENPARM.TBL        # General parameter lookup table
    TBL_MPTABLE.TBL        # Noah-MP parameter table
    TBL_SOILPARM.TBL       # Soil parameter table
    TBL_VEGPARM.TBL        # Vegetation parameter table
    coldState.nc           # Initial conditions
    attributes.nc          # Spatial attributes (HRU/GRU)
    trialParams.nc         # Calibration parameters
  forcing/SUMMA_input/     # (optional) default forcing if not provided separately
    *.nc

Default template files for the settings are included in this package and can be used as a starting point.

Container

The Docker image builds standard SUMMA (with iterative solver) and wraps it via a Python subprocess BMI + grpc4bmi:

cd container
docker build -t ghcr.io/ewatercycle/summa-grpc4bmi:v0.1.0 .

The first update() call runs the full SUMMA simulation as a subprocess. Subsequent update() calls step through the output timesteps. All standard SUMMA output variables are available via get_value().

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ewatercycle_summa-0.1.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ewatercycle_summa-0.1.0-py2.py3-none-any.whl (37.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ewatercycle_summa-0.1.0.tar.gz.

File metadata

  • Download URL: ewatercycle_summa-0.1.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ewatercycle_summa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9fe2df90fdb589c5f8eb4cd03679a7000533b577a1964b7e14615a4873dd5de
MD5 2e3a261d71a6931c55472a620379867d
BLAKE2b-256 c141be778bf8e6a17dcd54caec854ff7a7fc6d35aa09c06006dc9adb3af0cee8

See more details on using hashes here.

File details

Details for the file ewatercycle_summa-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ewatercycle_summa-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2d5f79c21eb718a5511e19f71281a7d5795b1db9a5d36789c26b7cc409460086
MD5 358044bdef29ff8318a3ed6f508faea5
BLAKE2b-256 51576b068da8b40ff6b4238e4d3cf22954e2189ea43c1949c76cfdcbe414e66e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page