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

Adding IWUELN and VPD_2M diagnostic #1267

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 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
41 changes: 35 additions & 6 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module CanopyFluxesMod
use abortutils , only : endrun
use clm_varctl , only : iulog, use_cn, use_lch4, use_c13, use_c14, use_cndv, use_fates, &
use_luna, use_hydrstress, use_biomass_heat_storage
use clm_varpar , only : nlevgrnd, nlevsno, mxpft
use clm_varcon , only : namep
use clm_varpar , only : nlevgrnd, nlevsno, nlevcan, mxpft
use clm_varcon , only : namep, spval
use pftconMod , only : pftcon
use decompMod , only : bounds_type
use ActiveLayerMod , only : active_layer_type
Expand Down Expand Up @@ -224,7 +224,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
!
! !USES:
use shr_const_mod , only : SHR_CONST_RGAS, shr_const_pi
use clm_time_manager , only : get_step_size_real, get_prev_date,is_end_curr_day
use clm_time_manager , only : get_step_size_real, get_prev_date,is_end_curr_day, is_near_local_noon
use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice, c_to_b
use clm_varcon , only : denh2o, tfrz, tlsai_crit, alpha_aero
use clm_varcon , only : c14ratio
Expand Down Expand Up @@ -280,7 +280,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,

!added by K.Sakaguchi for stability formulation
real(r8), parameter :: ria = 0.5_r8 ! free parameter for stable formulation (currently = 0.5, "gamma" in Sakaguchi&Zeng,2008)

real(r8) :: dtime ! land model time step (sec)
real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m]
real(r8) :: wc ! convective velocity [m/s]
Expand Down Expand Up @@ -324,6 +323,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
real(r8) :: qsatldT(bounds%begp:bounds%endp) ! derivative of "qsatl" on "t_veg"
real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa]
real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg]
real(r8) :: gs ! canopy conductance for iwue cal [molH2O/m2ground/s]
real(r8) :: air(bounds%begp:bounds%endp) ! atmos. radiation temporay set
real(r8) :: bir(bounds%begp:bounds%endp) ! atmos. radiation temporay set
real(r8) :: cir(bounds%begp:bounds%endp) ! atmos. radiation temporay set
Expand Down Expand Up @@ -401,7 +401,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
integer :: ft ! plant functional type index
real(r8) :: h2ocan ! total canopy water (mm H2O)
real(r8) :: dt_veg_temp(bounds%begp:bounds%endp)
integer :: iv
integer, parameter :: iv=1 ! index for first canopy layer (iwue calculation)
logical :: is_end_day ! is end of current day
real(r8) :: dbh(bounds%begp:bounds%endp) ! diameter at breast height of vegetation
real(r8) :: cp_leaf(bounds%begp:bounds%endp) ! heat capacity of leaves
Expand Down Expand Up @@ -496,6 +496,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
swmp80_ref2m_r => humanindex_inst%swmp80_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 80% effi (C)

sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2)
par_z_sun => solarabs_inst%parsun_z_patch , & ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2)

frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-]
elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
Expand Down Expand Up @@ -546,6 +547,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
qg_h2osfc => waterdiagnosticbulk_inst%qg_h2osfc_col , & ! Input: [real(r8) (:) ] specific humidity at h2osfc surface [kg/kg]
qg => waterdiagnosticbulk_inst%qg_col , & ! Input: [real(r8) (:) ] specific humidity at ground surface [kg/kg]
dqgdT => waterdiagnosticbulk_inst%dqgdT_col , & ! Input: [real(r8) (:) ] temperature derivative of "qg"

h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2)
h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] by F. Li and S. Levis
h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2)
Expand All @@ -557,16 +559,20 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
rh_ref2m_r => waterdiagnosticbulk_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%)
rh_ref2m => waterdiagnosticbulk_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%)
rhaf => waterdiagnosticbulk_inst%rh_af_patch , & ! Output: [real(r8) (:) ] fractional humidity of canopy air [dimensionless]
vpd_ref2m => waterdiagnosticbulk_inst%vpd_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface vapor pressure deficit (Pa)
iwue_ln => waterdiagnosticbulk_inst%iwue_ln_patch , & ! Output: [real(r8) (:) ] local noon ecosystem-scale inherent water use efficiency (gC kgH2O-1 hPa)

qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Output: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm)
qflx_evap_veg => waterfluxbulk_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm)
qflx_evap_soi => waterfluxbulk_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm)
qflx_ev_snow => waterfluxbulk_inst%qflx_ev_snow_patch , & ! Output: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm]
qflx_ev_soil => waterfluxbulk_inst%qflx_ev_soil_patch , & ! Output: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm]
qflx_ev_h2osfc => waterfluxbulk_inst%qflx_ev_h2osfc_patch , & ! Output: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm]

gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Input: [real(r8) (:) ] patch sunlit leaf stomatal conductance (umol H2O/m**2/s)
gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Input: [real(r8) (:) ] patch shaded leaf stomatal conductance (umol H2O/m**2/s)
rssun => photosyns_inst%rssun_patch , & ! Output: [real(r8) (:) ] leaf sunlit stomatal resistance (s/m) (output from Photosynthesis)
rssha => photosyns_inst%rssha_patch , & ! Output: [real(r8) (:) ] leaf shaded stomatal resistance (s/m) (output from Photosynthesis)
fpsn => photosyns_inst%fpsn_patch , & ! Input: [real(r8) (:) ] photosynthesis (umol CO2 /m**2 /s)

grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s]

