[general]
name=WetSpass-M Modern
description=Spatially distributed monthly water balance model for QGIS. Estimates groundwater recharge, evapotranspiration, surface runoff, and interception using GeoTIFF inputs. Adds a dynamic soil-water bucket to the original Wetspass-M 2016 physics, with automatic spin-up convergence detection.
about=WetSpass-M Modern is a modernized version of the original Wetspass-M 2016 model (Abdollahi, Bashir & Batelaan, Vrije Universiteit Brussel). It estimates diffuse and focused groundwater recharge, evapotranspiration, surface runoff, and interception at monthly, seasonal, and annual time steps.
    The modernization preserves the original physics but adds:
    - A dynamic soil-water bucket (soil moisture carried forward between months) replacing the original quasi-steady-state assumption. Essential for seasonally-concentrated rainfall regimes such as monsoonal, Mediterranean, and semi-arid climates.
    - An ET cap at (P - runoff) instead of P, ensuring the catchment-scale mass balance closes exactly.
    - Groundwater-fed ET reported separately as Cell_gw_discharge, outside the precipitation balance.
    - Nodata-preserving aggregation so annual rasters share the same valid-cell mask.
    - Automatic spin-up with convergence detection (mean |dS| compared to max(1 mm, 0.5%% of mean annual P), with a 5%% tolerance margin so residuals on the numerical noise floor are recognised as converged).
    - Automatic checkpointing after every completed month, so a power loss or drive disconnection resumes where it stopped.
    - A Skip to final cycle button on the Progress tab, so a run that has essentially converged can jump straight to the final output cycle without waiting for the spinner count.
    - A dedicated Water Balance tab with explicit dS and an acceptability verdict.
    - A Wetspass-M 2016 compatibility mode for validation against legacy results.
    - A Focused Recharge module for streambed infiltration along ephemeral stream networks.
    Inputs: 12 monthly climate rasters (rainfall, PET, temperature, wind, groundwater depth), a DEM, land use, soil, and optional slope. Outputs: monthly, seasonal, and annual GeoTIFFs of every flux, plus a per-month summary table.
    Original authors (Wetspass-M 2016):
    K. Abdollahi, I. Bashir, O. Batelaan - Vrije Universiteit Brussel
    Modernization:
    M. G. Gurmu
    Email: mggurmu@gmail.com
version=2.0.5
qgisMinimumVersion=3.28
qgisMaximumVersion=4.99
author=M. G. Gurmu
email=mggurmu@gmail.com
repository=https://github.com/Lafto/wetspass_modern
tracker=https://github.com/Lafto/wetspass_modern/issues
homepage=https://github.com/Lafto/wetspass_modern
category=Raster
icon=icon.png
experimental=False
deprecated=False
tags=water balance,groundwater recharge,evapotranspiration,runoff,hydrology,water resources,wetspass,recharge,soil moisture,modelling,raster,climate,spatial analysis,monthly,groundwater,streamflow
changelog=2.0.5 — Resume, pause, and convergence improvements
    2026-10-06
    - Fixed a bug where a disk error (external drive disconnect, power
      loss, or unexpected shutdown) overwrote the good checkpoint with
      a stale one that said "resume from month 1", forcing a full
      restart on Resume. The workflow now preserves the checkpoint
      written after the last completed month, so Resume picks up at
      the exact month and block where it stopped.
    - Added read-side retries. A transient input-drive disconnect
      during a read is now retried up to three times before the run
      pauses cleanly, instead of crashing with a hard I/O error.
    - Added a "Skip to final cycle" button on the Progress tab.
      Once the soil-water bucket has essentially converged, you can
      press it to abandon the remaining spin-up cycles and jump
      straight to the final output cycle. The current cycle finishes
      cleanly, then the workflow proceeds to the final pass.
    - Added a 5 percent tolerance margin to the convergence test, so
      residuals sitting on the numerical noise floor are recognised
      as converged. This prevents the workflow from running an extra
      spin-up cycle when the bucket is already at equilibrium.
    - Fixed the Cancel button being inactive during a run. Cancel and
      Pause are now enabled as soon as the worker starts.
    - Pause now checks the pause flag between individual block writes
      as well as at the start of each block, so the run stops within
      one write instead of waiting for a whole block to complete.
    - Added a "Resuming from checkpoint" line to the Progress log so
      the resume position is visible.
    - Fixed duplicate "[Check Inputs]" log lines. Auto-checks
      triggered by switching to the Check Inputs tab or changing the
      working directory no longer write to the run log; only an
      explicit Check Inputs click does.
    - Pass 1 (static lookups) no longer rebuilds on every resume
      when the user supplies their own slope raster on the Inputs
      tab. The workflow now correctly recognises the supplied slope
      raster and skips the redundant Pass 1 rebuild.
    - Simulated.tbl is now appended to, rather than truncated, when
      a run is resumed. Months written before the pause are preserved
      in the final file.
    - The status bar no longer duplicates the full log line; it shows
      a short summary of the most recent message.
    - QGIS 4 readiness: qgisMaximumVersion raised to 4.99, so the
      plugin is listed on the QGIS 4 Ready Plugins page.
    - Full Qt6 compatibility: all Qt enums are fully scoped. Loads
      cleanly in Qt5 and Qt6 without deprecation warnings.
    - Replaced all remaining try/except/pass and try/except/continue
      blocks with contextlib.suppress or a small helper function
      across wetspass_plugin.py, ui/main_dialog.py,
      ui/water_balance_tab.py, ui/worker.py, core/raster_io.py,
      core/stream_io.py, and core/workflow.py. Fixes Flake8 B110
      and B112.
    - Renamed the ambiguous loop variable 'l' to 'line' in
      ui/water_balance_tab.py. Fixes Flake8 E741.
    - Replaced subprocess.Popen with QDesktopServices.openUrl for the
      "Show in folder" button. Fixes Bandit B603/B607 without needing
      suppression comments.
    - Fixed metadata.txt continuation-line indentation and escaped
      literal percent signs so the repository parser accepts the file.
    - No functional or numerical changes to the model physics. Model
      results are identical to 2.0.2 for the same inputs and starting
      state.

[extras]
hasProcessingProvider=yes

[author]
name=M. G. Gurmu
email=mggurmu@gmail.com