54 integer,
private :: I_COMM_DENS = 1
55 integer,
private :: I_COMM_MOMZ = 2
56 integer,
private :: I_COMM_MOMX = 3
57 integer,
private :: I_COMM_MOMY = 4
58 integer,
private :: I_COMM_RHOT = 5
59 integer,
private,
allocatable :: I_COMM_PROG(:)
60 integer,
private,
allocatable :: I_COMM_QTRC(:)
62 logical,
private :: BND_W
63 logical,
private :: BND_E
64 logical,
private :: BND_S
65 logical,
private :: BND_N
67 real(RP),
private,
allocatable :: num_diff (:,:,:,:,:)
68 real(RP),
private,
allocatable :: num_diff_q(:,:,:,:)
69 real(RP),
private,
allocatable :: wdamp_coef(:)
71 logical,
private :: DYN_NONE
78 DYN_Tinteg_Short_TYPE, &
79 DYN_Tinteg_Tracer_TYPE, &
80 DYN_Tinteg_Large_TYPE, &
81 DYN_Tstep_Tracer_TYPE, &
82 DYN_Tstep_Large_TYPE, &
83 DYN_Tstep_Short_TYPE, &
85 DYN_FVM_FLUX_TYPE_TRACER, &
86 DENS, MOMZ, MOMX, MOMY, RHOT, &
128 character(len=*),
intent(in) :: dyn_tinteg_short_type
129 character(len=*),
intent(in) :: dyn_tinteg_tracer_type
130 character(len=*),
intent(in) :: dyn_tinteg_large_type
131 character(len=*),
intent(in) :: dyn_tstep_tracer_type
132 character(len=*),
intent(in) :: dyn_tstep_large_type
133 character(len=*),
intent(in) :: dyn_tstep_short_type
134 character(len=*),
intent(in) :: dyn_fvm_flux_type
135 character(len=*),
intent(in) :: dyn_fvm_flux_type_tracer
136 real(rp),
intent(inout) :: dens(
ka,
ia,
ja)
137 real(rp),
intent(inout) :: momz(
ka,
ia,
ja)
138 real(rp),
intent(inout) :: momx(
ka,
ia,
ja)
139 real(rp),
intent(inout) :: momy(
ka,
ia,
ja)
140 real(rp),
intent(inout) :: rhot(
ka,
ia,
ja)
141 real(rp),
intent(inout) :: qtrc(
ka,
ia,
ja,
qa)
142 real(rp),
intent(inout) :: prog(
ka,
ia,
ja,
va)
143 real(rp),
intent(in) :: cdz(
ka)
144 real(rp),
intent(in) :: cdx(
ia)
145 real(rp),
intent(in) :: cdy(
ja)
146 real(rp),
intent(in) :: fdz(
ka-1)
147 real(rp),
intent(in) :: fdx(
ia-1)
148 real(rp),
intent(in) :: fdy(
ja-1)
149 real(rp),
intent(in) :: wdamp_tau
150 real(rp),
intent(in) :: wdamp_height
151 real(rp),
intent(in) :: fz(0:
ka)
152 logical,
optional,
intent(in) :: none
159 if (
present(none) )
then
163 allocate( i_comm_prog(max(
va,1)) )
164 allocate( i_comm_qtrc(
qa) )
166 if ( .NOT. dyn_none )
then
172 allocate( num_diff(
ka,
ia,
ja,5,3) )
173 allocate( num_diff_q(
ka,
ia,
ja,3) )
174 allocate( wdamp_coef(
ka) )
175 num_diff(:,:,:,:,:) = undef
176 num_diff_q(:,:,:,:) = undef
179 dyn_fvm_flux_type_tracer )
186 dens, momz, momx, momy, rhot, &
197 cdz, cdx, cdy, fdz, fdx, fdy )
201 wdamp_tau, wdamp_height, &
217 i_comm_prog(iv) = 5 + iv
222 i_comm_qtrc(iq) = 5 +
va + iq
234 DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, &
236 DENS_av, MOMZ_av, MOMX_av, MOMY_av, RHOT_av, QTRC_av, &
237 DENS_tp, MOMZ_tp, MOMX_tp, MOMY_tp, RHOT_tp, RHOQ_tp, &
239 CDZ, CDX, CDY, FDZ, FDX, FDY, &
240 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
242 J13G, J23G, J33G, MAPF, &
243 AQ_R, AQ_CV, AQ_CP, AQ_MASS, &
244 REF_dens, REF_pott, REF_qv, REF_pres, &
245 ND_COEF, ND_COEF_Q, ND_LAPLACIAN_NUM, &
246 ND_SFC_FACT, ND_USE_RS, &
247 BND_QA, BND_IQ, BND_SMOOTHER_FACT, &
248 DAMP_DENS, DAMP_VELZ, DAMP_VELX, &
249 DAMP_VELY, DAMP_POTT, DAMP_QTRC, &
250 DAMP_alpha_DENS, DAMP_alpha_VELZ, DAMP_alpha_VELX, &
251 DAMP_alpha_VELY, DAMP_alpha_POTT, DAMP_alpha_QTRC, &
252 MFLUX_OFFSET_X, MFLUX_OFFSET_Y, &
254 FLAG_TRACER_SPLIT_TEND, &
255 FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_TRACER, &
256 FLAG_FCT_ALONG_STREAM, &
269 real(rp),
intent(inout) :: dens(
ka,
ia,
ja)
270 real(rp),
intent(inout) :: momz(
ka,
ia,
ja)
271 real(rp),
intent(inout) :: momx(
ka,
ia,
ja)
272 real(rp),
intent(inout) :: momy(
ka,
ia,
ja)
273 real(rp),
intent(inout) :: rhot(
ka,
ia,
ja)
274 real(rp),
intent(inout) :: qtrc(
ka,
ia,
ja,
qa)
275 real(rp),
intent(inout) :: prog(
ka,
ia,
ja,
va)
277 real(rp),
intent(inout) :: dens_av(
ka,
ia,
ja)
278 real(rp),
intent(inout) :: momz_av(
ka,
ia,
ja)
279 real(rp),
intent(inout) :: momx_av(
ka,
ia,
ja)
280 real(rp),
intent(inout) :: momy_av(
ka,
ia,
ja)
281 real(rp),
intent(inout) :: rhot_av(
ka,
ia,
ja)
282 real(rp),
intent(inout) :: qtrc_av(
ka,
ia,
ja,
qa)
284 real(rp),
intent(in) :: dens_tp(
ka,
ia,
ja)
285 real(rp),
intent(in) :: momz_tp(
ka,
ia,
ja)
286 real(rp),
intent(in) :: momx_tp(
ka,
ia,
ja)
287 real(rp),
intent(in) :: momy_tp(
ka,
ia,
ja)
288 real(rp),
intent(in) :: rhot_tp(
ka,
ia,
ja)
289 real(rp),
intent(in) :: rhoq_tp(
ka,
ia,
ja,
qa)
291 real(rp),
intent(in) :: coriolis(
ia,
ja)
293 real(rp),
intent(in) :: cdz (
ka)
294 real(rp),
intent(in) :: cdx (
ia)
295 real(rp),
intent(in) :: cdy (
ja)
296 real(rp),
intent(in) :: fdz (
ka-1)
297 real(rp),
intent(in) :: fdx (
ia-1)
298 real(rp),
intent(in) :: fdy (
ja-1)
299 real(rp),
intent(in) :: rcdz(
ka)
300 real(rp),
intent(in) :: rcdx(
ia)
301 real(rp),
intent(in) :: rcdy(
ja)
302 real(rp),
intent(in) :: rfdz(
ka-1)
303 real(rp),
intent(in) :: rfdx(
ia-1)
304 real(rp),
intent(in) :: rfdy(
ja-1)
306 real(rp),
intent(in) :: phi (
ka,
ia,
ja)
307 real(rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
308 real(rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
309 real(rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
310 real(rp),
intent(in) :: j33g
311 real(rp),
intent(in) :: mapf (
ia,
ja,2,4)
313 real(rp),
intent(in) :: aq_r (
qa)
314 real(rp),
intent(in) :: aq_cv (
qa)
315 real(rp),
intent(in) :: aq_cp (
qa)
316 real(rp),
intent(in) :: aq_mass(
qa)
318 real(rp),
intent(in) :: ref_dens(
ka,
ia,
ja)
319 real(rp),
intent(in) :: ref_pott(
ka,
ia,
ja)
320 real(rp),
intent(in) :: ref_qv (
ka,
ia,
ja)
321 real(rp),
intent(in) :: ref_pres(
ka,
ia,
ja)
322 real(rp),
intent(in) :: nd_coef
323 real(rp),
intent(in) :: nd_coef_q
324 integer,
intent(in) :: nd_laplacian_num
325 real(rp),
intent(in) :: nd_sfc_fact
326 logical,
intent(in) :: nd_use_rs
328 integer,
intent(in) :: bnd_qa
329 integer,
intent(in) :: bnd_iq(
qa)
330 real(rp),
intent(in) :: bnd_smoother_fact
332 real(rp),
intent(in) :: damp_dens(
ka,
ia,
ja)
333 real(rp),
intent(in) :: damp_velz(
ka,
ia,
ja)
334 real(rp),
intent(in) :: damp_velx(
ka,
ia,
ja)
335 real(rp),
intent(in) :: damp_vely(
ka,
ia,
ja)
336 real(rp),
intent(in) :: damp_pott(
ka,
ia,
ja)
337 real(rp),
intent(in) :: damp_qtrc(
ka,
ia,
ja,bnd_qa)
339 real(rp),
intent(in) :: damp_alpha_dens(
ka,
ia,
ja)
340 real(rp),
intent(in) :: damp_alpha_velz(
ka,
ia,
ja)
341 real(rp),
intent(in) :: damp_alpha_velx(
ka,
ia,
ja)
342 real(rp),
intent(in) :: damp_alpha_vely(
ka,
ia,
ja)
343 real(rp),
intent(in) :: damp_alpha_pott(
ka,
ia,
ja)
344 real(rp),
intent(in) :: damp_alpha_qtrc(
ka,
ia,
ja,bnd_qa)
345 real(rp),
intent(in) :: mflux_offset_x(
ka,
ja,2)
346 real(rp),
intent(in) :: mflux_offset_y(
ka,
ja,2)
348 real(rp),
intent(in) :: divdmp_coef
350 logical,
intent(in) :: flag_tracer_split_tend
351 logical,
intent(in) :: flag_fct_momentum
352 logical,
intent(in) :: flag_fct_t
353 logical,
intent(in) :: flag_fct_tracer
354 logical,
intent(in) :: flag_fct_along_stream
356 logical,
intent(in) :: use_average
358 integer,
intent(in) :: i_qv
360 real(
dp),
intent(in) :: dtsec
361 real(
dp),
intent(in) :: dtsec_dyn
364 real(rp) :: dens00 (
ka,
ia,
ja)
369 integer :: i, j,
k, iq
372 log_progress(*)
'atmosphere / dynamics'
374 dt = real(dtsec, kind=rp)
383 dens00(
k,i,j) = dens(
k,i,j)
385 dens(
k,i,j) = dens(
k,i,j) + dens_tp(
k,i,j) * dt
393 momz(
k,i,j) = momz(
k,i,j) + momz_tp(
k,i,j) * dt
401 momx(
k,i,j) = momx(
k,i,j) + momx_tp(
k,i,j) * dt
409 momy(
k,i,j) = momy(
k,i,j) + momy_tp(
k,i,j) * dt
417 rhot(
k,i,j) = rhot(
k,i,j) + rhot_tp(
k,i,j) * dt
426 qtrc(
k,i,j,iq) = max( 0.0_rp, &
427 qtrc(
k,i,j,iq) * dens00(
k,i,j) + rhoq_tp(
k,i,j,iq) * dt &
434 call comm_vars8( dens(:,:,:), i_comm_dens )
435 call comm_vars8( momz(:,:,:), i_comm_momz )
436 call comm_vars8( momx(:,:,:), i_comm_momx )
437 call comm_vars8( momy(:,:,:), i_comm_momy )
438 call comm_vars8( rhot(:,:,:), i_comm_rhot )
440 call comm_vars8( qtrc(:,:,:,iq), i_comm_qtrc(iq) )
443 call comm_wait ( dens(:,:,:), i_comm_dens, .false. )
444 call comm_wait ( momz(:,:,:), i_comm_momz, .false. )
445 call comm_wait ( momx(:,:,:), i_comm_momx, .false. )
446 call comm_wait ( momy(:,:,:), i_comm_momy, .false. )
447 call comm_wait ( rhot(:,:,:), i_comm_rhot, .false. )
449 call comm_wait ( qtrc(:,:,:,iq), i_comm_qtrc(iq), .false. )
452 if ( use_average )
then
453 dens_av(:,:,:) = dens(:,:,:)
454 momz_av(:,:,:) = momz(:,:,:)
455 momx_av(:,:,:) = momx(:,:,:)
456 momy_av(:,:,:) = momy(:,:,:)
457 rhot_av(:,:,:) = rhot(:,:,:)
458 qtrc_av(:,:,:,:) = qtrc(:,:,:,:)
470 dens_av, momz_av, momx_av, momy_av, rhot_av, qtrc_av, &
471 num_diff, num_diff_q, &
472 dens_tp, momz_tp, momx_tp, momy_tp, rhot_tp, rhoq_tp, &
474 cdz, cdx, cdy, fdz, fdx, fdy, &
475 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
477 j13g, j23g, j33g, mapf, &
478 aq_r, aq_cv, aq_cp, aq_mass, &
479 ref_dens, ref_pott, ref_qv, ref_pres, &
480 bnd_w, bnd_e, bnd_s, bnd_n,
prc_twod, &
481 nd_coef, nd_coef_q, nd_laplacian_num, &
482 nd_sfc_fact, nd_use_rs, &
483 bnd_qa, bnd_iq, bnd_smoother_fact, &
484 damp_dens, damp_velz, damp_velx, &
485 damp_vely, damp_pott, damp_qtrc, &
486 damp_alpha_dens, damp_alpha_velz, damp_alpha_velx, &
487 damp_alpha_vely, damp_alpha_pott, damp_alpha_qtrc, &
488 mflux_offset_x, mflux_offset_y, &
489 wdamp_coef, divdmp_coef, &
490 flag_tracer_split_tend, &
491 flag_fct_momentum, flag_fct_t, flag_fct_tracer, &
492 flag_fct_along_stream, &