54 subroutine mp_tempo_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendlim, &
60 integer,
intent(in) :: ncol
61 integer,
intent(in) :: nlev
62 real(kind_phys),
dimension(:,:),
intent(in) :: tgrs_save
63 real(kind_phys),
dimension(:,:),
intent(inout) :: tgrs
64 real(kind_phys),
dimension(:,:),
intent(in) :: prslk
65 real(kind_phys),
intent(in) :: dtp
66 real(kind_phys),
intent(in) :: ttendlim
67 integer,
intent(in) :: kdt
70 character(len=*),
intent( out) :: errmsg
71 integer,
intent( out) :: errflg
74 real(kind_phys),
dimension(1:ncol,1:nlev) :: mp_tend
85 if (.not.is_initialized)
then
86 write(errmsg, fmt=
'((a))')
'mp_tempo_post_run called before mp_tempo_post_init'
92 if (.not.apply_limiter)
return
95 mp_tend = (tgrs - tgrs_save)/prslk
102 mp_tend(i,k) = max( -ttendlim*dtp, min( ttendlim*dtp, mp_tend(i,k) ) )
105 if (tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k) .ne. tgrs(i,k))
then
106 write(0,
'(a,3i6,3e16.7)')
"mp_tempo_post_run mp_tend limiter: kdt, i, k, t_old, t_new, t_lim:", &
107 & kdt, i, k, tgrs_save(i,k), tgrs(i,k), tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
111 tgrs(i,k) = tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
117 write(0,
'(a,i0,a,i0,a,i0)')
"mp_tempo_post_run: ttendlim applied ", events,
"/", nlev*ncol, &
118 &
" times at timestep ", kdt