55 integer,
private :: I_COMM_DENS = 1
56 integer,
private :: I_COMM_MOMZ = 2
57 integer,
private :: I_COMM_MOMX = 3
58 integer,
private :: I_COMM_MOMY = 4
59 integer,
private :: I_COMM_RHOT = 5
60 integer,
private,
allocatable :: I_COMM_PROG(:)
61 integer,
private,
allocatable :: I_COMM_QTRC(:)
63 logical,
private :: BND_W
64 logical,
private :: BND_E
65 logical,
private :: BND_S
66 logical,
private :: BND_N
68 real(RP),
private,
allocatable :: num_diff (:,:,:,:,:)
69 real(RP),
private,
allocatable :: num_diff_q(:,:,:,:)
70 real(RP),
private,
allocatable :: wdamp_coef(:)
72 logical,
private :: DYN_NONE
79 DYN_Tinteg_Short_TYPE, &
80 DYN_Tinteg_Tracer_TYPE, &
81 DYN_Tinteg_Large_TYPE, &
82 DYN_Tstep_Tracer_TYPE, &
83 DYN_Tstep_Large_TYPE, &
84 DYN_Tstep_Short_TYPE, &
86 DYN_FVM_FLUX_TYPE_TRACER, &
87 DENS, MOMZ, MOMX, MOMY, RHOT, &
129 character(len=*),
intent(in) :: dyn_tinteg_short_type
130 character(len=*),
intent(in) :: dyn_tinteg_tracer_type
131 character(len=*),
intent(in) :: dyn_tinteg_large_type
132 character(len=*),
intent(in) :: dyn_tstep_tracer_type
133 character(len=*),
intent(in) :: dyn_tstep_large_type
134 character(len=*),
intent(in) :: dyn_tstep_short_type
135 character(len=*),
intent(in) :: dyn_fvm_flux_type
136 character(len=*),
intent(in) :: dyn_fvm_flux_type_tracer
137 real(rp),
intent(inout) :: dens(
ka,
ia,
ja)
138 real(rp),
intent(inout) :: momz(
ka,
ia,
ja)
139 real(rp),
intent(inout) :: momx(
ka,
ia,
ja)
140 real(rp),
intent(inout) :: momy(
ka,
ia,
ja)
141 real(rp),
intent(inout) :: rhot(
ka,
ia,
ja)
142 real(rp),
intent(inout) :: qtrc(
ka,
ia,
ja,
qa)
143 real(rp),
intent(inout) :: prog(
ka,
ia,
ja,
va)
144 real(rp),
intent(in) :: cdz(
ka)
145 real(rp),
intent(in) :: cdx(
ia)
146 real(rp),
intent(in) :: cdy(
ja)
147 real(rp),
intent(in) :: fdz(
ka-1)
148 real(rp),
intent(in) :: fdx(
ia-1)
149 real(rp),
intent(in) :: fdy(
ja-1)
150 real(rp),
intent(in) :: wdamp_tau
151 real(rp),
intent(in) :: wdamp_height
152 real(rp),
intent(in) :: fz(0:
ka)
153 logical,
optional,
intent(in) :: none
160 if (
present(none) )
then
164 allocate( i_comm_prog(max(
va,1)) )
165 allocate( i_comm_qtrc(
qa) )
167 if ( .NOT. dyn_none )
then
173 allocate( num_diff(
ka,
ia,
ja,5,3) )
174 allocate( num_diff_q(
ka,
ia,
ja,3) )
175 allocate( wdamp_coef(
ka) )
176 num_diff(:,:,:,:,:) = undef
177 num_diff_q(:,:,:,:) = undef
181 dyn_fvm_flux_type_tracer )
188 dens, momz, momx, momy, rhot, &
199 cdz, cdx, cdy, fdz, fdx, fdy )
203 wdamp_tau, wdamp_height, &
219 i_comm_prog(iv) = 5 + iv
224 i_comm_qtrc(iq) = 5 +
va + iq
247 deallocate( i_comm_prog )
248 deallocate( i_comm_qtrc )
250 if ( .NOT. dyn_none )
then
263 deallocate( num_diff )
264 deallocate( num_diff_q )
265 deallocate( wdamp_coef )
273 DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, &
275 DENS_av, MOMZ_av, MOMX_av, MOMY_av, RHOT_av, QTRC_av, &
276 DENS_tp, MOMZ_tp, MOMX_tp, MOMY_tp, RHOT_tp, RHOQ_tp, &
278 CDZ, CDX, CDY, FDZ, FDX, FDY, &
279 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
281 J13G, J23G, J33G, MAPF, &
282 AQ_R, AQ_CV, AQ_CP, AQ_MASS, &
283 REF_dens, REF_pott, REF_qv, REF_pres, &
284 ND_COEF, ND_COEF_Q, ND_LAPLACIAN_NUM, &
285 ND_SFC_FACT, ND_USE_RS, &
286 BND_QA, BND_IQ, BND_SMOOTHER_FACT, &
287 DAMP_DENS, DAMP_VELZ, DAMP_VELX, &
288 DAMP_VELY, DAMP_POTT, DAMP_QTRC, &
289 DAMP_alpha_DENS, DAMP_alpha_VELZ, DAMP_alpha_VELX, &
290 DAMP_alpha_VELY, DAMP_alpha_POTT, DAMP_alpha_QTRC, &
291 MFLUX_OFFSET_X, MFLUX_OFFSET_Y, &
293 FLAG_TRACER_SPLIT_TEND, &
294 FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_TRACER, &
295 FLAG_FCT_ALONG_STREAM, &
308 real(rp),
intent(inout) :: dens(
ka,
ia,
ja)
309 real(rp),
intent(inout) :: momz(
ka,
ia,
ja)
310 real(rp),
intent(inout) :: momx(
ka,
ia,
ja)
311 real(rp),
intent(inout) :: momy(
ka,
ia,
ja)
312 real(rp),
intent(inout) :: rhot(
ka,
ia,
ja)
313 real(rp),
intent(inout) :: qtrc(
ka,
ia,
ja,
qa)
314 real(rp),
intent(inout) :: prog(
ka,
ia,
ja,
va)
316 real(rp),
intent(inout) :: dens_av(
ka,
ia,
ja)
317 real(rp),
intent(inout) :: momz_av(
ka,
ia,
ja)
318 real(rp),
intent(inout) :: momx_av(
ka,
ia,
ja)
319 real(rp),
intent(inout) :: momy_av(
ka,
ia,
ja)
320 real(rp),
intent(inout) :: rhot_av(
ka,
ia,
ja)
321 real(rp),
intent(inout) :: qtrc_av(
ka,
ia,
ja,
qa)
323 real(rp),
intent(in) :: dens_tp(
ka,
ia,
ja)
324 real(rp),
intent(in) :: momz_tp(
ka,
ia,
ja)
325 real(rp),
intent(in) :: momx_tp(
ka,
ia,
ja)
326 real(rp),
intent(in) :: momy_tp(
ka,
ia,
ja)
327 real(rp),
intent(in) :: rhot_tp(
ka,
ia,
ja)
328 real(rp),
intent(in) :: rhoq_tp(
ka,
ia,
ja,
qa)
330 real(rp),
intent(in) :: coriolis(
ia,
ja)
332 real(rp),
intent(in) :: cdz (
ka)
333 real(rp),
intent(in) :: cdx (
ia)
334 real(rp),
intent(in) :: cdy (
ja)
335 real(rp),
intent(in) :: fdz (
ka-1)
336 real(rp),
intent(in) :: fdx (
ia-1)
337 real(rp),
intent(in) :: fdy (
ja-1)
338 real(rp),
intent(in) :: rcdz(
ka)
339 real(rp),
intent(in) :: rcdx(
ia)
340 real(rp),
intent(in) :: rcdy(
ja)
341 real(rp),
intent(in) :: rfdz(
ka-1)
342 real(rp),
intent(in) :: rfdx(
ia-1)
343 real(rp),
intent(in) :: rfdy(
ja-1)
345 real(rp),
intent(in) :: phi (
ka,
ia,
ja)
346 real(rp),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
347 real(rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
348 real(rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
349 real(rp),
intent(in) :: j33g
350 real(rp),
intent(in) :: mapf (
ia,
ja,2,4)
352 real(rp),
intent(in) :: aq_r (
qa)
353 real(rp),
intent(in) :: aq_cv (
qa)
354 real(rp),
intent(in) :: aq_cp (
qa)
355 real(rp),
intent(in) :: aq_mass(
qa)
357 real(rp),
intent(in) :: ref_dens(
ka,
ia,
ja)
358 real(rp),
intent(in) :: ref_pott(
ka,
ia,
ja)
359 real(rp),
intent(in) :: ref_qv (
ka,
ia,
ja)
360 real(rp),
intent(in) :: ref_pres(
ka,
ia,
ja)
361 real(rp),
intent(in) :: nd_coef
362 real(rp),
intent(in) :: nd_coef_q
363 integer,
intent(in) :: nd_laplacian_num
364 real(rp),
intent(in) :: nd_sfc_fact
365 logical,
intent(in) :: nd_use_rs
367 integer,
intent(in) :: bnd_qa
368 integer,
intent(in) :: bnd_iq(
qa)
369 real(rp),
intent(in) :: bnd_smoother_fact
371 real(rp),
intent(in) :: damp_dens(
ka,
ia,
ja)
372 real(rp),
intent(in) :: damp_velz(
ka,
ia,
ja)
373 real(rp),
intent(in) :: damp_velx(
ka,
ia,
ja)
374 real(rp),
intent(in) :: damp_vely(
ka,
ia,
ja)
375 real(rp),
intent(in) :: damp_pott(
ka,
ia,
ja)
376 real(rp),
intent(in) :: damp_qtrc(
ka,
ia,
ja,bnd_qa)
378 real(rp),
intent(in) :: damp_alpha_dens(
ka,
ia,
ja)
379 real(rp),
intent(in) :: damp_alpha_velz(
ka,
ia,
ja)
380 real(rp),
intent(in) :: damp_alpha_velx(
ka,
ia,
ja)
381 real(rp),
intent(in) :: damp_alpha_vely(
ka,
ia,
ja)
382 real(rp),
intent(in) :: damp_alpha_pott(
ka,
ia,
ja)
383 real(rp),
intent(in) :: damp_alpha_qtrc(
ka,
ia,
ja,bnd_qa)
384 real(rp),
intent(in) :: mflux_offset_x(
ka,
ja,2)
385 real(rp),
intent(in) :: mflux_offset_y(
ka,
ia,2)
387 real(rp),
intent(in) :: divdmp_coef
389 logical,
intent(in) :: flag_tracer_split_tend
390 logical,
intent(in) :: flag_fct_momentum
391 logical,
intent(in) :: flag_fct_t
392 logical,
intent(in) :: flag_fct_tracer
393 logical,
intent(in) :: flag_fct_along_stream
395 logical,
intent(in) :: use_average
397 integer,
intent(in) :: i_qv
399 real(
dp),
intent(in) :: dtsec
400 real(
dp),
intent(in) :: dtsec_dyn
403 real(rp) :: dens00 (
ka,
ia,
ja)
408 integer :: i, j,
k, iq
411 log_progress(*)
'atmosphere / dynamics'
413 dt = real(dtsec, kind=rp)
425 dens00(
k,i,j) = dens(
k,i,j)
427 dens(
k,i,j) = dens(
k,i,j) + dens_tp(
k,i,j) * dt
437 momz(
k,i,j) = momz(
k,i,j) + momz_tp(
k,i,j) * dt
447 momx(
k,i,j) = momx(
k,i,j) + momx_tp(
k,i,j) * dt
457 momy(
k,i,j) = momy(
k,i,j) + momy_tp(
k,i,j) * dt
467 rhot(
k,i,j) = rhot(
k,i,j) + rhot_tp(
k,i,j) * dt
478 qtrc(
k,i,j,iq) = max( 0.0_rp, &
479 qtrc(
k,i,j,iq) * dens00(
k,i,j) + rhoq_tp(
k,i,j,iq) * dt &
489 call comm_vars8( dens(:,:,:), i_comm_dens )
490 call comm_vars8( momz(:,:,:), i_comm_momz )
491 call comm_vars8( momx(:,:,:), i_comm_momx )
492 call comm_vars8( momy(:,:,:), i_comm_momy )
493 call comm_vars8( rhot(:,:,:), i_comm_rhot )
495 call comm_vars8( qtrc(:,:,:,iq), i_comm_qtrc(iq) )
498 call comm_wait ( dens(:,:,:), i_comm_dens, .false. )
499 call comm_wait ( momz(:,:,:), i_comm_momz, .false. )
500 call comm_wait ( momx(:,:,:), i_comm_momx, .false. )
501 call comm_wait ( momy(:,:,:), i_comm_momy, .false. )
502 call comm_wait ( rhot(:,:,:), i_comm_rhot, .false. )
504 call comm_wait ( qtrc(:,:,:,iq), i_comm_qtrc(iq), .false. )
507 if ( use_average )
then
509 dens_av(:,:,:) = dens(:,:,:)
512 momz_av(:,:,:) = momz(:,:,:)
515 momx_av(:,:,:) = momx(:,:,:)
518 momy_av(:,:,:) = momy(:,:,:)
521 rhot_av(:,:,:) = rhot(:,:,:)
524 qtrc_av(:,:,:,:) = qtrc(:,:,:,:)
551 dens_av, momz_av, momx_av, momy_av, rhot_av, qtrc_av, &
552 num_diff, num_diff_q, &
553 dens_tp, momz_tp, momx_tp, momy_tp, rhot_tp, rhoq_tp, &
555 cdz, cdx, cdy, fdz, fdx, fdy, &
556 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
558 j13g, j23g, j33g, mapf, &
559 aq_r, aq_cv, aq_cp, aq_mass, &
560 ref_dens, ref_pott, ref_qv, ref_pres, &
561 bnd_w, bnd_e, bnd_s, bnd_n,
prc_twod, &
562 nd_coef, nd_coef_q, nd_laplacian_num, &
563 nd_sfc_fact, nd_use_rs, &
564 bnd_qa, bnd_iq, bnd_smoother_fact, &
565 damp_dens, damp_velz, damp_velx, &
566 damp_vely, damp_pott, damp_qtrc, &
567 damp_alpha_dens, damp_alpha_velz, damp_alpha_velx, &
568 damp_alpha_vely, damp_alpha_pott, damp_alpha_qtrc, &
569 mflux_offset_x, mflux_offset_y, &
570 wdamp_coef, divdmp_coef, &
571 flag_tracer_split_tend, &
572 flag_fct_momentum, flag_fct_t, flag_fct_tracer, &
573 flag_fct_along_stream, &