8000 Refactor modules for plant class handling, erosion, sediment, & biomass. by tugraskan · Pull Request #36 · swat-model/swatplus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactor modules for plant class handling, erosion, sediment, & biomass. #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

tugraskan
Copy link
Collaborator

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

Jeff Arnold and others added 4 commits December 31, 2024 13:11
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.
@odav odav requested a review from fgeter January 2, 2025 16:56
Copy link
Collaborator
@fgeter fgeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok to me.

@odav odav merged commit 0937104 into swat-model:main Jan 2, 2025
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.

3 participants
0