Skip to content

Commit

Permalink
prevent an infinite loop in the rrfs-sd
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed Feb 2, 2024
1 parent d52832b commit cddd49b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions physics/smoke_dust/module_smoke_plumerise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ SUBROUTINE MAKEPLUME (coms,kmt,ztopmax,ixx,imm)
character (len=10) :: varn
integer :: izprint, iconv, itime, k, kk, kkmax, deltak,ilastprint,kmt &
,ixx,nrectotal,i_micro,n_sub_step
real(kind=kind_phys) :: vc, g, r, cp, eps, &
real(kind=kind_phys) :: vc, g, r, cp, eps, min_dt, max_dt, &
tmelt, heatsubl, heatfus, heatcond, tfreeze, &
ztopmax, wmax, rmaxtime, es, esat, heat,dt_save !ESAT_PR,
character (len=2) :: cixx
Expand Down Expand Up @@ -685,6 +685,8 @@ SUBROUTINE MAKEPLUME (coms,kmt,ztopmax,ixx,imm)

! ******************* model evolution ******************************
rmaxtime = float(coms%maxtime)
min_dt = rmaxtime*1e-4
max_dt = 5
!
!print * ,' TIME=',coms%time,' RMAXTIME=',rmaxtime
!print*,'======================================================='
Expand All @@ -698,7 +700,7 @@ SUBROUTINE MAKEPLUME (coms,kmt,ztopmax,ixx,imm)
!sam write(0,81) coms%nm1,kmt,kkmax,deltak
!-- set timestep
!coms%dt = (coms%zm(2)-coms%zm(1)) / (coms%tstpf * wmax)
coms%dt = min(5.,(coms%zm(2)-coms%zm(1)) / (coms%tstpf * wmax))
coms%dt = min(max_dt, max(min_dt, (coms%zm(2)-coms%zm(1)) / (coms%tstpf * wmax)))

!-- elapsed time, sec
coms%time = coms%time+coms%dt
Expand Down

0 comments on commit cddd49b

Please sign in to comment.