Skip to content

Commit 49df997

Browse files
committed
add h2o_liq_sisl to the fates interface registery
1 parent bedbd84 commit 49df997

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎biogeophys/FatesPlantHydraulicsMod.F90‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ subroutine HydrSiteColdStart(sites, bc_in )
15541554

15551555
! [kg/m2] / ([m] * [kg/m3]) = [m3/m3]
15561556
h2osoi_liqvol = min(eff_por, &
1557-
sum(bc_in(s)%h2o_liq_sisl(j_t:j_b))/(csite_hydr%dz_rhiz(j)*denh2o))
1557+
sum(sites(s)%bc_in(ifp)%h2o_liq_sisl(j_t:j_b))/(csite_hydr%dz_rhiz(j)*denh2o))
15581558
csite_hydr%h2osoi_liqvol_shell(j,1:nshell) = h2osoi_liqvol
15591559

15601560
end do
@@ -2235,6 +2235,7 @@ subroutine FillDrainRhizShells(nsites, sites, bc_in)
22352235
real(r8) :: cumShellH2O ! sum of water in all the shells of a specific layer [kg/m2]
22362236
real(r8) :: h2osoi_liq_shell(nlevsoi_hyd_max,nshell) ! water in the rhizosphere shells [kg]
22372237
integer :: tmp ! temporary
2238+
integer :: ifp ! patch index for accessing boundary condition water content
22382239
logical :: found ! flag in search loop
22392240
!-----------------------------------------------------------------------
22402241

@@ -2253,6 +2254,9 @@ subroutine FillDrainRhizShells(nsites, sites, bc_in)
22532254
! If there are just no plants in this site, don't bother shuffling water
22542255
if( sum(csite_hydr%l_aroot_layer) <= nearzero ) cycle
22552256

2257+
! Temporarily hardcode this prior to multi-column fates implementation
2258+
ifp = 1
2259+
22562260
do j = 1,csite_hydr%nlevrhiz
22572261

22582262
j_t = csite_hydr%map_r2s(j,1) ! top soil layer matching rhiz layer
@@ -2263,7 +2267,7 @@ subroutine FillDrainRhizShells(nsites, sites, bc_in)
22632267
cumShellH2O=sum(csite_hydr%h2osoi_liqvol_shell(j,:) *csite_hydr%v_shell(j,:)) * denh2o*AREA_INV
22642268

22652269
! [kg/m2]
2266-
dwat_kgm2 = sum(bc_in(s)%h2o_liq_sisl(j_t:j_b)) - cumShellH2O
2270+
dwat_kgm2 = sum(sites(s)%bc_in(ifp)%h2o_liq_sisl(j_t:j_b)) - cumShellH2O
22672271

22682272
dwat_kg = dwat_kgm2 * AREA
22692273

@@ -2325,7 +2329,7 @@ subroutine FillDrainRhizShells(nsites, sites, bc_in)
23252329
csite_hydr%v_shell(j,:) * denh2o
23262330

23272331

2328-
errh2o(j) = sum(h2osoi_liq_shell(j,:))*AREA_INV - sum(bc_in(s)%h2o_liq_sisl(j_t:j_b))
2332+
errh2o(j) = sum(h2osoi_liq_shell(j,:))*AREA_INV - sum(sites(s)%bc_in(ifp)%h2o_liq_sisl(j_t:j_b))
23292333

