Skip to content

Commit 093f44c

Browse files
Make model err if SGH dt < 1 millisecond
1 parent 4b55925 commit 093f44c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/core_landice/mode_forward/mpas_li_subglacial_hydro.F

+10-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ subroutine li_SGH_solve(domain, err)
327327
! =============
328328
! =============
329329
! =============
330-
do while (timeLeft > 0.0_RKIND)
330+
timecycling: do while (timeLeft > 0.0_RKIND)
331331
numSubCycles = numSubCycles + 1
332332
333333
@@ -468,6 +468,9 @@ subroutine li_SGH_solve(domain, err)
468468
! =============
469469
call check_timestep(domain, timeLeft, err_tmp)
470470
err = ior(err, err_tmp)
471+
if (err > 0) then
472+
exit timecycling
473+
endif
471474
472475
473476
! =============
@@ -580,7 +583,7 @@ subroutine li_SGH_solve(domain, err)
580583
! =============
581584
! =============
582585
! =============
583-
end do ! while timeLeft>0
586+
end do timecycling ! while timeLeft>0
584587
! =============
585588
! =============
586589
! =============
@@ -1156,6 +1159,10 @@ subroutine check_timestep(domain, timeLeft, err)
11561159
endif
11571160
endif
11581161
1162+
if (proposedDt < 1.0E-3_RKIND) then
1163+
call mpas_log_write("CFL conditions are limiting subglacial hydrology timestep to <1 millisecond.", MPAS_LOG_ERR)
1164+
err = ior(err, 1)
1165+
endif
11591166
11601167
! Don't exceed the maximum allowed hydro time step
11611168
proposedDt = min(proposedDt, maxDt)
@@ -1201,6 +1208,7 @@ subroutine check_timestep(domain, timeLeft, err)
12011208
realArgs=(/deltatSGH, deltatSGHdiffuChannel/))
12021209
endif
12031210
1211+
12041212
!--------------------------------------------------------------------
12051213
end subroutine check_timestep
12061214

0 commit comments

Comments
 (0)