RK3.
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) :: wdamp_coef(KA)
246 real(RP),
intent(in) :: divdmp_coef
247 real(RP),
intent(in) :: DDIV(KA,IA,JA)
249 logical,
intent(in) :: FLAG_FCT_MOMENTUM
250 logical,
intent(in) :: FLAG_FCT_T
251 logical,
intent(in) :: FLAG_FCT_ALONG_STREAM
253 real(RP),
intent(in) :: CDZ (KA)
254 real(RP),
intent(in) :: FDZ (KA-1)
255 real(RP),
intent(in) :: FDX (IA-1)
256 real(RP),
intent(in) :: FDY (JA-1)
257 real(RP),
intent(in) :: RCDZ(KA)
258 real(RP),
intent(in) :: RCDX(IA)
259 real(RP),
intent(in) :: RCDY(JA)
260 real(RP),
intent(in) :: RFDZ(KA-1)
261 real(RP),
intent(in) :: RFDX(IA-1)
262 real(RP),
intent(in) :: RFDY(JA-1)
264 real(RP),
intent(in) :: PHI (KA,IA,JA)
265 real(RP),
intent(in) :: GSQRT(KA,IA,JA,7)
266 real(RP),
intent(in) :: J13G (KA,IA,JA,7)
267 real(RP),
intent(in) :: J23G (KA,IA,JA,7)
268 real(RP),
intent(in) :: J33G
269 real(RP),
intent(in) :: MAPF (IA,JA,2,4)
271 real(RP),
intent(in) :: REF_pres(KA,IA,JA)
272 real(RP),
intent(in) :: REF_dens(KA,IA,JA)
274 logical,
intent(in) :: BND_W
275 logical,
intent(in) :: BND_E
276 logical,
intent(in) :: BND_S
277 logical,
intent(in) :: BND_N
279 real(RP),
intent(in) :: dt
281 real(RP) :: DENS0(KA,IA,JA)
282 real(RP) :: MOMZ0(KA,IA,JA)
283 real(RP) :: MOMX0(KA,IA,JA)
284 real(RP) :: MOMY0(KA,IA,JA)
285 real(RP) :: RHOT0(KA,IA,JA)
286 real(RP) :: PROG0(KA,IA,JA,VA)
288 real(RP) :: mflx_hi_RK(KA,IA,JA,3,3)
289 real(RP) :: tflx_hi_RK(KA,IA,JA,3,3)
293 integer :: i, j, k, iv, n
296 call prof_rapstart(
"DYN_RK4_Prep",3)
299 dens_rk1(:,:,:) = undef
300 momz_rk1(:,:,:) = undef
301 momx_rk1(:,:,:) = undef
302 momy_rk1(:,:,:) = undef
303 rhot_rk1(:,:,:) = undef
304 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
306 dens_rk2(:,:,:) = undef
307 momz_rk2(:,:,:) = undef
308 momx_rk2(:,:,:) = undef
309 momy_rk2(:,:,:) = undef
310 rhot_rk2(:,:,:) = undef
311 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
313 dens_rk3(:,:,:) = undef
314 momz_rk3(:,:,:) = undef
315 momx_rk3(:,:,:) = undef
316 momy_rk3(:,:,:) = undef
317 rhot_rk3(:,:,:) = undef
318 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
320 mflx_hi_rk(:,:,:,:,:) = undef
321 tflx_hi_rk(:,:,:,:,:) = undef
325 mflx_hi( 1:
ks-1,:,:,:) = undef
326 mflx_hi(
ke+1:
ka ,:,:,:) = undef
340 if (
va > 0 ) prog0 = prog
345 mflx_hi_rk(k,
is-1,j,2,:) = mflx_hi(k,
is-1,j,2)
352 mflx_hi_rk(k,
ie,j,2,:) = mflx_hi(k,
ie,j,2)
359 mflx_hi_rk(k,i,
js-1,3,:) = mflx_hi(k,i,
js-1,3)
366 mflx_hi_rk(k,i,
je,3,:) = mflx_hi(k,i,
je,3)
371 call prof_rapend (
"DYN_RK4_Prep",3)
379 call prof_rapstart(
"DYN_RK4",3)
383 call atmos_dyn_tstep( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
385 mflx_hi_rk(:,:,:,:,1), tflx_hi_rk(:,:,:,:,1), &
386 dens0, momz0, momx0, momy0, rhot0, &
387 dens, momz, momx, momy, rhot, &
388 dens_t, momz_t, momx_t, momy_t, rhot_t, &
390 rtot, cvtot, corioli, &
391 num_diff, wdamp_coef, divdmp_coef, ddiv, &
392 flag_fct_momentum, flag_fct_t, &
393 flag_fct_along_stream, &
394 cdz, fdz, fdx, fdy, &
395 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
396 phi, gsqrt, j13g, j23g, j33g, mapf, &
397 ref_pres, ref_dens, &
398 bnd_w, bnd_e, bnd_s, bnd_n, &
401 call prof_rapend (
"DYN_RK4",3)
402 call prof_rapstart(
"DYN_RK4_BND",3)
406 dens0, momz0, momx0, momy0, rhot0, &
408 bnd_w, bnd_e, bnd_s, bnd_n )
410 call prof_rapend (
"DYN_RK4_BND",3)
412 call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
413 call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
414 call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
415 call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
416 call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
418 call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
421 call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
422 call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
423 call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
424 call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
425 call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
427 call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
432 call prof_rapstart(
"DYN_RK4",3)
436 call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
438 mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), &
439 dens0, momz0, momx0, momy0, rhot0, &
440 dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
441 dens_t, momz_t, momx_t, momy_t, rhot_t, &
443 rtot, cvtot, corioli, &
444 num_diff, wdamp_coef, divdmp_coef, ddiv, &
445 flag_fct_momentum, flag_fct_t, &
446 flag_fct_along_stream, &
447 cdz, fdz, fdx, fdy, &
448 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
449 phi, gsqrt, j13g, j23g, j33g, mapf, &
450 ref_pres, ref_dens, &
451 bnd_w, bnd_e, bnd_s, bnd_n, &
454 call prof_rapend (
"DYN_RK4",3)
455 call prof_rapstart(
"DYN_RK4_BND",3)
459 dens0, momz0, momx0, momy0, rhot0, &
461 bnd_w, bnd_e, bnd_s, bnd_n )
463 call prof_rapend (
"DYN_RK4_BND",3)
465 call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
466 call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
467 call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
468 call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
469 call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
471 call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
474 call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
475 call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
476 call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
477 call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
478 call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
480 call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
485 call prof_rapstart(
"DYN_RK4",3)
489 call atmos_dyn_tstep( dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
491 mflx_hi_rk(:,:,:,:,3), tflx_hi_rk(:,:,:,:,3), &
492 dens0, momz0, momx0, momy0, rhot0, &
493 dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
494 dens_t, momz_t, momx_t, momy_t, rhot_t, &
496 rtot, cvtot, corioli, &
497 num_diff, wdamp_coef, divdmp_coef, ddiv, &
498 flag_fct_momentum, flag_fct_t, &
499 flag_fct_along_stream, &
500 cdz, fdz, fdx, fdy, &
501 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
502 phi, gsqrt, j13g, j23g, j33g, mapf, &
503 ref_pres, ref_dens, &
504 bnd_w, bnd_e, bnd_s, bnd_n, &
507 call prof_rapend (
"DYN_RK4",3)
508 call prof_rapstart(
"DYN_RK4_BND",3)
512 dens0, momz0, momx0, momy0, rhot0, &
514 bnd_w, bnd_e, bnd_s, bnd_n )
516 call prof_rapend (
"DYN_RK4_BND",3)
518 call comm_vars8( dens_rk3(:,:,:), i_comm_dens_rk3 )
519 call comm_vars8( momz_rk3(:,:,:), i_comm_momz_rk3 )
520 call comm_vars8( momx_rk3(:,:,:), i_comm_momx_rk3 )
521 call comm_vars8( momy_rk3(:,:,:), i_comm_momy_rk3 )
522 call comm_vars8( rhot_rk3(:,:,:), i_comm_rhot_rk3 )
524 call comm_vars8( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv) )
527 call comm_wait ( dens_rk3(:,:,:), i_comm_dens_rk3, .false. )
528 call comm_wait ( momz_rk3(:,:,:), i_comm_momz_rk3, .false. )
529 call comm_wait ( momx_rk3(:,:,:), i_comm_momx_rk3, .false. )
530 call comm_wait ( momy_rk3(:,:,:), i_comm_momy_rk3, .false. )
531 call comm_wait ( rhot_rk3(:,:,:), i_comm_rhot_rk3, .false. )
533 call comm_wait ( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv), .false. )
538 call prof_rapstart(
"DYN_RK4",3)
542 call atmos_dyn_tstep( dens, momz, momx, momy, rhot, &
545 dens0, momz0, momx0, momy0, rhot0, &
546 dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
547 dens_t, momz_t, momx_t, momy_t, rhot_t, &
549 rtot, cvtot, corioli, &
550 num_diff, wdamp_coef, divdmp_coef, ddiv, &
551 flag_fct_momentum, flag_fct_t, &
552 flag_fct_along_stream, &
553 cdz, fdz, fdx, fdy, &
554 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
555 phi, gsqrt, j13g, j23g, j33g, mapf, &
556 ref_pres, ref_dens, &
557 bnd_w, bnd_e, bnd_s, bnd_n, &
565 dens(k,i,j) = ( dens_rk1(k,i,j) * 2.0_rp &
566 + dens_rk2(k,i,j) * 4.0_rp &
567 + dens_rk3(k,i,j) * 2.0_rp &
569 - dens0(k,i,j) * 3.0_rp ) / 6.0_rp
577 momz(k,i,j) = ( momz_rk1(k,i,j) * 2.0_rp &
578 + momz_rk2(k,i,j) * 4.0_rp &
579 + momz_rk3(k,i,j) * 2.0_rp &
581 - momz0(k,i,j) * 3.0_rp ) / 6.0_rp
589 momx(k,i,j) = ( momx_rk1(k,i,j) * 2.0_rp &
590 + momx_rk2(k,i,j) * 4.0_rp &
591 + momx_rk3(k,i,j) * 2.0_rp &
593 - momx0(k,i,j) * 3.0_rp ) / 6.0_rp
601 momy(k,i,j) = ( momy_rk1(k,i,j) * 2.0_rp &
602 + momy_rk2(k,i,j) * 4.0_rp &
603 + momy_rk3(k,i,j) * 2.0_rp &
605 - momy0(k,i,j) * 3.0_rp ) / 6.0_rp
616 rhot(k,i,j) = ( rhot_rk1(k,i,j) * 2.0_rp &
617 + rhot_rk2(k,i,j) * 4.0_rp &
618 + rhot_rk3(k,i,j) * 2.0_rp &
620 - rhot0(k,i,j) * 3.0_rp ) / 6.0_rp
629 prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 2.0_rp &
630 + prog_rk2(k,i,j,iv) * 4.0_rp &
631 + prog_rk3(k,i,j,iv) * 2.0_rp &
633 - prog0(k,i,j,iv) * 3.0_rp ) / 6.0_rp
644 mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
645 + mflx_hi_rk(k,i,j,n,2) * 2.0_rp &
646 + mflx_hi_rk(k,i,j,n,3) * 2.0_rp &
647 + mflx_hi(k,i,j,n ) ) / 6.0_rp
657 tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
658 + tflx_hi_rk(k,i,j,n,2) * 2.0_rp &
659 + tflx_hi_rk(k,i,j,n,3) * 2.0_rp &
660 + tflx_hi(k,i,j,n ) ) / 6.0_rp
666 call prof_rapend (
"DYN_RK4",3)
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
module Atmosphere / Dynamical scheme
integer, public ke
end point of inner domain: z, local
integer, public ka
of whole cells: z, local, with HALO
procedure(short), pointer, public atmos_dyn_tstep_short
integer, public js
start point of inner domain: y, local
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
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