Skip to content

Commit

Permalink
Loosen tolerance on near-zero truncation of h2osoi_ice and h2osoi_liq
Browse files Browse the repository at this point in the history
In UpdateState_TopLayerFluxes, there is a somewhat arbitrary epsilon
used to determine if h2osoi_ice and h2osoi_liq are close enough to zero
that they should be truncated to zero. If the state remains negative
after this truncation, we deem this to be a problem. It seems that this
tolerance is occasionally exceeded, leading runs to abort. Since this
tolerance is somewhat arbitrary, we will loosen it by an order of
magnitude.

Resolves ESCOMP#1979

Note that, although the issue was only reported for h2osoi_ice, I am
changing the tolerance for both liq and ice so they remain consistent.
  • Loading branch information
billsacks committed Apr 2, 2023
1 parent 4e126c7 commit 060aa27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/biogeophys/SnowHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ subroutine UpdateState_TopLayerFluxes(bounds, num_snowc, filter_snowc, &
lev = lev_top(bounds%begc:bounds%endc), &
data_baseline = h2osoi_ice_top_orig(bounds%begc:bounds%endc), &
data = h2osoi_ice(bounds%begc:bounds%endc, :), &
custom_rel_epsilon = 1.e-12_r8)
custom_rel_epsilon = 1.e-11_r8)
call truncate_small_values_one_lev( &
num_f = num_snowc, &
filter_f = filter_snowc, &
Expand All @@ -1226,7 +1226,7 @@ subroutine UpdateState_TopLayerFluxes(bounds, num_snowc, filter_snowc, &
lev = lev_top(bounds%begc:bounds%endc), &
data_baseline = h2osoi_liq_top_orig(bounds%begc:bounds%endc), &
data = h2osoi_liq(bounds%begc:bounds%endc, :), &
custom_rel_epsilon = 1.e-12_r8)
custom_rel_epsilon = 1.e-11_r8)

! Make sure that we don't have any negative residuals - i.e., that we didn't try to
! remove more ice or liquid than was initially present.
Expand Down

0 comments on commit 060aa27

Please sign in to comment.