Refactor modules for plant class handling, erosion, sediment, & biomass. #36
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.
basin_module.f90, basin_prm_default.f90:
Update rsd_covco value from 0.30 to 0.75.
cal_conditions.f90:
Add plant_data_module.
Add case for pl_class to check condition and update cond_met based on pl_class.
cal_parm_select.f90:
Add case for usle_c to update pldb(ielem)%usle_c using chg_par.
Add case for rsd_covco to update bsn_prm%rsd_covco using chg_par.
Add use plant_data_module.
cal_parmchr_read.f90:
Add case for pl_class to update cal_upd(i)%num_elem based on db_mx%plantparm.
ero_cfactor:
Update method for calculating grnd_covfact and rsd_covfact using bsn_prm%rsd_covco instead of the previous hardcoded factor.
Modify the logic for calculating c to incorporate grnd_covfact and rsd_covfact directly, removing unnecessary comments.
Remove redundant calculations for grnd_covfact and bio_covfac, and simplify the logic.
Update erosion output variables to reflect the new calculations for soil erosion factors and cover factors.
mgt_harvbiomass.f90:
Refined biomass yield calculation by explicitly summing seed, leaf, and stem biomass.
Added pest stress logic to adjust the yield based on pest stress and harvest efficiency, ensuring more accurate yield values.
nut_nminrl:
Remove the declaration of ipl as it was no longer used in the new version.
Comment out the idp variable and remove any related logic, as it was not needed anymore.
Initialize hnb_d(j)%rsd_nitorg_n and hnb_d(j)%rsd_laborg_p to 0 to track nitrogen and phosphorus mineralization from residue decomposition.
Update tracking of nitrogen and phosphorus mineralization by adding .8 * decomp%n to hnb_d(j)%rsd_nitorg_n and .8 * decomp%p to hnb_d(j)%rsd_laborg_p after decomposition calculations.
pl_dormant:
Updated leaf_drop%m calculation to include rto factor: leaf_drop%m = rto * lai_drop * pl_mass(j)%leaf(ipl)%m.
pl_fert:
Moved the declaration of rtof from the variable declarations section to the main body of the subroutine, initializing it with 0.5 directly in the body.
plant_data_module:
Added pl_class as a dynamically allocated character array of length 25 to store plant class information (e.g., row crop, tree, grass, etc.).
plant_parm_read:
Added a new character variable plclass to store the plant class (e.g., row crop, close grown, grass, tree, etc.), initialized as an empty string.
Allocated pl_class array with size 0:0.
Updated reading logic to handle pl_class by reading it from the file and adjusting logic to conditionally read plclass or pldb(ic) based on the value of plclass.
smp_grass_wway:
Updated sediment yield calculation to use sedyld(j) directly instead of scaling by hru(ihru)%km.
Limited the sheetflow area to 10% of the HRU area, adjusting for realistic flow dynamics and sediment transport.
Updated runoff depth calculation to use hru(ihru)%area_ha instead of hru(ihru)%km for more accurate area-based computations, ensuring the runoff depth is in millimeters and accounting for the sheetflow area.
Updated sediment load calculation to use kg/m^2 instead of kg/ha for more accurate representation of sediment load per unit area of the sheetflow.
Updated limits for surq_remove and sed_remove to a maximum of 95 instead of 100, ensuring more conservative estimates for surface runoff and sediment removal.
Added constraints to sed_frac to limit it between 5 and 75, ensuring it falls within a reasonable range.
Updated surq_frac calculation to account for surq_remove, with limits on sed_frac to ensure it stays between 0 and 30, preventing excessively high or low values.
Formatting fixes:
Improved indentation for better readability.
Refined inline comment formatting for consistency across the subroutine.
3bb22e,b5c414