Skip to content

Conversation

@sunt05
Copy link

@sunt05 sunt05 commented Oct 17, 2025

Summary

Removes the obsolete BaseTmethod parameter from the Fortran codebase and simplifies heating/cooling degree day (HDD/CDD) calculations to always use weekday/weekend-specific base temperatures.

Context

BaseTmethod was a legacy parameter that controlled whether to use:

  • Method 1: Single BaseT_HC value for both heating and cooling
  • Method 2: Separate weekday/weekend BaseT_Heating and BaseT_Cooling arrays

Since BaseT_HC was removed from input files in SUEWS v2023a, Method 1 became non-functional. The Fortran code had BaseTmethod hardcoded to 2 (always use Method 2), making it dead code.

Changes

Fortran Code

  • suews_ctrl_const.f95: Removed BaseTMethod variable declaration
  • suews_phys_dailystate.f95:
    • Removed BaseTMethod and BaseT_HC parameters
    • Removed these from update_DailyState_Day subroutine signature
    • Simplified HDD/CDD calculation by removing SELECT CASE logic
    • Now directly uses BaseT_Heating(iu) and BaseT_Cooling(iu) based on weekday/weekend

Code Simplification

! Before: SELECT CASE with two methods
SELECT CASE (BaseTMethod)
CASE (1)
   BaseT_Heating_use = BaseT_HC
   BaseT_Cooling_use = BaseT_HC
CASE (2)
   BaseT_Heating_use = BaseT_Heating(iu)
   BaseT_Cooling_use = BaseT_Cooling(iu)
END SELECT

! After: Direct assignment
BaseT_Heating_use = BaseT_Heating(iu)
BaseT_Cooling_use = BaseT_Cooling(iu)

Impact

User-Facing

No breaking changes

  • basetmethod was already removed from user-facing configuration in v2023
  • Python/YAML API does not expose this parameter
  • Pydantic data models have no reference to BaseTmethod
  • Calculation behaviour unchanged (Method 2 was already hardcoded)

Internal

  • Removes 21 lines of dead code
  • Simplifies subroutine interfaces
  • Aligns Fortran implementation with modern data model

Clarification: BaseT vs BaseTe

This change does NOT affect BaseT and BaseTe, which are separate vegetation parameters for:

  • BaseT: Base temperature for growing degree days (GDD) in LAI phenology
  • BaseTe: Base temperature for senescence degree days (SDD) in LAI phenology

These remain unchanged and are unrelated to anthropogenic heat flux calculations.

Testing

  • Fortran code compiles successfully
  • Existing tests pass
  • No user-facing API changes

Fixes #144

@github-actions
Copy link

🤖 I've automatically formatted the code in this PR using:

  • Python: ruff v0.8.6
  • Fortran: fprettify v0.3.7

Please pull the latest changes before making further edits.

… base temperatures

Removes the BaseTmethod parameter which controlled whether to use a single
BaseT_HC value or separate weekday/weekend base temperatures for heating/
cooling degree day (HDD/CDD) calculations in the anthropogenic heat flux
module.

Changes:
- Remove BaseTMethod parameter from suews_ctrl_const.f95
- Remove BaseTMethod and BaseT_HC from update_DailyState_Day subroutine
- Always use weekday/weekend-specific BaseT_Heating and BaseT_Cooling arrays
- Simplify HDD/CDD calculation logic by removing SELECT CASE branching

This change aligns with the data model which already provides weekday/weekend
base temperature profiles, and follows the removal of BaseT_HC from input
files in SUEWS v2023a.

Note: BaseT and BaseTe remain as separate parameters for vegetation LAI
phenology calculations (growing degree days and senescence degree days).

Addresses #144
sunt05 and others added 2 commits December 5, 2025 21:56
- Mark BaseTMethod as deprecated in scheme_options.rst with v2025a notice
- Add CHANGELOG entry for BaseTMethod removal
- Update requirement from "Required" to "Optional (ignored)"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sunt05 sunt05 marked this pull request as ready for review December 5, 2025 23:05
@sunt05 sunt05 added this pull request to the merge queue Dec 5, 2025
Merged via the queue into master with commit 0f49b61 Dec 5, 2025
28 checks passed
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.

BaseTmethod vs BaseT and BaseTe

2 participants