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

Enable leaf phenology when running Static Stand Structure (ST3) Mode #1129

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
17 changes: 7 additions & 10 deletions main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,13 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in, bc_out)
! Zero mass balance
call TotalBalanceCheck(currentSite, 0)

! We do not allow phenology while in ST3 mode either, it is hypothetically
! possible to allow this, but we have not plugged in the litter fluxes
! of flushing or turning over leaves for non-dynamics runs
if (hlm_use_ed_st3.eq.ifalse)then
if(hlm_use_sp.eq.ifalse) then
call phenology(currentSite, bc_in )
else
call satellite_phenology(currentSite, bc_in )
end if ! SP phenology
end if
! Phenology. For now ST3 mode also represents phenology, though it is
! an incomplete representation as it lacks transfers to the litter layer
if (hlm_use_sp == ifalse) then
call phenology(currentSite, bc_in )
else
call satellite_phenology(currentSite, bc_in )
end if ! SP phenology


if (hlm_use_ed_st3.eq.ifalse.and.hlm_use_sp.eq.ifalse) then ! Bypass if ST3
Expand Down
2 changes: 1 addition & 1 deletion main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,7 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in)
hio_lai_si => this%hvars(ih_lai_si)%r81d )

! If we don't have dynamics turned on, we just abort these diagnostics
if (hlm_use_ed_st3.eq.itrue) return
Copy link
Contributor

@rgknox rgknox Jan 15, 2024

Choose a reason for hiding this comment

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

I'm working on breaking up the history calls (in another PR) so that we are not processing variables that are not desired or active. My take, is that by removing this line, the user can now view phenologically relevant output?

Copy link
Contributor Author

@mpaiao mpaiao Jan 15, 2024

Choose a reason for hiding this comment

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

To be honest, I had removed this because I wanted to see the computed forest structure properties in the output, and forgot to uncomment it back for the PR. But you are right, this return may disable variables that are now going to change due to phenology. Perhaps we could move the phenology-related variables before the if and keep the others after the if?

Copy link
Contributor

@rgknox rgknox Jan 15, 2024

Choose a reason for hiding this comment

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

my intention in the PR that cleans up history was to enable diagnostics that show forest structure and states, and to turn off flux variables (with st3 AND Sat Phen). So, if you don't have a strong preference for this PR, lets just keep the return in there to make testing more straight forward?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can uncomment it.

Maybe a topic for the other PR, but wouldn't you want to output flux variables (and LAI) when using ST3 and SP modes, and turn off the other forest structure and states (as they wouldn't vary in these modes)?

! if (hlm_use_ed_st3.eq.itrue) return

model_day_int = nint(hlm_model_day)

Expand Down
8 changes: 8 additions & 0 deletions parteh/PRTLossFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module PRTLossFluxesMod
use FatesConstantsMod, only : nearzero
use FatesConstantsMod, only : calloc_abs_error
use FatesConstantsMod, only : itrue
use FatesInterfaceTypesMod, only : hlm_use_ed_st3
use FatesGlobals , only : endrun => fates_endrun
use FatesGlobals , only : fates_log
use shr_log_mod , only : errMsg => shr_log_errMsg
Expand Down Expand Up @@ -567,6 +568,13 @@ subroutine DeciduousTurnoverSimpleRetranslocation(prt,ipft,organ_id,mass_fractio

if( prt_params%organ_param_id(organ_id) < 1 ) then
retrans = 0._r8
else if (hlm_use_ed_st3 == itrue) then
! For now we retranslocate all biomass to storage to prevent carbon balance errors.
! This is not an ideal solution because tissue abscission may contribute to a
! seasonal sign in litter and consequently heterotrophic respiration (though the
! lack of phenology is also problematic for seasonal cycles of GPP, ET, sensible
! heat, etc.).
retrans = 1._r8
else
if ( element_id == carbon12_element ) then
retrans = 0._r8
Expand Down