Skip to content

Commit

Permalink
Ensure EXCESS_ICE only hist/rest files if use_polygonal_tundra
Browse files Browse the repository at this point in the history
Some developer tests were reporting DIFF due to additional
variables being added to history files (and restart files).
This commit adds a flag for these variables using elm_varctl
  • Loading branch information
rfiorella committed Jul 14, 2024
1 parent 296568c commit a9ff4cb
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions components/elm/src/data_types/ColumnDataType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module ColumnDataType
use elm_varctl , only : hist_wrtch4diag, use_century_decomp
use elm_varctl , only : get_carbontag, override_bgc_restart_mismatch_dump
use elm_varctl , only : pf_hmode, nu_com
use elm_varctl , only : use_extrasnowlayers
use elm_varctl , only : use_extrasnowlayers, use_polygonal_tundra
use elm_varctl , only : use_fan
use ch4varcon , only : allowlakeprod
use pftvarcon , only : VMAX_MINSURF_P_vr, KM_MINSURF_P_vr, pinit_beta1, pinit_beta2
Expand Down Expand Up @@ -1479,9 +1479,11 @@ subroutine col_ws_init(this, begc, endc, h2osno_input, snow_depth_input, watsat_
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?
if (use_polygonal_tundra) then
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?
end if

this%h2osfc(begc:endc) = spval
call hist_addfld1d (fname='H2OSFC', units='mm', &
Expand Down Expand Up @@ -1799,17 +1801,19 @@ 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 240713 - notes from Chuck: initialize all to 0.36_r8
this%excess_ice(c,j) = 0.36_r8
! 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
!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 @@ -1867,10 +1871,12 @@ 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)
if (use_polygonal_tundra) then
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)
end if

call restartvar(ncid=ncid, flag=flag, varname='SOILP', xtype=ncd_double, &
dim1name='column', dim2name='levgrnd', switchdim=.true., &
Expand Down

0 comments on commit a9ff4cb

Please sign in to comment.