59 subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendlim, &
60 kdt, mpicomm, mpirank, mpiroot, errmsg, errflg)
65 integer,
intent(in) :: ncol
66 integer,
intent(in) :: nlev
67 real(kind_phys),
dimension(:,:),
intent(in) :: tgrs_save
68 real(kind_phys),
dimension(:,:),
intent(inout) :: tgrs
69 real(kind_phys),
dimension(:,:),
intent(in) :: prslk
70 real(kind_phys),
intent(in) :: dtp
71 real(kind_phys),
intent(in) :: ttendlim
72 integer,
intent(in) :: kdt
74 type(mpi_comm),
intent(in ) :: mpicomm
75 integer,
intent(in ) :: mpirank
76 integer,
intent(in ) :: mpiroot
78 character(len=*),
intent( out) :: errmsg
79 integer,
intent( out) :: errflg
82 real(kind_phys),
dimension(1:ncol,1:nlev) :: mp_tend
93 if (.not.is_initialized)
then
94 write(errmsg, fmt=
'((a))')
'mp_thompson_post_run called before mp_thompson_post_init'
100 if (.not.apply_limiter)
return
103 mp_tend = (tgrs - tgrs_save)/prslk
110 mp_tend(i,k) = max( -ttendlim*dtp, min( ttendlim*dtp, mp_tend(i,k) ) )
113 if (tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k) .ne. tgrs(i,k))
then
114 write(0,
'(a,3i6,3e16.7)')
"mp_thompson_post_run mp_tend limiter: kdt, i, k, t_old, t_new, t_lim:", &
115 & kdt, i, k, tgrs_save(i,k), tgrs(i,k), tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
119 tgrs(i,k) = tgrs_save(i,k) + mp_tend(i,k)*prslk(i,k)
125 write(0,
'(a,i0,a,i0,a,i0)')
"mp_thompson_post_run: ttendlim applied ", events,
"/", nlev*ncol, &
126 &
" times at timestep ", kdt
This module contain the post processing of Thompson microphysics.