59 real(RP),
allocatable :: QTRC_RK_list(:,:,:,:)
60 integer,
private :: I_COMM_RK_list(2)
61 integer,
private :: nstage = 3
76 character(len=*) :: tinteg_type
80 if ( tinteg_type(1:5) /=
'LINRK' .or. tinteg_type(7:7) /=
's' )
then
81 log_error(
"ATMOS_DYN_Tinteg_tracer_linrkNs_setup",*)
'TINTEG_TRACER_TYPE is invalid. Check!'
84 read(tinteg_type(6:6),*) nstage
86 allocate( qtrc_rk_list(
ka,
ia,
ja,2) )
87 i_comm_rk_list(:) = (/ 1, 2 /)
88 call comm_vars8_init(
'QTRC_RK1', qtrc_rk_list(:,:,:,1), i_comm_rk_list(1) )
89 call comm_vars8_init(
'QTRC_RK2', qtrc_rk_list(:,:,:,2), i_comm_rk_list(2) )
98 deallocate( qtrc_rk_list )
106 QTRC, qflx, & ! (out)
107 qtrc0, rhoq_t, dens0, dens, &
110 cdz, rcdz, rcdx, rcdy, &
111 bnd_w, bnd_e, bnd_s, bnd_n, &
114 flag_fct_tracer, flag_fct_along_stream )
124 real(rp),
intent(inout) :: qtrc (
ka,
ia,
ja)
125 real(rp),
intent(out) :: qflx (
ka,
ia,
ja,3)
126 real(rp),
intent(in) :: qtrc0 (
ka,
ia,
ja)
127 real(rp),
intent(in) :: rhoq_t (
ka,
ia,
ja)
128 real(rp),
intent(in) :: dens0 (
ka,
ia,
ja)
129 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
130 real(rp),
intent(in) :: mflx_hi (
ka,
ia,
ja,3)
131 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja,3)
132 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
133 real(rp),
intent(in) :: mapf (
ia,
ja)
134 real(rp),
intent(in) :: cdz(
ka)
135 real(rp),
intent(in) :: rcdz(
ka)
136 real(rp),
intent(in) :: rcdx(
ia)
137 real(rp),
intent(in) :: rcdy(
ja)
138 logical,
intent(in) :: bnd_w
139 logical,
intent(in) :: bnd_e
140 logical,
intent(in) :: bnd_s
141 logical,
intent(in) :: bnd_n
142 logical,
intent(in) :: twod
143 real(rp),
intent(in) :: dtl
144 logical,
intent(in) :: flag_fct_tracer
145 logical,
intent(in) :: flag_fct_along_stream
147 real(rp) :: dens_rk(
ka,
ia,
ja)
150 real(rp) :: linrk_coef
151 integer :: i_in, i_out, i_tmp
163 qtrc_rk_list(
k,i,j,i_in) = qtrc0(
k,i,j)
168 do nowstage=1, nstage
169 linrk_coef = 1.0_rp/real(nstage - nowstage + 1, kind=rp)
173 bnd_w, bnd_e, bnd_s, bnd_n, &
176 call comm_vars8( qtrc_rk_list(:,:,:,i_in), i_comm_rk_list(i_in) )
177 call comm_wait ( qtrc_rk_list(:,:,:,i_in), i_comm_rk_list(i_in), .false. )
179 if (nowstage < nstage)
then
182 do i = max(
is-1,1), min(
ie+1,
ia)
184 dens_rk(
k,i,j) = dens0(
k,i,j) &
185 + ( dens(
k,i,j) - dens0(
k,i,j) ) * linrk_coef
191 qtrc_rk_list(:,:,:,i_out), qflx, &
192 qtrc_rk_list(:,:,:,i_in), qtrc0, rhoq_t, &
196 cdz, rcdz, rcdx, rcdy, &
197 twod, dtl*linrk_coef, &
198 .false., flag_fct_along_stream )
203 qtrc_rk_list(:,:,:,i_in), qtrc0, rhoq_t, &
207 cdz, rcdz, rcdx, rcdy, &
209 flag_fct_tracer, flag_fct_along_stream )
214 i_out = i_in; i_in = i_tmp