Skip to content
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

Crown damage module #788

Merged
merged 104 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
49b41a0
[ cancel endrun for buggy error check ]
JessicaNeedham Sep 29, 2021
e68c22c
Squashed commit of all crown damage work
JessicaNeedham Sep 30, 2021
d090bfd
[ Uncomment a check that was breaking runs ]
JessicaNeedham Sep 30, 2021
fc3ed80
[ Fix bug with understory number densities ]
Oct 1, 2021
ad11283
Merge remote-tracking branch 'jfneedham_repo/JessicaNeedham-crowndama…
Oct 1, 2021
177876b
[moving damage module to biogeochem ]
JessicaNeedham Dec 9, 2021
d700c60
[bracket the increase in maxCohortsPerPatch in logic so it only incre…
JessicaNeedham Dec 9, 2021
63e513d
[ Revert number of canopy layers back to 2 ]
JessicaNeedham Dec 9, 2021
7c585f9
[Change min_n_safemath and min_npm2 to default values. ]
JessicaNeedham Dec 15, 2021
21b802b
[ Remove unnecessary history variables]
JessicaNeedham Dec 15, 2021
86d423e
Merge remote-tracking branch 'jfneedham_repo/JessicaNeedham-crowndama…
JessicaNeedham Dec 16, 2021
efeb680
[ Add comments to FatesAllometry related to crown damage ]
JessicaNeedham Dec 16, 2021
7484d25
[ Correct typo in parameter file ]
JessicaNeedham Dec 16, 2021
c00b89d
[Update comments in parameter file with more details on
JessicaNeedham Dec 16, 2021
1e1242b
[ Add comments on crowndamage declaration ]
JessicaNeedham Dec 17, 2021
586cf0c
Merge remote-tracking branch 'ngeet_repo/master'
JessicaNeedham Dec 17, 2021
b7cb23d
Merge branch 'master' into damage_temp
JessicaNeedham Jan 7, 2022
b2937ab
[ Remove old damage history dimensions and fix bugs with
JessicaNeedham Jan 10, 2022
ca903c4
[ update units on damage history variables ]
JessicaNeedham Jan 10, 2022
cc5a60b
[ Remove branch frac as a cohort variable ]
JessicaNeedham Jan 28, 2022
092f9df
Merge remote-tracking branch 'ngeet_repo/master'
JessicaNeedham Feb 7, 2022
ada5ce7
Merge branch 'master' into branch_frac_fix
JessicaNeedham Feb 12, 2022
a5f752b
[ Fix merge conflicts in EDCanopySturctureMod ]
JessicaNeedham Feb 14, 2022
14399fc
[ Add damage x damage dimension back ]
JessicaNeedham Feb 14, 2022
1324109
[ Fix bug with if statements in fateshistoryinterface ]
JessicaNeedham Feb 16, 2022
14ef508
Merge branch 'branch_frac_fix' into JessicaNeedham-crowndamage_module
JessicaNeedham Feb 16, 2022
6b6ed7f
[ Remove cdcd dimension ]
JessicaNeedham Feb 17, 2022
d15081f
[ update comments on branch_frac ]
JessicaNeedham Feb 28, 2022
a3bb261
[ delete old variables from EDInitMod]
JessicaNeedham Mar 1, 2022
36e8faf
[ Remove old history variables ]
JessicaNeedham Mar 2, 2022
6ea0259
Merge remote-tracking branch 'ngeet_repo/master'
JessicaNeedham Mar 8, 2022
7ed9029
[ and remove the last damage_clux and damage_rate variables ]
JessicaNeedham Mar 2, 2022
63edb53
[ Change default damage param values ]
JessicaNeedham Mar 7, 2022
d59e249
Merge remote-tracking branch 'ngeet_repo/master'
JessicaNeedham Mar 9, 2022
c8d86d1
[ remove damage_cflux ]
JessicaNeedham Mar 10, 2022
4a622fe
Merge branch 'master' into JessicaNeedham-crowndamage_module
JessicaNeedham Mar 11, 2022
64abd25
Merge branch 'master' into JessicaNeedham-crowndamage_module
JessicaNeedham Mar 21, 2022
442639f
[ Add damage only dimension back. ]
JessicaNeedham Mar 22, 2022
6f0e682
[ Make crown damage bin edges flexible ]
JessicaNeedham Mar 22, 2022
78b4f1a
[ Fixing flexible damage bins ]
JessicaNeedham Mar 23, 2022
d9ee7ab
[Fix bug in defining nlevdamage ]
JessicaNeedham Apr 3, 2022
f0352aa
[ fixing canopy_too_full error - possibly from bad merge ]
JessicaNeedham Apr 3, 2022
8f994c2
[ Fix canopy too full error with damage code ]
JessicaNeedham Apr 16, 2022
f28f532
[ make damage timings be controlled by event_code as in
JessicaNeedham May 13, 2022
2613582
[ Fixing damage event codes ]
JessicaNeedham May 14, 2022
758d902
[ create a single hlm_use_crown_damage switch and make a parameter
JessicaNeedham May 26, 2022
4d1cd0a
Merge branch 'master' into crowndamage-deconflict
glemieux May 26, 2022
ece0c71
converting new procedures to CamelCase
glemieux May 26, 2022
f73d65d
[ change damage bin edges ]
JessicaNeedham May 26, 2022
59d4357
converting logical from CamelCase back to original format
glemieux May 26, 2022
657ba0a
adding target_c_area local to UpdateCohortLAI
glemieux May 26, 2022
cc2d5f8
fixing erroneous damage_time name changes
glemieux May 27, 2022
6b21b53
fixing bad merge
glemieux May 27, 2022
a76d62f
[ update UpdateCohortLAI to accommodate extra arguments needed for da…
JessicaNeedham May 27, 2022
f0e8c30
Merge remote-tracking branch 'glemieux_repo/crowndamage-deconflict' i…
JessicaNeedham May 27, 2022
50dc896
Merge remote-tracking branch 'jfneedham_repo/JessicaNeedham-crowndama…
JessicaNeedham Jun 21, 2022
c1bb091
First pass at resolving conflicts between the damage module and api 2…
rgknox Jun 28, 2022
e85d1f4
Updated argument name in UpdateCohortLai
rgknox Jun 29, 2022
bb345fc
Added the undamaged class named constant
rgknox Jun 29, 2022
ce6f93b
[ Change tree_sai so that it is affected by damage ]
JessicaNeedham Jun 29, 2022
d2dfb73
Minor variable name change for readability
rgknox Jun 30, 2022
21ae55e
Merge branch 'JessicaNeedham-crowndamage_module-merged' of github.com…
rgknox Jun 30, 2022
71c56b1
Inremental change towards damage recovery refactor
rgknox Jun 30, 2022
010a95f
Second pass through splitting allocation and modularizing the recover…
rgknox Jun 30, 2022
02b661a
Minor updates to damage recovery
rgknox Jun 30, 2022
db14473
Applying the phase argument to carbon allocation in parteh
rgknox Jun 30, 2022
daafba1
cleaning up damage boundary condition to parteh, adding in phase hook…
rgknox Jun 30, 2022
f6bfc64
Various merge resolutions and fixes for new damge recovery scheme
rgknox Jul 1, 2022
b660f7b
Moving DamageRecovery to cohortdynamics
rgknox Jul 1, 2022
bfe205c
resolution on moving damagerecovery
rgknox Jul 1, 2022
84e84b9
Removed check on use_tree_damage, which is allowed now
rgknox Jul 1, 2022
650077a
Fixes to use_tree_damage
rgknox Jul 1, 2022
71c41c6
Making tree_sai in canopy_trim use actual area
rgknox Jul 3, 2022
52f5b87
argument re-ordering in crowndamage allometry argument and adding in …
rgknox Jul 5, 2022
b266106
Removed a redundant (double) allocation call
rgknox Jul 6, 2022
34a6fe3
Removed patch level damage code, in preparation for moving it to a pr…
rgknox Jul 6, 2022
3351666
Added declaration of global hlm_use_tree_damage
rgknox Jul 6, 2022
b9d7b97
First pass at the new damage application routine
rgknox Jul 6, 2022
3e2aeab
Adding variable definitions to the damage generation routine
rgknox Jul 11, 2022
85f7e55
Added module use statements to damage and litter generation module
rgknox Jul 12, 2022
c263eac
conflict resolutions on damage branch
rgknox Sep 13, 2022
eadc895
Syntax updates for tree damage mode
rgknox Sep 16, 2022
32a5a4d
slight correction to crown damage calc
rgknox Sep 16, 2022
cf91237
Fixes to allocation phases vis-a-vis recovery
rgknox Sep 16, 2022
dc3e5f4
Subtle fixes to the allocation phasing and damage
rgknox Sep 16, 2022
d5e9ad4
Fixes, yet again, to allocation and phasing
rgknox Sep 16, 2022
38d9f32
Changes to sapwood respiration to account for aboveground damage.
Sep 16, 2022
6fc3bef
Fix the sapwood respiration bug
Sep 17, 2022
c955cf1
Slight update to allow FATES CNP to work with new phased allocation, …
rgknox Sep 20, 2022
ae40104
Added user name checks for damage mode and parteh 2
rgknox Sep 20, 2022
2b064f0
Updated error statement for fates cnp and tree damage
rgknox Sep 20, 2022
79f3065
Conflict resolutions
rgknox Sep 20, 2022
f998407
reverting nlevleaf
rgknox Sep 21, 2022
35dad01
Changing how damage fraction is calculated to account for variable
Sep 22, 2022
86dd566
Merge remote-tracking branch 'jfneedham_repo/JessicaNeedham-crowndama…
Sep 22, 2022
bec8928
Tidy up some debugging print statements
Sep 24, 2022
3efa3d0
Fix damage transition matrix to account for flexible damage bins
Sep 26, 2022
0251401
add crowndamage to allometry calls in EDPhysiologyMod
Sep 26, 2022
de822e4
Update sapwood respiration to fix damage related bug
Sep 27, 2022
e5b0121
Tidy comments on damage code
Oct 4, 2022
9dddd74
Update biogeophys/FatesPlantRespPhotosynthMod.F90
glemieux Oct 24, 2022
ab4e75b
fix whitespace and add comment
glemieux Oct 24, 2022
b1e4a1a
add debug check
glemieux Oct 24, 2022
adfba93
Merge tag 'sci.1.59.7_api.24.1.0' into JessicaNeedham-crowndamage_module
glemieux Oct 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 33 additions & 25 deletions biogeochem/EDCanopyStructureMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr,bc_in)
currentCohort => currentPatch%shortest
do while (associated(currentCohort))
call carea_allom(currentCohort%dbh,currentCohort%n, &
currentSite%spread,currentCohort%pft,currentCohort%c_area)
currentSite%spread,currentCohort%pft,&
currentCohort%crowndamage, currentCohort%c_area)

if(debug) then
if(currentCohort%c_area<0._r8)then
Expand Down Expand Up @@ -686,9 +687,10 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr,bc_in)
currentSite%demotion_carbonflux = currentSite%demotion_carbonflux + &
(leaf_c + store_c + fnrt_c + sapw_c + struct_c) * currentCohort%n

call carea_allom(copyc%dbh,copyc%n,currentSite%spread,copyc%pft,copyc%c_area)
call carea_allom(copyc%dbh,copyc%n,currentSite%spread,copyc%pft, &
copyc%crowndamage, copyc%c_area)
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)

!----------- Insert copy into linked list ------------------------!
copyc%shorter => currentCohort
Expand Down Expand Up @@ -727,7 +729,8 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr,bc_in)
end if

call carea_allom(currentCohort%dbh,currentCohort%n, &
currentSite%spread,currentCohort%pft,currentCohort%c_area)
currentSite%spread,currentCohort%pft,&
currentCohort%crowndamage, currentCohort%c_area)

