Skip to content

Refactored Soil Respiration Flux Calculations#251

Open
ayushman1210 wants to merge 5 commits intoPecanProject:masterfrom
ayushman1210:code_quality
Open

Refactored Soil Respiration Flux Calculations#251
ayushman1210 wants to merge 5 commits intoPecanProject:masterfrom
ayushman1210:code_quality

Conversation

@ayushman1210
Copy link
Contributor

Refactored Soil Respiration Flux Calculations

Location src/sipnet/sipnet.c
Description
The updatePoolsForSoil() function was mixing flux calculations with pool updates, violating SIPNET's general pattern where calculateFluxes() handles all flux computations before pool updates occur

Changes
Moved the fluxes.rSoil calculation for the microbe model from updatePoolsForSoil() to calcMicrobeFluxes(), ensuring all flux calculations happen in the dedicated flux calculation phase

Improves code maintainability by clearly separating concerns between flux calculations and state updates, and removes the TODO comment indicating incomplete refactoring.

@ayushman1210
Copy link
Contributor Author

Hi @dlebauer when you have some free time, I’d appreciate it if you could review this PR.
Thanks!!

- Initialize unknownParams buffer with {0} for full zero-initialization
- Move rSoil flux calculation to calcMicrobeFluxes for better separation of concerns
- Remove completed TODO comment
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