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

Fix vegetation temperature weighting during phenology #1306

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
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
18 changes: 15 additions & 3 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ subroutine phenology( currentSite, bc_in )
integer :: gddstart ! beginning of counting period for growing degree days.
integer :: nlevroot ! Number of rooting levels to consider
real(r8) :: temp_in_C ! daily averaged temperature in celsius
real(r8) :: temp_wgt ! canopy area weighting factor for daily average
! vegetation temperature calculation
real(r8) :: elongf_prev ! Elongation factor from previous time
real(r8) :: elongf_1st ! First guess for elongation factor
integer :: ndays_pft_leaf_lifespan ! PFT life span of drought deciduous [days].
Expand Down Expand Up @@ -1019,13 +1021,23 @@ subroutine phenology( currentSite, bc_in )
!Parameters, default from from SDGVM model of senesence

temp_in_C = 0._r8
temp_wgt = 0._r8
cpatch => CurrentSite%oldest_patch
do while(associated(cpatch))
temp_in_C = temp_in_C + cpatch%tveg24%GetMean()*cpatch%area
temp_in_C = temp_in_C + cpatch%tveg24%GetMean()*cpatch%total_canopy_area
temp_wgt = temp_wgt + cpatch%total_canopy_area
cpatch => cpatch%younger
end do
temp_in_C = temp_in_C * area_inv - tfrz

if(temp_wgt>nearzero)then
temp_in_C = temp_in_C/temp_wgt - tfrz
else
! If there is no canopy area, we use the veg temperature
! of the first patch, which is the forcing air temperature
! as defined in CLM/ELM. The forcing air temperature
! should be the same among all patches. (Although
! it is unlikely there are more than 1 in this scenario)
temp_in_C = CurrentSite%oldest_patch%tveg24%GetMean() - tfrz
end if

!-----------------Cold Phenology--------------------!

Expand Down