Skip to content

Commit

Permalink
added logic to differentiate canopy_summarization calls for restart v…
Browse files Browse the repository at this point in the history
…ersus timestepping
  • Loading branch information
ckoven committed Apr 6, 2021
1 parent b93a60e commit e33f6bc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ module CLMFatesInterfaceMod
use dynHarvestMod , only : dynHarvest_interp_resolve_harvesttypes
use FatesConstantsMod , only : hlm_harvest_area_fraction
use FatesConstantsMod , only : hlm_harvest_carbon
use FatesConstantsMod , only : itrue, ifalse
use perf_mod , only : t_startf, t_stopf
implicit none

Expand Down Expand Up @@ -919,7 +920,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, &
call this%wrap_update_hlmfates_dyn(nc, &
bounds_clump, &
waterdiagnosticbulk_inst, &
canopystate_inst)
canopystate_inst, ifalse)

! ---------------------------------------------------------------------------------
! Part IV:
Expand All @@ -942,7 +943,7 @@ end subroutine dynamics_driv
! ------------------------------------------------------------------------------------

subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, &
waterdiagnosticbulk_inst, canopystate_inst)
waterdiagnosticbulk_inst, canopystate_inst, is_called_at_restart)

! ---------------------------------------------------------------------------------
! This routine handles the updating of vegetation canopy diagnostics, (such as lai)
Expand All @@ -956,7 +957,8 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, &
integer , intent(in) :: nc
type(waterdiagnosticbulk_type) , intent(inout) :: waterdiagnosticbulk_inst
type(canopystate_type) , intent(inout) :: canopystate_inst

integer , intent(in) :: is_called_at_restart ! ifalse = daily timestep, itrue = restart

integer :: npatch ! number of patches in each site
integer :: ifp ! index FATES patch
integer :: p ! HLM patch index
Expand Down Expand Up @@ -991,7 +993,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, &
! Canopy diagnostics for FATES
call canopy_summarization(this%fates(nc)%nsites, &
this%fates(nc)%sites, &
this%fates(nc)%bc_in)
this%fates(nc)%bc_in, is_called_at_restart)

! Canopy diagnostic outputs for HLM
call update_hlm_dynamics(this%fates(nc)%nsites, &
Expand Down Expand Up @@ -1390,7 +1392,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
! Update diagnostics of FATES ecosystem structure used in HLM.
! ------------------------------------------------------------------------
call this%wrap_update_hlmfates_dyn(nc,bounds_clump, &
waterdiagnosticbulk_inst,canopystate_inst)
waterdiagnosticbulk_inst,canopystate_inst, itrue)

! ------------------------------------------------------------------------
! Update the 3D patch level radiation absorption fractions
Expand Down Expand Up @@ -1527,7 +1529,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, &
! Update diagnostics of FATES ecosystem structure used in HLM.
! ------------------------------------------------------------------------
call this%wrap_update_hlmfates_dyn(nc,bounds_clump, &
waterdiagnosticbulk_inst,canopystate_inst)
waterdiagnosticbulk_inst,canopystate_inst, ifalse)

! ------------------------------------------------------------------------
! Update history IO fields that depend on ecosystem dynamics
Expand Down Expand Up @@ -1610,6 +1612,7 @@ subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst)
end do
end do


! -------------------------------------------------------------------------------
! Call FATES public function to calculate internal sun/shade structures
! as well as total patch sun/shade fraction output boundary condition
Expand Down

0 comments on commit e33f6bc

Please sign in to comment.