Skip to content

Commit

Permalink
Merge pull request NGEET#759 from rgknox/new_params
Browse files Browse the repository at this point in the history
new parameters
  • Loading branch information
rgknox authored Jul 2, 2021
2 parents 64c557e + 6ee0d72 commit c1f6ddd
Show file tree
Hide file tree
Showing 9 changed files with 565 additions and 140 deletions.
149 changes: 74 additions & 75 deletions biogeophys/FatesPlantHydraulicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module FatesPlantHydraulicsMod
use EDParamsMod , only : hydr_kmax_rsurf2
use EDParamsMod , only : hydr_psi0
use EDParamsMod , only : hydr_psicap
use EDParamsMod , only : hydr_htftype_node

use EDTypesMod , only : ed_site_type
use EDTypesMod , only : ed_patch_type
Expand Down Expand Up @@ -190,12 +191,24 @@ module FatesPlantHydraulicsMod
__FILE__


integer, public, parameter :: van_genuchten_type = 1
integer, public, parameter :: campbell_type = 2
integer, public, parameter :: tfs_type = 3
! These index flags specify which pressure-volumen and pressure
! conductivity relationship are available.
! For plants: Users can option between useing tfs and van_genuchten
! by specifying their choice in the parameter file,
! with the model parameter hydr_htftype_node,
! the value should be 1 for TFS or 2 for VG (as shown below).
! Campbell, could technically be used, but the parameters for
! that hypothesis are not in the parameter file, so it not currently available.
! For soil: The soil hypothesis should follow the hypothesis for water transfer
! in the Host Land Model. At this time campbell is the default for both
! ELM and ALM. However, if alternatives arise (like VG), we still need to write
! interface routines to transfer over parameters. Right now we just hard-code
! the use of campbell_type for the soil (see a few lines below).

integer, public, parameter :: van_genuchten_type = 2
integer, public, parameter :: campbell_type = 3
integer, public, parameter :: tfs_type = 1

integer, parameter :: plant_wrf_type = tfs_type
integer, parameter :: plant_wkf_type = tfs_type
integer, parameter :: soil_wrf_type = campbell_type
integer, parameter :: soil_wkf_type = campbell_type

Expand Down Expand Up @@ -5312,81 +5325,67 @@ subroutine InitHydroGlobals()
! Initialize the Water Retention Functions
! -----------------------------------------------------------------------------------

select case(plant_wrf_type)
case(van_genuchten_type)
do ft = 1,numpft
do pm = 1, n_plant_media
allocate(wrf_vg)
wrf_plant(pm,ft)%p => wrf_vg
call wrf_vg%set_wrf_param([alpha_vg, psd_vg, th_sat_vg, th_res_vg])
end do
end do
case(campbell_type)
do ft = 1,numpft
do pm = 1,n_plant_media
allocate(wrf_cch)
wrf_plant(pm,ft)%p => wrf_cch
call wrf_cch%set_wrf_param([EDPftvarcon_inst%hydr_thetas_node(ft,pm), &
EDPftvarcon_inst%hydr_pinot_node(ft,pm), &
9._r8])
end do
end do
case(tfs_type)
do ft = 1,numpft
do pm = 1,n_plant_media
allocate(wrf_tfs)
wrf_plant(pm,ft)%p => wrf_tfs

if (pm.eq.leaf_p_media) then ! Leaf tissue
cap_slp = 0.0_r8
cap_int = 0.0_r8
cap_corr = 1.0_r8
else ! Non leaf tissues
cap_slp = (hydr_psi0 - hydr_psicap )/(1.0_r8 - rwccap(pm))
cap_int = -cap_slp + hydr_psi0
cap_corr = -cap_int/cap_slp
end if

call wrf_tfs%set_wrf_param([EDPftvarcon_inst%hydr_thetas_node(ft,pm), &
EDPftvarcon_inst%hydr_resid_node(ft,pm), &
EDPftvarcon_inst%hydr_pinot_node(ft,pm), &
EDPftvarcon_inst%hydr_epsil_node(ft,pm), &
rwcft(pm), &
cap_corr, &
cap_int, &
cap_slp,real(pm,r8)])
do pm = 1, n_plant_media
select case(hydr_htftype_node(pm))
case(van_genuchten_type)
do ft = 1,numpft
allocate(wrf_vg)
wrf_plant(pm,ft)%p => wrf_vg
call wrf_vg%set_wrf_param([EDPftvarcon_inst%hydr_vg_alpha_node(ft,pm), &
EDPftvarcon_inst%hydr_vg_m_node(ft,pm), &
EDPftvarcon_inst%hydr_thetas_node(ft,pm), &
EDPftvarcon_inst%hydr_resid_node(ft,pm)])
end do
case(tfs_type)
do ft = 1,numpft
allocate(wrf_tfs)
wrf_plant(pm,ft)%p => wrf_tfs
if (pm.eq.leaf_p_media) then ! Leaf tissue
cap_slp = 0.0_r8
cap_int = 0.0_r8
cap_corr = 1.0_r8
else ! Non leaf tissues
cap_slp = (hydr_psi0 - hydr_psicap )/(1.0_r8 - rwccap(pm))
cap_int = -cap_slp + hydr_psi0
cap_corr = -cap_int/cap_slp
end if
call wrf_tfs%set_wrf_param([EDPftvarcon_inst%hydr_thetas_node(ft,pm), &
EDPftvarcon_inst%hydr_resid_node(ft,pm), &
EDPftvarcon_inst%hydr_pinot_node(ft,pm), &
EDPftvarcon_inst%hydr_epsil_node(ft,pm), &
rwcft(pm), &
cap_corr, &
cap_int, &
cap_slp,real(pm,r8)])
end do
end do

