Implement ash deposition handling and transfer to surface DOC/DON - v2#7
Open
wburke24 wants to merge 2 commits into
Open
Implement ash deposition handling and transfer to surface DOC/DON - v2#7wburke24 wants to merge 2 commits into
wburke24 wants to merge 2 commits into
Conversation
Introduce ash deposition handling for fire losses: when -ash_deposition is enabled, carbon and nitrogen lost to fire are accumulated in per-patch ash_C_pool and ash_N_pool (computed from litter, canopy and CWD losses using fmax to avoid negatives). Add daily transfer logic to move a fraction (ash_transfer_pct) of ash pools into surface DOC/DON using configurable soluble percentages. New config parameters (ash_transfer_pct, ash_pct_soluble_DOC, ash_pct_soluble_DON) were added to soil_default with defaults; patch object gains ash_C_pool and ash_N_pool and they are initialized on construction; command-line parsing now recognizes -ash_deposition. Changes affect: rhessys/include/rhessys.h, rhessys/cn/compute_fire_effects.c, rhessys/cycle/patch_daily_F.c, rhessys/init/construct_command_line.c, rhessys/init/construct_patch.c, and rhessys/init/construct_soil_defaults.c.
Replace generic ash_C_pool/ash_N_pool with explicit ash_DOC and ash_DON pools, update initialization and struct fields in rhessys.h and construct_patch.c, and propagate these names through compute_fire_effects.c and patch_daily_F.c. Introduce a combustion remainder factor (combust_remain_pct, currently 0.15) to convert consumed C to DOC where appropriate and apply soil_defaults ash soluble fractions when computing deposited DOC/DON; simplify ash transfer to move from ash_DOC/ash_DON directly to surface_DOC/surface_DON using ash_transfer_pct. Update comments/printfs to reflect DOC/DON naming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Second version - now does full calculation to DOC in the fire effects.c, so the ash DOC is only actual DOC values. Combustion completeness is currently hardcoded into fire effects code, but could be parameterized - is currently set at 85%.
AI summary:
This pull request introduces support for simulating ash deposition and its effects following fire events in RHESSys. The main changes add new flags, state variables, and calculations to track ash-derived carbon (DOC) and nitrogen (DON) pools, their transfer to surface pools, and related soil parameters. These enhancements allow for more realistic modeling of post-fire biogeochemical cycling.
Major changes:
Ash deposition modeling:
-ash_deposition) to enable ash deposition calculations, and associated logic to parse and set this flag incommand_line_objectand its constructor (construct_command_line). [1] [2]ash_DOCandash_DONto track fire-derived ash carbon and nitrogen pools, with initialization in both the patch object and its constructor. [1] [2]Fire effects and ash pool updates:
compute_fire_effectsto calculate and add ash DOC and DON to patch pools during fire events, using soil parameters for soluble fractions and a combustion completeness assumption. This includes contributions from litter, coarse woody debris, and canopy components. [1] [2] [3] [4]Ash transfer to surface pools:
patch_daily_F, implemented logic to transfer a fraction of patch ash DOC and DON to surface DOC/DON pools each day, based on new soil default parameters. [1] [2]Soil and patch initialization:
ash_transfer_pct,ash_pct_soluble_DOC,ash_pct_soluble_DON) to control ash pool behavior, with parsing and initialization in both the header and constructor. [1] [2]