23302334
if (abs(errh2o(j)) > 1.e-9_r8) then
23312335
write(fates_log(),*)'WARNING: water balance error in FillDrainRhizShells'
@@ -2771,7 +2775,7 @@ subroutine hydraulics_bc ( nsites, sites, bc_in, bc_out, dtime)
27712775
! into the root, othersize weight by root length
27722776
! h2osoi_liqvol: [kg/m2] / [m] / [kg/m3] = [m3/m3]
27732777
eff_por = sites(s)%bc_in(ifp)%eff_porosity_sl(j_bc)
2774-
h2osoi_liqvol = min(eff_por, bc_in(s)%h2o_liq_sisl(j_bc)/(bc_in(s)%dz_sisl(j_bc)*denh2o))
2778+
h2osoi_liqvol = min(eff_por, sites(s)%bc_in(ifp)%h2o_liq_sisl(j_bc)/(sites(s)%bc_in(ifp)%dz_sisl(j_bc)*denh2o))
27752779
psi_layer = csite_hydr%wrf_soil(j)%p%psi_from_th(h2osoi_liqvol)
27762780
ftc_layer = csite_hydr%wkf_soil(j)%p%ftc_from_psi(psi_layer)
27772781
weight_sl(j_bc) = bc_in(s)%hksat_sisl(j_bc)*ftc_layer*csite_hydr%rootl_sl(j_bc)

‎main/FatesInterfaceMod.F90‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ subroutine allocate_bcin(bc_in, nlevsoil_in, nlevdecomp_in, num_lu_harvest_cats,
570570
allocate(bc_in%sucsat_sisl(nlevsoil_in))
571571
allocate(bc_in%bsw_sisl(nlevsoil_in))
572572
allocate(bc_in%hksat_sisl(nlevsoil_in))
573-
allocate(bc_in%h2o_liq_sisl(nlevsoil_in)); bc_in%h2o_liq_sisl = nan
574573
end if
575574

576575
! Land use
@@ -3009,6 +3008,8 @@ subroutine InitializeBoundaryConditions(this, patches_per_site)
30093008
if (hlm_use_planthydro == itrue) then
30103009
call this%registry(r)%Register(key=hlm_fates_soil_potential_min, &
30113010
data=bc_in%smpmin, hlm_flag=.false.)
3011+
call this%registry(r)%Register(key=hlm_fates_liquid_water, &
3012+
data=bc_in%h2o_liq_sisl, hlm_flag=.false.)
30123013
end if
30133014

30143015
! bc_out

‎main/FatesInterfaceParametersMod.F90‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module FatesInterfaceParametersMod
3232
character(len=*), parameter, public :: hlm_fates_soil_h2o_liquid = 'soil_h2o_liquid_volume_content'
3333
character(len=*), parameter, public :: hlm_fates_soil_temperature = 'soil_temperature'
3434
character(len=*), parameter, public :: hlm_fates_soil_potential_min = 'soil_potential_minimum'
35+
character(len=*), parameter, public :: hlm_fates_liquid_water = 'liquid_water'
3536

3637
! Registry update frequency parameters
3738
integer, parameter, public :: registry_update_init_dims = 0 ! variable dimension that needs to be updated during initialization

‎main/FatesInterfaceTypesMod.F90‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ subroutine InitializeBCIn(this)
983983
allocate(this%watsat_sl(this%nlevgrnd))
984984
allocate(this%h2o_liqvol_sl(this%nlevgrnd))
985985
allocate(this%tempk_sl(this%nlevgrnd))
986+
allocate(this%h2o_liq_sisl(this%nlevgrnd))
986987

987988
! Unset variables
988989
this%decomp_id = fates_unset_int
@@ -997,6 +998,7 @@ subroutine InitializeBCIn(this)
997998
this%h2o_liqvol_sl= nan
998999
this%tempk_sl = nan
9991000
this%smpmin = nan
1001+
this%h2o_liq_sisl = nan
10001002

10011003
end subroutine InitializeBCIn
10021004

@@ -1220,6 +1222,8 @@ subroutine DefineInterfaceRegistry(this, initialize)
12201222
if (hlm_use_planthydro == itrue) then
12211223
call this%DefineInterfaceVariable(key=hlm_fates_soil_potential_min, initialize=initialize, index=index, &
12221224
update_frequency=registry_update_timestep, bc_dir=bc_in)
1225+
call this%DefineInterfaceVariable(key=hlm_fates_liquid_water, initialize=initialize, index=index, &
1226+
update_frequency=registry_update_timestep, bc_dir=bc_in)
12231227
end if
12241228

12251229
! Define the N and P litter fluxes if in CNP mode

0 commit comments

Comments
 (0)