55 subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendlim, &
56 kdt, mpicomm, mpirank, mpiroot, errmsg, errflg)
61 integer,
intent(in) :: ncol
62 integer,
intent(in) :: nlev
63 real(kind_phys),
dimension(:,:),
intent(in) :: tgrs_save
64 real(kind_phys),
dimension(:,:),
intent(inout) :: tgrs
65 real(kind_phys),
dimension(:,:),
intent(in) :: prslk
66 real(kind_phys),
intent(in) :: dtp
67 real(kind_phys),
intent(in) :: ttendlim
68 integer,
intent(in) :: kdt
70 type(mpi_comm),
intent(in ) :: mpicomm
71 integer,
intent(in ) :: mpirank
72 integer,
intent(in ) :: mpiroot
74 character(len=*),
intent( out) :: errmsg
75 integer,
intent( out) :: errflg
78 real(kind_phys),
dimension(1:ncol,1:nlev) :: mp_tend
89 if (.not.is_initialized)
then
90 write(errmsg, fmt=
'((a))')
'mp_thompson_post_run called before mp_thompson_post_init'
96 if (.not.apply_limiter)
return
99 mp_tend = (tgrs - tgrs_save)/prslk
106 mp_tend(i,k) = max( -ttendlim*dtp, min( ttendlim*dtp, mp_tend(i,k) ) )
109 if (tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k) .ne. tgrs(i,k))
then
110 write(0,
'(a,3i6,3e16.7)')
"mp_thompson_post_run mp_tend limiter: kdt, i, k, t_old, t_new, t_lim:", &
111 & kdt, i, k, tgrs_save(i,k), tgrs(i,k), tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
115 tgrs(i,k) = tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
121 write(0,
'(a,i0,a,i0,a,i0)')
"mp_thompson_post_run: ttendlim applied ", events,
"/", nlev*ncol, &
122 &
" times at timestep ", kdt