35 use fv_mp_nlm_mod,
only: is, ie, js, je, isd, ied, jsd, jed, isc, iec, jsc, jec
51 real,
allocatable ::
rf(:),
rw(:)
76 & u_tl, v, v_tl, w, pt, delp, delz, q, uc, uc_tl, vc, vc_tl, pkz, &
77 & nested, inline_q, make_nh, ng, gridstruct, flagstruct, neststruct, &
78 & nest_timestep, tracer_nest_timestep, domain, bd, nwat)
81 REAL,
INTENT(IN) :: zvir
82 INTEGER,
INTENT(IN) :: npx, npy, npz
83 INTEGER,
INTENT(IN) :: ncnst, ng, nwat
84 LOGICAL,
INTENT(IN) :: inline_q, make_nh, nested
86 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
88 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
91 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
93 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
96 REAL,
INTENT(INOUT) :: w(bd%isd:, bd%jsd:, :)
98 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
100 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
102 REAL,
INTENT(INOUT) :: delz(bd%isd:, bd%jsd:, :)
104 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
106 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
107 REAL,
INTENT(INOUT) :: uc_tl(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
108 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
109 REAL,
INTENT(INOUT) :: vc_tl(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
111 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
112 INTEGER,
INTENT(INOUT) :: nest_timestep, tracer_nest_timestep
116 TYPE(
domain2d),
INTENT(INOUT) :: domain
117 REAL :: divg(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
118 REAL :: ua(bd%isd:bd%ied, bd%jsd:bd%jed)
119 REAL :: va(bd%isd:bd%ied, bd%jsd:bd%jed)
120 REAL :: pkz_coarse(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
121 INTEGER :: i, j, k, n, p, sphum
125 LOGICAL,
POINTER :: child_grids(:)
126 INTEGER :: is, ie, js, je
127 INTEGER :: isd, ied, jsd, jed
139 child_grids => neststruct%child_grids
143 IF (.NOT.inline_q) tracer_nest_timestep = 0
144 IF (neststruct%nested .AND. ((.NOT.neststruct%first_step) .OR. &
147 CALL set_bcs_t0(ncnst, flagstruct%hydrostatic, neststruct)
154 IF (any(neststruct%child_grids))
THEN 159 & dgrid_ne, complete=.true.)
167 CALL d2c_setup_tlm(u(isd, jsd, k), u_tl(isd, jsd, k), v(isd, jsd&
168 & , k), v_tl(isd, jsd, k), ua, va, uc(isd, jsd, k), &
169 & uc_tl(isd, jsd, k), vc(isd, jsd, k), vc_tl(isd, jsd&
170 & , k), flagstruct%nord .GT. 0, isd, ied, jsd, jed, &
171 & is, ie, js, je, npx, npy, gridstruct%grid_type, &
172 & gridstruct%nested, gridstruct%se_corner, gridstruct&
173 & %sw_corner, gridstruct%ne_corner, gridstruct%&
174 & nw_corner, gridstruct%rsin_u, gridstruct%rsin_v, &
175 & gridstruct%cosa_s, gridstruct%rsin2)
178 & , va, divg(isd, jsd, k), gridstruct, &
182 & , divg(isd, jsd, k), gridstruct, flagstruct, &
190 IF (flagstruct%hydrostatic)
THEN 195 pkz_coarse(i, j, k) = pkz(i, j, k)
201 IF (neststruct%nested)
THEN 202 IF (.NOT.
ALLOCATED(
q_buf))
THEN 203 ALLOCATE(
q_buf(ncnst))
213 IF (flagstruct%hydrostatic)
THEN 215 & jsd, jed, npx, npy, npz, ng, 0, 0, 0, &
237 DO p=1,
SIZE(child_grids)
238 IF (child_grids(p))
THEN 243 & nest_domain_all(p), 0, 0)
247 IF (flagstruct%hydrostatic)
THEN 250 & nest_domain_all(p), 0, 0)
270 & ind_h, neststruct%wt_h, 0, 0, npx, npy, &
271 & npz, bd, neststruct%delp_bc,
delp_buf, &
275 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
276 & , npz, bd, neststruct%q_bc(n),
q_buf(n)&
280 & ind_h, neststruct%wt_h, 0, 0, npx, npy, &
281 & npz, bd, neststruct%pt_bc,
pt_buf)
283 IF (flagstruct%hydrostatic)
THEN 285 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
287 CALL setup_pt_bc(neststruct%pt_bc, pkz_bc, neststruct%q_bc(sphum&
288 & ), npx, npy, npz, zvir, bd)
291 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
292 & , npz, bd, neststruct%w_bc,
w_buf)
294 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
295 & , npz, bd, neststruct%delz_bc,
delz_buf)
298 & neststruct%delz_bc, neststruct%q_bc(sphum), &
299 & neststruct%q_bc, ncnst, npx, npy, npz, zvir, bd)
302 & ind_u, neststruct%wt_u, 0, 1, npx, npy, &
303 & npz, bd, neststruct%u_bc,
u_buf)
305 & ind_u, neststruct%wt_u, 0, 1, npx, npy, &
306 & npz, bd, neststruct%vc_bc,
vc_buf)
308 & ind_v, neststruct%wt_v, 1, 0, npx, npy, &
309 & npz, bd, neststruct%v_bc,
v_buf)
311 & ind_v, neststruct%wt_v, 1, 0, npx, npy, &
312 & npz, bd, neststruct%uc_bc,
uc_buf)
314 & ind_b, neststruct%wt_b, 1, 1, npx, npy, &
315 & npz, bd, neststruct%divg_bc,
divg_buf)
317 IF (neststruct%first_step)
THEN 318 IF (neststruct%nested)
CALL set_bcs_t0(ncnst, flagstruct%&
319 & hydrostatic, neststruct)
320 neststruct%first_step = .false.
321 IF (.NOT.flagstruct%hydrostatic) flagstruct%make_nh = .false.
322 ELSE IF (flagstruct%make_nh)
THEN 324 flagstruct%make_nh = .false.
339 & pt, delp, delz, q, uc, vc, pkz, nested, inline_q, make_nh, ng, &
340 & gridstruct, flagstruct, neststruct, nest_timestep, &
341 & tracer_nest_timestep, domain, bd, nwat)
344 REAL,
INTENT(IN) :: zvir
345 INTEGER,
INTENT(IN) :: npx, npy, npz
346 INTEGER,
INTENT(IN) :: ncnst, ng, nwat
347 LOGICAL,
INTENT(IN) :: inline_q, make_nh, nested
349 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
352 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
355 REAL,
INTENT(INOUT) :: w(bd%isd:, bd%jsd:, :)
357 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
359 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
361 REAL,
INTENT(INOUT) :: delz(bd%isd:, bd%jsd:, :)
363 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
365 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
366 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
368 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
369 INTEGER,
INTENT(INOUT) :: nest_timestep, tracer_nest_timestep
373 TYPE(
domain2d),
INTENT(INOUT) :: domain
374 REAL :: divg(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
375 REAL :: ua(bd%isd:bd%ied, bd%jsd:bd%jed)
376 REAL :: va(bd%isd:bd%ied, bd%jsd:bd%jed)
377 REAL :: pkz_coarse(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
378 INTEGER :: i, j, k, n, p, sphum
382 LOGICAL,
POINTER :: child_grids(:)
383 INTEGER :: is, ie, js, je
384 INTEGER :: isd, ied, jsd, jed
396 child_grids => neststruct%child_grids
400 IF (.NOT.inline_q) tracer_nest_timestep = 0
401 IF (neststruct%nested .AND. ((.NOT.neststruct%first_step) .OR. &
404 CALL set_bcs_t0(ncnst, flagstruct%hydrostatic, neststruct)
411 IF (any(neststruct%child_grids))
THEN 422 CALL d2c_setup(u(isd, jsd, k), v(isd, jsd, k), ua, va, uc(isd, &
423 & jsd, k), vc(isd, jsd, k), flagstruct%nord .GT. 0, isd, &
424 & ied, jsd, jed, is, ie, js, je, npx, npy, gridstruct%&
425 &
grid_type, gridstruct%nested, gridstruct%se_corner, &
426 & gridstruct%sw_corner, gridstruct%ne_corner, gridstruct%&
427 & nw_corner, gridstruct%rsin_u, gridstruct%rsin_v, &
428 & gridstruct%cosa_s, gridstruct%rsin2)
431 & , va, divg(isd, jsd, k), gridstruct, &
435 & , divg(isd, jsd, k), gridstruct, flagstruct, &
440 IF (flagstruct%hydrostatic)
THEN 445 pkz_coarse(i, j, k) = pkz(i, j, k)
451 IF (neststruct%nested)
THEN 452 IF (.NOT.
ALLOCATED(
q_buf))
THEN 453 ALLOCATE(
q_buf(ncnst))
463 IF (flagstruct%hydrostatic)
THEN 465 & jsd, jed, npx, npy, npz, ng, 0, 0, 0, &
487 DO p=1,
SIZE(child_grids)
488 IF (child_grids(p))
THEN 493 & nest_domain_all(p), 0, 0)
497 IF (flagstruct%hydrostatic)
THEN 500 & nest_domain_all(p), 0, 0)
520 & ind_h, neststruct%wt_h, 0, 0, npx, npy, &
521 & npz, bd, neststruct%delp_bc,
delp_buf, &
525 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
526 & , npz, bd, neststruct%q_bc(n),
q_buf(n)&
530 & ind_h, neststruct%wt_h, 0, 0, npx, npy, &
531 & npz, bd, neststruct%pt_bc,
pt_buf)
533 IF (flagstruct%hydrostatic)
THEN 535 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
537 CALL setup_pt_bc(neststruct%pt_bc, pkz_bc, neststruct%q_bc(sphum&
538 & ), npx, npy, npz, zvir, bd)
541 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
542 & , npz, bd, neststruct%w_bc,
w_buf)
544 & %ind_h, neststruct%wt_h, 0, 0, npx, npy&
545 & , npz, bd, neststruct%delz_bc,
delz_buf)
548 & neststruct%delz_bc, neststruct%q_bc(sphum), &
549 & neststruct%q_bc, ncnst, npx, npy, npz, zvir, bd)
552 & ind_u, neststruct%wt_u, 0, 1, npx, npy, &
553 & npz, bd, neststruct%u_bc,
u_buf)
555 & ind_u, neststruct%wt_u, 0, 1, npx, npy, &
556 & npz, bd, neststruct%vc_bc,
vc_buf)
558 & ind_v, neststruct%wt_v, 1, 0, npx, npy, &
559 & npz, bd, neststruct%v_bc,
v_buf)
561 & ind_v, neststruct%wt_v, 1, 0, npx, npy, &
562 & npz, bd, neststruct%uc_bc,
uc_buf)
564 & ind_b, neststruct%wt_b, 1, 1, npx, npy, &
565 & npz, bd, neststruct%divg_bc,
divg_buf)
567 IF (neststruct%first_step)
THEN 568 IF (neststruct%nested)
CALL set_bcs_t0(ncnst, flagstruct%&
569 & hydrostatic, neststruct)
570 neststruct%first_step = .false.
571 IF (.NOT.flagstruct%hydrostatic) flagstruct%make_nh = .false.
572 ELSE IF (flagstruct%make_nh)
THEN 574 flagstruct%make_nh = .false.
586 SUBROUTINE setup_pt_bc(pt_bc, pkz_bc, sphum_bc, npx, npy, npz, zvir, &
589 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
590 TYPE(FV_NEST_BC_TYPE_3D),
INTENT(IN),
TARGET :: pkz_bc, sphum_bc
591 TYPE(FV_NEST_BC_TYPE_3D),
INTENT(INOUT),
TARGET :: pt_bc
592 INTEGER,
INTENT(IN) :: npx, npy, npz
593 REAL,
INTENT(IN) :: zvir
594 REAL,
DIMENSION(:, :, :),
POINTER :: ptbc, pkzbc, sphumbc
595 INTEGER :: i, j, k, istart, iend
596 INTEGER :: is, ie, js, je
597 INTEGER :: isd, ied, jsd, jed
607 ptbc => pt_bc%west_t1
608 pkzbc => pkz_bc%west_t1
609 sphumbc => sphum_bc%west_t1
614 ptbc(i, j, k) = ptbc(i, j, k)/pkzbc(i, j, k)*(1.+zvir*&
621 ptbc => pt_bc%south_t1
622 pkzbc => pkz_bc%south_t1
623 sphumbc => sphum_bc%south_t1
629 IF (ie .EQ. npx - 1)
THEN 638 ptbc(i, j, k) = ptbc(i, j, k)/pkzbc(i, j, k)*(1.+zvir*&
644 IF (ie .EQ. npx - 1)
THEN 645 ptbc => pt_bc%east_t1
646 pkzbc => pkz_bc%east_t1
647 sphumbc => sphum_bc%east_t1
652 ptbc(i, j, k) = ptbc(i, j, k)/pkzbc(i, j, k)*(1.+zvir*&
658 IF (je .EQ. npy - 1)
THEN 659 ptbc => pt_bc%north_t1
660 pkzbc => pkz_bc%north_t1
661 sphumbc => sphum_bc%north_t1
667 IF (ie .EQ. npx - 1)
THEN 676 ptbc(i, j, k) = ptbc(i, j, k)/pkzbc(i, j, k)*(1.+zvir*&
683 SUBROUTINE setup_pt_nh_bc(pt_bc, delp_bc, delz_bc, sphum_bc, q_bc, nq&
684 & , npx, npy, npz, zvir, bd)
686 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
687 TYPE(FV_NEST_BC_TYPE_3D),
INTENT(IN),
TARGET :: delp_bc, delz_bc, &
689 TYPE(FV_NEST_BC_TYPE_3D),
INTENT(INOUT),
TARGET :: pt_bc
690 INTEGER,
INTENT(IN) :: nq
691 TYPE(FV_NEST_BC_TYPE_3D),
INTENT(IN),
TARGET :: q_bc(nq)
692 INTEGER,
INTENT(IN) :: npx, npy, npz
693 REAL,
INTENT(IN) :: zvir
695 REAL,
PARAMETER :: c_liq=4185.5
697 REAL,
PARAMETER :: c_ice=1972.
700 REAL,
DIMENSION(:, :, :),
POINTER :: ptbc, sphumbc, qconbc, delpbc, &
702 REAL,
DIMENSION(:, :, :),
POINTER :: liq_watbc_west, ice_watbc_west&
703 & , rainwatbc_west, snowwatbc_west, graupelbc_west
704 REAL,
DIMENSION(:, :, :),
POINTER :: liq_watbc_east, ice_watbc_east&
705 & , rainwatbc_east, snowwatbc_east, graupelbc_east
706 REAL,
DIMENSION(:, :, :),
POINTER :: liq_watbc_north, &
707 & ice_watbc_north, rainwatbc_north, snowwatbc_north, graupelbc_north
708 REAL,
DIMENSION(:, :, :),
POINTER :: liq_watbc_south, &
709 & ice_watbc_south, rainwatbc_south, snowwatbc_south, graupelbc_south
710 REAL :: dp1, q_liq, q_sol
711 REAL,
SAVE :: q_con=0.
716 INTEGER :: i, j, k, istart, iend
717 INTEGER :: liq_wat, ice_wat, rainwat, snowwat, graupel
719 REAL,
PARAMETER :: tice=273.16
720 REAL,
PARAMETER :: t_i0=15.
721 INTEGER :: is, ie, js, je
722 INTEGER :: isd, ied, jsd, jed
745 ALLOCATE(
dum_west(isd:0, jsd:jed, npz))
769 IF (ie .EQ. npx - 1)
THEN 771 ALLOCATE(
dum_east(npx:ied, jsd:jed, npz))
782 IF (je .EQ. npy - 1)
THEN 784 ALLOCATE(
dum_north(isd:ied, npy:jed, npz))
795 IF (liq_wat .GT. 0)
THEN 796 liq_watbc_west => q_bc(liq_wat)%west_t1
797 liq_watbc_east => q_bc(liq_wat)%east_t1
798 liq_watbc_north => q_bc(liq_wat)%north_t1
799 liq_watbc_south => q_bc(liq_wat)%south_t1
806 IF (ice_wat .GT. 0)
THEN 807 ice_watbc_west => q_bc(ice_wat)%west_t1
808 ice_watbc_east => q_bc(ice_wat)%east_t1
809 ice_watbc_north => q_bc(ice_wat)%north_t1
810 ice_watbc_south => q_bc(ice_wat)%south_t1
817 IF (rainwat .GT. 0)
THEN 818 rainwatbc_west => q_bc(rainwat)%west_t1
819 rainwatbc_east => q_bc(rainwat)%east_t1
820 rainwatbc_north => q_bc(rainwat)%north_t1
821 rainwatbc_south => q_bc(rainwat)%south_t1
828 IF (snowwat .GT. 0)
THEN 829 snowwatbc_west => q_bc(snowwat)%west_t1
830 snowwatbc_east => q_bc(snowwat)%east_t1
831 snowwatbc_north => q_bc(snowwat)%north_t1
832 snowwatbc_south => q_bc(snowwat)%south_t1
839 IF (graupel .GT. 0)
THEN 840 graupelbc_west => q_bc(graupel)%west_t1
841 graupelbc_east => q_bc(graupel)%east_t1
842 graupelbc_north => q_bc(graupel)%north_t1
843 graupelbc_south => q_bc(graupel)%south_t1
851 ptbc => pt_bc%west_t1
852 sphumbc => sphum_bc%west_t1
853 delpbc => delp_bc%west_t1
854 delzbc => delz_bc%west_t1
862 dp1 = zvir*sphumbc(i, j, k)
863 arg1 = rdg*delpbc(i, j, k)*ptbc(i, j, k)*(1.+dp1)/delzbc(i, &
865 arg2 =
kappa*log(arg1)
867 ptbc(i, j, k) = ptbc(i, j, k)*(1.+dp1)/pkz
873 ptbc => pt_bc%south_t1
874 sphumbc => sphum_bc%south_t1
875 delpbc => delp_bc%south_t1
876 delzbc => delz_bc%south_t1
882 IF (ie .EQ. npx - 1)
THEN 895 dp1 = zvir*sphumbc(i, j, k)
896 arg1 = rdg*delpbc(i, j, k)*ptbc(i, j, k)*(1.+dp1)/delzbc(i, &
898 arg2 =
kappa*log(arg1)
900 ptbc(i, j, k) = ptbc(i, j, k)*(1.+dp1)/pkz
905 IF (ie .EQ. npx - 1)
THEN 906 ptbc => pt_bc%east_t1
907 sphumbc => sphum_bc%east_t1
908 delpbc => delp_bc%east_t1
909 delzbc => delz_bc%east_t1
917 dp1 = zvir*sphumbc(i, j, k)
918 arg1 = rdg*delpbc(i, j, k)*ptbc(i, j, k)*(1.+dp1)/delzbc(i, &
920 arg2 =
kappa*log(arg1)
922 ptbc(i, j, k) = ptbc(i, j, k)*(1.+dp1)/pkz
927 IF (je .EQ. npy - 1)
THEN 928 ptbc => pt_bc%north_t1
929 sphumbc => sphum_bc%north_t1
930 delpbc => delp_bc%north_t1
931 delzbc => delz_bc%north_t1
937 IF (ie .EQ. npx - 1)
THEN 949 dp1 = zvir*sphumbc(i, j, k)
950 arg1 = rdg*delpbc(i, j, k)*ptbc(i, j, k)*(1.+dp1)/delzbc(i, &
952 arg2 =
kappa*log(arg1)
954 ptbc(i, j, k) = ptbc(i, j, k)*(1.+dp1)/pkz
962 TYPE(FV_NEST_TYPE),
INTENT(INOUT) :: neststruct
963 neststruct%delz_bc%east_t0 = neststruct%delz_bc%east_t1
964 neststruct%delz_bc%west_t0 = neststruct%delz_bc%west_t1
965 neststruct%delz_bc%north_t0 = neststruct%delz_bc%north_t1
966 neststruct%delz_bc%south_t0 = neststruct%delz_bc%south_t1
967 neststruct%w_bc%east_t0 = neststruct%w_bc%east_t1
968 neststruct%w_bc%west_t0 = neststruct%w_bc%west_t1
969 neststruct%w_bc%north_t0 = neststruct%w_bc%north_t1
970 neststruct%w_bc%south_t0 = neststruct%w_bc%south_t1
972 SUBROUTINE set_bcs_t0(ncnst, hydrostatic, neststruct)
974 INTEGER,
INTENT(IN) :: ncnst
975 LOGICAL,
INTENT(IN) :: hydrostatic
976 TYPE(FV_NEST_TYPE),
INTENT(INOUT) :: neststruct
978 neststruct%delp_bc%east_t0 = neststruct%delp_bc%east_t1
979 neststruct%delp_bc%west_t0 = neststruct%delp_bc%west_t1
980 neststruct%delp_bc%north_t0 = neststruct%delp_bc%north_t1
981 neststruct%delp_bc%south_t0 = neststruct%delp_bc%south_t1
983 neststruct%q_bc(n)%east_t0 = neststruct%q_bc(n)%east_t1
984 neststruct%q_bc(n)%west_t0 = neststruct%q_bc(n)%west_t1
985 neststruct%q_bc(n)%north_t0 = neststruct%q_bc(n)%north_t1
986 neststruct%q_bc(n)%south_t0 = neststruct%q_bc(n)%south_t1
988 neststruct%pt_bc%east_t0 = neststruct%pt_bc%east_t1
989 neststruct%pt_bc%west_t0 = neststruct%pt_bc%west_t1
990 neststruct%pt_bc%north_t0 = neststruct%pt_bc%north_t1
991 neststruct%pt_bc%south_t0 = neststruct%pt_bc%south_t1
992 neststruct%pt_bc%east_t0 = neststruct%pt_bc%east_t1
993 neststruct%pt_bc%west_t0 = neststruct%pt_bc%west_t1
994 neststruct%pt_bc%north_t0 = neststruct%pt_bc%north_t1
995 neststruct%pt_bc%south_t0 = neststruct%pt_bc%south_t1
997 neststruct%u_bc%east_t0 = neststruct%u_bc%east_t1
998 neststruct%u_bc%west_t0 = neststruct%u_bc%west_t1
999 neststruct%u_bc%north_t0 = neststruct%u_bc%north_t1
1000 neststruct%u_bc%south_t0 = neststruct%u_bc%south_t1
1001 neststruct%v_bc%east_t0 = neststruct%v_bc%east_t1
1002 neststruct%v_bc%west_t0 = neststruct%v_bc%west_t1
1003 neststruct%v_bc%north_t0 = neststruct%v_bc%north_t1
1004 neststruct%v_bc%south_t0 = neststruct%v_bc%south_t1
1005 neststruct%vc_bc%east_t0 = neststruct%vc_bc%east_t1
1006 neststruct%vc_bc%west_t0 = neststruct%vc_bc%west_t1
1007 neststruct%vc_bc%north_t0 = neststruct%vc_bc%north_t1
1008 neststruct%vc_bc%south_t0 = neststruct%vc_bc%south_t1
1009 neststruct%uc_bc%east_t0 = neststruct%uc_bc%east_t1
1010 neststruct%uc_bc%west_t0 = neststruct%uc_bc%west_t1
1011 neststruct%uc_bc%north_t0 = neststruct%uc_bc%north_t1
1012 neststruct%uc_bc%south_t0 = neststruct%uc_bc%south_t1
1013 neststruct%divg_bc%east_t0 = neststruct%divg_bc%east_t1
1014 neststruct%divg_bc%west_t0 = neststruct%divg_bc%west_t1
1015 neststruct%divg_bc%north_t0 = neststruct%divg_bc%north_t1
1016 neststruct%divg_bc%south_t0 = neststruct%divg_bc%south_t1
1039 INTEGER,
INTENT(IN) :: ngrids
1041 LOGICAL,
INTENT(IN) :: grids_on_this_pe(ngrids)
1042 REAL,
INTENT(IN) :: zvir
1043 INTEGER :: n, p, sphum
1045 IF (ngrids .GT. 1)
THEN 1049 IF (atm(n)%neststruct%twowaynest)
THEN 1050 IF (grids_on_this_pe(n) .OR. grids_on_this_pe(atm(n)%&
1051 & parent_grid%grid_number))
THEN 1054 & zvir, atm(n)%ncnst, sphum, atm(n)%u, atm(n&
1055 & )%v, atm(n)%w, atm(n)%omga, atm(n)%pt, atm&
1056 & (n)%delp, atm(n)%q, atm(n)%uc, atm(n)%vc, &
1057 & atm(n)%pkz, atm(n)%delz, atm(n)%ps, atm(n)&
1058 & %ptop, atm(n)%gridstruct, atm(n)%&
1059 & flagstruct, atm(n)%neststruct, atm(n)%&
1060 & parent_grid, atm(n)%bd, .false.)
1066 IF (atm(n)%neststruct%parent_of_twoway .AND. grids_on_this_pe(n)&
1068 & npz, atm(n)%ng, atm(n)%ncnst, atm(n)%u&
1069 & , atm(n)%v, atm(n)%w, atm(n)%delz, atm&
1070 & (n)%pt, atm(n)%delp, atm(n)%q, atm(n)%&
1071 & ps, atm(n)%pe, atm(n)%pk, atm(n)%peln&
1072 & , atm(n)%pkz, atm(n)%phis, atm(n)%ua, &
1073 & atm(n)%va, atm(n)%ptop, atm(n)%&
1074 & gridstruct, atm(n)%flagstruct, atm(n)%&
1075 & domain, atm(n)%bd)
1082 & , w, omga, pt, delp, q, uc, vc, pkz, delz, ps, ptop, gridstruct, &
1083 & flagstruct, neststruct, parent_grid, bd, conv_theta_in)
1085 REAL,
INTENT(IN) :: zvir, ptop
1086 INTEGER,
INTENT(IN) :: npx, npy, npz
1087 INTEGER,
INTENT(IN) :: ncnst, sphum
1088 LOGICAL,
INTENT(IN),
OPTIONAL :: conv_theta_in
1089 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
1091 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
1094 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
1097 REAL,
INTENT(INOUT) :: w(bd%isd:, bd%jsd:, :)
1099 REAL,
INTENT(INOUT) :: omga(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1101 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1103 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1105 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
1107 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
1108 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
1110 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
1112 REAL,
INTENT(INOUT) :: delz(bd%isd:, bd%jsd:, :)
1114 REAL,
INTENT(INOUT) :: ps(bd%isd:bd%ied, bd%jsd:bd%jed)
1115 TYPE(FV_GRID_TYPE),
INTENT(INOUT) :: gridstruct
1116 TYPE(FV_FLAGS_TYPE),
INTENT(INOUT) :: flagstruct
1117 TYPE(FV_NEST_TYPE),
INTENT(INOUT) :: neststruct
1118 TYPE(FV_ATMOS_TYPE),
INTENT(INOUT) :: parent_grid
1119 REAL,
ALLOCATABLE :: t_nest(:, :, :), ps0(:, :)
1120 INTEGER :: i, j, k, n
1121 INTEGER :: isd_p, ied_p, jsd_p, jed_p, isc_p, iec_p, jsc_p, jec_p
1122 INTEGER :: isg, ieg, jsg, jeg, npx_p, npy_p
1123 INTEGER :: istart, iend
1124 REAL :: qmass_b, qmass_a
1125 REAL,
SAVE :: fix=1.
1127 LOGICAL,
SAVE :: conv_theta=.true.
1128 REAL :: qdp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1129 REAL,
ALLOCATABLE :: qdp_coarse(:, :, :)
1130 REAL(kind=f_p),
ALLOCATABLE :: q_diff(:, :, :)
1131 REAL :: l_sum_b(npz), l_sum_a(npz)
1133 INTEGER :: is, ie, js, je
1134 INTEGER :: isd, ied, jsd, jed
1135 INTEGER :: isu, ieu, jsu, jeu
1146 isu = neststruct%isu
1147 ieu = neststruct%ieu
1148 jsu = neststruct%jsu
1149 jeu = neststruct%jeu
1150 upoff = neststruct%upoff
1153 IF (
PRESENT(conv_theta_in)) conv_theta = conv_theta_in
1154 IF (.NOT.neststruct%parent_proc .AND. (.NOT.neststruct%child_proc)) &
1163 IF (neststruct%nestupdate .LT. 3)
THEN 1165 & nest_domain, neststruct%ind_update_h, &
1166 & gridstruct%dx, gridstruct%dy, gridstruct%area&
1167 & , isd_p, ied_p, jsd_p, jed_p, isd, ied, jsd, &
1168 & jed, neststruct%isu, neststruct%ieu, &
1169 & neststruct%jsu, neststruct%jeu, npx, npy, npz&
1170 & , 0, 0, neststruct%refinement, neststruct%&
1171 & nestupdate, upoff, 0, neststruct%parent_proc, &
1172 & neststruct%child_proc, parent_grid)
1177 IF (neststruct%nestupdate .NE. 3 .AND. neststruct%nestupdate .NE. &
1178 & 7 .AND. neststruct%nestupdate .NE. 8)
THEN 1179 ALLOCATE(qdp_coarse(isd_p:ied_p, jsd_p:jed_p, npz))
1180 IF (parent_grid%flagstruct%nwat .GT. 0)
THEN 1181 ALLOCATE(q_diff(isd_p:ied_p, jsd_p:jed_p, npz))
1184 DO n=1,parent_grid%flagstruct%nwat
1186 IF (neststruct%child_proc)
THEN 1190 qdp(i, j, k) = q(i, j, k, n)*delp(i, j, k)
1197 IF (neststruct%parent_proc)
THEN 1202 qdp_coarse(i, j, k) = parent_grid%q(i, j, k, n)*&
1203 & parent_grid%delp(i, j, k)
1207 CALL level_sum(qdp_coarse, parent_grid%gridstruct%area, &
1208 & parent_grid%domain, parent_grid%bd, npz, l_sum_b)
1212 IF (neststruct%parent_proc)
THEN 1213 IF (n .LE. parent_grid%flagstruct%nwat)
THEN 1217 q_diff(i, j, k) = q_diff(i, j, k) - qdp_coarse(i, j&
1225 & nest_domain, neststruct%ind_update_h, &
1226 & gridstruct%dx, gridstruct%dy, gridstruct%&
1227 & area, isd_p, ied_p, jsd_p, jed_p, isd, ied, &
1228 & jsd, jed, neststruct%isu, neststruct%ieu, &
1229 & neststruct%jsu, neststruct%jeu, npx, npy, &
1230 & npz, 0, 0, neststruct%refinement, neststruct&
1231 & %nestupdate, upoff, 0, neststruct%&
1232 & parent_proc, neststruct%child_proc, &
1236 IF (neststruct%parent_proc)
THEN 1237 CALL level_sum(qdp_coarse, parent_grid%gridstruct%area, &
1238 & parent_grid%domain, parent_grid%bd, npz, l_sum_a)
1240 IF (l_sum_a(k) .GT. 0.)
THEN 1241 fix = l_sum_b(k)/l_sum_a(k)
1245 parent_grid%q(i, j, k, n) = qdp_coarse(i, j, k)*fix
1252 IF (neststruct%parent_proc)
THEN 1253 IF (n .LE. parent_grid%flagstruct%nwat)
THEN 1257 q_diff(i, j, k) = q_diff(i, j, k) + parent_grid%q(i&
1265 IF (neststruct%parent_proc)
THEN 1266 IF (parent_grid%flagstruct%nwat .GT. 0)
THEN 1270 parent_grid%delp(i, j, k) = parent_grid%delp(i, j, k) &
1276 DO n=1,parent_grid%flagstruct%nwat
1280 parent_grid%q(i, j, k, n) = parent_grid%q(i, j, k, n)/&
1281 & parent_grid%delp(i, j, k)
1287 DEALLOCATE(qdp_coarse)
1288 IF (
ALLOCATED(q_diff))
THEN 1293 IF (neststruct%nestupdate .NE. 3 .AND. neststruct%nestupdate .NE. &
1296 IF (conv_theta)
THEN 1297 IF (neststruct%child_proc)
THEN 1301 ALLOCATE(t_nest(isd:ied, jsd:jed, 1:npz))
1306 t_nest(i, j, k) = pt(i, j, k)*pkz(i, j, k)/(1.+zvir*q(&
1314 & nest_domain, neststruct%ind_update_h, &
1315 & gridstruct%dx, gridstruct%dy, gridstruct%&
1316 & area, isd_p, ied_p, jsd_p, jed_p, isd, ied, &
1317 & jsd, jed, neststruct%isu, neststruct%ieu, &
1318 & neststruct%jsu, neststruct%jeu, npx, npy, &
1319 & npz, 0, 0, neststruct%refinement, neststruct&
1320 & %nestupdate, upoff, 0, neststruct%&
1321 & parent_proc, neststruct%child_proc, &
1325 & nest_domain, neststruct%ind_update_h, &
1326 & gridstruct%dx, gridstruct%dy, gridstruct%&
1327 & area, isd_p, ied_p, jsd_p, jed_p, isd, ied, &
1328 & jsd, jed, neststruct%isu, neststruct%ieu, &
1329 & neststruct%jsu, neststruct%jeu, npx, npy, &
1330 & npz, 0, 0, neststruct%refinement, neststruct&
1331 & %nestupdate, upoff, 0, neststruct%&
1332 & parent_proc, neststruct%child_proc, &
1337 IF (.NOT.flagstruct%hydrostatic)
THEN 1339 & nest_domain, neststruct%ind_update_h, &
1340 & gridstruct%dx, gridstruct%dy, gridstruct%&
1341 & area, isd_p, ied_p, jsd_p, jed_p, isd, ied, &
1342 & jsd, jed, neststruct%isu, neststruct%ieu, &
1343 & neststruct%jsu, neststruct%jeu, npx, npy, &
1344 & npz, 0, 0, neststruct%refinement, neststruct&
1345 & %nestupdate, upoff, 0, neststruct%&
1346 & parent_proc, neststruct%child_proc, &
1358 & neststruct%ind_update_h, gridstruct%dx, &
1359 & gridstruct%dy, gridstruct%area, isd_p, ied_p, &
1360 & jsd_p, jed_p, isd, ied, jsd, jed, neststruct%isu&
1361 & , neststruct%ieu, neststruct%jsu, neststruct%jeu&
1362 & , npx, npy, npz, 0, 1, neststruct%refinement, &
1363 & neststruct%nestupdate, upoff, 0, neststruct%&
1364 & parent_proc, neststruct%child_proc, parent_grid)
1366 & neststruct%ind_update_h, gridstruct%dx, &
1367 & gridstruct%dy, gridstruct%area, isd_p, ied_p, &
1368 & jsd_p, jed_p, isd, ied, jsd, jed, neststruct%isu&
1369 & , neststruct%ieu, neststruct%jsu, neststruct%jeu&
1370 & , npx, npy, npz, 1, 0, neststruct%refinement, &
1371 & neststruct%nestupdate, upoff, 0, neststruct%&
1372 & parent_proc, neststruct%child_proc, parent_grid)
1375 IF (neststruct%nestupdate .GE. 5 .AND. npz .GT. 4)
THEN 1379 ALLOCATE(ps0(isd_p:ied_p, jsd_p:jed_p))
1380 IF (neststruct%parent_proc)
THEN 1381 parent_grid%ps = parent_grid%ptop
1387 parent_grid%ps(i, j) = parent_grid%ps(i, j) + &
1388 & parent_grid%delp(i, j, k)
1392 ps0 = parent_grid%ps
1394 IF (neststruct%child_proc)
THEN 1400 ps(i, j) = ps(i, j) + delp(i, j, k)
1406 & neststruct%ind_update_h, gridstruct%dx, &
1407 & gridstruct%dy, gridstruct%area, isd_p, ied_p, &
1408 & jsd_p, jed_p, isd, ied, jsd, jed, neststruct%&
1409 & isu, neststruct%ieu, neststruct%jsu, &
1410 & neststruct%jeu, npx, npy, 0, 0, neststruct%&
1411 & refinement, neststruct%nestupdate, upoff, 0, &
1412 & neststruct%parent_proc, neststruct%child_proc&
1417 IF (neststruct%parent_proc)
THEN 1425 IF (parent_grid%tile .EQ. neststruct%parent_tile)
THEN 1427 IF (neststruct%parent_proc)
THEN 1432 IF (parent_grid%flagstruct%remap_option .NE. 0)
THEN 1437 parent_grid%pt(i, j, k) = parent_grid%pt(i, j, k)/&
1438 & parent_grid%pkz(i, j, k)*(1.+zvir*parent_grid%q(i&
1445 & parent_grid%ps, parent_grid%delp, &
1446 & parent_grid%pt, parent_grid%q, parent_grid%w&
1447 & , parent_grid%flagstruct%hydrostatic, npz, &
1448 & ps0, zvir, parent_grid%ptop, ncnst, &
1449 & parent_grid%flagstruct%kord_tm, parent_grid%&
1450 & flagstruct%kord_tr, parent_grid%flagstruct%&
1451 & kord_wz, isc_p, iec_p, jsc_p, jec_p, isd_p, &
1452 & ied_p, jsd_p, jed_p, .false.)
1454 IF (parent_grid%flagstruct%remap_option .NE. 0)
THEN 1459 parent_grid%pt(i, j, k) = parent_grid%pt(i, j, k)*&
1460 & parent_grid%pkz(i, j, k)/(1.+zvir*parent_grid%q(i&
1467 & parent_grid%ps, parent_grid%u, parent_grid%v&
1468 & , npz, ps0, parent_grid%flagstruct%kord_mt, &
1469 & isc_p, iec_p, jsc_p, jec_p, isd_p, ied_p, &
1470 & jsd_p, jed_p, parent_grid%ptop)
1473 IF (
ALLOCATED(ps0))
THEN 1479 SUBROUTINE level_sum(q, area, domain, bd, npz, l_sum)
1483 INTEGER,
INTENT(IN) :: npz
1484 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
1485 REAL,
INTENT(IN) :: area(bd%isd:bd%ied, bd%jsd:bd%jed)
1486 REAL,
INTENT(IN) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1487 REAL,
INTENT(OUT) :: l_sum(npz)
1488 TYPE(DOMAIN2D),
INTENT(IN) :: domain
1489 INTEGER :: i, j, k, n
1497 qa = qa + q(i, j, k)*area(i, j)
1500 CALL mp_reduce_sum(qa)
1505 & , delz, pt, delp, q, ps, pe, pk, peln, pkz, phis, ua, va, ptop, &
1506 & gridstruct, flagstruct, domain, bd)
1508 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
1509 REAL,
INTENT(IN) :: ptop
1510 INTEGER,
INTENT(IN) :: ng, npx, npy, npz
1511 INTEGER,
INTENT(IN) :: ncnst
1513 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
1516 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
1519 REAL,
INTENT(INOUT) :: w(bd%isd:, bd%jsd:, :)
1521 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1523 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1525 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
1527 REAL,
INTENT(INOUT) :: delz(bd%isd:, bd%jsd:, :)
1534 REAL,
INTENT(INOUT) :: ps(bd%isd:bd%ied, bd%jsd:bd%jed)
1536 REAL,
INTENT(INOUT) :: pe(bd%is-1:bd%ie+1, npz+1, bd%js-1:bd%je+1)
1538 REAL,
INTENT(INOUT) :: pk(bd%is:bd%ie, bd%js:bd%je, npz+1)
1540 REAL,
INTENT(INOUT) :: peln(bd%is:bd%ie, npz+1, bd%js:bd%je)
1542 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
1547 REAL,
INTENT(INOUT) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
1548 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed, npz),
INTENT(INOUT) ::&
1550 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
1551 TYPE(FV_FLAGS_TYPE),
INTENT(IN) :: flagstruct
1552 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
1553 LOGICAL :: bad_range
1554 INTEGER :: is, ie, js, je
1555 INTEGER :: isd, ied, jsd, jed
1565 & gridstruct%grid_type, domain, gridstruct%nested, &
1566 & flagstruct%c2l_ord, bd)
1572 CALL p_var(npz, is, ie, js, je, ptop,
ptop_min, delp, delz, pt, ps, &
1573 & pe, peln, pk, pkz,
kappa, q, ng, flagstruct%ncnst, gridstruct%&
1574 & area_64, 0., .false., .false., flagstruct%moist_phys, &
1575 & flagstruct%hydrostatic, flagstruct%nwat, domain, .false.)
1576 IF (flagstruct%range_warn)
THEN 1577 CALL range_check(
'TA update', pt, is, ie, js, je, ng, npz, &
1578 & gridstruct%agrid, 130., 350., bad_range)
1579 CALL range_check(
'UA update', ua, is, ie, js, je, ng, npz, &
1580 & gridstruct%agrid, -220., 250., bad_range)
1581 CALL range_check(
'VA update', va, is, ie, js, je, ng, npz, &
1582 & gridstruct%agrid, -220., 220., bad_range)
1583 IF (.NOT.flagstruct%hydrostatic)
CALL range_check(
'W update', w, &
1584 & is, ie, js, je, ng, &
1585 & npz, gridstruct%agrid&
1593 & hydrostatic, kmd, ps0, zvir, ptop, nq, kord_tm, kord_tr, kord_wz, is&
1594 & , ie, js, je, isd, ied, jsd, jed, do_q)
1596 INTEGER,
INTENT(IN) :: npz, kmd, nq, kord_tm, kord_tr, kord_wz
1597 REAL,
INTENT(IN) :: zvir, ptop
1598 REAL,
INTENT(IN) :: ak(npz+1), bk(npz+1)
1599 INTEGER,
INTENT(IN) :: is, ie, js, je, isd, ied, jsd, jed
1600 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(IN) :: ps0
1601 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(IN) :: ps
1602 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(IN) :: delp
1603 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(INOUT) :: t, w
1604 REAL,
DIMENSION(isd:ied, jsd:jed, npz, nq),
INTENT(INOUT) :: q
1605 LOGICAL,
INTENT(IN) :: hydrostatic, do_q
1607 REAL,
DIMENSION(is:ie, kmd) :: tp, qp
1608 REAL,
DIMENSION(is:ie, kmd+1) :: pe0, pn0
1609 REAL,
DIMENSION(is:ie, npz) :: qn1
1610 REAL,
DIMENSION(is:ie, npz+1) :: pe1, pn1
1611 INTEGER :: i, j, k, iq
1621 pe0(i, k) = ak(k) + bk(k)*ps0(i, j)
1622 pn0(i, k) = log(pe0(i, k))
1627 pe1(i, k) = ak(k) + bk(k)*ps(i, j)
1628 pn1(i, k) = log(pe1(i, k))
1635 qp(i, k) = q(i, j, k, iq)
1638 CALL mappm(kmd, pe0, qp, npz, pe1, qn1, is, ie, 0, kord_tr, &
1642 q(i, j, k, iq) = qn1(i, k)
1649 tp(i, k) = t(i, j, k)
1652 IF (kord_tm .GE. 0.)
THEN 1658 CALL mappm(kmd, pn0, tp, npz, pn1, qn1, is, ie, 1, abs0, ptop)
1661 t(i, j, k) = qn1(i, k)
1664 IF (.NOT.hydrostatic)
THEN 1667 tp(i, k) = w(i, j, k)
1672 CALL mappm(kmd, pe0, tp, npz, pe1, qn1, is, ie, -1, kord_wz, &
1676 w(i, j, k) = qn1(i, k)
1683 SUBROUTINE update_remap_uv(npz, ak, bk, ps, u, v, kmd, ps0, kord_mt, &
1684 & is, ie, js, je, isd, ied, jsd, jed, ptop)
1686 INTEGER,
INTENT(IN) :: npz
1687 REAL,
INTENT(IN) :: ak(npz+1), bk(npz+1)
1688 INTEGER,
INTENT(IN) :: is, ie, js, je, isd, ied, jsd, jed
1689 REAL,
INTENT(IN) :: ps(isd:ied, jsd:jed)
1690 REAL,
DIMENSION(isd:ied, jsd:jed+1, npz),
INTENT(INOUT) :: u
1691 REAL,
DIMENSION(isd:ied+1, jsd:jed, npz),
INTENT(INOUT) :: v
1693 INTEGER,
INTENT(IN) :: kmd, kord_mt
1694 REAL,
INTENT(IN) :: ptop
1695 REAL,
INTENT(IN) :: ps0(isd:ied, jsd:jed)
1698 REAL,
DIMENSION(is:ie+1, kmd+1) :: pe0
1699 REAL,
DIMENSION(is:ie+1, npz+1) :: pe1
1700 REAL,
DIMENSION(is:ie+1, kmd) :: qt
1701 REAL,
DIMENSION(is:ie+1, npz) :: qn1
1714 pe0(i, k) = ak(k) + bk(k)*0.5*(ps0(i, j)+ps0(i, j-1))
1722 pe1(i, k) = ak(k) + bk(k)*0.5*(ps(i, j)+ps(i, j-1))
1731 qt(i, k) = u(i, j, k)
1735 CALL mappm(kmd, pe0(is:ie, :), qt(is:ie, :), npz, pe1(is:ie, :), &
1736 & qn1(is:ie, :), is, ie, -1, kord_mt, ptop)
1739 u(i, j, k) = qn1(i, k)
1754 pe0(i, k) = ak(k) + bk(k)*0.5*(ps0(i, j)+ps0(i-1, j))
1762 pe1(i, k) = ak(k) + bk(k)*0.5*(ps(i, j)+ps(i-1, j))
1771 qt(i, k) = v(i, j, k)
1775 CALL mappm(kmd, pe0(is:ie+1, :), qt(is:ie+1, :), npz, pe1(is:ie+1&
1776 & , :), qn1(is:ie+1, :), is, ie + 1, -1, 8, ptop)
1779 v(i, j, k) = qn1(i, k)
subroutine set_nh_bcs_t0(neststruct)
type(fv_nest_bc_type_3d) vc_buf
real, parameter, public radius
Radius of the Earth [m].
subroutine, public twoway_nesting(atm, ngrids, grids_on_this_pe, zvir)
integer, parameter, public model_atmos
subroutine, public p_var(km, ifirst, ilast, jfirst, jlast, ptop, ptop_min, delp, delz, pt, ps, pe, peln, pk, pkz, cappa, q, ng, nq, area, dry_mass, adjust_dry_mass, mountain, moist_phys, hydrostatic, nwat, domain, make_nh)
type(fv_nest_bc_type_3d) pkz_buf
real, dimension(:,:,:), allocatable, target dum_east
real, dimension(:,:,:), allocatable, target dum_north
real, parameter, public ptop_min
type(fv_nest_bc_type_3d) delp_buf
subroutine setup_pt_nh_bc(pt_bc, delp_bc, delz_bc, sphum_bc, q_bc, nq, npx, npy, npz, zvir, bd)
real, dimension(:,:,:), allocatable, target dum_south
real(kind=8), parameter, public pi_8
Ratio of circle circumference to diameter [N/A].
type(fv_nest_bc_type_3d) uc_buf
real, parameter, public hlv
Latent heat of evaporation [J/kg].
subroutine, public d2c_setup(u, v, ua, va, uc, vc, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
type(fv_nest_bc_type_3d) v_buf
real, parameter, public rdgas
Gas constant for dry air [J/kg/deg].
real, public sphum_ll_fix
subroutine set_bcs_t0(ncnst, hydrostatic, neststruct)
real, parameter, public cp_vapor
Specific heat capacity of water vapor at constant pressure [J/kg/deg].
subroutine after_twoway_nest_update(npx, npy, npz, ng, ncnst, u, v, w, delz, pt, delp, q, ps, pe, pk, peln, pkz, phis, ua, va, ptop, gridstruct, flagstruct, domain, bd)
type(fv_nest_bc_type_3d) w_buf
subroutine, public cubed_to_latlon(u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, nested, c2l_ord, bd)
type(fv_nest_bc_type_3d) pt_buf
subroutine, public nested_grid_bc_recv(nest_domain, istag, jstag, npz, bd, nest_BC_buffers)
subroutine setup_pt_bc(pt_bc, pkz_bc, sphum_bc, npx, npy, npz, zvir, bd)
integer, parameter, public f_p
subroutine update_remap_tqw(npz, ak, bk, ps, delp, t, q, w, hydrostatic, kmd, ps0, zvir, ptop, nq, kord_tm, kord_tr, kord_wz, is, ie, js, je, isd, ied, jsd, jed, do_q)
real, parameter, public rvgas
Gas constant for water vapor [J/kg/deg].
subroutine, public setup_nested_grid_bcs_tlm(npx, npy, npz, zvir, ncnst, u, u_tl, v, v_tl, w, pt, delp, delz, q, uc, uc_tl, vc, vc_tl, pkz, nested, inline_q, make_nh, ng, gridstruct, flagstruct, neststruct, nest_timestep, tracer_nest_timestep, domain, bd, nwat)
type(fv_nest_bc_type_3d) delz_buf
subroutine timing_on(blk_name)
subroutine update_remap_uv(npz, ak, bk, ps, u, v, kmd, ps0, kord_mt, is, ie, js, je, isd, ied, jsd, jed, ptop)
real, parameter, public cp_air
Specific heat capacity of dry air at constant pressure [J/kg/deg].
type(fv_nest_bc_type_3d) u_buf
subroutine, public d2a_setup(u, v, ua, va, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, cosa_s, rsin2)
subroutine, public divergence_corner(u, v, ua, va, divg_d, gridstruct, flagstruct, bd)
subroutine level_sum(q, area, domain, bd, npz, l_sum)
subroutine, public d2c_setup_tlm(u, u_tl, v, v_tl, ua, va, uc, uc_tl, vc, vc_tl, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
subroutine, public nested_grid_bc_send(var_coarse, nest_domain, istag, jstag)
real, parameter, public grav
Acceleration due to gravity [m/s^2].
real function, public g_sum(domain, p, ifirst, ilast, jfirst, jlast, ngc, area, mode, reproduce)
type(fv_nest_bc_type_3d) divg_buf
subroutine, public mappm(km, pe1, q1, kn, pe2, q2, i1, i2, iv, kord, ptop)
subroutine, public neg_adj3(is, ie, js, je, ng, kbot, hydrostatic, peln, delz, pt, dp, qv, ql, qr, qi, qs, qg, qa, check_negative)
subroutine, public divergence_corner_nest(u, v, ua, va, divg_d, gridstruct, flagstruct, bd)
type(fv_nest_bc_type_3d), dimension(:), allocatable q_buf
real, dimension(:), allocatable rw
subroutine, public nested_grid_bc_save_proc(nest_domain, ind, wt, istag, jstag, npx, npy, npz, bd, nest_BC, nest_BC_buffers, pd_in)
real, dimension(:,:), allocatable te_2d_coarse
subroutine twoway_nest_update(npx, npy, npz, zvir, ncnst, sphum, u, v, w, omga, pt, delp, q, uc, vc, pkz, delz, ps, ptop, gridstruct, flagstruct, neststruct, parent_grid, bd, conv_theta_in)
real, parameter, public kappa
RDGAS / CP_AIR [dimensionless].
real, dimension(:,:,:), allocatable, target dum_west
subroutine, public range_check(qname, q, is, ie, js, je, n_g, km, pos, q_low, q_hi, bad_range)
subroutine, public setup_nested_grid_bcs(npx, npy, npz, zvir, ncnst, u, v, w, pt, delp, delz, q, uc, vc, pkz, nested, inline_q, make_nh, ng, gridstruct, flagstruct, neststruct, nest_timestep, tracer_nest_timestep, domain, bd, nwat)
Derived type containing the data.
real, dimension(:), allocatable rf
real, dimension(:,:,:), allocatable dp1_coarse
real(fp), parameter, public pi
subroutine timing_off(blk_name)