end select
end select
end do

! -----------------------------------------------------------------------------------
! Initialize the Water Conductance (K) Functions
! -----------------------------------------------------------------------------------

select case(plant_wkf_type)
case(van_genuchten_type)
do ft = 1,numpft
do pm = 1, n_plant_media
allocate(wkf_vg)
wkf_plant(pm,ft)%p => wkf_vg
call wkf_vg%set_wkf_param([alpha_vg, psd_vg, th_sat_vg, th_res_vg, tort_vg])
end do

end do
case(campbell_type)
write(fates_log(),*) 'campbell/clapp-hornberger conductance not used in plants'
call endrun(msg=errMsg(sourcefile, __LINE__))
case(tfs_type)
do ft = 1,numpft
do pm = 1, n_plant_media
allocate(wkf_tfs)
wkf_plant(pm,ft)%p => wkf_tfs
call wkf_tfs%set_wkf_param([EDPftvarcon_inst%hydr_p50_node(ft,pm), &
EDPftvarcon_inst%hydr_avuln_node(ft,pm)])
end do
end do
end select
do pm = 1, n_plant_media
select case(hydr_htftype_node(pm))

case(van_genuchten_type)
do ft = 1,numpft
allocate(wkf_vg)
wkf_plant(pm,ft)%p => wkf_vg
call wkf_vg%set_wkf_param([EDPftvarcon_inst%hydr_vg_alpha_node(ft,pm), &
EDPftvarcon_inst%hydr_vg_m_node(ft,pm), &
EDPftvarcon_inst%hydr_thetas_node(ft,pm), &
EDPftvarcon_inst%hydr_resid_node(ft,pm), &
tort_vg])
end do
case(tfs_type)
do ft = 1,numpft
allocate(wkf_tfs)
wkf_plant(pm,ft)%p => wkf_tfs
call wkf_tfs%set_wkf_param([EDPftvarcon_inst%hydr_p50_node(ft,pm), &
EDPftvarcon_inst%hydr_avuln_node(ft,pm)])
end do
end select
end do

! There is only 1 stomata conductance hypothesis which uses the p50 and
! vulnerability parameters
Expand Down
10 changes: 3 additions & 7 deletions biogeophys/FatesPlantRespPhotosynthMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
! ------------------------------------------------------------------------------------

use EDPftvarcon , only : EDPftvarcon_inst
use EDParamsMod , only : theta_cj_c3, theta_cj_c4


! Arguments
Expand Down Expand Up @@ -962,11 +963,6 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
! quantum efficiency, used only for C4 (mol CO2 / mol photons) (index 0)
real(r8),parameter,dimension(0:1) :: quant_eff = [0.05_r8,0.0_r8]

! empirical curvature parameter for ac, aj photosynthesis co-limitation.
! Changed theta_cj and theta_ip to 0.999 to effectively remove smoothing logic
! following Anthony Walker's findings from MAAT.
real(r8),parameter,dimension(0:1) :: theta_cj = [0.999_r8,0.999_r8]

! empirical curvature parameter for ap photosynthesis co-limitation
real(r8),parameter :: theta_ip = 0.999_r8

Expand Down Expand Up @@ -1063,7 +1059,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in
(4._r8*co2_inter_c+8._r8*co2_cpoint)

! Gross photosynthesis smoothing calculations. Co-limit ac and aj.
aquad = theta_cj(c3c4_path_index)
aquad = theta_cj_c3
bquad = -(ac + aj)
cquad = ac * aj
call quadratic_f (aquad, bquad, cquad, r1, r2)
Expand Down Expand Up @@ -1094,7 +1090,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in

! Gross photosynthesis smoothing calculations. First co-limit ac and aj. Then co-limit ap

aquad = theta_cj(c3c4_path_index)
aquad = theta_cj_c4
bquad = -(ac + aj)
cquad = ac * aj
call quadratic_f (aquad, bquad, cquad, r1, r2)
Expand Down
Loading

0 comments on commit c1f6ddd

Please sign in to comment.