Skip to content

Commit

Permalink
Update excess_ice from single column value to depth varying
Browse files Browse the repository at this point in the history
Changes dimension on excess_ice parameter in water state types
from being one value per column to having dimensions
(columns, depth in soil)
  • Loading branch information
rfiorella committed May 1, 2024
1 parent 7a7ae66 commit 1239e13
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion components/elm/src/biogeophys/CanopyHydrologyMod.F90
Original file line number Diff line number Diff line change
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 [kg/m2]

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 Down
4 changes: 2 additions & 2 deletions components/elm/src/biogeophys/WaterStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module WaterstateType
real(r8), pointer :: bw_col (:,:) ! col partial density of water in the snow pack (ice + liquid) [kg/m3]
real(r8), pointer :: finundated_col (:) ! fraction of column that is inundated, this is for bgc caclulation in betr
real(r8), pointer :: h2osoi_tend_tsl_col (:) ! col moisture tendency due to vertical movement at topmost layer (m3/m3/s)
real(r8), pointer :: excess_ice (:) ! excess ground ice in polygonal tundra areas [kg/m2]
real(r8), pointer :: excess_ice (:,:) ! excess ground ice in polygonal tundra areas [kg/m2]

real(r8), pointer :: rhvap_soi_col (:,:)
real(r8), pointer :: rho_vap_col (:,:)
Expand Down Expand Up @@ -212,7 +212,7 @@ subroutine InitAllocate(this, bounds)
if (use_fan) then
allocate(this%h2osoi_tend_tsl_col(begc:endc)) ; this%h2osoi_tend_tsl_col (:) = nan
end if
allocate(this%excess_ice (begc:endc)) ; this%excess_ice (:) = nan
allocate(this%excess_ice (begc:endc, 1:nlevgrnd)) ; this%excess_ice (:,:) = nan

