15 #include "inc_openmp.h" 56 real(RP),
private,
allocatable :: dens_rk1(:,:,:)
57 real(RP),
private,
allocatable :: momz_rk1(:,:,:)
58 real(RP),
private,
allocatable :: momx_rk1(:,:,:)
59 real(RP),
private,
allocatable :: momy_rk1(:,:,:)
60 real(RP),
private,
allocatable :: rhot_rk1(:,:,:)
61 real(RP),
private,
allocatable :: prog_rk1(:,:,:,:)
62 real(RP),
private,
allocatable :: dens_rk2(:,:,:)
63 real(RP),
private,
allocatable :: momz_rk2(:,:,:)
64 real(RP),
private,
allocatable :: momx_rk2(:,:,:)
65 real(RP),
private,
allocatable :: momy_rk2(:,:,:)
66 real(RP),
private,
allocatable :: rhot_rk2(:,:,:)
67 real(RP),
private,
allocatable :: prog_rk2(:,:,:,:)
68 real(RP),
private,
allocatable :: dens_rk3(:,:,:)
69 real(RP),
private,
allocatable :: momz_rk3(:,:,:)
70 real(RP),
private,
allocatable :: momx_rk3(:,:,:)
71 real(RP),
private,
allocatable :: momy_rk3(:,:,:)
72 real(RP),
private,
allocatable :: rhot_rk3(:,:,:)
73 real(RP),
private,
allocatable :: prog_rk3(:,:,:,:)
76 integer :: i_comm_dens_rk1 = 1
77 integer :: i_comm_momz_rk1 = 2
78 integer :: i_comm_momx_rk1 = 3
79 integer :: i_comm_momy_rk1 = 4
80 integer :: i_comm_rhot_rk1 = 5
81 integer,
allocatable :: i_comm_prog_rk1(:)
83 integer :: i_comm_dens_rk2 = 1
84 integer :: i_comm_momz_rk2 = 2
85 integer :: i_comm_momx_rk2 = 3
86 integer :: i_comm_momy_rk2 = 4
87 integer :: i_comm_rhot_rk2 = 5
88 integer,
allocatable :: i_comm_prog_rk2(:)
90 integer :: i_comm_dens_rk3 = 1
91 integer :: i_comm_momz_rk3 = 2
92 integer :: i_comm_momx_rk3 = 3
93 integer :: i_comm_momy_rk3 = 4
94 integer :: i_comm_rhot_rk3 = 5
95 integer,
allocatable :: i_comm_prog_rk3(:)
111 character(len=*) :: tinteg_type
116 if ( tinteg_type /=
'RK4' )
then 117 write(*,*)
'xxx TINTEG_TYPE is not RK4. Check!' 121 allocate( dens_rk1(
ka,
ia,
ja) )
122 allocate( momz_rk1(
ka,
ia,
ja) )
123 allocate( momx_rk1(
ka,
ia,
ja) )
124 allocate( momy_rk1(
ka,
ia,
ja) )
125 allocate( rhot_rk1(
ka,
ia,
ja) )
127 allocate( dens_rk2(
ka,
ia,
ja) )
128 allocate( momz_rk2(
ka,
ia,
ja) )
129 allocate( momx_rk2(
ka,
ia,
ja) )
130 allocate( momy_rk2(
ka,
ia,
ja) )
131 allocate( rhot_rk2(
ka,
ia,
ja) )
133 allocate( dens_rk3(
ka,
ia,
ja) )
134 allocate( momz_rk3(
ka,
ia,
ja) )
135 allocate( momx_rk3(
ka,
ia,
ja) )
136 allocate( momy_rk3(
ka,
ia,
ja) )
137 allocate( rhot_rk3(
ka,
ia,
ja) )
139 allocate( prog_rk1(
ka,
ia,
ja,max(
va,1)) )
140 allocate( prog_rk2(
ka,
ia,
ja,max(
va,1)) )
141 allocate( prog_rk3(
ka,
ia,
ja,max(
va,1)) )
142 allocate( i_comm_prog_rk1(max(
va,1)) )
143 allocate( i_comm_prog_rk2(max(
va,1)) )
144 allocate( i_comm_prog_rk3(max(
va,1)) )
152 i_comm_prog_rk1(iv) = 5 + iv
162 i_comm_prog_rk2(iv) = 5 + iv
172 i_comm_prog_rk3(iv) = 5 + iv
176 dens_rk1(:,:,:) = undef
177 momz_rk1(:,:,:) = undef
178 momx_rk1(:,:,:) = undef
179 momy_rk1(:,:,:) = undef
180 rhot_rk1(:,:,:) = undef
181 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
183 dens_rk2(:,:,:) = undef
184 momz_rk2(:,:,:) = undef
185 momx_rk2(:,:,:) = undef
186 momy_rk2(:,:,:) = undef
187 rhot_rk2(:,:,:) = undef
188 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
190 dens_rk3(:,:,:) = undef
191 momz_rk3(:,:,:) = undef
192 momx_rk3(:,:,:) = undef
193 momy_rk3(:,:,:) = undef
194 rhot_rk3(:,:,:) = undef
195 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
203 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
205 DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
206 Rtot, CVtot, CORIOLI, &
207 num_diff, divdmp_coef, DDIV, &
208 FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
209 FLAG_FCT_ALONG_STREAM, &
210 CDZ, FDZ, FDX, FDY, &
211 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
212 PHI, GSQRT, J13G, J23G, J33G, MAPF, &
213 REF_pres, REF_dens, &
214 BND_W, BND_E, BND_S, BND_N, &
225 real(RP),
intent(inout) :: DENS(
ka,
ia,
ja)
226 real(RP),
intent(inout) :: MOMZ(
ka,
ia,
ja)
227 real(RP),
intent(inout) :: MOMX(
ka,
ia,
ja)
228 real(RP),
intent(inout) :: MOMY(
ka,
ia,
ja)
229 real(RP),
intent(inout) :: RHOT(
ka,
ia,
ja)
230 real(RP),
intent(inout) :: PROG(
ka,
ia,
ja,
va)
232 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
233 real(RP),
intent(inout) :: tflx_hi(
ka,
ia,
ja,3)
235 real(RP),
intent(in) :: DENS_t(
ka,
ia,
ja)
236 real(RP),
intent(in) :: MOMZ_t(
ka,
ia,
ja)
237 real(RP),
intent(in) :: MOMX_t(
ka,
ia,
ja)
238 real(RP),
intent(in) :: MOMY_t(
ka,
ia,
ja)
239 real(RP),
intent(in) :: RHOT_t(
ka,
ia,
ja)
241 real(RP),
intent(in) :: Rtot(
ka,
ia,
ja)
242 real(RP),
intent(in) :: CVtot(
ka,
ia,
ja)
243 real(RP),
intent(in) :: CORIOLI(
ia,
ja)
244 real(RP),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
245 real(RP),
intent(in) :: divdmp_coef
246 real(RP),
intent(in) :: DDIV(
ka,
ia,
ja)
248 logical,
intent(in) :: FLAG_FCT_MOMENTUM
249 logical,
intent(in) :: FLAG_FCT_T
250 logical,
intent(in) :: FLAG_FCT_ALONG_STREAM
252 real(RP),
intent(in) :: CDZ (
ka)
253 real(RP),
intent(in) :: FDZ (
ka-1)
254 real(RP),
intent(in) :: FDX (
ia-1)
255 real(RP),
intent(in) :: FDY (
ja-1)
256 real(RP),
intent(in) :: RCDZ(
ka)
257 real(RP),
intent(in) :: RCDX(
ia)
258 real(RP),
intent(in) :: RCDY(
ja)
259 real(RP),
intent(in) :: RFDZ(
ka-1)
260 real(RP),
intent(in) :: RFDX(
ia-1)
261 real(RP),
intent(in) :: RFDY(
ja-1)
263 real(RP),
intent(in) :: PHI (
ka,
ia,
ja)
264 real(RP),
intent(in) :: GSQRT(
ka,
ia,
ja,7)
265 real(RP),
intent(in) :: J13G (
ka,
ia,
ja,7)
266 real(RP),
intent(in) :: J23G (
ka,
ia,
ja,7)
267 real(RP),
intent(in) :: J33G
268 real(RP),
intent(in) :: MAPF (
ia,
ja,2,4)
270 real(RP),
intent(in) :: REF_pres(
ka,
ia,
ja)
271 real(RP),
intent(in) :: REF_dens(
ka,
ia,
ja)
273 logical,
intent(in) :: BND_W
274 logical,
intent(in) :: BND_E
275 logical,
intent(in) :: BND_S
276 logical,
intent(in) :: BND_N
278 real(RP),
intent(in) :: dt
280 real(RP) :: DENS0(
ka,
ia,
ja)
281 real(RP) :: MOMZ0(
ka,
ia,
ja)
282 real(RP) :: MOMX0(
ka,
ia,
ja)
283 real(RP) :: MOMY0(
ka,
ia,
ja)
284 real(RP) :: RHOT0(
ka,
ia,
ja)
287 real(RP) :: mflx_hi_RK(
ka,
ia,
ja,3,3)
288 real(RP) :: tflx_hi_RK(
ka,
ia,
ja,3,3)
292 integer :: i, j, k, iv, n
298 dens_rk1(:,:,:) = undef
299 momz_rk1(:,:,:) = undef
300 momx_rk1(:,:,:) = undef
301 momy_rk1(:,:,:) = undef
302 rhot_rk1(:,:,:) = undef
303 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
305 dens_rk2(:,:,:) = undef
306 momz_rk2(:,:,:) = undef
307 momx_rk2(:,:,:) = undef
308 momy_rk2(:,:,:) = undef
309 rhot_rk2(:,:,:) = undef
310 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
312 dens_rk3(:,:,:) = undef
313 momz_rk3(:,:,:) = undef
314 momx_rk3(:,:,:) = undef
315 momy_rk3(:,:,:) = undef
316 rhot_rk3(:,:,:) = undef
317 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
319 mflx_hi(:,:,:,:) = undef
320 tflx_hi(:,:,:,:) = undef
322 mflx_hi_rk(:,:,:,:,:) = undef
323 tflx_hi_rk(:,:,:,:,:) = 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), &
384 dens0, momz0, momx0, momy0, rhot0, &
385 dens, momz, momx, momy, rhot, &
386 dens_t, momz_t, momx_t, momy_t, rhot_t, &
388 rtot, cvtot, corioli, &
389 num_diff, divdmp_coef, ddiv, &
390 flag_fct_momentum, flag_fct_t, &
391 flag_fct_along_stream, &
392 cdz, fdz, fdx, fdy, &
393 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
394 phi, gsqrt, j13g, j23g, j33g, mapf, &
395 ref_pres, ref_dens, &
396 bnd_w, bnd_e, bnd_s, bnd_n, &
404 dens0, momz0, momx0, momy0, rhot0, &
406 bnd_w, bnd_e, bnd_s, bnd_n )
410 call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
411 call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
412 call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
413 call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
414 call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
416 call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
419 call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
420 call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
421 call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
422 call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
423 call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
425 call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
434 call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
436 mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), &
437 dens0, momz0, momx0, momy0, rhot0, &
438 dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
439 dens_t, momz_t, momx_t, momy_t, rhot_t, &
441 rtot, cvtot, corioli, &
442 num_diff, divdmp_coef, ddiv, &
443 flag_fct_momentum, flag_fct_t, &
444 flag_fct_along_stream, &
445 cdz, fdz, fdx, fdy, &
446 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
447 phi, gsqrt, j13g, j23g, j33g, mapf, &
448 ref_pres, ref_dens, &
449 bnd_w, bnd_e, bnd_s, bnd_n, &
457 dens0, momz0, momx0, momy0, rhot0, &
459 bnd_w, bnd_e, bnd_s, bnd_n )
463 call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
464 call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
465 call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
466 call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
467 call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
469 call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
472 call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
473 call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
474 call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
475 call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
476 call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
478 call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
487 call atmos_dyn_tstep( dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
489 mflx_hi_rk(:,:,:,:,3), tflx_hi_rk(:,:,:,:,3), &
490 dens0, momz0, momx0, momy0, rhot0, &
491 dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
492 dens_t, momz_t, momx_t, momy_t, rhot_t, &
494 rtot, cvtot, corioli, &
495 num_diff, divdmp_coef, ddiv, &
496 flag_fct_momentum, flag_fct_t, &
497 flag_fct_along_stream, &
498 cdz, fdz, fdx, fdy, &
499 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
500 phi, gsqrt, j13g, j23g, j33g, mapf, &
501 ref_pres, ref_dens, &
502 bnd_w, bnd_e, bnd_s, bnd_n, &
510 dens0, momz0, momx0, momy0, rhot0, &
512 bnd_w, bnd_e, bnd_s, bnd_n )
516 call comm_vars8( dens_rk3(:,:,:), i_comm_dens_rk3 )
517 call comm_vars8( momz_rk3(:,:,:), i_comm_momz_rk3 )
518 call comm_vars8( momx_rk3(:,:,:), i_comm_momx_rk3 )
519 call comm_vars8( momy_rk3(:,:,:), i_comm_momy_rk3 )
520 call comm_vars8( rhot_rk3(:,:,:), i_comm_rhot_rk3 )
522 call comm_vars8( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv) )
525 call comm_wait ( dens_rk3(:,:,:), i_comm_dens_rk3, .false. )
526 call comm_wait ( momz_rk3(:,:,:), i_comm_momz_rk3, .false. )
527 call comm_wait ( momx_rk3(:,:,:), i_comm_momx_rk3, .false. )
528 call comm_wait ( momy_rk3(:,:,:), i_comm_momy_rk3, .false. )
529 call comm_wait ( rhot_rk3(:,:,:), i_comm_rhot_rk3, .false. )
531 call comm_wait ( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv), .false. )
540 call atmos_dyn_tstep( dens, momz, momx, momy, rhot, &
543 dens0, momz0, momx0, momy0, rhot0, &
544 dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
545 dens_t, momz_t, momx_t, momy_t, rhot_t, &
547 rtot, cvtot, corioli, &
548 num_diff, divdmp_coef, ddiv, &
549 flag_fct_momentum, flag_fct_t, &
550 flag_fct_along_stream, &
551 cdz, fdz, fdx, fdy, &
552 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
553 phi, gsqrt, j13g, j23g, j33g, mapf, &
554 ref_pres, ref_dens, &
555 bnd_w, bnd_e, bnd_s, bnd_n, &
561 dens(k,i,j) = ( dens_rk1(k,i,j) * 2.0_rp &
562 + dens_rk2(k,i,j) * 4.0_rp &
563 + dens_rk3(k,i,j) * 2.0_rp &
565 - dens0(k,i,j) * 3.0_rp ) / 6.0_rp
573 momz(k,i,j) = ( momz_rk1(k,i,j) * 2.0_rp &
574 + momz_rk2(k,i,j) * 4.0_rp &
575 + momz_rk3(k,i,j) * 2.0_rp &
577 - momz0(k,i,j) * 3.0_rp ) / 6.0_rp
585 momx(k,i,j) = ( momx_rk1(k,i,j) * 2.0_rp &
586 + momx_rk2(k,i,j) * 4.0_rp &
587 + momx_rk3(k,i,j) * 2.0_rp &
589 - momx0(k,i,j) * 3.0_rp ) / 6.0_rp
597 momy(k,i,j) = ( momy_rk1(k,i,j) * 2.0_rp &
598 + momy_rk2(k,i,j) * 4.0_rp &
599 + momy_rk3(k,i,j) * 2.0_rp &
601 - momy0(k,i,j) * 3.0_rp ) / 6.0_rp
609 rhot(k,i,j) = ( rhot_rk1(k,i,j) * 2.0_rp &
610 + rhot_rk2(k,i,j) * 4.0_rp &
611 + rhot_rk3(k,i,j) * 2.0_rp &
613 - rhot0(k,i,j) * 3.0_rp ) / 6.0_rp
622 prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 2.0_rp &
623 + prog_rk2(k,i,j,iv) * 4.0_rp &
624 + prog_rk3(k,i,j,iv) * 2.0_rp &
626 - prog0(k,i,j,iv) * 3.0_rp ) / 6.0_rp
637 mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
638 + mflx_hi_rk(k,i,j,n,2) * 2.0_rp &
639 + mflx_hi_rk(k,i,j,n,3) * 2.0_rp &
640 + mflx_hi(k,i,j,n ) ) / 6.0_rp
650 tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
651 + tflx_hi_rk(k,i,j,n,2) * 2.0_rp &
652 + tflx_hi_rk(k,i,j,n,3) * 2.0_rp &
653 + tflx_hi(k,i,j,n ) ) / 6.0_rp
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
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, Rtot, CVtot, CORIOLI, num_diff, 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 prc_mpistop
Abort MPI.
module Atmosphere / Dynamical scheme
subroutine, public atmos_dyn_tinteg_short_rk4_setup(tinteg_type)
Setup.
integer, public ke
end point of inner domain: z, local
subroutine, public check(current_line, v)
Undefined value checker.
real(rp), public const_undef
integer, public ia
of x whole cells (local, with HALO)
subroutine, public comm_vars8_init(var, vid)
Register variables.
integer, public ka
of z whole cells (local, with HALO)
procedure(short), pointer, public atmos_dyn_tstep_short
integer, public js
start point of inner domain: y, local
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, 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 ie
end point of inner domain: x, local
module Atmosphere / Dyn Tinteg
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
integer, public ja
of y whole cells (local, with HALO)