Skip to content

Commit

Permalink
Introduction of boundary condition passing in host<->fates
Browse files Browse the repository at this point in the history
Merge branch 'rgknox-bcs'

New structures were created in FatesMod: bc_in(s) and bc_out(s), these
structures hold boundary conditions, where for FATES input they are
filled during the interface, and for FATES output they write to their
corresponding host's variable.

The new structures were prototyped with the calculation of the
sunshade fractions and btran. Wrappers were created in the interface
to call edbtran and the sunshade fractions.

Some of the boundary condition arrays needed dimension info, some of
these dimensions are dictated by the host, and so a scheme was
implemented to pass these "control parameters" from the host to FATES
as well. (see line ~230 of
components/clm/src/ED/main/FatesInterfaceMod.F90, and line 211 of
components/clm/src/utils/clmfates_interfaceMod.F90)

Fixes: none

User interface changes?: no

Code review: code discussion and review with @bishtgautam and
conferencing with @rosiealice @ckoven @bandre-ucar @mvertens and D
Lawrence

Test suite: ed - lawrencium-lr3 intel, yellowstone intel, gnu, pgi

Test baseline: answer changing, (hydrologic calculations of suction
were moved from FATES to the host)

Test namelist changes: none

Test answer changes: answer changing

Test summary: PASS except for known failures: #14, f09 and f19
restarts
  • Loading branch information
bandre-ucar committed Jul 23, 2016
2 parents 6521dca + fb1e138 commit a7f74bb
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 446 deletions.
17 changes: 6 additions & 11 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ subroutine canopy_derivs( currentPatch )
end subroutine canopy_derivs

! ============================================================================
subroutine non_canopy_derivs( currentPatch, temperature_inst, soilstate_inst, waterstate_inst)
subroutine non_canopy_derivs( currentPatch, temperature_inst )
!
! !DESCRIPTION:
! Returns time differentials of the state vector
Expand All @@ -80,8 +80,6 @@ subroutine non_canopy_derivs( currentPatch, temperature_inst, soilstate_inst, wa
! !ARGUMENTS
type(ed_patch_type) , intent(inout) :: currentPatch
type(temperature_type) , intent(in) :: temperature_inst
type(soilstate_type) , intent(in) :: soilstate_inst
type(waterstate_type) , intent(in) :: waterstate_inst
!
! !LOCAL VARIABLES:
integer c,p
Expand All @@ -108,7 +106,7 @@ subroutine non_canopy_derivs( currentPatch, temperature_inst, soilstate_inst, wa

! update fragmenting pool fluxes
call cwd_input(currentPatch)
call cwd_out( currentPatch, temperature_inst, soilstate_inst, waterstate_inst)
call cwd_out( currentPatch, temperature_inst)

do p = 1,numpft_ed
currentPatch%dseed_dt(p) = currentPatch%seeds_in(p) - currentPatch%seed_decay(p) - currentPatch%seed_germination(p)
Expand Down Expand Up @@ -244,7 +242,7 @@ subroutine phenology( currentSite, temperature_inst, waterstate_inst)
!
! !USES:
use clm_varcon, only : tfrz
use clm_time_manager, only : get_days_per_year, get_curr_date
use clm_time_manager, only : get_curr_date
use clm_time_manager, only : get_ref_date, timemgr_datediff
use EDTypesMod, only : udata
use PatchType , only : patch
Expand Down Expand Up @@ -1145,7 +1143,7 @@ subroutine fragmentation_scaler( currentPatch, temperature_inst )
! !USES:
use shr_const_mod , only : SHR_CONST_PI, SHR_CONST_TKFRZ
use EDSharedParamsMod , only : EDParamsShareInst
use PatchType , only : patch

!
! !ARGUMENTS
type(ed_patch_type) , intent(inout) :: currentPatch
Expand All @@ -1154,7 +1152,7 @@ subroutine fragmentation_scaler( currentPatch, temperature_inst )
! !LOCAL VARIABLES:
logical :: use_century_tfunc = .false.
type(ed_site_type), pointer :: currentSite
integer :: c,p,j
integer :: p,j
real(r8) :: t_scalar
real(r8) :: w_scalar
real(r8) :: catanf ! hyperbolic temperature function from CENTURY
Expand All @@ -1173,7 +1171,6 @@ subroutine fragmentation_scaler( currentPatch, temperature_inst )

! c = currentPatch%siteptr%clmcolumn
p = currentPatch%clm_pno
c = patch%column(p)

! set "froz_q10" parameter
froz_q10 = EDParamsShareInst%froz_q10
Expand Down Expand Up @@ -1204,7 +1201,7 @@ subroutine fragmentation_scaler( currentPatch, temperature_inst )
end subroutine fragmentation_scaler

! ============================================================================
subroutine cwd_out( currentPatch, temperature_inst, soilstate_inst, waterstate_inst)
subroutine cwd_out( currentPatch, temperature_inst )
!
! !DESCRIPTION:
! Simple CWD fragmentation Model
Expand All @@ -1217,8 +1214,6 @@ subroutine cwd_out( currentPatch, temperature_inst, soilstate_inst, waterstate_i
! !ARGUMENTS
type(ed_patch_type) , intent(inout), target :: currentPatch
type(temperature_type) , intent(in) :: temperature_inst
type(soilstate_type) , intent(in) :: soilstate_inst
type(waterstate_type) , intent(in) :: waterstate_inst
!
! !LOCAL VARIABLES:
type(ed_site_type), pointer :: currentSite
Expand Down
5 changes: 5 additions & 0 deletions biogeophys/EDAccumulateFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ subroutine AccumulateFluxes_ED(bounds, p, sites, nsites, hsites , photosyns_inst
psncanopy => photosyns_inst%psncanopy_patch & ! Output: [real(r8) (:,:)] canopy scale photosynthesis umol CO2 /m**2/ s
)


! INTERF-TODO: WHY IS THIS BEING UPDATED?
! IT IS JUST GOING TO BE ZEROED A THE END OF THE FUNCTION
! THAT CALLS THIS SUBROUTINE (CANOPYFLUXES), AND IT WON'T
! BE USED BETWEEN NOW AND THEN
fpsn(p) = psncanopy(p)

if (patch%is_veg(p)) then
Expand Down
Loading

0 comments on commit a7f74bb

Please sign in to comment.