24 #if defined DEBUG || defined QUICKDEBUG 53 real(RP),
private,
allocatable :: dens_rk1(:,:,:)
54 real(RP),
private,
allocatable :: momz_rk1(:,:,:)
55 real(RP),
private,
allocatable :: momx_rk1(:,:,:)
56 real(RP),
private,
allocatable :: momy_rk1(:,:,:)
57 real(RP),
private,
allocatable :: rhot_rk1(:,:,:)
58 real(RP),
private,
allocatable :: prog_rk1(:,:,:,:)
59 real(RP),
private,
allocatable :: dens_rk2(:,:,:)
60 real(RP),
private,
allocatable :: momz_rk2(:,:,:)
61 real(RP),
private,
allocatable :: momx_rk2(:,:,:)
62 real(RP),
private,
allocatable :: momy_rk2(:,:,:)
63 real(RP),
private,
allocatable :: rhot_rk2(:,:,:)
64 real(RP),
private,
allocatable :: prog_rk2(:,:,:,:)
65 real(RP),
private,
allocatable :: dens_rk3(:,:,:)
66 real(RP),
private,
allocatable :: momz_rk3(:,:,:)
67 real(RP),
private,
allocatable :: momx_rk3(:,:,:)
68 real(RP),
private,
allocatable :: momy_rk3(:,:,:)
69 real(RP),
private,
allocatable :: rhot_rk3(:,:,:)
70 real(RP),
private,
allocatable :: prog_rk3(:,:,:,:)
73 integer :: i_comm_dens_rk1 = 1
74 integer :: i_comm_momz_rk1 = 2
75 integer :: i_comm_momx_rk1 = 3
76 integer :: i_comm_momy_rk1 = 4
77 integer :: i_comm_rhot_rk1 = 5
78 integer,
allocatable :: i_comm_prog_rk1(:)
80 integer :: i_comm_dens_rk2 = 1
81 integer :: i_comm_momz_rk2 = 2
82 integer :: i_comm_momx_rk2 = 3
83 integer :: i_comm_momy_rk2 = 4
84 integer :: i_comm_rhot_rk2 = 5
85 integer,
allocatable :: i_comm_prog_rk2(:)
87 integer :: i_comm_dens_rk3 = 1
88 integer :: i_comm_momz_rk3 = 2
89 integer :: i_comm_momx_rk3 = 3
90 integer :: i_comm_momy_rk3 = 4
91 integer :: i_comm_rhot_rk3 = 5
92 integer,
allocatable :: i_comm_prog_rk3(:)
108 character(len=*) :: tinteg_type
113 if ( tinteg_type /=
'RK4' )
then 114 log_error(
"ATMOS_DYN_Tinteg_short_rk4_setup",*)
'TINTEG_TYPE is not RK4. Check!' 118 allocate( dens_rk1(
ka,
ia,
ja) )
119 allocate( momz_rk1(
ka,
ia,
ja) )
120 allocate( momx_rk1(
ka,
ia,
ja) )
121 allocate( momy_rk1(
ka,
ia,
ja) )
122 allocate( rhot_rk1(
ka,
ia,
ja) )
124 allocate( dens_rk2(
ka,
ia,
ja) )
125 allocate( momz_rk2(
ka,
ia,
ja) )
126 allocate( momx_rk2(
ka,
ia,
ja) )
127 allocate( momy_rk2(
ka,
ia,
ja) )
128 allocate( rhot_rk2(
ka,
ia,
ja) )
130 allocate( dens_rk3(
ka,
ia,
ja) )
131 allocate( momz_rk3(
ka,
ia,
ja) )
132 allocate( momx_rk3(
ka,
ia,
ja) )
133 allocate( momy_rk3(
ka,
ia,
ja) )
134 allocate( rhot_rk3(
ka,
ia,
ja) )
136 allocate( prog_rk1(
ka,
ia,
ja,max(
va,1)) )
137 allocate( prog_rk2(
ka,
ia,
ja,max(
va,1)) )
138 allocate( prog_rk3(
ka,
ia,
ja,max(
va,1)) )
139 allocate( i_comm_prog_rk1(max(
va,1)) )
140 allocate( i_comm_prog_rk2(max(
va,1)) )
141 allocate( i_comm_prog_rk3(max(
va,1)) )
149 i_comm_prog_rk1(iv) = 5 + iv
150 call comm_vars8_init(
'PROG_RK1', prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
159 i_comm_prog_rk2(iv) = 5 + iv
160 call comm_vars8_init(
'PROG_RK2', prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
169 i_comm_prog_rk3(iv) = 5 + iv
170 call comm_vars8_init(
'PROG_RK3', prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv) )
173 dens_rk1(:,:,:) = undef
174 momz_rk1(:,:,:) = undef
175 momx_rk1(:,:,:) = undef
176 momy_rk1(:,:,:) = undef
177 rhot_rk1(:,:,:) = undef
178 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
180 dens_rk2(:,:,:) = undef
181 momz_rk2(:,:,:) = undef
182 momx_rk2(:,:,:) = undef
183 momy_rk2(:,:,:) = undef
184 rhot_rk2(:,:,:) = undef
185 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
187 dens_rk3(:,:,:) = undef
188 momz_rk3(:,:,:) = undef
189 momx_rk3(:,:,:) = undef
190 momy_rk3(:,:,:) = undef
191 rhot_rk3(:,:,:) = undef
192 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
200 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
202 DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
203 DPRES0, CVtot, CORIOLI, &
204 num_diff, wdamp_coef, divdmp_coef, DDIV, &
205 FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
206 FLAG_FCT_ALONG_STREAM, &
207 CDZ, FDZ, FDX, FDY, &
208 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
209 PHI, GSQRT, J13G, J23G, J33G, MAPF, &
210 REF_pres, REF_dens, &
211 BND_W, BND_E, BND_S, BND_N, &
222 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
223 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
224 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
225 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
226 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
227 real(RP),
intent(inout) :: PROG(
ka,
ia,
ja,
va)
229 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
230 real(RP),
intent(inout) :: tflx_hi(
ka,
ia,
ja,3)
232 real(RP),
intent(in) :: DENS_t(
ka,
ia,
ja)
233 real(RP),
intent(in) :: MOMZ_t(
ka,
ia,
ja)
234 real(RP),
intent(in) :: MOMX_t(
ka,
ia,
ja)
235 real(RP),
intent(in) :: MOMY_t(
ka,
ia,
ja)
236 real(RP),
intent(in) :: RHOT_t(
ka,
ia,
ja)
238 real(RP),
intent(in) :: DPRES0(
ka,
ia,
ja)
239 real(RP),
intent(in) :: CVtot(
ka,
ia,
ja)
240 real(RP),
intent(in) :: CORIOLI(
ia,
ja)
241 real(RP),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
242 real(RP),
intent(in) :: wdamp_coef(
ka)
243 real(RP),
intent(in) :: divdmp_coef
244 real(RP),
intent(in) :: DDIV(
ka,
ia,
ja)
246 logical,
intent(in) :: FLAG_FCT_MOMENTUM
247 logical,
intent(in) :: FLAG_FCT_T
248 logical,
intent(in) :: FLAG_FCT_ALONG_STREAM
250 real(RP),
intent(in) :: CDZ (
ka)
251 real(RP),
intent(in) :: FDZ (
ka-1)
252 real(RP),
intent(in) :: FDX (
ia-1)
253 real(RP),
intent(in) :: FDY (
ja-1)
254 real(RP),
intent(in) :: RCDZ(
ka)
255 real(RP),
intent(in) :: RCDX(
ia)
256 real(RP),
intent(in) :: RCDY(
ja)
257 real(RP),
intent(in) :: RFDZ(
ka-1)
258 real(RP),
intent(in) :: RFDX(
ia-1)
259 real(RP),
intent(in) :: RFDY(
ja-1)
261 real(RP),
intent(in) :: PHI (
ka,
ia,
ja)
262 real(RP),
intent(in) :: GSQRT(
ka,
ia,
ja,7)
263 real(RP),
intent(in) :: J13G (
ka,
ia,
ja,7)
264 real(RP),
intent(in) :: J23G (
ka,
ia,
ja,7)
265 real(RP),
intent(in) :: J33G
266 real(RP),
intent(in) :: MAPF (
ia,
ja,2,4)
268 real(RP),
intent(in) :: REF_pres(
ka,
ia,
ja)
269 real(RP),
intent(in) :: REF_dens(
ka,
ia,
ja)
271 logical,
intent(in) :: BND_W
272 logical,
intent(in) :: BND_E
273 logical,
intent(in) :: BND_S
274 logical,
intent(in) :: BND_N
276 real(RP),
intent(in) :: dt
278 real(RP) :: DENS0(
ka,
ia,
ja)
279 real(RP) :: MOMZ0(
ka,
ia,
ja)
280 real(RP) :: MOMX0(
ka,
ia,
ja)
281 real(RP) :: MOMY0(
ka,
ia,
ja)
282 real(RP) :: RHOT0(
ka,
ia,
ja)
285 real(RP) :: mflx_hi_RK(
ka,
ia,
ja,3,3)
286 real(RP) :: tflx_hi_RK(
ka,
ia,
ja,3,3)
290 integer :: i, j, k, iv, n
296 dens_rk1(:,:,:) = undef
297 momz_rk1(:,:,:) = undef
298 momx_rk1(:,:,:) = undef
299 momy_rk1(:,:,:) = undef
300 rhot_rk1(:,:,:) = undef
301 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
303 dens_rk2(:,:,:) = undef
304 momz_rk2(:,:,:) = undef
305 momx_rk2(:,:,:) = undef
306 momy_rk2(:,:,:) = undef
307 rhot_rk2(:,:,:) = undef
308 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
310 dens_rk3(:,:,:) = undef
311 momz_rk3(:,:,:) = undef
312 momx_rk3(:,:,:) = undef
313 momy_rk3(:,:,:) = undef
314 rhot_rk3(:,:,:) = undef
315 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
317 mflx_hi_rk(:,:,:,:,:) = undef
318 tflx_hi_rk(:,:,:,:,:) = undef
322 mflx_hi( 1:
ks-1,:,:,:) = undef
323 mflx_hi(
ke+1:
ka ,:,:,:) = undef
337 if (
va > 0 ) prog0 = prog
342 mflx_hi_rk(k,
is-1,j,2,:) = mflx_hi(k,
is-1,j,2)
349 mflx_hi_rk(k,
ie,j,2,:) = mflx_hi(k,
ie,j,2)
356 mflx_hi_rk(k,i,
js-1,3,:) = mflx_hi(k,i,
js-1,3)
363 mflx_hi_rk(k,i,
je,3,:) = mflx_hi(k,i,
je,3)
380 call atmos_dyn_tstep( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
382 mflx_hi_rk(:,:,:,:,1), tflx_hi_rk(:,:,:,:,1), &
383 dens0, momz0, momx0, momy0, rhot0, &
384 dens, momz, momx, momy, rhot, &
385 dens_t, momz_t, momx_t, momy_t, rhot_t, &
387 dpres0, cvtot, corioli, &
388 num_diff, wdamp_coef, divdmp_coef, ddiv, &
389 flag_fct_momentum, flag_fct_t, &
390 flag_fct_along_stream, &
391 cdz, fdz, fdx, fdy, &
392 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
393 phi, gsqrt, j13g, j23g, j33g, mapf, &
394 ref_pres, ref_dens, &
395 bnd_w, bnd_e, bnd_s, bnd_n, &
403 dens0, momz0, momx0, momy0, rhot0, &
405 bnd_w, bnd_e, bnd_s, bnd_n )
409 call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
410 call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
411 call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
412 call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
413 call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
415 call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
418 call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
419 call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
420 call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
421 call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
422 call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
424 call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
433 call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
435 mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), &
436 dens0, momz0, momx0, momy0, rhot0, &
437 dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
438 dens_t, momz_t, momx_t, momy_t, rhot_t, &
440 dpres0, cvtot, corioli, &
441 num_diff, wdamp_coef, divdmp_coef, ddiv, &
442 flag_fct_momentum, flag_fct_t, &
443 flag_fct_along_stream, &
444 cdz, fdz, fdx, fdy, &
445 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
446 phi, gsqrt, j13g, j23g, j33g, mapf, &
447 ref_pres, ref_dens, &
448 bnd_w, bnd_e, bnd_s, bnd_n, &
456 dens0, momz0, momx0, momy0, rhot0, &
458 bnd_w, bnd_e, bnd_s, bnd_n )
462 call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
463 call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
464 call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
465 call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
466 call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
468 call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
471 call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
472 call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
473 call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
474 call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
475 call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
477 call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
486 call atmos_dyn_tstep( dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
488 mflx_hi_rk(:,:,:,:,3), tflx_hi_rk(:,:,:,:,3), &
489 dens0, momz0, momx0, momy0, rhot0, &
490 dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
491 dens_t, momz_t, momx_t, momy_t, rhot_t, &
493 dpres0, cvtot, corioli, &
494 num_diff, wdamp_coef, divdmp_coef, ddiv, &
495 flag_fct_momentum, flag_fct_t, &
496 flag_fct_along_stream, &
497 cdz, fdz, fdx, fdy, &
498 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
499 phi, gsqrt, j13g, j23g, j33g, mapf, &
500 ref_pres, ref_dens, &
501 bnd_w, bnd_e, bnd_s, bnd_n, &
509 dens0, momz0, momx0, momy0, rhot0, &
511 bnd_w, bnd_e, bnd_s, bnd_n )
515 call comm_vars8( dens_rk3(:,:,:), i_comm_dens_rk3 )
516 call comm_vars8( momz_rk3(:,:,:), i_comm_momz_rk3 )
517 call comm_vars8( momx_rk3(:,:,:), i_comm_momx_rk3 )
518 call comm_vars8( momy_rk3(:,:,:), i_comm_momy_rk3 )
519 call comm_vars8( rhot_rk3(:,:,:), i_comm_rhot_rk3 )
521 call comm_vars8( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv) )
524 call comm_wait ( dens_rk3(:,:,:), i_comm_dens_rk3, .false. )
525 call comm_wait ( momz_rk3(:,:,:), i_comm_momz_rk3, .false. )
526 call comm_wait ( momx_rk3(:,:,:), i_comm_momx_rk3, .false. )
527 call comm_wait ( momy_rk3(:,:,:), i_comm_momy_rk3, .false. )
528 call comm_wait ( rhot_rk3(:,:,:), i_comm_rhot_rk3, .false. )
530 call comm_wait ( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv), .false. )
539 call atmos_dyn_tstep( dens, momz, momx, momy, rhot, &
542 dens0, momz0, momx0, momy0, rhot0, &
543 dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
544 dens_t, momz_t, momx_t, momy_t, rhot_t, &
546 dpres0, cvtot, corioli, &
547 num_diff, wdamp_coef, divdmp_coef, ddiv, &
548 flag_fct_momentum, flag_fct_t, &
549 flag_fct_along_stream, &
550 cdz, fdz, fdx, fdy, &
551 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
552 phi, gsqrt, j13g, j23g, j33g, mapf, &
553 ref_pres, ref_dens, &
554 bnd_w, bnd_e, bnd_s, bnd_n, &
562 dens(k,i,j) = ( dens_rk1(k,i,j) * 2.0_rp &
563 + dens_rk2(k,i,j) * 4.0_rp &
564 + dens_rk3(k,i,j) * 2.0_rp &
566 - dens0(k,i,j) * 3.0_rp ) / 6.0_rp
574 momz(k,i,j) = ( momz_rk1(k,i,j) * 2.0_rp &
575 + momz_rk2(k,i,j) * 4.0_rp &
576 + momz_rk3(k,i,j) * 2.0_rp &
578 - momz0(k,i,j) * 3.0_rp ) / 6.0_rp
586 momx(k,i,j) = ( momx_rk1(k,i,j) * 2.0_rp &
587 + momx_rk2(k,i,j) * 4.0_rp &
588 + momx_rk3(k,i,j) * 2.0_rp &
590 - momx0(k,i,j) * 3.0_rp ) / 6.0_rp
598 momy(k,i,j) = ( momy_rk1(k,i,j) * 2.0_rp &
599 + momy_rk2(k,i,j) * 4.0_rp &
600 + momy_rk3(k,i,j) * 2.0_rp &
602 - momy0(k,i,j) * 3.0_rp ) / 6.0_rp
613 rhot(k,i,j) = ( rhot_rk1(k,i,j) * 2.0_rp &
614 + rhot_rk2(k,i,j) * 4.0_rp &
615 + rhot_rk3(k,i,j) * 2.0_rp &
617 - rhot0(k,i,j) * 3.0_rp ) / 6.0_rp
626 prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 2.0_rp &
627 + prog_rk2(k,i,j,iv) * 4.0_rp &
628 + prog_rk3(k,i,j,iv) * 2.0_rp &
630 - prog0(k,i,j,iv) * 3.0_rp ) / 6.0_rp
641 mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
642 + mflx_hi_rk(k,i,j,n,2) * 2.0_rp &
643 + mflx_hi_rk(k,i,j,n,3) * 2.0_rp &
644 + mflx_hi(k,i,j,n ) ) / 6.0_rp
654 tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
655 + tflx_hi_rk(k,i,j,n,2) * 2.0_rp &
656 + tflx_hi_rk(k,i,j,n,3) * 2.0_rp &
657 + tflx_hi(k,i,j,n ) ) / 6.0_rp
module Atmosphere / Dynamical scheme
integer, public ia
of whole cells: x, local, with HALO
subroutine, public atmos_dyn_tinteg_short_rk4(DENS, MOMZ, MOMX, MOMY, RHOT, PROG, mflx_hi, tflx_hi, DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, DPRES0, CVtot, CORIOLI, num_diff, wdamp_coef, divdmp_coef, DDIV, FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_ALONG_STREAM, CDZ, FDZ, FDX, FDY, RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, PHI, GSQRT, J13G, J23G, J33G, MAPF, REF_pres, REF_dens, BND_W, BND_E, BND_S, BND_N, dt)
RK3.
subroutine, public atmos_dyn_tinteg_short_rk4_setup(tinteg_type)
Setup.
integer, public ja
of whole cells: y, local, with HALO
subroutine, public check(current_line, v)
Undefined value checker.
real(rp), public const_undef
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
procedure(short), pointer, public atmos_dyn_tstep_short
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: 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
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
subroutine, public atmos_dyn_copy_boundary(DENS, MOMZ, MOMX, MOMY, RHOT, PROG, DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, BND_W, BND_E, BND_S, BND_N)
integer, public ka
of whole cells: z, local, with HALO
module Atmosphere / Dyn Tinteg
subroutine, public prof_rapend(rapname_base, level)
Save raptime.