58 real(RP),
allocatable :: QTRC_RK_list(:,:,:,:)
59 integer,
private :: I_COMM_RK_list(2)
60 integer,
private :: nstage = 3
75 character(len=*) :: tinteg_type
79 if ( tinteg_type(1:5) /=
'LINRK' .or. tinteg_type(7:7) /=
's' )
then
80 log_error(
"ATMOS_DYN_Tinteg_tracer_linrkNs_setup",*)
'TINTEG_TRACER_TYPE is invalid. Check!'
83 read(tinteg_type(6:6),*) nstage
85 allocate( qtrc_rk_list(
ka,
ia,
ja,2) )
86 i_comm_rk_list(:) = (/ 1, 2 /)
87 call comm_vars8_init(
'QTRC_RK1', qtrc_rk_list(:,:,:,1), i_comm_rk_list(1) )
88 call comm_vars8_init(
'QTRC_RK2', qtrc_rk_list(:,:,:,2), i_comm_rk_list(2) )
97 qtrc0, rhoq_t, dens0, dens, &
100 cdz, rcdz, rcdx, rcdy, &
101 bnd_w, bnd_e, bnd_s, bnd_n, &
104 flag_fct_tracer, flag_fct_along_stream )
114 real(rp),
intent(inout) :: qtrc (
ka,
ia,
ja)
115 real(rp),
intent(out) :: qflx (
ka,
ia,
ja,3)
116 real(rp),
intent(in) :: qtrc0 (
ka,
ia,
ja)
117 real(rp),
intent(in) :: rhoq_t (
ka,
ia,
ja)
118 real(rp),
intent(in) :: dens0 (
ka,
ia,
ja)
119 real(rp),
intent(in) :: dens (
ka,
ia,
ja)
120 real(rp),
intent(in) :: mflx_hi (
ka,
ia,
ja,3)
121 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja,3)
122 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
123 real(rp),
intent(in) :: mapf (
ia,
ja)
124 real(rp),
intent(in) :: cdz(
ka)
125 real(rp),
intent(in) :: rcdz(
ka)
126 real(rp),
intent(in) :: rcdx(
ia)
127 real(rp),
intent(in) :: rcdy(
ja)
128 logical,
intent(in) :: bnd_w
129 logical,
intent(in) :: bnd_e
130 logical,
intent(in) :: bnd_s
131 logical,
intent(in) :: bnd_n
132 logical,
intent(in) :: twod
133 real(rp),
intent(in) :: dtl
134 logical,
intent(in) :: flag_fct_tracer
135 logical,
intent(in) :: flag_fct_along_stream
137 real(rp) :: dens_rk(
ka,
ia,
ja)
140 real(rp) :: linrk_coef
141 integer :: i_in, i_out, i_tmp
153 qtrc_rk_list(
k,i,j,i_in) = qtrc0(
k,i,j)
158 do nowstage=1, nstage
159 linrk_coef = 1.0_rp/real(nstage - nowstage + 1, kind=rp)
163 bnd_w, bnd_e, bnd_s, bnd_n, &
166 call comm_vars8( qtrc_rk_list(:,:,:,i_in), i_comm_rk_list(i_in) )
167 call comm_wait ( qtrc_rk_list(:,:,:,i_in), i_comm_rk_list(i_in), .false. )
169 if (nowstage < nstage)
then
172 do i = max(
is-1,1), min(
ie+1,
ia)
174 dens_rk(
k,i,j) = dens0(
k,i,j) &
175 + ( dens(
k,i,j) - dens0(
k,i,j) ) * linrk_coef
181 qtrc_rk_list(:,:,:,i_out), qflx, &
182 qtrc_rk_list(:,:,:,i_in), qtrc0, rhoq_t, &
186 cdz, rcdz, rcdx, rcdy, &
187 twod, dtl*linrk_coef, &
188 .false., flag_fct_along_stream )
193 qtrc_rk_list(:,:,:,i_in), qtrc0, rhoq_t, &
197 cdz, rcdz, rcdx, rcdy, &
199 flag_fct_tracer, flag_fct_along_stream )
204 i_out = i_in; i_in = i_tmp