fix: enable biogenic CO2 calculations to resolve constant FcRespi output (#245) #599
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The
SUEWS_cal_BiogenCO2subroutine insuews_ctrl_driver.f95was entirely commented out, preventing any biogenic CO2 calculations. This causedFcRespi(respiration flux) to remain at its initialized value of 0.0 throughout simulations.Solution
Uncommented the biogenic CO2 calculation code:
SUEWS_cal_BiogenCO2subroutine definitionSUEWS_cal_BiogenCO2in the main simulation loop after anthropogenic emissionsFixed compilation errors:
sfc_resist→resist_moduleforSurfaceResistanceANTHRO_EMIS_STATE→anthroEmis_STATEHYDRO_STATEandSUEWS_SITEVerified the fix works:
resp_bparameter is non-zeroFc) correctly combines anthropogenic and biogenic componentsTesting
✅ 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 - whenresp_b = 0, the equationEXP(resp_b * T)always equals 1, resulting in constant respiration.Users should ensure their input parameters have non-zero
resp_bvalues for temperature-dependent respiration.Test Results
With manually adjusted parameters (resp_b = 0.08, vegetation fraction = 30%):
Related Issues