endif !canopy layer = i_ly

Expand Down Expand Up @@ -833,7 +836,7 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)

currentCohort%canopy_layer = i_lyr
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)
! keep track of number and biomass of promoted cohort
currentSite%promotion_rate(currentCohort%size_class) = &
currentSite%promotion_rate(currentCohort%size_class) + currentCohort%n
Expand All @@ -859,7 +862,7 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)
if(currentCohort%canopy_layer == i_lyr+1)then !look at the cohorts in the canopy layer below...

if (ED_val_comp_excln .ge. 0.0_r8 ) then
Expand Down Expand Up @@ -1126,7 +1129,7 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)
newarea = currentCohort%c_area - cc_gain !new area of existing cohort

call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)

! number of individuals in promoted cohort.
copyc%n = currentCohort%n*cc_gain/currentCohort%c_area
Expand All @@ -1145,8 +1148,9 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)
(leaf_c + fnrt_c + store_c + sapw_c + struct_c) * copyc%n

call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
call carea_allom(copyc%dbh,copyc%n,currentSite%spread,copyc%pft,copyc%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)
call carea_allom(copyc%dbh,copyc%n,currentSite%spread,copyc%pft,&
copyc%crowndamage, copyc%c_area)

!----------- Insert copy into linked list ------------------------!
copyc%shorter => currentCohort
Expand Down Expand Up @@ -1223,7 +1227,9 @@ subroutine canopy_spread( currentSite )
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
call carea_allom(currentCohort%dbh,currentCohort%n, &
currentSite%spread,currentCohort%pft,currentCohort%c_area)
currentSite%spread,currentCohort%pft, &
currentCohort%crowndamage, currentCohort%c_area)

