-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add subgrid hillslope hydrology (NGEE Arctic IM2) #6718
base: master
Are you sure you want to change the base?
Changes from all commits
d7924a0
da4098e
1eee981
6c860ff
fe1e477
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
./xmlchange --id ELM_BLDNML_OPTS --val "-bgc sp -topounit" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata/half_degree_merge_surfdata_0.5x0.5_simyr2000_c190418.with_aveDTB.20201222.nc' | ||
use_IM2_hillslope_hydrology = .true. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ module SoilHydrologyMod | |
use SoilHydrologyType , only : soilhydrology_type | ||
use SoilStateType , only : soilstate_type | ||
use WaterfluxType , only : waterflux_type | ||
use TopounitType , only : top_pp | ||
use TopounitDataType , only : top_ws | ||
use LandunitType , only : lun_pp | ||
use ColumnType , only : col_pp | ||
use ColumnDataType , only : col_es, col_ws, col_wf | ||
|
@@ -47,12 +49,12 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & | |
! | ||
! !USES: | ||
!$acc routine seq | ||
use elm_varcon , only : denice, denh2o, wimp, pondmx_urban | ||
use elm_varcon , only : denice, denh2o, wimp, pondmx_urban, frac_from_uphill | ||
use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall | ||
use column_varcon , only : icol_road_imperv, icol_road_perv | ||
use elm_varpar , only : nlevsoi, nlevgrnd, maxpatch_pft | ||
use elm_varpar , only : nlayer, nlayert | ||
use elm_varctl , only : use_var_soil_thick | ||
use elm_varctl , only : use_var_soil_thick, use_IM2_hillslope_hydrology | ||
use SoilWaterMovementMod, only : zengdecker_2009_with_var_soil_thick | ||
! | ||
! !ARGUMENTS: | ||
|
@@ -66,7 +68,7 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & | |
real(r8), intent(in) :: dtime | ||
! | ||
! !LOCAL VARIABLES: | ||
integer :: c,j,fc,g,l,i !indices | ||
integer :: c,j,fc,g,l,t,i !indices | ||
integer :: nlevbed !# levels to bedrock | ||
real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit | ||
real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevgrnd) !partial volume of ice lens in layer | ||
|
@@ -101,6 +103,7 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & | |
qflx_floodc => col_wf%qflx_floodc , & ! Input: [real(r8) (:) ] column flux of flood water from RTM | ||
qflx_evap_grnd => col_wf%qflx_evap_grnd , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] | ||
qflx_top_soil => col_wf%qflx_top_soil , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) | ||
qflx_from_uphill => col_wf%qflx_from_uphill , & ! Output: [real(r8) (:) ] water received from uphill topounit (mm/s) | ||
qflx_surf => col_wf%qflx_surf , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) | ||
qflx_irrig => col_wf%qflx_irrig , & ! Input: [real(r8) (:) ] irrigation flux (mm H2O /s) | ||
irrig_rate => veg_wf%irrig_rate , & ! Input: [real(r8) (:) ] current irrigation rate (applied if !n_irrig_steps_left > 0) [mm/s] | ||
|
@@ -241,11 +244,34 @@ subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & | |
|
||
end do | ||
|
||
! calculate the sum of column weights on each topounit for columns in the hydrologyc filter | ||
! This will be the istsoil, istcrop, and icol_road_perv subset of urban columns | ||
! First zero the topounit sum of weights. This zeros some multiple times, but no harm done. | ||
do fc = 1, num_hydrologyc | ||
c = filter_hydrologyc(fc) | ||
t = col_pp%topounit(c) | ||
top_pp%uphill_wt(t) = 0._r8 | ||
end do | ||
! Next sum the weights | ||
do fc = 1, num_hydrologyc | ||
c = filter_hydrologyc(fc) | ||
t = col_pp%topounit(c) | ||
top_pp%uphill_wt(t) = top_pp%uphill_wt(t) + col_pp%wttopounit(c) | ||
end do | ||
|
||
! remove stormflow and snow on h2osfc from qflx_top_soil | ||
do fc = 1, num_hydrologyc | ||
c = filter_hydrologyc(fc) | ||
t = col_pp%topounit(c) | ||
! add flood water flux to qflx_top_soil | ||
qflx_top_soil(c) = qflx_top_soil(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) | ||
|
||
! flow from uphill topounit goes to top of soil for soil, crop, and pervious road columns | ||
if (use_IM2_hillslope_hydrology) then | ||
qflx_from_uphill(c) = (col_pp%wttopounit(c)/top_pp%uphill_wt(t)) * (frac_from_uphill * top_ws%from_uphill(t)) / dtime | ||
qflx_top_soil(c) = qflx_top_soil(c) + qflx_from_uphill(c) | ||
endif | ||
|
||
end do | ||
Comment on lines
263
to
275
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about avoiding the
|
||
|
||
end associate | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -515,6 +515,8 @@ module ColumnDataType | |
real(r8), pointer :: qflx_irr_demand (:) => null() ! col surface irrigation demand (mm H2O /s) | ||
real(r8), pointer :: qflx_over_supply (:) => null() ! col over supplied irrigation | ||
real(r8), pointer :: qflx_h2orof_drain (:) => null() ! drainage from floodplain inundation volume (mm H2O/s)) | ||
real(r8), pointer :: qflx_from_uphill (:) => null() ! input to top soil layer from uphill topounit(s) (mm H2O/s)) | ||
real(r8), pointer :: qflx_to_downhill (:) => null() ! output from column to the downhill topounit (mm H2O/s)) | ||
|
||
real(r8), pointer :: mflx_infl_1d (:) => null() ! infiltration source in top soil control volume (kg H2O /s) | ||
real(r8), pointer :: mflx_dew_1d (:) => null() ! liquid+snow dew source in top soil control volume (kg H2O /s) | ||
|
@@ -5737,6 +5739,8 @@ subroutine col_wf_init(this, begc, endc) | |
allocate(this%qflx_over_supply (begc:endc)) ; this%qflx_over_supply (:) = spval | ||
allocate(this%qflx_irr_demand (begc:endc)) ; this%qflx_irr_demand (:) = spval | ||
allocate(this%qflx_h2orof_drain (begc:endc)) ; this%qflx_h2orof_drain (:) = spval | ||
allocate(this%qflx_from_uphill (begc:endc)) ; this%qflx_from_uphill (:) = spval | ||
allocate(this%qflx_to_downhill (begc:endc)) ; this%qflx_to_downhill (:) = spval | ||
|
||
!VSFM variables | ||
ncells = endc - begc + 1 | ||
|
@@ -5843,6 +5847,14 @@ subroutine col_wf_init(this, begc, endc) | |
avgflag='A', long_name='column-integrated snow freezing rate', & | ||
ptr_col=this%qflx_snofrz, set_lake=spval, c2l_scale_type='urbanf', default='inactive') | ||
|
||
call hist_addfld1d (fname='QFROM_UPHILL', units='mm/s', & | ||
avgflag='A', long_name='input to top layer soil from uphill topounit(s)', & | ||
ptr_col=this%qflx_from_uphill, c2l_scale_type='urbanf') | ||
|
||
call hist_addfld1d (fname='QTO_DOWNHILL', units='mm/s', & | ||
avgflag='A', long_name='output from column to downhill topounit', & | ||
ptr_col=this%qflx_to_downhill, c2l_scale_type='urbanf') | ||
|
||
Comment on lines
+5850
to
+5857
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these fields are added by default, let's only add them if the new physics is turned on. |
||
if (create_glacier_mec_landunit) then | ||
this%qflx_glcice(begc:endc) = spval | ||
call hist_addfld1d (fname='QICE', units='mm/s', & | ||
|
@@ -5890,6 +5902,8 @@ subroutine col_wf_init(this, begc, endc) | |
this%qflx_grnd_irrig(begc:endc) = 0._r8 | ||
this%qflx_over_supply(begc:endc) = 0._r8 | ||
this%qflx_h2orof_drain(begc:endc)= 0._r8 | ||
this%qflx_from_uphill(begc:endc) = 0._r8 | ||
this%qflx_to_downhill(begc:endc) = 0._r8 | ||
! needed for CNNLeaching | ||
do c = begc, endc | ||
l = col_pp%landunit(c) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't these weights be computed during initialization?