18 subroutine gfs_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_summed, &
19 dtidx, is_photochem, ldiag3d, ip_physics, ip_photochem, ip_prod_loss, ip_ozmix, &
20 ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, &
21 dtend, errmsg, errflg)
24 integer,
intent(in) :: &
25 ncol, & !< Horizontal dimension
26 nlev, & !< Number of vertical layers
27 ntoz, & !< Index for ozone mixing ratio
28 ntracp100, & !< Number of tracers plus 100
29 nprocess, & !< Number of processes that cause changes in state variables
30 nprocess_summed,& !< Number of causes in dtidx per tracer summed for total physics tendency
31 ip_physics, & !< Index for process in diagnostic tendency output
32 ip_photochem, & !< Index for process in diagnostic tendency output
33 ip_prod_loss, & !< Index for process in diagnostic tendency output
34 ip_ozmix, & !< Index for process in diagnostic tendency output
35 ip_temp, & !< Index for process in diagnostic tendency output
37 integer,
intent(in),
dimension(:,:) :: &
39 logical,
intent(in) :: &
41 logical,
intent(in),
dimension(:) :: &
45 real(kind=kind_phys),
intent(in),
dimension(:,:),
pointer,
optional :: &
52 real(kind=kind_phys),
intent(inout),
dimension(:,:,:),
optional :: &
54 character(len=*),
intent(out) :: &
56 integer,
intent(out) :: &
60 integer :: idtend, ichem, iphys, itrac
61 logical :: all_true(nprocess)
76 idtend = dtidx(100+ntoz,ip_prod_loss)
77 if (idtend >= 1 .and.
associated(do3_dt_prd))
then
78 dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_prd
81 idtend = dtidx(100+ntoz,ip_ozmix)
82 if (idtend >= 1 .and.
associated(do3_dt_ozmx))
then
83 dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ozmx
86 idtend = dtidx(100+ntoz,ip_temp)
87 if (idtend >= 1 .and.
associated(do3_dt_temp))
then
88 dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_temp
91 idtend = dtidx(100+ntoz,ip_overhead_ozone)
92 if (idtend >= 1 .and.
associated(do3_dt_ohoz))
then
93 dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ohoz
102 ichem = dtidx(itrac, ip_photochem)
104 call sum_it(ichem, itrac, is_photochem)
113 do itrac = 2,ntracp100
114 iphys = dtidx(itrac,ip_physics)
116 call sum_it(iphys, itrac, all_true)
123 subroutine sum_it(isum,itrac,sum_me)
124 integer,
intent(in) :: isum
125 integer,
intent(in) :: itrac
126 logical,
intent(in) :: sum_me(nprocess)
128 integer :: idtend, iprocess
131 do iprocess=1,nprocess
132 if(iprocess>nprocess_summed)
then
134 else if(.not.sum_me(iprocess))
then
137 idtend = dtidx(itrac,iprocess)
142 dtend(:,:,isum) = dtend(:,:,idtend)
145 dtend(:,:,isum) = dtend(:,:,isum) + dtend(:,:,idtend)
153 end subroutine sum_it