Skip to content

feat: Phase A NetCDF forcing validation pass (10-day QHH)#36

Merged
DankerMu merged 1 commit into
mainfrom
feat/netcdf-forcing-validation
Feb 14, 2026
Merged

feat: Phase A NetCDF forcing validation pass (10-day QHH)#36
DankerMu merged 1 commit into
mainfrom
feat/netcdf-forcing-validation

Conversation

@DankerMu
Copy link
Copy Markdown
Owner

Summary

Phase A (NetCDF Forcing) 验证通过。NetcdfForcingProvider 直接读取 CMFD2 NetCDF 原始文件,与 AutoSHUD 生成的 baseline CSV forcing 完全一致。

Changes

projects/qhh/shud.yaml

  • nc profile: add forcing.kv.CMFD_PRECIP_UNITS: MM_HR override
  • nc profile: set output_mode: legacy for Phase A validation

tools/shudnc.py

  • render-shud-cfg: support forcing.kv dict for arbitrary KEY VALUE overrides in cfg.forcing

tools/compare_forcing.py

  • Add CSV quantization matching (precip 4dp, temp 2dp, RH 4dp, wind 2dp, radiation int)
  • Support CMFD_PRECIP_UNITS override from cfg.forcing

SHUD submodule

  • Updated ref → DankerMu/SHUD-up PR #78 (off-by-one fix + quantization matching)

Verification Results

10-day QHH run (END=730, START=1):

Metric Result
Forcing diff (5 vars) max_abs = 0 (exact match)
Output .dat binary diff IDENTICAL (md5sum match)
Baseline rerun (NETCDF=1 binary) Output unchanged

Dependencies

- shud.yaml nc profile: add forcing.kv.CMFD_PRECIP_UNITS=MM_HR override,
  set output_mode=legacy for Phase A validation
- shudnc.py render-shud-cfg: support forcing.kv dict for arbitrary KEY VALUE
  overrides in cfg.forcing (e.g. CMFD_PRECIP_UNITS)
- compare_forcing.py: add CSV quantization matching (precip 4dp, temp 2dp,
  RH 4dp, wind 2dp, radiation int) + CMFD_PRECIP_UNITS override support
- Update SHUD submodule ref (PR #78: off-by-one fix + quantization)

Verification: all 5 forcing variables max_abs_diff=0, output .dat binary
identical, baseline unbroken.
@DankerMu
Copy link
Copy Markdown
Owner Author

Review: SHUD-NC PR #36

shud.yaml

kv: CMFD_PRECIP_UNITS: MM_HR and output_mode: legacy are correct for Phase A validation.

shudnc.py render-shud-cfg kv support

Input validation is thorough (type check, null, whitespace). Keys uppercased. Appended after adapter defaults allowing override.

compare_forcing.py

_cmfd2_precip_units_kind_from_cfg() mirrors C++ CMFD_PRECIP_UNITS logic. Quantization matches C++ side exactly.

SHUD submodule ref

Points to PR #78 commit (off-by-one fix + quantization).

Verification

10-day QHH: all 5 forcing vars max_abs_diff=0, output .dat binary identical, baseline unbroken.

@DankerMu DankerMu merged commit 6463f61 into main Feb 14, 2026
5 checks passed
@DankerMu DankerMu deleted the feat/netcdf-forcing-validation branch February 14, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant