54 real(RP),
private,
allocatable :: dens_t(:,:,:)
55 real(RP),
private,
allocatable :: momz_t(:,:,:)
56 real(RP),
private,
allocatable :: momx_t(:,:,:)
57 real(RP),
private,
allocatable :: momy_t(:,:,:)
58 real(RP),
private,
allocatable :: rhot_t(:,:,:)
59 real(RP),
private,
allocatable,
target :: rhoq_t(:,:,:,:)
60 real(RP),
private,
allocatable,
target :: zero(:,:,:)
61 real(RP),
private,
pointer :: rhoq_tn(:,:,:)
63 real(RP),
private,
allocatable :: mflx_hi(:,:,:,:)
67 integer :: i_comm_dens = 1
68 integer :: i_comm_momz = 2
69 integer :: i_comm_momx = 3
70 integer :: i_comm_momy = 4
71 integer :: i_comm_rhot = 5
72 integer,
allocatable :: i_comm_prog(:)
74 integer :: i_comm_dens_t = 1
75 integer :: i_comm_momz_t = 2
76 integer :: i_comm_momx_t = 3
77 integer :: i_comm_momy_t = 4
78 integer :: i_comm_rhot_t = 5
80 integer,
allocatable :: i_comm_rhoq_t(:)
81 integer,
allocatable :: i_comm_qtrc(:)
83 integer :: i_comm_mflx_z = 1
84 integer :: i_comm_mflx_x = 2
85 integer :: i_comm_mflx_y = 3
93 DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, &
110 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
111 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
112 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
113 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
114 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
115 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,
qa)
116 real(RP),
intent(inout) :: PROG(
ka,
ia,
ja,
va)
117 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
122 allocate( dens_t(
ka,
ia,
ja) )
123 allocate( momz_t(
ka,
ia,
ja) )
124 allocate( momx_t(
ka,
ia,
ja) )
125 allocate( momy_t(
ka,
ia,
ja) )
126 allocate( rhot_t(
ka,
ia,
ja) )
129 allocate( i_comm_prog(max(
va,1)) )
130 allocate( i_comm_qtrc(
qa) )
131 allocate( i_comm_rhoq_t(
qa) )
139 i_comm_prog(iv) = 5 + iv
150 i_comm_rhoq_t(iq) = 5 +
va + iq
151 i_comm_qtrc(iq) = 5 +
va + iq
161 allocate( zero(
ka,
ia,
ja) )
164 mflx_hi(:,:,:,:) = undef
172 DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, &
173 DENS_av, MOMZ_av, MOMX_av, MOMY_av, RHOT_av, QTRC_av, &
175 num_diff, num_diff_q, &
177 DENS_tp, MOMZ_tp, MOMX_tp, MOMY_tp, RHOT_tp, RHOQ_tp, &
179 CDZ, CDX, CDY, FDZ, FDX, FDY, &
180 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
182 J13G, J23G, J33G, MAPF, &
183 AQ_R, AQ_CV, AQ_CP, AQ_MASS, &
184 REF_dens, REF_pott, REF_qv, REF_pres, &
185 BND_W, BND_E, BND_S, BND_N, &
186 ND_COEF, ND_COEF_Q, ND_ORDER, ND_SFC_FACT, ND_USE_RS, &
187 BND_QA, BND_SMOOTHER_FACT, &
188 DAMP_DENS, DAMP_VELZ, DAMP_VELX, &
189 DAMP_VELY, DAMP_POTT, DAMP_QTRC, &
190 DAMP_alpha_DENS, DAMP_alpha_VELZ, DAMP_alpha_VELX, &
191 DAMP_alpha_VELY, DAMP_alpha_POTT, DAMP_alpha_QTRC, &
194 FLAG_TRACER_SPLIT_TEND, &
195 FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_TRACER, &
196 FLAG_FCT_ALONG_STREAM, &
226 file_history_set_disable
233 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
234 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
235 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
236 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
237 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
238 real(RP),
intent(inout) :: QTRC(
ka,
ia,
ja,
qa)
239 real(RP),
intent(inout) :: PROG(
ka,
ia,
ja,
va)
241 real(RP),
intent(inout) :: DENS_av(
ka,
ia,
ja)
242 real(RP),
intent(inout) :: MOMZ_av(
ka,
ia,
ja)
243 real(RP),
intent(inout) :: MOMX_av(
ka,
ia,
ja)
244 real(RP),
intent(inout) :: MOMY_av(
ka,
ia,
ja)
245 real(RP),
intent(inout) :: RHOT_av(
ka,
ia,
ja)
246 real(RP),
intent(inout) :: QTRC_av(
ka,
ia,
ja,
qa)
248 real(RP),
intent(out) :: mflx_hi(
ka,
ia,
ja,3)
249 real(RP),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
251 real(RP),
intent(out) :: num_diff(
ka,
ia,
ja,5,3)
252 real(RP),
intent(out) :: num_diff_q(
ka,
ia,
ja,3)
254 real(RP),
intent(in) :: QTRC0(
ka,
ia,
ja,
qa)
256 real(RP),
intent(in) :: DENS_tp(
ka,
ia,
ja)
257 real(RP),
intent(in) :: MOMZ_tp(
ka,
ia,
ja)
258 real(RP),
intent(in) :: MOMX_tp(
ka,
ia,
ja)
259 real(RP),
intent(in) :: MOMY_tp(
ka,
ia,
ja)
260 real(RP),
intent(in) :: RHOT_tp(
ka,
ia,
ja)
261 real(RP),
intent(in) :: RHOQ_tp(
ka,
ia,
ja,
qa)
263 real(RP),
intent(in) :: CORIOLI(
ia,
ja)
265 real(RP),
intent(in) :: CDZ (
ka)
266 real(RP),
intent(in) :: CDX (
ia)
267 real(RP),
intent(in) :: CDY (
ja)
268 real(RP),
intent(in) :: FDZ (
ka-1)
269 real(RP),
intent(in) :: FDX (
ia-1)
270 real(RP),
intent(in) :: FDY (
ja-1)
271 real(RP),
intent(in) :: RCDZ(
ka)
272 real(RP),
intent(in) :: RCDX(
ia)
273 real(RP),
intent(in) :: RCDY(
ja)
274 real(RP),
intent(in) :: RFDZ(
ka-1)
275 real(RP),
intent(in) :: RFDX(
ia-1)
276 real(RP),
intent(in) :: RFDY(
ja-1)
278 real(RP),
intent(in) :: PHI (
ka,
ia,
ja)
279 real(RP),
intent(in) :: GSQRT(
ka,
ia,
ja,7)
280 real(RP),
intent(in) :: J13G (
ka,
ia,
ja,7)
281 real(RP),
intent(in) :: J23G (
ka,
ia,
ja,7)
282 real(RP),
intent(in) :: J33G
283 real(RP),
intent(in) :: MAPF (
ia,
ja,2,4)
285 real(RP),
intent(in) :: AQ_R (
qa)
286 real(RP),
intent(in) :: AQ_CV (
qa)
287 real(RP),
intent(in) :: AQ_CP (
qa)
288 real(RP),
intent(in) :: AQ_MASS(
qa)
290 real(RP),
intent(in) :: REF_dens(
ka,
ia,
ja)
291 real(RP),
intent(in) :: REF_pott(
ka,
ia,
ja)
292 real(RP),
intent(in) :: REF_qv (
ka,
ia,
ja)
293 real(RP),
intent(in) :: REF_pres(
ka,
ia,
ja)
295 logical,
intent(in) :: BND_W
296 logical,
intent(in) :: BND_E
297 logical,
intent(in) :: BND_S
298 logical,
intent(in) :: BND_N
300 real(RP),
intent(in) :: ND_COEF
301 real(RP),
intent(in) :: ND_COEF_Q
302 integer,
intent(in) :: ND_ORDER
303 real(RP),
intent(in) :: ND_SFC_FACT
304 logical,
intent(in) :: ND_USE_RS
306 integer,
intent(in) :: BND_QA
307 real(RP),
intent(in) :: BND_SMOOTHER_FACT
309 real(RP),
intent(in) :: DAMP_DENS(
ka,
ia,
ja)
310 real(RP),
intent(in) :: DAMP_VELZ(
ka,
ia,
ja)
311 real(RP),
intent(in) :: DAMP_VELX(
ka,
ia,
ja)
312 real(RP),
intent(in) :: DAMP_VELY(
ka,
ia,
ja)
313 real(RP),
intent(in) :: DAMP_POTT(
ka,
ia,
ja)
314 real(RP),
intent(in) :: DAMP_QTRC(
ka,
ia,
ja,bnd_qa)
316 real(RP),
intent(in) :: DAMP_alpha_DENS(
ka,
ia,
ja)
317 real(RP),
intent(in) :: DAMP_alpha_VELZ(
ka,
ia,
ja)
318 real(RP),
intent(in) :: DAMP_alpha_VELX(
ka,
ia,
ja)
319 real(RP),
intent(in) :: DAMP_alpha_VELY(
ka,
ia,
ja)
320 real(RP),
intent(in) :: DAMP_alpha_POTT(
ka,
ia,
ja)
321 real(RP),
intent(in) :: DAMP_alpha_QTRC(
ka,
ia,
ja,bnd_qa)
323 real(RP),
intent(in) :: wdamp_coef(
ka)
324 real(RP),
intent(in) :: divdmp_coef
326 logical,
intent(in) :: FLAG_TRACER_SPLIT_TEND
327 logical,
intent(in) :: FLAG_FCT_MOMENTUM
328 logical,
intent(in) :: FLAG_FCT_T
329 logical,
intent(in) :: FLAG_FCT_TRACER
330 logical,
intent(in) :: FLAG_FCT_ALONG_STREAM
332 logical,
intent(in) :: USE_AVERAGE
334 integer,
intent(in) :: I_QV
336 real(DP),
intent(in) :: DTLS
337 real(DP),
intent(in) :: DTSS
338 logical ,
intent(in) :: Llast
341 real(RP) :: DENS00 (
ka,
ia,
ja)
344 real(RP) :: DDIV (
ka,
ia,
ja)
345 real(RP) :: DPRES0 (
ka,
ia,
ja)
346 real(RP) :: RT2P (
ka,
ia,
ja)
347 real(RP) :: REF_rhot(
ka,
ia,
ja)
358 real(RP) :: DENS_tq(
ka,
ia,
ja)
359 real(RP) :: diff(
ka,
ia,
ja)
362 real(RP) :: damp_t(
ka,
ia,
ja)
366 real(RP) :: mflx_av (
ka,
ia,
ja,3)
372 integer :: i, j, k, iq, step
379 dts =
real(DTSS, kind=RP) 380 dtl =
real(DTLS, kind=RP) 381 nstep = ceiling( ( dtl - eps ) / dts )
385 log_info(
"ATMOS_DYN_Tstep_large_fvm_heve",*)
'Dynamics large time step' 386 log_info_cont(
'(1x,A,F0.2,A,F0.2,A,I0)') &
387 '-> DT_large, DT_small, DT_large/DT_small : ', dtl,
', ', dts,
', ', nstep
389 dens00(:,:,:) = undef
391 num_diff(:,:,:,:,:) = undef
393 mflx_hi(:,:,:,:) = undef
394 tflx_hi(:,:,:,:) = undef
398 dens00(:,:,:) = dens(:,:,:)
400 if ( use_average )
then 402 dens_av(:,:,:) = 0.0_rp
404 momz_av(:,:,:) = 0.0_rp
406 momx_av(:,:,:) = 0.0_rp
408 momy_av(:,:,:) = 0.0_rp
410 rhot_av(:,:,:) = 0.0_rp
415 mflx_av(:,:,:,:) = 0.0_rp
420 cpovcv = cpdry / cvdry
447 pres = p0 * ( rdry * rhot(k,i,j) / p0 )**cpovcv
448 rt2p(k,i,j) = cpovcv * pres / rhot(k,i,j)
455 rtot = rtot + aq_r(iq) * qtrc(k,i,j,iq)
456 cvtot = cvtot + aq_cv(iq) * qtrc(k,i,j,iq)
457 cptot = cptot + aq_cp(iq) * qtrc(k,i,j,iq)
458 qdry = qdry - qtrc(k,i,j,iq) * aq_mass(iq)
460 rtot = rtot + rdry * qdry
461 cvtot = cvtot + cvdry * qdry
462 cptot = cptot + cpdry * qdry
463 pres = p0 * ( rtot * rhot(k,i,j) / p0 )**( cptot / cvtot )
464 rt2p(k,i,j) = cptot / cvtot * pres / rhot(k,i,j)
466 dpres0(k,i,j) = pres - ref_pres(k,i,j)
467 ref_rhot(k,i,j) = rhot(k,i,j)
469 dpres0(
ks-1,i,j) = dpres0(
ks+1,i,j) + ( ref_pres(
ks+1,i,j) - ref_pres(
ks-1,i,j) )
470 dpres0(
ke+1,i,j) = dpres0(
ke-1,i,j) + ( ref_pres(
ke-1,i,j) - ref_pres(
ke+1,i,j) )
484 damp_t(:,:,:) = 0.0_rp
488 dens_tq(:,:,:) = 0.0_rp
492 if ( iq >= i_qv .and. iq < i_qv+bnd_qa )
then 499 diff(k,i,j) = qtrc(k,i,j,iq) - damp_qtrc(k,i,j,iq-i_qv+1)
514 damp = - damp_alpha_qtrc(k,i,j,iq-i_qv+1) &
516 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
517 * 0.125_rp * bnd_smoother_fact )
521 damp = damp * dens00(k,i,j)
522 rhoq_t(k,i,j,iq) = rhoq_tp(k,i,j,iq) + damp
523 dens_tq(k,i,j) = dens_tq(k,i,j) + damp *
tracer_mass(iq)
528 call file_history_in(rhoq_tp(:,:,:,iq), trim(
tracer_name(iq))//
'_t_phys', &
529 'tendency of '//trim(
tracer_name(iq))//
' due to physics (w/ HIST_TEND)',
'kg/kg/s' )
530 call file_history_in(damp_t, trim(
tracer_name(iq))//
'_t_damp', &
531 'tendency of '//trim(
tracer_name(iq))//
' due to damping (w/ HIST_TEND)',
'kg/kg/s' )
536 rhoq_t( 1:
ks-1,i,j,iq) = 0.0_rp
537 rhoq_t(
ke+1:
ka ,i,j,iq) = 0.0_rp
541 call comm_vars8( rhoq_t(:,:,:,iq), i_comm_rhoq_t(iq) )
542 call comm_wait ( rhoq_t(:,:,:,iq), i_comm_rhoq_t(iq), .false. )
551 rhoq_t(k,i,j,iq) = rhoq_tp(k,i,j,iq)
568 mflx_hi(k,
is-1,j,
xdir) = gsqrt(k,
is-1,j,
i_uyz) * momx(k,
is-1,j) / mapf(
is-1,j,2,
i_uy)
576 mflx_hi(k,
ie,j,
xdir) = gsqrt(k,
ie,j,
i_uyz) * momx(k,
ie,j) / mapf(
ie,j,2,
i_uy)
584 mflx_hi(k,i,
js-1,
ydir) = gsqrt(k,i,
js-1,
i_xvz) * momy(k,i,
js-1) / mapf(i,
js-1,1,
i_xv)
592 mflx_hi(k,i,
je,
ydir) = gsqrt(k,i,
je,
i_xvz) * momy(k,i,
je) / mapf(i,
je,1,
i_xv)
602 call file_history_set_disable( .not. (llast .AND. step == nstep ) )
613 diff(k,i,j) = dens(k,i,j) - damp_dens(k,i,j)
628 damp = - damp_alpha_dens(k,i,j) &
630 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
631 * 0.125_rp * bnd_smoother_fact ) &
633 dens_t(k,i,j) = dens_tp(k,i,j) &
644 dens_t( 1:
ks-1,i,j) = 0.0_rp
645 dens_t(
ke+1:
ka ,i,j) = 0.0_rp
648 call comm_vars8( dens_t(:,:,:), i_comm_dens_t )
650 call file_history_in(dens_tp,
'DENS_t_phys',
'tendency of dencity due to physics (w/ HIST_TEND)',
'kg/m3/s' )
651 call file_history_in(damp_t,
'DENS_t_damp',
'tendency of dencity due to damping (w/ HIST_TEND)',
'kg/m3/s' )
659 diff(k,i,j) = momz(k,i,j) - damp_velz(k,i,j) * ( dens(k,i,j)+dens(k+1,i,j) ) * 0.5_rp
674 damp = - damp_alpha_velz(k,i,j) &
676 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
677 * 0.125_rp * bnd_smoother_fact )
679 momz_t(k,i,j) = momz_tp(k,i,j) &
690 momz_t( 1:
ks-1,i,j) = 0.0_rp
691 momz_t(
ke:
ka ,i,j) = 0.0_rp
694 call comm_vars8( momz_t(:,:,:), i_comm_momz_t )
696 call file_history_in(momz_tp,
'MOMZ_t_phys',
'tendency of momentum z due to physics (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY' )
697 call file_history_in(damp_t,
'MOMZ_t_damp',
'tendency of momentum z due to damping (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY' )
705 diff(k,i,j) = momx(k,i,j) - damp_velx(k,i,j) * ( dens(k,i,j)+dens(k,i+1,j) ) * 0.5_rp
720 damp = - damp_alpha_velx(k,i,j) &
722 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
723 * 0.125_rp * bnd_smoother_fact )
724 momx_t(k,i,j) = momx_tp(k,i,j) &
735 momx_t( 1:
ks-1,i,j) = 0.0_rp
736 momx_t(
ke+1:
ka ,i,j) = 0.0_rp
739 call comm_vars8( momx_t(:,:,:), i_comm_momx_t )
741 call file_history_in(momx_tp,
'MOMX_t_phys',
'tendency of momentum x due to physics (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY' )
742 call file_history_in(damp_t,
'MOMX_t_damp',
'tendency of momentum x due to damping (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY' )
750 diff(k,i,j) = momy(k,i,j) - damp_vely(k,i,j) * ( dens(k,i,j)+dens(k,i,j+1) ) * 0.5_rp
765 damp = - damp_alpha_vely(k,i,j) &
767 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
768 * 0.125_rp * bnd_smoother_fact )
769 momy_t(k,i,j) = momy_tp(k,i,j) &
780 momy_t( 1:
ks-1,i,j) = 0.0_rp
781 momy_t(
ke+1:
ka ,i,j) = 0.0_rp
784 call comm_vars8( momy_t(:,:,:), i_comm_momy_t )
786 call file_history_in(momy_tp,
'MOMY_t_phys',
'tendency of momentum y due to physics (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH' )
787 call file_history_in(damp_t,
'MOMY_t_damp',
'tendency of momentum y due to damping (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH' )
795 diff(k,i,j) = rhot(k,i,j) - damp_pott(k,i,j) * dens(k,i,j)
810 damp = - damp_alpha_pott(k,i,j) &
812 - ( diff(k,i-1,j) + diff(k,i+1,j) + diff(k,i,j-1) + diff(k,i,j+1) - diff(k,i,j)*4.0_rp ) &
813 * 0.125_rp * bnd_smoother_fact )
814 rhot_t(k,i,j) = rhot_tp(k,i,j) &
825 rhot_t( 1:
ks-1,i,j) = 0.0_rp
826 rhot_t(
ke+1:
ka ,i,j) = 0.0_rp
829 call comm_vars8( rhot_t(:,:,:), i_comm_rhot_t )
831 call file_history_in(rhot_tp,
'RHOT_t_phys',
'tendency of rho*theta temperature due to physics (w/ HIST_TEND)',
'K kg/m3/s' )
832 call file_history_in(damp_t,
'RHOT_t_damp',
'tendency of rho*theta temperature due to damping (w/ HIST_TEND)',
'K kg/m3/s' )
835 call comm_wait ( dens_t(:,:,:), i_comm_dens_t, .false. )
836 call comm_wait ( momz_t(:,:,:), i_comm_momz_t, .false. )
837 call comm_wait ( momx_t(:,:,:), i_comm_momx_t, .false. )
838 call comm_wait ( momy_t(:,:,:), i_comm_momy_t, .false. )
839 call comm_wait ( rhot_t(:,:,:), i_comm_rhot_t, .false. )
847 if ( nd_coef == 0.0_rp )
then 849 num_diff(:,:,:,:,:) = 0.0_rp
852 dens, momz, momx, momy, rhot, &
853 cdz, cdx, cdy, fdz, fdx, fdy, dts, &
854 ref_dens, ref_pott, &
855 nd_coef, nd_order, nd_sfc_fact, nd_use_rs )
860 if ( divdmp_coef > 0.0_rp )
then 864 gsqrt, j13g, j23g, j33g, mapf, &
865 rcdz, rcdx, rcdy, rfdz, fdz )
882 dens_t, momz_t, momx_t, momy_t, rhot_t, &
883 dpres0, rt2p, corioli, &
884 num_diff, wdamp_coef, divdmp_coef, ddiv, &
885 flag_fct_momentum, flag_fct_t, &
886 flag_fct_along_stream, &
887 cdz, fdz, fdx, fdy, &
888 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
889 phi, gsqrt, j13g, j23g, j33g, mapf, &
890 ref_dens, ref_rhot, &
891 bnd_w, bnd_e, bnd_s, bnd_n, &
903 bnd_w, bnd_e, bnd_s, bnd_n )
910 dens( 1:
ks-1,i,j) = dens(
ks,i,j)
911 momz( 1:
ks-1,i,j) = 0.0_rp
912 momx( 1:
ks-1,i,j) = momx(
ks,i,j)
913 momy( 1:
ks-1,i,j) = momy(
ks,i,j)
914 rhot( 1:
ks-1,i,j) = rhot(
ks,i,j)
916 prog( 1:
ks-1,i,j,iv) = prog(
ks,i,j,iv)
918 dens(
ke+1:
ka, i,j) = dens(
ke,i,j)
919 momz(
ke+1:
ka, i,j) = 0.0_rp
920 momx(
ke+1:
ka, i,j) = momx(
ke,i,j)
921 momy(
ke+1:
ka, i,j) = momy(
ke,i,j)
922 rhot(
ke+1:
ka, i,j) = rhot(
ke,i,j)
924 prog(
ke+1:
ka, i,j,iv) = prog(
ke,i,j,iv)
929 call comm_vars8( dens(:,:,:), i_comm_dens )
930 call comm_vars8( momz(:,:,:), i_comm_momz )
931 call comm_vars8( momx(:,:,:), i_comm_momx )
932 call comm_vars8( momy(:,:,:), i_comm_momy )
933 call comm_vars8( rhot(:,:,:), i_comm_rhot )
935 call comm_vars8( prog(:,:,:,iv), i_comm_prog(iv) )
937 call comm_wait ( dens(:,:,:), i_comm_dens, .false. )
938 call comm_wait ( momz(:,:,:), i_comm_momz, .false. )
939 call comm_wait ( momx(:,:,:), i_comm_momx, .false. )
940 call comm_wait ( momy(:,:,:), i_comm_momy, .false. )
941 call comm_wait ( rhot(:,:,:), i_comm_rhot, .false. )
943 call comm_wait ( prog(:,:,:,iv), i_comm_prog(iv), .false. )
946 if ( use_average )
then 950 dens_av(k,i,j) = dens_av(k,i,j) + dens(k,i,j)
951 momz_av(k,i,j) = momz_av(k,i,j) + momz(k,i,j)
952 momx_av(k,i,j) = momx_av(k,i,j) + momx(k,i,j)
953 momy_av(k,i,j) = momy_av(k,i,j) + momy(k,i,j)
954 rhot_av(k,i,j) = rhot_av(k,i,j) + rhot(k,i,j)
964 mflx_av(k,i,j,:) = mflx_av(k,i,j,:) + mflx_hi(k,i,j,:)
972 if ( use_average )
then 976 dens_av(k,i,j) = dens_av(k,i,j) / nstep
983 momz_av(k,i,j) = momz_av(k,i,j) / nstep
990 momx_av(k,i,j) = momx_av(k,i,j) / nstep
997 momy_av(k,i,j) = momy_av(k,i,j) / nstep
1004 rhot_av(k,i,j) = rhot_av(k,i,j) / nstep
1020 mflx_hi(k,i,j,n) = mflx_av(k,i,j,n) / nstep
1026 call comm_vars8( mflx_hi(:,:,:,
zdir), i_comm_mflx_z )
1027 call comm_vars8( mflx_hi(:,:,:,
xdir), i_comm_mflx_x )
1028 call comm_vars8( mflx_hi(:,:,:,
ydir), i_comm_mflx_y )
1029 call comm_wait ( mflx_hi(:,:,:,
zdir), i_comm_mflx_z, .false. )
1030 call comm_wait ( mflx_hi(:,:,:,
xdir), i_comm_mflx_x, .false. )
1031 call comm_wait ( mflx_hi(:,:,:,
ydir), i_comm_mflx_y, .false. )
1033 if ( use_average )
then 1035 qtrc_av(:,:,:,:) = 0.0_rp
1052 if ( nd_coef_q == 0.0_rp )
then 1054 num_diff_q(:,:,:,:) = 0.0_rp
1057 dens00, qtrc(:,:,:,iq), iq==i_qv, &
1058 cdz, cdx, cdy, dtl, &
1060 nd_coef_q, nd_order, nd_sfc_fact, nd_use_rs )
1067 if ( flag_tracer_split_tend )
then 1073 qtrc(k,i,j,iq) = qtrc(k,i,j,iq) &
1074 + rhoq_t(k,i,j,iq) * dtl / dens(k,i,j)
1080 rhoq_tn => rhoq_t(:,:,:,iq)
1085 qtrc0(:,:,:,iq), rhoq_tn, &
1087 mflx_hi, num_diff_q, &
1088 gsqrt, mapf(:,:,:,
i_xy), &
1089 cdz, rcdz, rcdx, rcdy, &
1090 bnd_w, bnd_e, bnd_s, bnd_n, &
1092 llast .AND. flag_fct_tracer, &
1093 flag_fct_along_stream )
1102 qtrc(k,i,j,iq) = ( qtrc0(k,i,j,iq) * dens00(k,i,j) &
1103 + rhoq_t(k,i,j,iq) * dtl ) / dens(k,i,j)
1110 if ( use_average )
then 1114 qtrc_av(k,i,j,iq) = qtrc(k,i,j,iq)
1120 call comm_vars8( qtrc(:,:,:,iq), i_comm_qtrc(iq) )
1125 call comm_wait ( qtrc(:,:,:,iq), i_comm_qtrc(iq), .false. )
1139 BND_W, BND_E, BND_S, BND_N &
1150 real(RP),
intent(in) :: DENS (
ka,
ia,
ja)
1151 real(RP),
intent(in) :: DAMP_DENS(
ka,
ia,
ja)
1152 real(RP),
intent(in) :: mflx_hi (
ka,
ia,
ja,3)
1153 real(RP),
intent(in) :: tflx_hi (
ka,
ia,
ja,3)
1154 real(RP),
intent(in) :: GSQRT (
ka,
ia,
ja,7)
1155 real(RP),
intent(in) :: MAPF (
ia,
ja,2,7)
1156 real(RP),
intent(in) :: RCDX(
ia)
1157 real(RP),
intent(in) :: RCDY(
ja)
1158 real(RP),
intent(in) :: dt
1159 integer,
intent(in) :: step
1160 logical,
intent(in) :: BND_W
1161 logical,
intent(in) :: BND_E
1162 logical,
intent(in) :: BND_S
1163 logical,
intent(in) :: BND_N
1166 real(RP) :: mflx_lb_horizontal(
ka)
1167 real(RP) :: allmflx_lb_horizontal(
ka)
1168 real(RP) :: mflx_lb_total
1169 real(RP) :: mass_total
1170 real(RP) :: mass_total2
1171 real(RP) :: allmflx_lb_total
1172 real(RP) :: allmass_total
1173 real(RP) :: allmass_total2
1179 call file_history_in(mflx_hi(:,:,:,
zdir),
'MFLXZ',
'momentum flux of z-direction (w/ CHECK_MASS)',
'kg/m2/s', dim_type=
'ZHXY' )
1180 call file_history_in(mflx_hi(:,:,:,
xdir),
'MFLXX',
'momentum flux of x-direction (w/ CHECK_MASS)',
'kg/m2/s', dim_type=
'ZXHY' )
1181 call file_history_in(mflx_hi(:,:,:,
ydir),
'MFLXY',
'momentum flux of y-direction (w/ CHECK_MASS)',
'kg/m2/s', dim_type=
'ZXYH' )
1183 call file_history_in(tflx_hi(:,:,:,
zdir),
'TFLXZ',
'potential temperature flux of z-direction (w/ CHECK_MASS)',
'K*kg/m2/s', dim_type=
'ZHXY' )
1184 call file_history_in(tflx_hi(:,:,:,
xdir),
'TFLXX',
'potential temperature flux of x-direction (w/ CHECK_MASS)',
'K*kg/m2/s', dim_type=
'ZXHY' )
1185 call file_history_in(tflx_hi(:,:,:,
ydir),
'TFLXY',
'potential temperature flux of y-direction (w/ CHECK_MASS)',
'K*kg/m2/s', dim_type=
'ZXYH' )
1187 mflx_lb_total = 0.0_rp
1188 mflx_lb_horizontal(:) = 0.0_rp
1189 allmflx_lb_horizontal(:) = 0.0_rp
1195 mflx_lb_total = mflx_lb_total + mflx_hi(k,i-1,j,
xdir) * rcdx(i) * vol(k,i,j) &
1196 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1197 mflx_lb_horizontal(k) = mflx_lb_horizontal(k) + mflx_hi(k,i-1,j,
xdir) * rcdx(i) * vol(k,i,j) &
1198 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1207 mflx_lb_total = mflx_lb_total - mflx_hi(k,i,j,
xdir) * rcdx(i) * vol(k,i,j) &
1208 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1209 mflx_lb_horizontal(k) = mflx_lb_horizontal(k) - mflx_hi(k,i,j,
xdir) * rcdx(i) * vol(k,i,j) &
1210 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1218 mflx_lb_total = mflx_lb_total + mflx_hi(k,i,j-1,
ydir) * rcdy(j) * vol(k,i,j) &
1219 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1220 mflx_lb_horizontal(k) = mflx_lb_horizontal(k) + mflx_hi(k,i,j-1,
ydir) * rcdy(j) * vol(k,i,j) &
1221 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1229 mflx_lb_total = mflx_lb_total - mflx_hi(k,i,j,
ydir) * rcdy(j) * vol(k,i,j) &
1230 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1231 mflx_lb_horizontal(k) = mflx_lb_horizontal(k) - mflx_hi(k,i,j,
ydir) * rcdy(j) * vol(k,i,j) &
1232 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) * dt
1238 mass_total2 = 0.0_rp
1244 mass_total = mass_total + dens(k,i,j) * vol(k,i,j)
1245 mass_total2 = mass_total2 + damp_dens(k,i,j) * vol(k,i,j)
1250 call mpi_allreduce( mflx_lb_total, &
1258 log_info(
"check_mass",
'(A,1x,I1,1x,ES24.17)')
'total mflx_lb:', step, allmflx_lb_total
1260 call mpi_allreduce( mass_total, &
1268 log_info(
"check_mass",
'(A,1x,I1,1x,ES24.17)')
'total mass :', step, allmass_total
1270 call mpi_allreduce( mass_total2, &
1278 log_info(
"check_mass",
'(A,1x,I1,1x,ES24.17)')
'total mass2 :', step, allmass_total2
1280 call mpi_allreduce( mflx_lb_horizontal(
ks:
ke), &
1281 allmflx_lb_horizontal(
ks:
ke), &
1288 call file_history_in(allmflx_lb_horizontal(:),
'ALLMOM_lb_hz', &
1289 'horizontally total momentum flux from lateral boundary (w/ CHECK_MASS)',
'kg/m2/s' )
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
subroutine, public atmos_dyn_tstep_large_fvm_heve_setup(DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, mflx_hi)
Setup.
integer, public comm_world
communication world ID
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
subroutine, public atmos_dyn_fvm_fluxy_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation Y-flux at XYZ
subroutine, public atmos_dyn_fvm_fluxz_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation z-flux at XYZ
subroutine, public atmos_dyn_tstep_large_fvm_heve(DENS, MOMZ, MOMX, MOMY, RHOT, QTRC, PROG, DENS_av, MOMZ_av, MOMX_av, MOMY_av, RHOT_av, QTRC_av, mflx_hi, tflx_hi, num_diff, num_diff_q, QTRC0, DENS_tp, MOMZ_tp, MOMX_tp, MOMY_tp, RHOT_tp, RHOQ_tp, CORIOLI, CDZ, CDX, CDY, FDZ, FDX, FDY, RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, PHI, GSQRT, J13G, J23G, J33G, MAPF, AQ_R, AQ_CV, AQ_CP, AQ_MASS, REF_dens, REF_pott, REF_qv, REF_pres, BND_W, BND_E, BND_S, BND_N, ND_COEF, ND_COEF_Q, ND_ORDER, ND_SFC_FACT, ND_USE_RS, BND_QA, BND_SMOOTHER_FACT, DAMP_DENS, DAMP_VELZ, DAMP_VELX, DAMP_VELY, DAMP_POTT, DAMP_QTRC, DAMP_alpha_DENS, DAMP_alpha_VELZ, DAMP_alpha_VELX, DAMP_alpha_VELY, DAMP_alpha_POTT, DAMP_alpha_QTRC, wdamp_coef, divdmp_coef, FLAG_TRACER_SPLIT_TEND, FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_TRACER, FLAG_FCT_ALONG_STREAM, USE_AVERAGE, I_QV, DTLS, DTSS, Llast)
Dynamical Process.
module Atmosphere / Dynamics Temporal integration
subroutine, public atmos_dyn_numfilter_coef(num_diff, DENS, MOMZ, MOMX, MOMY, RHOT, CDZ, CDX, CDY, FDZ, FDX, FDY, DT, REF_dens, REF_pott, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
integer, public ia
of whole cells: x, local, with HALO
integer, public comm_datatype
datatype of variable
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxx_xyz
subroutine check_mass(DENS, DAMP_DENS, mflx_hi, tflx_hi, GSQRT, MAPF, RCDX, RCDY, dt, step, BND_W, BND_E, BND_S, BND_N)
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
logical, dimension(qa_max), public tracer_advc
integer, public ja
of whole cells: y, local, with HALO
subroutine, public check(current_line, v)
Undefined value checker.
module Atmosphere / Dynamics Temporal integration
logical, public prc_has_s
character(len=h_short), dimension(qa_max), public tracer_name
logical, public prc_has_n
logical, public prc_has_e
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
real(rp), public const_undef
integer, public is
start point of inner domain: x, local
real(rp), public const_ohm
angular velocity of the planet [1/s]
integer, public ie
end point of inner domain: x, local
integer, parameter, public ydir
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
real(rp), public const_pre00
pressure reference [Pa]
integer, public je
end point of inner domain: y, local
subroutine, public atmos_dyn_numfilter_coef_q(num_diff_q, DENS, QTRC, is_qv, CDZ, CDX, CDY, dt, REF_qv, iq, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
procedure(tinteg), pointer, public atmos_dyn_tinteg_tracer
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
integer, public kmax
of computational cells: z, local
subroutine, public comm_vars8_init(varname, var, vid)
Register variables.
subroutine, public prc_abort
Abort Process.
integer, public js
start point of inner domain: y, local
integer, parameter, public xdir
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
real(rp), public const_eps
small number
module Atmosphere GRID CartesC Real(real space)
module scale_atmos_dyn_fvm_flux
integer, public ka
of whole cells: z, local, with HALO
subroutine, public atmos_dyn_fct(qflx_anti, phi_in, DENS0, DENS, qflx_hi, qflx_lo, mflx_hi, rdz, rdx, rdy, GSQRT, MAPF, dt, flag_vect)
Flux Correction Transport Limiter.
subroutine, public atmos_dyn_divergence(DDIV, MOMZ, MOMX, MOMY, GSQRT, J13G, J23G, J33G, MAPF, RCDZ, RCDX, RCDY, RFDZ, FDZ)
procedure(short), pointer, public atmos_dyn_tinteg_short
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxz_xyz
integer, parameter, public zdir
real(rp), dimension(qa_max), public tracer_mass
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxy_xyz
module Atmosphere / Dynamics
subroutine, public atmos_dyn_fvm_fluxx_xyz_ud1(flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
calculation X-flux at XYZ
logical, public prc_has_w
module scale_atmos_dyn_fvm_flux_ud1