allocate(this%h2osno_col (begc:endc)) ; this%h2osno_col (:) = nan
allocate(this%h2osno_old_col (begc:endc)) ; this%h2osno_old_col (:) = nan
Expand Down
42 changes: 26 additions & 16 deletions components/elm/src/data_types/ColumnDataType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ module ColumnDataType
real(r8), pointer :: h2osoi_liq (:,:) => null() ! liquid water (-nlevsno+1:nlevgrnd) (kg/m2)
real(r8), pointer :: h2osoi_ice (:,:) => null() ! ice lens (-nlevsno+1:nlevgrnd) (kg/m2)
real(r8), pointer :: h2osoi_vol (:,:) => null() ! volumetric soil water (0<=h2osoi_vol<=watsat) (1:nlevgrnd) (m3/m3)
real(r8), pointer :: excess_ice (:,:) => null() ! NGEE Arctic: excess ground ice in column (1:nlevgrnd) (0 to 1)
real(r8), pointer :: h2osfc (:) => null() ! surface water (kg/m2)
real(r8), pointer :: h2ocan (:) => null() ! canopy water integrated to column (kg/m2)
real(r8), pointer :: total_plant_stored_h2o(:)=> null() ! total water in plants (kg/m2)
Expand Down Expand Up @@ -143,7 +144,6 @@ module ColumnDataType
real(r8), pointer :: snw_rds_top (:) => null() ! snow grain radius (top layer) (m^-6, microns)
logical , pointer :: do_capsnow (:) => null() ! true => do snow capping
real(r8), pointer :: h2osoi_tend_tsl_col(:) => null() ! col moisture tendency due to vertical movement at topmost layer (m3/m3/s)
real(r8), pointer :: excess_ice (:) => null() ! NGEE-Arctic: tracking excess ground ice
! Area fractions
real(r8), pointer :: frac_sno (:) => null() ! fraction of ground covered by snow (0 to 1)
real(r8), pointer :: frac_sno_eff (:) => null() ! fraction of ground covered by snow (0 to 1)
Expand Down Expand Up @@ -1384,6 +1384,7 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
allocate(this%h2osoi_liq (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_liq (:,:) = spval
allocate(this%h2osoi_ice (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_ice (:,:) = spval
allocate(this%h2osoi_vol (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol (:,:) = spval
allocate(this%excess_ice (begc:endc, 1:nlevgrnd)) ; this%excess_ice (:,:) = spval
allocate(this%h2osfc (begc:endc)) ; this%h2osfc (:) = spval
allocate(this%h2ocan (begc:endc)) ; this%h2ocan (:) = spval
allocate(this%wslake_col (begc:endc)) ; this%wslake_col (:) = spval
Expand Down Expand Up @@ -1417,7 +1418,6 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
if (use_fan) then
allocate(this%h2osoi_tend_tsl_col(begc:endc)) ; this%h2osoi_tend_tsl_col(:) = spval
end if
allocate(this%excess_ice (begc:endc)) ; this%excess_ice (:) = spval
allocate(this%snw_rds_top (begc:endc)) ; this%snw_rds_top (:) = spval
allocate(this%do_capsnow (begc:endc))
allocate(this%frac_sno (begc:endc)) ; this%frac_sno (:) = spval
Expand Down Expand Up @@ -1473,9 +1473,14 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
ptr_col=this%h2osoi_ice, l2g_scale_type='veg')

this%h2osoi_ice(begc:endc,:) = spval
call hist_addfld2d (fname='SOILICE_ICE', units='kg/m2', type2d='levgrnd', &
avgflag='A', long_name='soil ice (ice landunits only)', &
ptr_col=this%h2osoi_ice, l2g_scale_type='ice')
call hist_addfld2d (fname='SOILICE_ICE', units='kg/m2', type2d='levgrnd', &
avgflag='A', long_name='soil ice (ice landunits only)', &
ptr_col=this%h2osoi_ice, l2g_scale_type='ice')

this%excess_ice(begc:endc) = spval
call hist_addfld2d (fname='EXCESS_ICE', units = '1', type2d='levgrnd', &
avgflag='A', long_name='Excess ground ice (0 to 1)', &
ptr_col=this%excess_ice, l2g_scale_type='veg') ! <- RPF: should this be natveg?

this%h2osfc(begc:endc) = spval
call hist_addfld1d (fname='H2OSFC', units='mm', &
Expand Down Expand Up @@ -1565,11 +1570,6 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
default='inactive')
end if

this%excess_ice(begc:endc) = spval
call hist_addfld1d (fname='EXCESS_ICE', units = '1', &
avgflag='A', long_name='Excess ground ice (0 to 1)', &
ptr_col=this%excess_ice, l2g_scale_type='veg') ! <- RPF: should this be natveg?

this%frac_sno(begc:endc) = spval
call hist_addfld1d (fname='FSNO', units='1', &
avgflag='A', long_name='fraction of ground covered by snow', &
Expand Down Expand Up @@ -1641,7 +1641,6 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
this%frac_h2osfc_act(c) = 0._r8
this%h2orof(c) = 0._r8
this%frac_h2orof(c) = 0._r8
this%excess_ice(c) = 0.5_r8

if (lun_pp%urbpoi(l)) then
! From Bonan 1996 (LSM technical note)
Expand Down Expand Up @@ -1787,6 +1786,17 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
this%h2osoi_ice(c,j) = 0._r8
this%h2osoi_liq(c,j) = col_pp%dz(c,j)*denh2o*this%h2osoi_vol(c,j)
endif
! RPF - to do: a) apply to only polygonal ground
! b) pull in ALT information to get starting point right.
! for now, assuming no excess ice in top meter, 0.5 for 1-4 m,
! 0.2 below 4 m. Also: need to check signs!
if (col_pp%z(c,j) > -1._r8) then
this%excess_ice(c,j) = 0._r8
else if (col_pp%z(c,j) > -4._r8 .and. col_pp%z(c,j) < -1._r8) then
this%excess_ice(c,j) = 0.5_r8
else
this%excess_ice(c,j) = 0.2_r8
end if
end do

this%h2osoi_liq_old(c,:) = this%h2osoi_liq(c,:)
Expand Down Expand Up @@ -1844,6 +1854,11 @@ subroutine col_ws_restart(this, bounds, ncid, flag, watsat_input)
long_name='ice lens', units='kg/m2', &
interpinic_flag='interp', readvar=readvar, data=this%h2osoi_ice)

call restartvar(ncid=ncid, flag=flag, varname='EXCESS_ICE', xtype=ncd_double, &
dim1name='column', dim2name='levgrnd', switchdim=.true., &
long_name='excess ground ice (0 to 1)', units='1', &
interpinic_flag='interp', readvar=readvar, data=this%excess_ice)

call restartvar(ncid=ncid, flag=flag, varname='SOILP', xtype=ncd_double, &
dim1name='column', dim2name='levgrnd', switchdim=.true., &
long_name='soil pressure ', units='Pa', &
Expand Down Expand Up @@ -1907,11 +1922,6 @@ subroutine col_ws_restart(this, bounds, ncid, flag, watsat_input)
this%snow_persistence(:) = 0.0_r8
end if

call restartvar(ncid=ncid, flag=flag, varname='EXCESS_ICE', xtype=ncd_double, &
dim1name='column', &
long_name='excess ground ice (0 to 1)', units='1', &
interpinic_flag='interp', readvar=readvar, data=this%excess_ice)

call restartvar(ncid=ncid, flag=flag, varname='frac_sno', xtype=ncd_double, &
dim1name='column', &
long_name='fraction of ground covered by snow (0 to 1)',units='1',&
Expand Down

0 comments on commit 1239e13

Please sign in to comment.