Measured precip stops after ~17 years (6210 daily records) — WGN fallback on 61.0.1 / 61.0.2 / 61.0.2.61 (Editor 3.2.4)

7 views
Skip to first unread message

yakob mohammed

unread,
Sep 8, 2026, 2:40:28 PM (3 days ago) Sep 8
to SWAT+

1. Primary Issue Location

  • Component: SWAT+ Executable (cli_pmeas.f90 / cli_precip_control.f90)
  • Area of impact: Climate input / basin water balance output
  • Editor: SWAT+ Editor v3.2.4, QSWAT+ v3.2.3
  • Project: Salima10 watershed, Malawi (25 CHIRPS stations)

2. Description

Daily measured precipitation is used correctly for the first ~15–17 simulation years, then the model switches to weather-generator fallback (~13 mm annual precip, then ~0 mm). This is not real drought — CHIRPS .pcp files contain valid data through 2025, with correct nbyr headers and record counts.

Failure year depends on simulation start, which points to an internal climate read/indexing limit, not bad file content.

\Executables tested  \

  Evidence.png

\ Evidence — basin annual precip (mm)\

excuted versions.png

Climate files verified OK

  • Source: QSWAT+ CHIRPS Malawi, 25 stations (ML_000001.pcp … ML_000025.pcp)
  • ML_000001.pcp: nbyr=26, 9497 daily records, years 2000–2025
  • Runtime split file: nbyr=23, 8400 records, years 2003–2025
  • Record 6210 = last day of 2016 (end of 17th year from 2000) — matches test1 failure at 2017
  • Record 8401 ≈ end of 2022 — matches cal1 failure at 2023 (5844 skip records + 2557 loaded ≈ 8401 total read budget)

diagnostics.out (all scenarios)

ML_000001.pcp file not found (pgage) ML_000001.tmp file not found (tgage) file not found (basins_carbon.tes)

Suspected mechanism

In cli_pmeas.f90, array is allocated as ts(366, nbyr) from header, but effective load appears capped at ~6210 daily records (~17 years from file start) or ~8401 total records read (including skip-to-sim-start). When cli_precip_control detects out-of-bounds, precip is set to −98 and WGN fills in.

Python replication of read + bounds logic on the same files shows all 26 years should work — discrepancy is in the compiled executable, not file content.

Related group threads: CLI_PMEAS TSS overflow (nbyr mismatch)CLI_PMEAS TS overflow — our case is the silent bounds-fail variant, not a crash.

What is NOT the cause (already ruled out)

  • Wrong nbyr header (matches record count)
  • Missing .pcp/.tmp in TxtInOut (files present)
  • SQLite / Editor import errors (all 25 stations linked)
  • Dev-build regression (official 61.0.2 identical)
  • CHIRPS data quality (annual totals valid through 2025)

 Attachments (can provide on request)

  • Minimal TxtInOut zip: test1 scenario (one station ML_000001.pcp sufficient)
  • basin_wb_yr.csv, diagnostics.out, time.sim, pcp.cli, weather-sta.cli

Question for the team

Is there a hardcoded daily-record or year limit in cli_pmeas / climate loading (legacy SWAT2012 ~8401-day cap)? Can it be allocated from actual loaded record count rather than header nbyr only?

Happy to send TxtInOut if useful. Thank you, Yakob

Reply all
Reply to author
Forward
0 new messages