if( ( int(prt_params%woody(currentCohort%pft)) .eq. itrue ) .and. &
(currentCohort%canopy_layer .eq. 1 ) ) then
sitelevel_canopyarea = sitelevel_canopyarea + currentCohort%c_area
Expand Down Expand Up @@ -1323,7 +1329,7 @@ subroutine canopy_summarization( nsites, sites, bc_in )
! Update the cohort's index within the size bin classes
! Update the cohort's index within the SCPF classification system
call sizetype_class_index(currentCohort%dbh,currentCohort%pft, &
currentCohort%size_class,currentCohort%size_by_pft_class)
currentCohort%size_class,currentCohort%size_by_pft_class)

if (hlm_use_cohort_age_tracking .eq. itrue) then
call coagetype_class_index(currentCohort%coage,currentCohort%pft, &
Expand All @@ -1332,7 +1338,7 @@ subroutine canopy_summarization( nsites, sites, bc_in )

if(hlm_use_sp.eq.ifalse)then
call carea_allom(currentCohort%dbh,currentCohort%n,sites(s)%spread,&
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage,currentCohort%c_area)
endif
currentCohort%treelai = tree_lai(leaf_c, &
currentCohort%pft, currentCohort%c_area, currentCohort%n, &
Expand Down Expand Up @@ -1445,7 +1451,7 @@ subroutine leaf_area_profile( currentSite )
! currentCohort%treesai ! SAI per unit crown area (m2/m2)
! currentCohort%lai ! LAI per unit canopy area (m2/m2)
! currentCohort%sai ! SAI per unit canopy area (m2/m2)
! currentCohort%NV ! The number of discrete vegetation
! currentCohort%nv ! The number of discrete vegetation
! ! layers needed to describe this crown
!
! The following patch level diagnostics are updated here:
Expand All @@ -1471,7 +1477,6 @@ subroutine leaf_area_profile( currentSite )
! !USES:

use EDtypesMod , only : area, dinc_ed, hitemax, n_hite_bins

!
! !ARGUMENTS
type(ed_site_type) , intent(inout) :: currentSite
Expand All @@ -1498,8 +1503,9 @@ subroutine leaf_area_profile( currentSite )
real(r8) :: min_chite ! bottom of cohort canopy (m)
real(r8) :: max_chite ! top of cohort canopy (m)
real(r8) :: lai ! summed lai for checking m2 m-2
real(r8) :: leaf_c ! leaf carbon [kg]

real(r8) :: snow_depth_avg ! avg snow over whole site
real(r8) :: leaf_c ! leaf carbon [kgC]
real(r8) :: target_c_area ! crown area of undamaged cohort given dbh
!----------------------------------------------------------------------


Expand Down Expand Up @@ -1554,13 +1560,14 @@ subroutine leaf_area_profile( currentSite )
currentCohort%treelai = tree_lai(leaf_c, currentCohort%pft, currentCohort%c_area, &
currentCohort%n, currentCohort%canopy_layer, &
currentPatch%canopy_layer_tlai,currentCohort%vcmax25top )

if (hlm_use_sp .eq. ifalse) then
currentCohort%treesai = tree_sai(currentCohort%pft, currentCohort%dbh, currentCohort%canopy_trim, &
currentCohort%c_area, currentCohort%n, currentCohort%canopy_layer, &
currentPatch%canopy_layer_tlai, currentCohort%treelai , &
currentCohort%vcmax25top,4)
end if

if (hlm_use_sp .eq. ifalse) then
currentCohort%treesai = tree_sai(currentCohort%pft, currentCohort%dbh,&
currentSite%spread, currentCohort%canopy_trim, &
currentCohort%c_area, currentCohort%n, currentCohort%canopy_layer, &
currentPatch%canopy_layer_tlai, currentCohort%treelai , &
currentCohort%vcmax25top,4)
end if

currentCohort%lai = currentCohort%treelai *currentCohort%c_area/currentPatch%total_canopy_area
currentCohort%sai = currentCohort%treesai *currentCohort%c_area/currentPatch%total_canopy_area
Expand Down Expand Up @@ -2164,7 +2171,7 @@ subroutine CanopyLayerArea(currentPatch,site_spread,layer_index,layer_area)
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
call carea_allom(currentCohort%dbh,currentCohort%n,site_spread, &
currentCohort%pft,currentCohort%c_area)
currentCohort%pft,currentCohort%crowndamage, currentCohort%c_area)
if (currentCohort%canopy_layer .eq. layer_index) then
layer_area = layer_area + currentCohort%c_area
end if
Expand Down Expand Up @@ -2208,7 +2215,8 @@ function NumPotentialCanopyLayers(currentPatch,site_spread,include_substory) res
currentCohort => currentPatch%tallest
do while (associated(currentCohort))
if(currentCohort%canopy_layer == z) then
call carea_allom(currentCohort%dbh,currentCohort%n,site_spread,currentCohort%pft,c_area)
call carea_allom(currentCohort%dbh,currentCohort%n,site_spread,&
currentCohort%pft,currentCohort%crowndamage, c_area)
arealayer = arealayer + c_area
end if
currentCohort => currentCohort%shorter
Expand Down
Loading