Skip to content

Commit daa4163

Browse files
authored
enforce minimum snow grain radius (#552)
If the snow grain radius is set to zero, possibly because of zapping small ice or if ice disappears mid-timestep, then updates of snow grain radius will produce NaNs. Snow grain radius is usually bounded between a min and max so this generally doesn't happen, but a recent coupled E3SM bgc run crashed with this error. While the error seems to be relatively rare, this bug fix changes answers when the snow grain radius is nonzero but still less than the minimum.
1 parent 2f31ee3 commit daa4163

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

columnphysics/icepack_snow.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,9 @@ subroutine icepack_step_snow(dt, &
360360
hsn(n) = vsnon(n)/aicen(n)
361361
hin(n) = vicen(n)/aicen(n)
362362
endif
363+
do k = 1, nslyr
364+
rsnw (k,n) = max(rsnw_fall, rsnw(k,n))
365+
enddo
363366
enddo
364367

365368
call update_snow_radius (dt, &

0 commit comments

Comments
 (0)