Skip to content

Commit

Permalink
wip - Add ice wedge polygon variables to ActiveLayerMod
Browse files Browse the repository at this point in the history
Adds microtopographic parameters (relief, excluded volume,
depression depth) to active layer mode. Still needs
a few changes: a) requires subsidence to be calculated first
b) need to update microtopographic parameters based
on subsidence amounts.
  • Loading branch information
rfiorella committed May 3, 2024
1 parent f6c4c89 commit ec62bda
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 30 deletions.
29 changes: 27 additions & 2 deletions components/elm/src/biogeophys/ActiveLayerMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module ActiveLayerMod
use GridcellType , only : grc_pp
use ColumnType , only : col_pp
use ColumnDataType , only : col_es
use LandunitType , only : lun_pp
!
implicit none
save
Expand Down Expand Up @@ -57,7 +58,7 @@ subroutine alt_calc(num_soilc, filter_soilc, &
!
! !LOCAL VARIABLES:
integer :: c, j, fc, g ! counters
integer :: alt_ind ! index of base of activel layer
integer :: alt_ind ! index of base of active layer
integer :: year ! year (0, ...) for nstep+1
integer :: mon ! month (1, ..., 12) for nstep+1
integer :: day ! day of month (1, ..., 31) for nstep+1
Expand All @@ -78,7 +79,11 @@ subroutine alt_calc(num_soilc, filter_soilc, &
alt_indx => canopystate_vars%alt_indx_col , & ! Output: [integer (:) ] current depth of thaw
altmax_indx => canopystate_vars%altmax_indx_col , & ! Output: [integer (:) ] maximum annual depth of thaw
altmax_lastyear_indx => canopystate_vars%altmax_lastyear_indx_col , & ! Output: [integer (:) ] prior year maximum annual depth of thaw
altmax_ever_indx => canopystate_vars%altmax_ever_indx_col & ! Output: [integer (:) ] maximum thaw depth since initialization
altmax_ever_indx => canopystate_vars%altmax_ever_indx_col, & ! Output: [integer (:) ] maximum thaw depth since initialization
excess_ice => col_pp%excess_ice , & ! Input: [real(r8) (:,:) ] depth variable excess ice content in soil column (-)
rmax => col_pp%iwp_microrel , & ! Output: [real(r8) (:) ] ice wedge polygon microtopographic relief (m)
vexc => col_pp%iwp_exclvol , & ! Output: [real(r8) (:) ] ice wedge polygon excluded volume (m)
ddep => col_pp%iwp_ddep ! Output: [real(r8) (:) ] ice wedge polygon depression depth (m)
)

! on a set annual timestep, update annual maxima
Expand Down Expand Up @@ -162,6 +167,26 @@ subroutine alt_calc(num_soilc, filter_soilc, &
endif
endif

! update ice wedge polygon microtopographic parameters if in polygonal ground
! TODO: need to retrieve landunit this column is on.
if (lun_pp%ispolygon) then
if (lun_pp%polygontype(c) .eq. ilowcenpoly) then
rmax(c) = 0.4_r8
vexc(c) = 0.2_r8
ddep(c) = 0.15_r8 ! TODO - update based on subsidence calcs.
elseif (lun_pp%polygontype(c) .eq. iflatcenpoly) then
rmax(c) = 0.1_r8 ! TODO - update based on subsidence calcs.
vexc(c) = 0.05_r8 ! TODO - update based on subsidence calcs.
ddep(c) = 0.01_r8 ! TODO - update based on subsidence calcs.
elseif (lun_pp%polygontype(c) .eq. ihighcenpoly) then
rmax(c) = 0.4_r8
vexc(c) = 0.2_r8
ddep(c) = 0.05_m
else
!call endrun !<- TODO: needed? Potential way to prevent unintended updating of microtopography
! if polygonal ground is misspecified on surface file.
endif
endif
end do

end associate
Expand Down
55 changes: 27 additions & 28 deletions components/elm/src/biogeophys/CanopyHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ subroutine CanopyHydrology(bounds, &
elai => canopystate_vars%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow
esai => canopystate_vars%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow

t_grnd => col_es%t_grnd , & ! Input: [real(r8) (:) ] ground temperature (Kelvin)
t_soisno => col_es%t_soisno , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin)
t_grnd => col_es%t_grnd , & ! Input: [real(r8) (:) ] ground temperature (Kelvin)
t_soisno => col_es%t_soisno , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin)

do_capsnow => col_ws%do_capsnow , & ! Output: [logical (:) ] true => do snow capping
h2ocan => veg_ws%h2ocan , & ! Output: [real(r8) (:) ] total canopy water (mm H2O)
h2ocan => veg_ws%h2ocan , & ! Output: [real(r8) (:) ] total canopy water (mm H2O)
h2osfc => col_ws%h2osfc , & ! Output: [real(r8) (:) ] surface water (mm)
h2osno => col_ws%h2osno , & ! Output: [real(r8) (:) ] snow water (mm H2O)
snow_depth => col_ws%snow_depth , & ! Output: [real(r8) (:) ] snow height (m)
Expand All @@ -225,29 +225,29 @@ subroutine CanopyHydrology(bounds, &
h2osoi_liq => col_ws%h2osoi_liq , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2)
swe_old => col_ws%swe_old , & ! Output: [real(r8) (:,:) ] snow water before update

irrig_rate => veg_wf%irrig_rate , & ! Input: [real(r8) (:) ] current irrigation rate (applied if n_irrig_steps_left > 0) [mm/s]
n_irrig_steps_left => veg_wf%n_irrig_steps_left , & ! Output: [integer (:) ] number of time steps for which we still need to irrigate today
qflx_floodc => col_wf%qflx_floodc , & ! Output: [real(r8) (:) ] column flux of flood water from RTM
qflx_snow_melt => col_wf%qflx_snow_melt , & ! Output: [real(r8) (:) ] snow melt from previous time step
qflx_snow_h2osfc => col_wf%qflx_snow_h2osfc , & ! Output: [real(r8) (:) ] snow falling on surface water (mm/s)
qflx_snwcp_liq => veg_wf%qflx_snwcp_liq , & ! Output: [real(r8) (:) ] excess rainfall due to snow capping (mm H2O /s) [+]
qflx_snwcp_ice => veg_wf%qflx_snwcp_ice , & ! Output: [real(r8) (:) ] excess snowfall due to snow capping (mm H2O /s) [+]
qflx_snow_grnd_col => col_wf%qflx_snow_grnd , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+]
qflx_snow_grnd_patch => veg_wf%qflx_snow_grnd , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+]
qflx_prec_intr => veg_wf%qflx_prec_intr , & ! Output: [real(r8) (:) ] interception of precipitation [mm/s]
qflx_prec_grnd => veg_wf%qflx_prec_grnd , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)]
qflx_rain_grnd => veg_wf%qflx_rain_grnd , & ! Output: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+]
qflx_dirct_rain => veg_wf%qflx_dirct_rain , & ! Output: [real(r8) (:) ] direct rain throughfall on ground (mm H2O/s)
qflx_leafdrip => veg_wf%qflx_leafdrip , & ! Output: [real(r8) (:) ] leap rain drip on ground (mm H2O/s)
qflx_irrig => veg_wf%qflx_irrig_patch , & ! Output: [real(r8) (:) ] total water demand or irrigation amount if one-way (mm/s)
qflx_real_irrig => veg_wf%qflx_real_irrig_patch , & ! Output: [real(r8) (:) ] actual irrigation amount (mm/s)
qflx_surf_irrig_col => col_wf%qflx_surf_irrig , & ! Output: [real(r8) (:) ] col real surface water irrigation flux (mm H2O /s)
qflx_grnd_irrig_col => col_wf%qflx_grnd_irrig , & ! Output: [real(r8) (:) ] col real groundwater irrigation flux (mm H2O /s)
qflx_over_supply_col => col_wf%qflx_over_supply , & ! Output: [real(r8) (:) ] over supply irrigation flux (mm H2O /s)
qflx_supply => veg_wf%qflx_supply_patch , & ! Output: [real(r8) (:) ] irrigation supply (mm/s)
qflx_surf_irrig => veg_wf%qflx_surf_irrig_patch , & ! Output: [real(r8) (:) ] actual surface water irrigation (mm/s)
qflx_grnd_irrig => veg_wf%qflx_grnd_irrig_patch , & ! Output: [real(r8) (:) ] actual groundwater irrigation (mm/s)
qflx_over_supply => veg_wf%qflx_over_supply_patch & ! Output: [real(r8) (:) ] the portion of supply that exceed total demand (mm/s)
irrig_rate => veg_wf%irrig_rate , & ! Input: [real(r8) (:) ] current irrigation rate (applied if n_irrig_steps_left > 0) [mm/s]
n_irrig_steps_left => veg_wf%n_irrig_steps_left , & ! Output: [integer (:) ] number of time steps for which we still need to irrigate today
qflx_floodc => col_wf%qflx_floodc , & ! Output: [real(r8) (:) ] column flux of flood water from RTM
qflx_snow_melt => col_wf%qflx_snow_melt , & ! Output: [real(r8) (:) ] snow melt from previous time step
qflx_snow_h2osfc => col_wf%qflx_snow_h2osfc , & ! Output: [real(r8) (:) ] snow falling on surface water (mm/s)
qflx_snwcp_liq => veg_wf%qflx_snwcp_liq , & ! Output: [real(r8) (:) ] excess rainfall due to snow capping (mm H2O /s) [+]
qflx_snwcp_ice => veg_wf%qflx_snwcp_ice , & ! Output: [real(r8) (:) ] excess snowfall due to snow capping (mm H2O /s) [+]
qflx_snow_grnd_col => col_wf%qflx_snow_grnd , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+]
qflx_snow_grnd_patch => veg_wf%qflx_snow_grnd , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+]
qflx_prec_intr => veg_wf%qflx_prec_intr , & ! Output: [real(r8) (:) ] interception of precipitation [mm/s]
qflx_prec_grnd => veg_wf%qflx_prec_grnd , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)]
qflx_rain_grnd => veg_wf%qflx_rain_grnd , & ! Output: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+]
qflx_dirct_rain => veg_wf%qflx_dirct_rain , & ! Output: [real(r8) (:) ] direct rain throughfall on ground (mm H2O/s)
qflx_leafdrip => veg_wf%qflx_leafdrip , & ! Output: [real(r8) (:) ] leap rain drip on ground (mm H2O/s)
qflx_irrig => veg_wf%qflx_irrig_patch , & ! Output: [real(r8) (:) ] total water demand or irrigation amount if one-way (mm/s)
qflx_real_irrig => veg_wf%qflx_real_irrig_patch, & ! Output: [real(r8) (:) ] actual irrigation amount (mm/s)
qflx_surf_irrig_col => col_wf%qflx_surf_irrig , & ! Output: [real(r8) (:) ] col real surface water irrigation flux (mm H2O /s)
qflx_grnd_irrig_col => col_wf%qflx_grnd_irrig , & ! Output: [real(r8) (:) ] col real groundwater irrigation flux (mm H2O /s)
qflx_over_supply_col => col_wf%qflx_over_supply , & ! Output: [real(r8) (:) ] over supply irrigation flux (mm H2O /s)
qflx_supply => veg_wf%qflx_supply_patch , & ! Output: [real(r8) (:) ] irrigation supply (mm/s)
qflx_surf_irrig => veg_wf%qflx_surf_irrig_patch, & ! Output: [real(r8) (:) ] actual surface water irrigation (mm/s)
qflx_grnd_irrig => veg_wf%qflx_grnd_irrig_patch, & ! Output: [real(r8) (:) ] actual groundwater irrigation (mm/s)
qflx_over_supply => veg_wf%qflx_over_supply_patch & ! Output: [real(r8) (:) ] the portion of supply that exceed total demand (mm/s)
)

! Compute time step
Expand Down Expand Up @@ -804,7 +804,7 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
micro_sigma => col_pp%micro_sigma , & ! Input: [real(r8) (:) ] microtopography pdf sigma (m)

h2osno => col_ws%h2osno , & ! Input: [real(r8) (:) ] snow water (mm H2O)
excess_ice => col_ws%excess_ice , & ! Input: [real(r8) (:,:) ] excess ground ice [kg/m2]
excess_ice => col_ws%excess_ice , & ! Input: [real(r8) (:) ] excess ground ice (0 to 1)

h2osoi_liq => col_ws%h2osoi_liq , & ! Output: [real(r8) (:,:) ] liquid water (col,lyr) [kg/m2]
h2osfc => col_ws%h2osfc , & ! Output: [real(r8) (:) ] surface water (mm)
Expand All @@ -827,7 +827,6 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
! Use newton-raphson method to iteratively determine frac_h20sfc
! based on amount of surface water storage (h2osfc) and
! microtopography variability (micro_sigma)

if (h2osfc(c) > min_h2osfc) then
! a cutoff is needed for numerical reasons...(nonconvergence after 5 iterations)
d=0.0
Expand Down

0 comments on commit ec62bda

Please sign in to comment.