Skip to content

Conversation

@sunt05
Copy link

@sunt05 sunt05 commented Aug 10, 2025

Summary

  • Fixes FcRespi output is constant  #245 - FcRespi output was constant throughout simulation days
  • Re-enables the biogenic CO2 calculation module that was completely commented out
  • Ensures FcRespi now varies with temperature as expected

Problem

The SUEWS_cal_BiogenCO2 subroutine in suews_ctrl_driver.f95 was entirely commented out, preventing any biogenic CO2 calculations. This caused FcRespi (respiration flux) to remain at its initialized value of 0.0 throughout simulations.

Solution

  1. Uncommented the biogenic CO2 calculation code:

    • Restored the SUEWS_cal_BiogenCO2 subroutine definition
    • Added call to SUEWS_cal_BiogenCO2 in the main simulation loop after anthropogenic emissions
  2. Fixed compilation errors:

    • Corrected module import: sfc_resistresist_module for SurfaceResistance
    • Fixed case sensitivity: ANTHRO_EMIS_STATEanthroEmis_STATE
    • Added missing imports: HYDRO_STATE and SUEWS_SITE
  3. Verified the fix works:

    • FcRespi now varies with temperature when resp_b parameter is non-zero
    • Total CO2 flux (Fc) correctly combines anthropogenic and biogenic components

Testing

✅ Fortran code compiles successfully
✅ Python tests demonstrate varying FcRespi output when appropriate parameters are set
✅ Backwards compatible - no breaking changes to existing functionality

Important Note on Sample Data

The default sample data has resp_b = 0.0 (temperature sensitivity coefficient), which makes FcRespi appear constant even with the fix. This is expected behavior - when resp_b = 0, the equation EXP(resp_b * T) always equals 1, resulting in constant respiration.

Users should ensure their input parameters have non-zero resp_b values for temperature-dependent respiration.

Test Results

With manually adjusted parameters (resp_b = 0.08, vegetation fraction = 30%):

  • Before fix: FcRespi = 0.0 (always)
  • After fix: FcRespi varies from 0.703 to 0.721 μmol m⁻² s⁻¹ with temperature

Related Issues

Fixes #245

The biogenic CO2 calculation subroutine SUEWS_cal_BiogenCO2 was completely
commented out, causing FcRespi to remain constant at its initialized value.

Changes:
- Uncommented SUEWS_cal_BiogenCO2 subroutine in suews_ctrl_driver.f95
- Added call to SUEWS_cal_BiogenCO2 in the main simulation loop after
  anthropogenic emissions calculation
- Fixed module imports: changed sfc_resist to resist_module for SurfaceResistance
- Fixed case sensitivity: ANTHRO_EMIS_STATE to anthroEmis_STATE
- Added missing HYDRO_STATE import and proper SUEWS_SITE type import

Testing notes:
- FcRespi now varies with temperature when resp_b parameter is non-zero
- Sample data has resp_b=0.0 which masks the fix, but manual override confirms
  the calculation path is now active
- Verified with EmissionsMethod=25 (Bellucco et al. 2017 model)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

FcRespi output is constant

2 participants