Skip to content

Fix interpolation bounds error in RSL profiles (GH#1223)#1228

Open
sunt05 wants to merge 1 commit intomasterfrom
sunt05/gh1223-investigate
Open

Fix interpolation bounds error in RSL profiles (GH#1223)#1228
sunt05 wants to merge 1 commit intomasterfrom
sunt05/gh1223-investigate

Conversation

@sunt05
Copy link

@sunt05 sunt05 commented Mar 9, 2026

Fixes #1223

Adds defensive checks to prevent NaN and invalid values in MOST height generation:

  • Validate z_x and height array for NaN before interpolation
  • Clamp PAI to valid range [0,1] and protect division by zero
  • Fall back to input z0m_in/zdm_in when computed values are invalid
  • Ensure minimum height above roughness sublayer for degenerate cases
  • Includes regression test for full-building urban grids

Add defensive checks to prevent NaN/invalid values in MOST height generation:
- Validate z_x and height array for NaN before interpolation
- Clamp PAI to [0,1] and protect division by zero in resistance module
- Fall back to input z0m_in/zdm_in when computed values are invalid
- Ensure minimum height above roughness sublayer for degenerate cases

Includes regression test for full-building urban grids.
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

CI Build Plan

Changed Files

Fortran source (2 files)

  • src/suews/src/suews_phys_resist.f95
  • src/suews/src/suews_phys_rslprof.f95

Rust bridge (1 file)

  • src/suews_bridge/build.rs

Tests (1 file)

  • test/physics/test_rslprof.py

Build Configuration

Configuration
Platforms Linux x86_64, macOS ARM64, Windows x64
Python 3.9, 3.14
Test tier standard (all except slow)
UMEP build Yes (compiled extension may differ)
PR status Ready (standard matrix)

Rationale

  • Fortran source changed -> multiplatform build required
  • Rust bridge changed -> multiplatform build required
  • Test files changed -> validation build
  • Compiled extension ABI may differ -> UMEP (NumPy 1.x) build included

Updated by CI on each push. See path-filters.yml for category definitions.

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.

SUEWS Error 103: b'interp_z: No valid interpolation bounds found

1 participant