RK3.
284 real(RP),
intent(inout) :: DENS(KA,IA,JA)
285 real(RP),
intent(inout) :: MOMZ(KA,IA,JA)
286 real(RP),
intent(inout) :: MOMX(KA,IA,JA)
287 real(RP),
intent(inout) :: MOMY(KA,IA,JA)
288 real(RP),
intent(inout) :: RHOT(KA,IA,JA)
289 real(RP),
intent(inout) :: PROG(KA,IA,JA,VA)
291 real(RP),
intent(inout) :: mflx_hi(KA,IA,JA,3)
292 real(RP),
intent(out) :: tflx_hi(KA,IA,JA,3)
294 real(RP),
intent(in) :: DENS_t(KA,IA,JA)
295 real(RP),
intent(in) :: MOMZ_t(KA,IA,JA)
296 real(RP),
intent(in) :: MOMX_t(KA,IA,JA)
297 real(RP),
intent(in) :: MOMY_t(KA,IA,JA)
298 real(RP),
intent(in) :: RHOT_t(KA,IA,JA)
300 real(RP),
intent(in) :: DPRES0(KA,IA,JA)
301 real(RP),
intent(in) :: CVtot(KA,IA,JA)
302 real(RP),
intent(in) :: CORIOLI(IA,JA)
303 real(RP),
intent(in) :: num_diff(KA,IA,JA,5,3)
304 real(RP),
intent(in) :: wdamp_coef(KA)
305 real(RP),
intent(in) :: divdmp_coef
306 real(RP),
intent(in) :: DDIV(KA,IA,JA)
308 logical,
intent(in) :: FLAG_FCT_MOMENTUM
309 logical,
intent(in) :: FLAG_FCT_T
310 logical,
intent(in) :: FLAG_FCT_ALONG_STREAM
312 real(RP),
intent(in) :: CDZ (KA)
313 real(RP),
intent(in) :: FDZ (KA-1)
314 real(RP),
intent(in) :: FDX (IA-1)
315 real(RP),
intent(in) :: FDY (JA-1)
316 real(RP),
intent(in) :: RCDZ(KA)
317 real(RP),
intent(in) :: RCDX(IA)
318 real(RP),
intent(in) :: RCDY(JA)
319 real(RP),
intent(in) :: RFDZ(KA-1)
320 real(RP),
intent(in) :: RFDX(IA-1)
321 real(RP),
intent(in) :: RFDY(JA-1)
323 real(RP),
intent(in) :: PHI (KA,IA,JA)
324 real(RP),
intent(in) :: GSQRT(KA,IA,JA,7)
325 real(RP),
intent(in) :: J13G (KA,IA,JA,7)
326 real(RP),
intent(in) :: J23G (KA,IA,JA,7)
327 real(RP),
intent(in) :: J33G
328 real(RP),
intent(in) :: MAPF (IA,JA,2,4)
330 real(RP),
intent(in) :: REF_pres(KA,IA,JA)
331 real(RP),
intent(in) :: REF_dens(KA,IA,JA)
333 logical,
intent(in) :: BND_W
334 logical,
intent(in) :: BND_E
335 logical,
intent(in) :: BND_S
336 logical,
intent(in) :: BND_N
337 logical,
intent(in) :: TwoD
339 real(RP),
intent(in) :: dt
341 real(RP) :: DENS0(KA,IA,JA)
342 real(RP) :: MOMZ0(KA,IA,JA)
343 real(RP) :: MOMX0(KA,IA,JA)
344 real(RP) :: MOMY0(KA,IA,JA)
345 real(RP) :: RHOT0(KA,IA,JA)
346 real(RP) :: PROG0(KA,IA,JA,VA)
348 real(RP) :: mflx_hi_RK(KA,IA,JA,3,3)
349 real(RP) :: tflx_hi_RK(KA,IA,JA,3,3)
353 integer :: i, j, k, iv, n
356 call prof_rapstart(
"DYN_RK4_Prep",3)
369 dens_rk1(:,:,:) = undef
370 momz_rk1(:,:,:) = undef
371 momx_rk1(:,:,:) = undef
372 momy_rk1(:,:,:) = undef
373 rhot_rk1(:,:,:) = undef
374 if (
va > 0 ) prog_rk1(:,:,:,:) = undef
376 dens_rk2(:,:,:) = undef
377 momz_rk2(:,:,:) = undef
378 momx_rk2(:,:,:) = undef
379 momy_rk2(:,:,:) = undef
380 rhot_rk2(:,:,:) = undef
381 if (
va > 0 ) prog_rk2(:,:,:,:) = undef
383 dens_rk3(:,:,:) = undef
384 momz_rk3(:,:,:) = undef
385 momx_rk3(:,:,:) = undef
386 momy_rk3(:,:,:) = undef
387 rhot_rk3(:,:,:) = undef
388 if (
va > 0 ) prog_rk3(:,:,:,:) = undef
390 mflx_hi_rk(:,:,:,:,:) = undef
391 tflx_hi_rk(:,:,:,:,:) = undef
397 mflx_hi( 1:
ks-1,:,:,:) = undef
398 mflx_hi(
ke+1:
ka ,:,:,:) = undef
404 dens0(:,:,:) = dens(:,:,:)
408 momz0(:,:,:) = momz(:,:,:)
412 momx0(:,:,:) = momx(:,:,:)
416 momy0(:,:,:) = momy(:,:,:)
420 rhot0(:,:,:) = rhot(:,:,:)
425 prog0(:,:,:,:) = prog(:,:,:,:)
429 if ( bnd_w .and. (.not. twod) )
then
433 mflx_hi_rk(k,
is-1,j,2,:) = mflx_hi(k,
is-1,j,2)
438 if ( bnd_e .and. (.not. twod) )
then
442 mflx_hi_rk(k,
ie,j,2,:) = mflx_hi(k,
ie,j,2)
451 mflx_hi_rk(k,i,
js-1,3,:) = mflx_hi(k,i,
js-1,3)
460 mflx_hi_rk(k,i,
je,3,:) = mflx_hi(k,i,
je,3)
466 call prof_rapend (
"DYN_RK4_Prep",3)
474 call prof_rapstart(
"DYN_RK4",3)
478 call atmos_dyn_tstep( dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
480 mflx_hi_rk(:,:,:,:,1), tflx_hi_rk(:,:,:,:,1), &
481 dens0, momz0, momx0, momy0, rhot0, &
482 dens, momz, momx, momy, rhot, &
483 dens_t, momz_t, momx_t, momy_t, rhot_t, &
485 dpres0, cvtot, corioli, &
486 num_diff, wdamp_coef, divdmp_coef, ddiv, &
487 flag_fct_momentum, flag_fct_t, &
488 flag_fct_along_stream, &
489 cdz, fdz, fdx, fdy, &
490 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
491 phi, gsqrt, j13g, j23g, j33g, mapf, &
492 ref_pres, ref_dens, &
493 bnd_w, bnd_e, bnd_s, bnd_n, twod, &
496 call prof_rapend (
"DYN_RK4",3)
497 call prof_rapstart(
"DYN_RK4_BND",3)
501 dens0, momz0, momx0, momy0, rhot0, &
503 bnd_w, bnd_e, bnd_s, bnd_n, twod )
505 call prof_rapend (
"DYN_RK4_BND",3)
507 call comm_vars8( dens_rk1(:,:,:), i_comm_dens_rk1 )
508 call comm_vars8( momz_rk1(:,:,:), i_comm_momz_rk1 )
509 call comm_vars8( momx_rk1(:,:,:), i_comm_momx_rk1 )
510 call comm_vars8( momy_rk1(:,:,:), i_comm_momy_rk1 )
511 call comm_vars8( rhot_rk1(:,:,:), i_comm_rhot_rk1 )
513 call comm_vars8( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv) )
516 call comm_wait ( dens_rk1(:,:,:), i_comm_dens_rk1, .false. )
517 call comm_wait ( momz_rk1(:,:,:), i_comm_momz_rk1, .false. )
518 call comm_wait ( momx_rk1(:,:,:), i_comm_momx_rk1, .false. )
519 call comm_wait ( momy_rk1(:,:,:), i_comm_momy_rk1, .false. )
520 call comm_wait ( rhot_rk1(:,:,:), i_comm_rhot_rk1, .false. )
522 call comm_wait ( prog_rk1(:,:,:,iv), i_comm_prog_rk1(iv), .false. )
527 call prof_rapstart(
"DYN_RK4",3)
531 call atmos_dyn_tstep( dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
533 mflx_hi_rk(:,:,:,:,2), tflx_hi_rk(:,:,:,:,2), &
534 dens0, momz0, momx0, momy0, rhot0, &
535 dens_rk1, momz_rk1, momx_rk1, momy_rk1, rhot_rk1, &
536 dens_t, momz_t, momx_t, momy_t, rhot_t, &
538 dpres0, cvtot, corioli, &
539 num_diff, wdamp_coef, divdmp_coef, ddiv, &
540 flag_fct_momentum, flag_fct_t, &
541 flag_fct_along_stream, &
542 cdz, fdz, fdx, fdy, &
543 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
544 phi, gsqrt, j13g, j23g, j33g, mapf, &
545 ref_pres, ref_dens, &
546 bnd_w, bnd_e, bnd_s, bnd_n, twod, &
549 call prof_rapend (
"DYN_RK4",3)
550 call prof_rapstart(
"DYN_RK4_BND",3)
554 dens0, momz0, momx0, momy0, rhot0, &
556 bnd_w, bnd_e, bnd_s, bnd_n, twod )
558 call prof_rapend (
"DYN_RK4_BND",3)
560 call comm_vars8( dens_rk2(:,:,:), i_comm_dens_rk2 )
561 call comm_vars8( momz_rk2(:,:,:), i_comm_momz_rk2 )
562 call comm_vars8( momx_rk2(:,:,:), i_comm_momx_rk2 )
563 call comm_vars8( momy_rk2(:,:,:), i_comm_momy_rk2 )
564 call comm_vars8( rhot_rk2(:,:,:), i_comm_rhot_rk2 )
566 call comm_vars8( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv) )
569 call comm_wait ( dens_rk2(:,:,:), i_comm_dens_rk2, .false. )
570 call comm_wait ( momz_rk2(:,:,:), i_comm_momz_rk2, .false. )
571 call comm_wait ( momx_rk2(:,:,:), i_comm_momx_rk2, .false. )
572 call comm_wait ( momy_rk2(:,:,:), i_comm_momy_rk2, .false. )
573 call comm_wait ( rhot_rk2(:,:,:), i_comm_rhot_rk2, .false. )
575 call comm_wait ( prog_rk2(:,:,:,iv), i_comm_prog_rk2(iv), .false. )
580 call prof_rapstart(
"DYN_RK4",3)
584 call atmos_dyn_tstep( dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
586 mflx_hi_rk(:,:,:,:,3), tflx_hi_rk(:,:,:,:,3), &
587 dens0, momz0, momx0, momy0, rhot0, &
588 dens_rk2, momz_rk2, momx_rk2, momy_rk2, rhot_rk2, &
589 dens_t, momz_t, momx_t, momy_t, rhot_t, &
591 dpres0, cvtot, corioli, &
592 num_diff, wdamp_coef, divdmp_coef, ddiv, &
593 flag_fct_momentum, flag_fct_t, &
594 flag_fct_along_stream, &
595 cdz, fdz, fdx, fdy, &
596 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
597 phi, gsqrt, j13g, j23g, j33g, mapf, &
598 ref_pres, ref_dens, &
599 bnd_w, bnd_e, bnd_s, bnd_n, twod, &
602 call prof_rapend (
"DYN_RK4",3)
603 call prof_rapstart(
"DYN_RK4_BND",3)
607 dens0, momz0, momx0, momy0, rhot0, &
609 bnd_w, bnd_e, bnd_s, bnd_n, twod )
611 call prof_rapend (
"DYN_RK4_BND",3)
613 call comm_vars8( dens_rk3(:,:,:), i_comm_dens_rk3 )
614 call comm_vars8( momz_rk3(:,:,:), i_comm_momz_rk3 )
615 call comm_vars8( momx_rk3(:,:,:), i_comm_momx_rk3 )
616 call comm_vars8( momy_rk3(:,:,:), i_comm_momy_rk3 )
617 call comm_vars8( rhot_rk3(:,:,:), i_comm_rhot_rk3 )
619 call comm_vars8( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv) )
622 call comm_wait ( dens_rk3(:,:,:), i_comm_dens_rk3, .false. )
623 call comm_wait ( momz_rk3(:,:,:), i_comm_momz_rk3, .false. )
624 call comm_wait ( momx_rk3(:,:,:), i_comm_momx_rk3, .false. )
625 call comm_wait ( momy_rk3(:,:,:), i_comm_momy_rk3, .false. )
626 call comm_wait ( rhot_rk3(:,:,:), i_comm_rhot_rk3, .false. )
628 call comm_wait ( prog_rk3(:,:,:,iv), i_comm_prog_rk3(iv), .false. )
633 call prof_rapstart(
"DYN_RK4",3)
637 call atmos_dyn_tstep( dens, momz, momx, momy, rhot, &
640 dens0, momz0, momx0, momy0, rhot0, &
641 dens_rk3, momz_rk3, momx_rk3, momy_rk3, rhot_rk3, &
642 dens_t, momz_t, momx_t, momy_t, rhot_t, &
644 dpres0, cvtot, corioli, &
645 num_diff, wdamp_coef, divdmp_coef, ddiv, &
646 flag_fct_momentum, flag_fct_t, &
647 flag_fct_along_stream, &
648 cdz, fdz, fdx, fdy, &
649 rcdz, rcdx, rcdy, rfdz, rfdx, rfdy, &
650 phi, gsqrt, j13g, j23g, j33g, mapf, &
651 ref_pres, ref_dens, &
652 bnd_w, bnd_e, bnd_s, bnd_n, twod, &
661 dens(k,i,j) = ( dens_rk1(k,i,j) * 2.0_rp &
662 + dens_rk2(k,i,j) * 4.0_rp &
663 + dens_rk3(k,i,j) * 2.0_rp &
665 - dens0(k,i,j) * 3.0_rp ) / 6.0_rp
675 momz(k,i,j) = ( momz_rk1(k,i,j) * 2.0_rp &
676 + momz_rk2(k,i,j) * 4.0_rp &
677 + momz_rk3(k,i,j) * 2.0_rp &
679 - momz0(k,i,j) * 3.0_rp ) / 6.0_rp
689 momx(k,i,j) = ( momx_rk1(k,i,j) * 2.0_rp &
690 + momx_rk2(k,i,j) * 4.0_rp &
691 + momx_rk3(k,i,j) * 2.0_rp &
693 - momx0(k,i,j) * 3.0_rp ) / 6.0_rp
703 momy(k,i,j) = ( momy_rk1(k,i,j) * 2.0_rp &
704 + momy_rk2(k,i,j) * 4.0_rp &
705 + momy_rk3(k,i,j) * 2.0_rp &
707 - momy0(k,i,j) * 3.0_rp ) / 6.0_rp
720 rhot(k,i,j) = ( rhot_rk1(k,i,j) * 2.0_rp &
721 + rhot_rk2(k,i,j) * 4.0_rp &
722 + rhot_rk3(k,i,j) * 2.0_rp &
724 - rhot0(k,i,j) * 3.0_rp ) / 6.0_rp
735 prog(k,i,j,iv) = ( prog_rk1(k,i,j,iv) * 2.0_rp &
736 + prog_rk2(k,i,j,iv) * 4.0_rp &
737 + prog_rk3(k,i,j,iv) * 2.0_rp &
739 - prog0(k,i,j,iv) * 3.0_rp ) / 6.0_rp
749 dens0, momz0, momx0, momy0, rhot0, &
751 bnd_w, bnd_e, bnd_s, bnd_n, twod )
758 mflx_hi(k,i,j,n) = ( mflx_hi_rk(k,i,j,n,1) &
759 + mflx_hi_rk(k,i,j,n,2) * 2.0_rp &
760 + mflx_hi_rk(k,i,j,n,3) * 2.0_rp &
761 + mflx_hi(k,i,j,n ) ) / 6.0_rp
773 tflx_hi(k,i,j,n) = ( tflx_hi_rk(k,i,j,n,1) &
774 + tflx_hi_rk(k,i,j,n,2) * 2.0_rp &
775 + tflx_hi_rk(k,i,j,n,3) * 2.0_rp &
776 + tflx_hi(k,i,j,n ) ) / 6.0_rp
785 call prof_rapend (
"DYN_RK4",3)