Expand Down Expand Up @@ -1451,6 +1457,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8)
rh_ref2m_r(p) = rh_ref2m(p)

! 2m vapor pressure deficit
vpd_ref2m(p) = e_ref2m*(1._r8-rh_ref2m(p)/100._r8)

! Human Heat Stress
if ( all_human_stress_indices .or. fast_human_stress_indices ) then
call KtoC(t_ref2m(p), tc_ref2m(p))
Expand Down Expand Up @@ -1548,6 +1557,26 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
call PhotosynthesisTotal(fn, filterp, &
atm2lnd_inst, canopystate_inst, photosyns_inst)

! Calculate water use efficiency
! does not support multi-layer canopy
if (nlevcan == 1) then
do f = 1, fn
p = filterp(f)
c = patch%column(p)
g = patch%gridcell(p)

if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) .and. fpsn(p)>0._r8 )then
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could use isecsphr from clm_varcon here in place of the hardcoded 3600. But, that's not too big of a deal either way.

gs = 1.e-6_r8*(laisun(p)*gs_mol_sun(p,iv)+laisha(p)*gs_mol_sha(p,iv)) ! 1e-6 converts umolH2O->molH2O
if ( gs>0._r8 ) then
iwue_ln(p) = fpsn(p)/gs
else
iwue_ln(p) = spval
end if
else
iwue_ln(p) = spval
end if
end do
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
end if
! Calculate ozone stress. This needs to be done after rssun and rsshade are
! computed by the Photosynthesis routine. However, Photosynthesis also uses the
! ozone stress computed here. Thus, the ozone stress computed in timestep i is
Expand Down
4 changes: 2 additions & 2 deletions src/biogeophys/PhotosynthesisMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ module PhotosynthesisMod
real(r8), pointer, private :: vcmax_z_phs_patch (:,:,:) ! patch maximum rate of carboxylation (umol co2/m**2/s)
real(r8), pointer, private :: kp_z_phs_patch (:,:,:) ! patch initial slope of CO2 response curve (C4 plants)
real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s)
real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s)
real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s)
real(r8), pointer, public :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s)
real(r8), pointer, public :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s)
real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s)
real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s)
real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s)
Expand Down
24 changes: 22 additions & 2 deletions src/biogeophys/WaterDiagnosticBulkType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module WaterDiagnosticBulkType
use decompMod , only : bounds_type
use abortutils , only : endrun
use clm_varctl , only : use_cn, iulog, use_luna
use clm_varpar , only : nlevgrnd, nlevsno
use clm_varpar , only : nlevgrnd, nlevsno, nlevcan
use clm_varcon , only : spval
use LandunitType , only : lun
use ColumnType , only : col
Expand Down Expand Up @@ -53,6 +53,8 @@ module WaterDiagnosticBulkType
real(r8), pointer :: h2osno_top_col (:) ! col top-layer mass of snow [kg]
real(r8), pointer :: sno_liq_top_col (:) ! col snow liquid water fraction (mass), top layer [fraction]

real(r8), pointer :: iwue_ln_patch (:) ! patch intrinsic water use efficiency near local noon (umolCO2/molH2O)
real(r8), pointer :: vpd_ref2m_patch (:) ! patch 2 m height surface vapor pressure deficit (Pa)
real(r8), pointer :: rh_ref2m_patch (:) ! patch 2 m height surface relative humidity (%)
real(r8), pointer :: rh_ref2m_r_patch (:) ! patch 2 m height surface relative humidity - rural (%)
real(r8), pointer :: rh_ref2m_u_patch (:) ! patch 2 m height surface relative humidity - urban (%)
Expand Down Expand Up @@ -190,7 +192,9 @@ subroutine InitBulkAllocate(this, bounds)
allocate(this%h2osno_top_col (begc:endc)) ; this%h2osno_top_col (:) = nan
allocate(this%sno_liq_top_col (begc:endc)) ; this%sno_liq_top_col (:) = nan

allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan
allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan
allocate(this%iwue_ln_patch (begp:endp)) ; this%iwue_ln_patch (:) = nan
allocate(this%vpd_ref2m_patch (begp:endp)) ; this%vpd_ref2m_patch (:) = nan
allocate(this%rh_ref2m_patch (begp:endp)) ; this%rh_ref2m_patch (:) = nan
allocate(this%rh_ref2m_u_patch (begp:endp)) ; this%rh_ref2m_u_patch (:) = nan
allocate(this%rh_ref2m_r_patch (begp:endp)) ; this%rh_ref2m_r_patch (:) = nan
Expand Down Expand Up @@ -268,6 +272,22 @@ subroutine InitBulkHistory(this, bounds)
long_name=this%info%lname('vertically summed soil cie (veg landunits only)'), &
ptr_col=this%h2osoi_ice_tot_col, l2g_scale_type='veg')

this%iwue_ln_patch(begp:endp) = spval
call hist_addfld1d ( &
fname=this%info%fname('IWUELN'), &
units='umolCO2/molH2O', &
avgflag='A', &
long_name=this%info%lname('local noon intrinsic water use efficiency'), &
ptr_patch=this%iwue_ln_patch, set_lake=spval, set_urb=spval)

this%vpd_ref2m_patch(begp:endp) = spval
call hist_addfld1d ( &
fname=this%info%fname('VPD2M'), &
units='Pa', &
avgflag='A', &
long_name=this%info%lname('2m vapor pressure deficit'), &
ptr_patch=this%vpd_ref2m_patch)

this%rh_ref2m_patch(begp:endp) = spval
call hist_addfld1d ( &
fname=this%info%fname('RH2M'), &
Expand Down