Skip to content

Commit

Permalink
Merge pull request #1306 from rgknox/fix-tveg-wgt-satphen
Browse files Browse the repository at this point in the history
Fix vegetation temperature weighting during phenology
  • Loading branch information
rgknox authored Jan 16, 2025
2 parents f459810 + efb14ac commit a969384
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,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 @@ -1010,13 +1012,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

0 comments on commit a969384

Please sign in to comment.