74 real,
allocatable ::
rf(:)
79 real,
allocatable:: u00(:,:,:), v00(:,:,:)
111 & fill, reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, &
112 & q_split, u, v, w, delz, hydrostatic, pt, delp, q, ps, pe, pk, peln, &
113 & pkz, phis, q_con, omga, ua, va, uc, vc, ak, bk, mfx, mfy, cx, cy, &
114 & ze0, hybrid_z, gridstruct, flagstruct, flagstructp, neststruct, &
115 & idiag, bd, parent_grid, domain, time_total)
119 REAL,
INTENT(IN) :: bdt
120 REAL,
INTENT(IN) :: consv_te
121 REAL,
INTENT(IN) :: kappa, cp_air
122 REAL,
INTENT(IN) :: zvir, ptop
123 REAL,
INTENT(IN),
OPTIONAL :: time_total
124 INTEGER,
INTENT(IN) :: npx
125 INTEGER,
INTENT(IN) :: npy
126 INTEGER,
INTENT(IN) :: npz
128 INTEGER,
INTENT(IN) :: nq_tot
129 INTEGER,
INTENT(IN) :: ng
130 INTEGER,
INTENT(IN) :: ks
131 INTEGER,
INTENT(IN) :: ncnst
133 INTEGER,
INTENT(IN) :: n_split
135 INTEGER,
INTENT(IN) :: q_split
136 LOGICAL,
INTENT(IN) :: fill
137 LOGICAL,
INTENT(IN) :: reproduce_sum
138 LOGICAL,
INTENT(IN) :: hydrostatic
140 LOGICAL,
INTENT(IN) :: hybrid_z
143 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
146 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
149 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
151 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
153 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
155 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
157 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
159 REAL,
INTENT(INOUT) :: ze0(bd%is:bd%is, bd%js:bd%js, 1)
167 REAL,
INTENT(INOUT) :: ps(bd%isd:bd%ied, bd%jsd:bd%jed)
169 REAL,
INTENT(INOUT) :: pe(bd%is-1:bd%ie+1, npz+1, bd%js-1:bd%je+1)
171 REAL,
INTENT(INOUT) :: pk(bd%is:bd%ie, bd%js:bd%je, npz+1)
173 REAL,
INTENT(INOUT) :: peln(bd%is:bd%ie, npz+1, bd%js:bd%je)
175 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
176 REAL,
INTENT(INOUT) :: q_con(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
181 REAL,
INTENT(INOUT) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
183 REAL,
INTENT(INOUT) :: omga(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
185 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
186 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
187 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed, npz),
INTENT(INOUT) ::&
189 REAL,
DIMENSION(npz+1),
INTENT(IN) :: ak, bk
191 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
192 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
194 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
195 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
200 TYPE(
domain2d),
INTENT(INOUT) :: domain
204 REAL :: ws(bd%is:bd%ie, bd%js:bd%je)
205 REAL :: te_2d(bd%is:bd%ie, bd%js:bd%je)
206 REAL :: teq(bd%is:bd%ie, bd%js:bd%je)
207 REAL :: ps2(bd%isd:bd%ied, bd%jsd:bd%jed)
208 REAL :: m_fac(bd%is:bd%ie, bd%js:bd%je)
210 REAL,
DIMENSION(bd%is:bd%ie) :: cvm
211 REAL :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz), dtdt_m(bd%is:bd%ie, &
212 & bd%js:bd%je, npz), cappa(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
213 REAL(kind=8) :: psx(bd%isd:bd%ied, bd%jsd:bd%jed)
214 REAL(kind=8) :: dpx(bd%is:bd%ie, bd%js:bd%je)
215 REAL :: akap, rdg, ph1, ph2, mdt, gam, amdt, u0
216 INTEGER :: kord_tracer(ncnst), kord_mt, kord_wz, kord_tm
217 INTEGER :: kord_tracer_pert(ncnst), kord_mt_pert, kord_wz_pert, &
219 INTEGER :: i, j, k, n, iq, n_map, nq, nwat, k_split
222 INTEGER,
SAVE :: liq_wat=-999
223 INTEGER,
SAVE :: ice_wat=-999
224 INTEGER,
SAVE :: rainwat=-999
225 INTEGER,
SAVE :: snowwat=-999
226 INTEGER,
SAVE :: graupel=-999
227 INTEGER,
SAVE :: cld_amt=-999
228 INTEGER,
SAVE :: theta_d=-999
229 LOGICAL :: used, last_step, do_omega
230 INTEGER,
PARAMETER :: max_packs=12
231 TYPE(group_halo_update_type),
SAVE :: i_pack(max_packs)
232 INTEGER :: is, ie, js, je
233 INTEGER :: isd, ied, jsd, jed
235 REAL(kind=8) :: t1, t2
238 REAL :: gz(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
239 REAL :: pkc(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
240 REAL :: ptc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
241 REAL :: crx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
242 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
243 REAL :: cry(bd%isd:bd%ied, bd%js:bd%je+1, npz)
244 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
245 REAL :: divgd(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
246 REAL :: delpc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
247 REAL :: ut(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
248 REAL :: vt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
249 REAL :: zh(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
250 REAL :: pk3(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
251 REAL :: du(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
252 REAL :: dv(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
264 REAL,
DIMENSION(bd%is:bd%ie, bd%js:bd%je) :: arg12
338 k_split = flagstruct%k_split
339 nwat = flagstruct%nwat
340 nq = nq_tot - flagstruct%dnats
348 IF (gridstruct%nested .OR. any(neststruct%child_grids))
THEN 349 CALL setup_nested_grid_bcs(npx, npy, npz, zvir, ncnst, u, v, w, pt&
350 & , delp, delz, q, uc, vc, pkz, neststruct%&
351 & nested, flagstruct%inline_q, flagstruct%&
352 & make_nh, ng, gridstruct, flagstruct, &
353 & neststruct, neststruct%nest_timestep, &
354 & neststruct%tracer_nest_timestep, domain, bd, &
356 IF (gridstruct%nested)
THEN 358 CALL nested_grid_bc_apply_intt(pt, 0, 0, npx, npy, npz, bd, 1., &
359 & 1., neststruct%pt_bc, bctype=neststruct&
368 IF (flagstruct%no_dycore)
THEN 369 IF (nwat .EQ. 2 .AND. (.NOT.hydrostatic))
THEN 379 IF (
fpp%fpp_mapl_mode)
THEN 412 IF (nwat .EQ. 0)
THEN 428 ph1 = ak(k) + bk(k)*flagstruct%p_ref
429 ph2 = ak(k+1) + bk(k+1)*flagstruct%p_ref
430 pfull(k) = (ph2-ph1)/log(ph2/ph1)
432 IF (hydrostatic)
THEN 438 dp1(i, j, k) = zvir*q(i, j, k, sphum)
449 IF (flagstruct%moist_phys)
THEN 452 dp1(i, j, k) = zvir*q(i, j, k, sphum)
454 pkz(i, j, k) = exp(kappa*log(rdg*delp(i, j, k)*pt(i, j, k)&
455 & *(1.+dp1(i, j, k))/delz(i, j, k)))
467 pkz(i, j, k) = exp(kappa*log(rdg*delp(i, j, k)*pt(i, j, k)&
476 IF (flagstruct%fv_debug)
THEN 477 IF (.NOT.hydrostatic)
THEN 489 CALL compute_total_energy_fwd(is, ie, js, je, isd, ied, jsd, jed, &
490 & npz, u, v, w, delz, pt, delp, q, dp1, pe, &
491 & peln, phis, gridstruct%rsin2, gridstruct%&
492 & cosa_s, zvir, cp_air,
rdgas,
hlv, te_2d, &
493 & ua, va, teq, flagstruct%moist_phys, nwat, &
494 & sphum, liq_wat, rainwat, ice_wat, snowwat&
495 & , graupel, hydrostatic, idiag%id_te)
496 IF (idiag%id_te .GT. 0)
THEN 504 IF ((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .AND. (.NOT.&
507 & gridstruct, bd, ptop, ua, va, u, v, delp, teq, ps2&
513 IF (flagstruct%tau .GT. 0.)
THEN 514 IF (gridstruct%grid_type .LT. 4)
THEN 515 IF (bdt .GE. 0.)
THEN 520 arg10 = .NOT.neststruct%nested
522 & flagstruct%tau, u, v, w, pt, ua, va, delz, &
523 & gridstruct%agrid, cp_air,
rdgas, ptop, &
524 & hydrostatic, arg10, flagstruct%rf_cutoff,
rf, &
525 & gridstruct, domain, bd)
528 IF (bdt .GE. 0.)
THEN 534 & flagstruct%tau, u, v, w, pt, ua, va, delz, &
535 & cp_air,
rdgas, ptop, hydrostatic, .true., &
536 & flagstruct%rf_cutoff,
rf, gridstruct, &
544 IF (flagstruct%adiabatic)
THEN 550 pt(i, j, k) = pt(i, j, k)/pkz(i, j, k)
553 IF (theta_d .GT. 0)
THEN 557 q(i, j, k, theta_d) = pt(i, j, k)
572 pt(i, j, k) = pt(i, j, k)*(1.+dp1(i, j, k))/pkz(i, j, k)
579 mdt = bdt/
REAL(k_split)
582 IF (
fpp%fpp_overload_r4)
THEN 585 psx(i, j) = pe(i, npz+1, j)
595 CALL pushrealarray(delp, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
598 CALL pushrealarray(pt, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
601 CALL pushrealarray(v, (bd%ied-bd%isd+2)*(bd%jed-bd%jsd+1)*npz)
602 CALL pushrealarray(u, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+2)*npz)
610 dp1(i, j, k) = delp(i, j, k)
614 IF (n_map .EQ. k_split) last_step = .true.
615 CALL dyn_core_fwd(npx, npy, npz, ng, sphum, nq, mdt, n_split, zvir&
616 & , cp_air, akap, cappa,
grav, hydrostatic, u, v, w, &
617 & delz, pt, q, delp, pe, pk, phis, ws, omga, ptop, pfull&
618 & , ua, va, uc, vc, mfx, mfy, cx, cy, pkz, peln, q_con, &
619 & ak, bk, dpx, ks, gridstruct, flagstruct, flagstructp, &
620 & neststruct, idiag, bd, domain, arg10, i_pack, &
621 & last_step, gz, pkc, ptc, crx, xfx, cry, yfx, divgd, &
622 & delpc, ut, vt, zh, pk3, du, dv, time_total)
625 IF (
fpp%fpp_overload_r4)
THEN 628 psx(i, j) = psx(i, j) + dpx(i, j)
635 pe(i, npz+1, j) = psx(i, j)
646 IF (.NOT.flagstruct%inline_q .AND. nq .NE. 0)
THEN 651 IF (gridstruct%nested)
THEN 652 CALL tracer_2d_nested_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct&
653 & , bd, domain, npx, npy, npz, nq, &
654 & flagstruct%hord_tr, q_split, mdt, idiag%&
655 & id_divg, i_pack(10), flagstruct%nord_tr, &
656 & flagstruct%trdm2, k_split, neststruct, &
657 & parent_grid, flagstructp%hord_tr_pert, &
658 & flagstructp%nord_tr_pert, flagstructp%&
659 & trdm2_pert, flagstructp%split_damp_tr)
661 ELSE IF (flagstruct%z_tracer)
THEN 662 CALL tracer_2d_1l_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct, bd&
663 & , domain, npx, npy, npz, nq, flagstruct%&
664 & hord_tr, q_split, mdt, idiag%id_divg, i_pack(&
665 & 10), flagstruct%nord_tr, flagstruct%trdm2, &
666 & flagstructp%hord_tr_pert, flagstructp%&
667 & nord_tr_pert, flagstructp%trdm2_pert, &
668 & flagstructp%split_damp_tr)
671 CALL tracer_2d_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, &
672 & domain, npx, npy, npz, nq, flagstruct%hord_tr, &
673 & q_split, mdt, idiag%id_divg, i_pack(10), &
674 & flagstruct%nord_tr, flagstruct%trdm2, flagstructp&
675 & %hord_tr_pert, flagstructp%nord_tr_pert, &
676 & flagstructp%trdm2_pert, flagstructp%split_damp_tr&
691 kord_tracer(iq) = flagstruct%kord_tr
693 IF (iq .EQ. cld_amt) kord_tracer(iq) = 9
695 kord_tracer_pert(iq) = flagstructp%kord_tr_pert
697 IF (iq .EQ. cld_amt)
THEN 699 kord_tracer_pert(iq) = 17
704 do_omega = hydrostatic .AND. last_step
705 kord_mt = flagstruct%kord_mt
706 kord_wz = flagstruct%kord_wz
707 kord_tm = flagstruct%kord_tm
708 kord_mt_pert = flagstructp%kord_mt_pert
709 kord_wz_pert = flagstructp%kord_wz_pert
710 kord_tm_pert = flagstructp%kord_tm_pert
711 IF (n_map .EQ. k_split)
THEN 712 kord_mt = kord_mt_pert
713 kord_wz = kord_wz_pert
714 kord_tm = kord_tm_pert
715 kord_tracer = kord_tracer_pert
717 CALL lagrangian_to_eulerian_fwd(last_step, consv_te, ps, pe, &
718 & delp, pkz, pk, mdt, bdt, npz, is, ie, &
719 & js, je, isd, ied, jsd, jed, nq, nwat, &
720 & sphum, q_con, u, v, w, delz, pt, q, &
721 & phis, zvir, cp_air, akap, cappa, &
722 & kord_mt, kord_wz, kord_tracer, kord_tm&
723 & , peln, te_2d, ng, ua, va, omga, dp1, &
724 & ws, fill, reproduce_sum, arg10, dtdt_m&
725 & , ptop, ak, bk, pfull, flagstruct, &
726 & gridstruct, domain, flagstruct%&
727 & do_sat_adj, hydrostatic, hybrid_z, &
728 & do_omega, flagstruct%adiabatic, &
730 & flagstruct%remap_option, kord_mt_pert&
731 & , kord_wz_pert, kord_tracer_pert, &
734 IF (.NOT.hydrostatic)
THEN 740 omga(i, j, k) = delp(i, j, k)/delz(i, j, k)*w(i, j, k)
751 IF (flagstruct%nf_omega .GT. 0)
THEN 752 arg11 = 0.18*gridstruct%da_min
754 & npy, npz, flagstruct%nf_omega, bd)
766 IF (nwat .EQ. 6)
THEN 767 IF (flagstruct%fv_debug)
THEN 775 IF (((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .OR. idiag%&
778 & gridstruct, bd, ptop, ua, va, u, v, delp, te_2d, ps&
784 IF ((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .AND. (.NOT.&
791 te_2d(i, j) = te_2d(i, j) - teq(i, j) + dt2*(ps2(i, j)+ps(i, j&
796 amdt = g_sum(domain, te_2d, is, ie, js, je, ng, gridstruct%&
797 & area_64, 0, reproduce=.true.)
798 result1 = g_sum(domain, m_fac, is, ie, js, je, ng, gridstruct%&
799 & area_64, 0, reproduce=.true.)
800 u0 = -(
radius*amdt/result1)
804 WRITE(6, *)
'Dynamic AM tendency (Hadleys)=', amdt/(bdt*1.e18)&
805 & ,
'del-u (per day)=', u0*86400./bdt
813 IF (flagstruct%consv_am)
THEN 822 CALL pushrealarray(cry, (bd%ied-bd%isd+1)*(bd%je-bd%js+2)*npz)
823 CALL pushrealarray(crx, (bd%ie-bd%is+2)*(bd%jed-bd%jsd+1)*npz)
827 CALL pushrealarray(vt, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
830 CALL pushrealarray(yfx, (bd%ied-bd%isd+1)*(bd%je-bd%js+2)*npz)
833 CALL pushrealarray(delpc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
834 CALL pushrealarray(pkc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1)&
836 CALL pushrealarray(ut, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
841 CALL pushrealarray(ptc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
842 CALL pushrealarray(dp1, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
843 CALL pushrealarray(gz, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1))
845 CALL pushrealarray(xfx, (bd%ie-bd%is+2)*(bd%jed-bd%jsd+1)*npz)
846 CALL pushrealarray(pk3, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1)&
875 & fill, reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, &
876 & q_split, u, u_ad, v, v_ad, w, w_ad, delz, delz_ad, hydrostatic, pt, &
877 & pt_ad, delp, delp_ad, q, q_ad, ps, ps_ad, pe, pe_ad, pk, pk_ad, peln&
878 & , peln_ad, pkz, pkz_ad, phis, q_con, omga, omga_ad, ua, ua_ad, va, &
879 & va_ad, uc, uc_ad, vc, vc_ad, ak, bk, mfx, mfx_ad, mfy, mfy_ad, cx, &
880 & cx_ad, cy, cy_ad, ze0, hybrid_z, gridstruct, flagstruct, flagstructp&
881 & , neststruct, idiag, bd, parent_grid, domain, time_total)
883 REAL,
INTENT(IN) :: bdt
884 REAL,
INTENT(IN) :: consv_te
885 REAL,
INTENT(IN) :: kappa, cp_air
886 REAL,
INTENT(IN) :: zvir, ptop
887 REAL,
INTENT(IN),
OPTIONAL :: time_total
888 INTEGER,
INTENT(IN) :: npx
889 INTEGER,
INTENT(IN) :: npy
890 INTEGER,
INTENT(IN) :: npz
891 INTEGER,
INTENT(IN) :: nq_tot
892 INTEGER,
INTENT(IN) :: ng
893 INTEGER,
INTENT(IN) :: ks
894 INTEGER,
INTENT(IN) :: ncnst
895 INTEGER,
INTENT(IN) :: n_split
896 INTEGER,
INTENT(IN) :: q_split
897 LOGICAL,
INTENT(IN) :: fill
898 LOGICAL,
INTENT(IN) :: reproduce_sum
899 LOGICAL,
INTENT(IN) :: hydrostatic
900 LOGICAL,
INTENT(IN) :: hybrid_z
902 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
904 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
906 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
908 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
910 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
911 REAL,
INTENT(INOUT) :: w_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
912 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
913 REAL,
INTENT(INOUT) :: pt_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
914 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
915 REAL,
INTENT(INOUT) :: delp_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
916 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
917 REAL,
INTENT(INOUT) :: q_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst&
919 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
920 REAL,
INTENT(INOUT) :: delz_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
921 REAL,
INTENT(INOUT) :: ze0(bd%is:bd%is, bd%js:bd%js, 1)
922 REAL,
INTENT(INOUT) :: ps(bd%isd:bd%ied, bd%jsd:bd%jed)
923 REAL,
INTENT(INOUT) :: ps_ad(bd%isd:bd%ied, bd%jsd:bd%jed)
924 REAL,
INTENT(INOUT) :: pe(bd%is-1:bd%ie+1, npz+1, bd%js-1:bd%je+1)
925 REAL,
INTENT(INOUT) :: pe_ad(bd%is-1:bd%ie+1, npz+1, bd%js-1:bd%je+1&
927 REAL,
INTENT(INOUT) :: pk(bd%is:bd%ie, bd%js:bd%je, npz+1)
928 REAL,
INTENT(INOUT) :: pk_ad(bd%is:bd%ie, bd%js:bd%je, npz+1)
929 REAL,
INTENT(INOUT) :: peln(bd%is:bd%ie, npz+1, bd%js:bd%je)
930 REAL,
INTENT(INOUT) :: peln_ad(bd%is:bd%ie, npz+1, bd%js:bd%je)
931 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
932 REAL,
INTENT(INOUT) :: pkz_ad(bd%is:bd%ie, bd%js:bd%je, npz)
933 REAL,
INTENT(INOUT) :: q_con(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
934 REAL,
INTENT(INOUT) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
935 REAL,
INTENT(INOUT) :: omga(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
936 REAL,
INTENT(INOUT) :: omga_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
937 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
938 REAL,
INTENT(INOUT) :: uc_ad(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
939 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
940 REAL,
INTENT(INOUT) :: vc_ad(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
941 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed, npz),
INTENT(INOUT) ::&
943 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed, npz),
INTENT(INOUT) ::&
945 REAL,
DIMENSION(npz+1),
INTENT(IN) :: ak, bk
946 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
947 REAL,
INTENT(INOUT) :: mfx_ad(bd%is:bd%ie+1, bd%js:bd%je, npz)
948 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
949 REAL,
INTENT(INOUT) :: mfy_ad(bd%is:bd%ie, bd%js:bd%je+1, npz)
950 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
951 REAL,
INTENT(INOUT) :: cx_ad(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
952 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
953 REAL,
INTENT(INOUT) :: cy_ad(bd%isd:bd%ied, bd%js:bd%je+1, npz)
958 TYPE(
domain2d),
INTENT(INOUT) :: domain
961 REAL :: ws(bd%is:bd%ie, bd%js:bd%je)
962 REAL :: ws_ad(bd%is:bd%ie, bd%js:bd%je)
963 REAL :: te_2d(bd%is:bd%ie, bd%js:bd%je)
964 REAL :: te_2d_ad(bd%is:bd%ie, bd%js:bd%je)
965 REAL :: teq(bd%is:bd%ie, bd%js:bd%je)
966 REAL :: teq_ad(bd%is:bd%ie, bd%js:bd%je)
967 REAL :: ps2(bd%isd:bd%ied, bd%jsd:bd%jed)
968 REAL :: ps2_ad(bd%isd:bd%ied, bd%jsd:bd%jed)
969 REAL :: m_fac(bd%is:bd%ie, bd%js:bd%je)
970 REAL :: m_fac_ad(bd%is:bd%ie, bd%js:bd%je)
972 REAL,
DIMENSION(bd%is:bd%ie) :: cvm
973 REAL :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz), dtdt_m(bd%is:bd%ie, &
974 & bd%js:bd%je, npz), cappa(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
975 REAL :: dp1_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
976 REAL(kind=8) :: psx(bd%isd:bd%ied, bd%jsd:bd%jed)
977 REAL(kind=8) :: psx_ad(bd%isd:bd%ied, bd%jsd:bd%jed)
978 REAL(kind=8) :: dpx(bd%is:bd%ie, bd%js:bd%je)
979 REAL(kind=8) :: dpx_ad(bd%is:bd%ie, bd%js:bd%je)
980 REAL :: akap, rdg, ph1, ph2, mdt, gam, amdt, u0
981 REAL :: amdt_ad, u0_ad
982 INTEGER :: kord_tracer(ncnst), kord_mt, kord_wz, kord_tm
983 INTEGER :: kord_tracer_pert(ncnst), kord_mt_pert, kord_wz_pert, &
985 INTEGER :: i, j, k, n, iq, n_map, nq, nwat, k_split
987 INTEGER,
SAVE :: liq_wat=-999
988 INTEGER,
SAVE :: ice_wat=-999
989 INTEGER,
SAVE :: rainwat=-999
990 INTEGER,
SAVE :: snowwat=-999
991 INTEGER,
SAVE :: graupel=-999
992 INTEGER,
SAVE :: cld_amt=-999
993 INTEGER,
SAVE :: theta_d=-999
994 LOGICAL :: used, last_step, do_omega
995 INTEGER,
PARAMETER :: max_packs=12
996 TYPE(group_halo_update_type),
SAVE :: i_pack(max_packs)
997 INTEGER :: is, ie, js, je
998 INTEGER :: isd, ied, jsd, jed
1000 REAL(kind=8) :: t1, t2
1003 REAL :: gz(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1004 REAL :: gz_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1005 REAL :: pkc(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1006 REAL :: pkc_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1007 REAL :: ptc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1008 REAL :: ptc_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1009 REAL :: crx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1010 REAL :: crx_ad(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1011 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1012 REAL :: xfx_ad(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1013 REAL :: cry(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1014 REAL :: cry_ad(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1015 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1016 REAL :: yfx_ad(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1017 REAL :: divgd(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
1018 REAL :: divgd_ad(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
1019 REAL :: delpc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1020 REAL :: delpc_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1021 REAL :: ut(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1022 REAL :: ut_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1023 REAL :: vt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1024 REAL :: vt_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1025 REAL :: zh(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1026 REAL :: zh_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1027 REAL :: pk3(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1028 REAL :: pk3_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1029 REAL :: du(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
1030 REAL :: du_ad(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
1031 REAL :: dv(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
1032 REAL :: dv_ad(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
1044 REAL,
DIMENSION(bd%is:bd%ie, bd%js:bd%je) :: arg12
1088 kord_tracer_pert = 0
1133 CALL poprealarray(pk3, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1))
1134 CALL poprealarray(xfx, (bd%ie-bd%is+2)*(bd%jed-bd%jsd+1)*npz)
1136 CALL poprealarray(gz, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1))
1137 CALL poprealarray(dp1, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1138 CALL poprealarray(ptc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1143 CALL poprealarray(ut, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1144 CALL poprealarray(pkc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*(npz+1))
1145 CALL poprealarray(delpc, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1147 CALL poprealarray(m_fac, (bd%ie-bd%is+1)*(bd%je-bd%js+1))
1148 CALL poprealarray(yfx, (bd%ied-bd%isd+1)*(bd%je-bd%js+2)*npz)
1150 CALL poprealarray(te_2d, (bd%ie-bd%is+1)*(bd%je-bd%js+1))
1151 CALL poprealarray(vt, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1155 CALL poprealarray(crx, (bd%ie-bd%is+2)*(bd%jed-bd%jsd+1)*npz)
1156 CALL poprealarray(cry, (bd%ied-bd%isd+1)*(bd%je-bd%js+2)*npz)
1163 IF (branch .EQ. 0)
THEN 1168 u0_ad = u0_ad + gridstruct%l2c_v(i, j)*v_ad(i, j, k)
1173 u0_ad = u0_ad + gridstruct%l2c_u(i, j)*u_ad(i, j, k)
1177 ELSE IF (branch .EQ. 1)
THEN 1188 IF (branch .EQ. 0)
THEN 1189 temp_ad6 = -(
radius*u0_ad/result1)
1191 result1_ad = -(amdt*temp_ad6/result1)
1192 CALL g_sum_adm(domain, m_fac, m_fac_ad, is, ie, js, je, ng, &
1193 & gridstruct%area_64, 0, reproduce=.true., g_sum_ad=&
1195 CALL g_sum_adm(domain, te_2d, te_2d_ad, is, ie, js, je, ng, &
1196 & gridstruct%area_64, 0, reproduce=.true., g_sum_ad=amdt_ad&
1208 temp_ad5 = dt2*idiag%zxg(i, j)*te_2d_ad(i, j)
1209 teq_ad(i, j) = teq_ad(i, j) - te_2d_ad(i, j)
1210 ps2_ad(i, j) = ps2_ad(i, j) + temp_ad5
1211 ps_ad(i, j) = ps_ad(i, j) + temp_ad5
1215 IF (branch .EQ. 0)
THEN 1221 & gridstruct, bd, ptop, ua, ua_ad, va, va_ad, u, u_ad&
1222 & , v, v_ad, delp, delp_ad, te_2d, te_2d_ad, ps, &
1223 & ps_ad, m_fac, m_fac_ad)
1226 nq = nq_tot - flagstruct%dnats
1227 k_split = flagstruct%k_split
1252 DO n_map=k_split,1,-1
1254 IF (branch .LT. 2)
THEN 1255 IF (branch .EQ. 0)
GOTO 110
1257 IF (branch .NE. 2)
THEN 1258 arg11 = 0.18*gridstruct%da_min
1260 & npx, npy, npz, flagstruct%nf_omega, bd)
1263 IF (branch .EQ. 0)
THEN 1268 temp_ad4 = omga_ad(i, j, k)/delz(i, j, k)
1269 delp_ad(i, j, k) = delp_ad(i, j, k) + w(i, j, k)*&
1271 w_ad(i, j, k) = w_ad(i, j, k) + delp(i, j, k)*temp_ad4
1272 delz_ad(i, j, k) = delz_ad(i, j, k) - delp(i, j, k)*w(i&
1273 & , j, k)*temp_ad4/delz(i, j, k)
1274 omga_ad(i, j, k) = 0.0
1280 kord_mt_pert = flagstructp%kord_mt_pert
1281 kord_wz_pert = flagstructp%kord_wz_pert
1283 & , pe_ad, delp, delp_ad, pkz, pkz_ad, pk&
1284 & , pk_ad, mdt, bdt, npz, is, ie, js, je, &
1285 & isd, ied, jsd, jed, nq, nwat, sphum, &
1286 & q_con, u, u_ad, v, v_ad, w, w_ad, delz, &
1287 & delz_ad, pt, pt_ad, q, q_ad, phis, zvir&
1288 & , cp_air, akap, cappa, kord_mt, kord_wz&
1289 & , kord_tracer, kord_tm, peln, peln_ad, &
1290 & te_2d, te_2d_ad, ng, ua, ua_ad, va, omga&
1291 & , omga_ad, dp1, dp1_ad, ws, ws_ad, fill&
1292 & , reproduce_sum, arg10, dtdt_m, ptop, ak&
1293 & , bk, pfull, flagstruct, gridstruct, &
1294 & domain, flagstruct%do_sat_adj, &
1295 & hydrostatic, hybrid_z, do_omega, &
1297 & , mfx, mfy, flagstruct%remap_option, &
1298 & kord_mt_pert, kord_wz_pert, &
1299 & kord_tracer_pert, kord_tm_pert)
1305 IF (branch .LT. 2)
THEN 1306 IF (branch .EQ. 0)
THEN 1308 & mfy, mfy_ad, cx, cx_ad, cy, cy_ad, &
1309 & gridstruct, bd, domain, npx, npy, npz, nq&
1310 & , flagstruct%hord_tr, q_split, mdt, idiag%&
1311 & id_divg, i_pack(10), flagstruct%nord_tr, &
1312 & flagstruct%trdm2, k_split, neststruct, &
1313 & parent_grid, flagstructp%hord_tr_pert, &
1314 & flagstructp%nord_tr_pert, flagstructp%&
1315 & trdm2_pert, flagstructp%split_damp_tr)
1318 & mfy_ad, cx, cx_ad, cy, cy_ad, gridstruct, bd, &
1319 & domain, npx, npy, npz, nq, flagstruct%hord_tr&
1320 & , q_split, mdt, idiag%id_divg, i_pack(10), &
1321 & flagstruct%nord_tr, flagstruct%trdm2, &
1322 & flagstructp%hord_tr_pert, flagstructp%&
1323 & nord_tr_pert, flagstructp%trdm2_pert, &
1324 & flagstructp%split_damp_tr)
1326 ELSE IF (branch .EQ. 2)
THEN 1327 CALL tracer_2d_bwd(q, q_ad, dp1, dp1_ad, mfx, mfx_ad, mfy, &
1328 & mfy_ad, cx, cx_ad, cy, cy_ad, gridstruct, bd, &
1329 & domain, npx, npy, npz, nq, flagstruct%hord_tr, &
1330 & q_split, mdt, idiag%id_divg, i_pack(10), flagstruct&
1331 & %nord_tr, flagstruct%trdm2, flagstructp%&
1332 & hord_tr_pert, flagstructp%nord_tr_pert, flagstructp&
1333 & %trdm2_pert, flagstructp%split_damp_tr)
1341 IF (branch .EQ. 0)
THEN 1345 psx_ad(i, j) = psx_ad(i, j) + pe_ad(i, npz+1, j)
1346 pe_ad(i, npz+1, j) = 0.0
1352 dpx_ad(i, j) = dpx_ad(i, j) + psx_ad(i, j)
1356 CALL dyn_core_bwd(npx, npy, npz, ng, sphum, nq, mdt, n_split, zvir&
1357 & , cp_air, akap, cappa,
grav, hydrostatic, u, u_ad, v, &
1358 & v_ad, w, w_ad, delz, delz_ad, pt, pt_ad, q, q_ad, delp&
1359 & , delp_ad, pe, pe_ad, pk, pk_ad, phis, ws, ws_ad, omga&
1360 & , omga_ad, ptop, pfull, ua, ua_ad, va, va_ad, uc, &
1361 & uc_ad, vc, vc_ad, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad&
1362 & , cy, cy_ad, pkz, pkz_ad, peln, peln_ad, q_con, ak, bk&
1363 & , dpx, dpx_ad, ks, gridstruct, flagstruct, flagstructp&
1364 & , neststruct, idiag, bd, domain, arg10, i_pack, &
1365 & last_step, gz, gz_ad, pkc, pkc_ad, ptc, ptc_ad, crx, &
1366 & crx_ad, xfx, xfx_ad, cry, cry_ad, yfx, yfx_ad, divgd, &
1367 & divgd_ad, delpc, delpc_ad, ut, ut_ad, vt, vt_ad, zh, &
1368 & zh_ad, pk3, pk3_ad, du, du_ad, dv, dv_ad, time_total)
1373 delp_ad(i, j, k) = delp_ad(i, j, k) + dp1_ad(i, j, k)
1374 dp1_ad(i, j, k) = 0.0
1378 CALL poprealarray(u, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+2)*npz)
1379 CALL poprealarray(v, (bd%ied-bd%isd+2)*(bd%jed-bd%jsd+1)*npz)
1381 & domain, gridtype=dgrid_ne)
1382 CALL poprealarray(pt, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1385 CALL poprealarray(delp, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
1387 & , complete=.true.)
1390 IF (branch .EQ. 0)
THEN 1393 pe_ad(i, npz+1, j) = pe_ad(i, npz+1, j) + psx_ad(i, j)
1394 psx_ad(i, j) = 0.0_8
1399 IF (branch .EQ. 0)
THEN 1402 IF (branch .NE. 0)
THEN 1406 pt_ad(i, j, k) = pt_ad(i, j, k) + q_ad(i, j, k, theta_d)
1407 q_ad(i, j, k, theta_d) = 0.0
1414 temp_ad2 = pt_ad(i, j, k)/pkz(i, j, k)
1415 pkz_ad(i, j, k) = pkz_ad(i, j, k) - pt(i, j, k)*temp_ad2/pkz&
1417 pt_ad(i, j, k) = temp_ad2
1426 temp7 = pkz(i, j, k)
1427 temp6 = pt(i, j, k)/temp7
1428 temp_ad3 = (dp1(i, j, k)+1.)*pt_ad(i, j, k)/temp7
1429 dp1_ad(i, j, k) = dp1_ad(i, j, k) + temp6*pt_ad(i, j, k)
1430 pkz_ad(i, j, k) = pkz_ad(i, j, k) - temp6*temp_ad3
1431 pt_ad(i, j, k) = temp_ad3
1437 IF (branch .EQ. 0)
THEN 1439 & flagstruct%tau, u, u_ad, v, v_ad, w, w_ad, pt, &
1440 & pt_ad, ua, ua_ad, va, va_ad, delz, gridstruct%&
1441 & agrid, cp_air,
rdgas, ptop, hydrostatic, arg10, &
1442 & flagstruct%rf_cutoff,
rf, gridstruct, domain, bd&
1444 ELSE IF (branch .EQ. 1)
THEN 1446 & flagstruct%tau, u, u_ad, v, v_ad, w, w_ad, pt&
1447 & , pt_ad, ua, ua_ad, va, va_ad, delz, delz_ad&
1448 & , cp_air,
rdgas, ptop, hydrostatic, .true., &
1449 & flagstruct%rf_cutoff,
rf, gridstruct, domain&
1454 & ied, jsd, jed, gridstruct, bd, &
1455 & ptop, ua, ua_ad, va, va_ad, u, &
1456 & u_ad, v, v_ad, delp, delp_ad, teq&
1457 & , teq_ad, ps2, ps2_ad, m_fac, &
1461 & , ied, jsd, jed, npz, u, &
1462 & u_ad, v, v_ad, w, w_ad, &
1463 & delz, delz_ad, pt, pt_ad&
1464 & , delp, delp_ad, q, q_ad&
1465 & , dp1, dp1_ad, pe, pe_ad&
1466 & , peln, peln_ad, phis, &
1467 & gridstruct%rsin2, &
1468 & gridstruct%cosa_s, zvir, &
1470 & , te_2d_ad, ua, va, teq, &
1471 & teq_ad, flagstruct%&
1472 & moist_phys, nwat, sphum, &
1473 & liq_wat, rainwat, ice_wat&
1474 & , snowwat, graupel, &
1475 & hydrostatic, idiag%id_te)
1479 IF (branch .EQ. 0)
THEN 1483 q_ad(i, j, k, sphum) = q_ad(i, j, k, sphum) + zvir*dp1_ad(i&
1485 dp1_ad(i, j, k) = 0.0
1492 IF (branch .EQ. 0)
THEN 1496 temp5 = delz(i, j, k)
1497 temp4 = delp(i, j, k)*pt(i, j, k)
1499 temp_ad1 = kappa*exp(kappa*log(rdg*temp3))*pkz_ad(i, j, k)&
1501 delp_ad(i, j, k) = delp_ad(i, j, k) + pt(i, j, k)*temp_ad1
1502 pt_ad(i, j, k) = pt_ad(i, j, k) + delp(i, j, k)*temp_ad1
1503 delz_ad(i, j, k) = delz_ad(i, j, k) - temp3*temp_ad1
1504 pkz_ad(i, j, k) = 0.0
1505 dp1_ad(i, j, k) = 0.0
1512 temp2 = delz(i, j, k)
1513 temp = (dp1(i, j, k)+1.)/temp2
1514 temp1 = delp(i, j, k)*pt(i, j, k)
1515 temp0 = rdg*temp1*temp
1516 temp_ad = kappa*exp(kappa*log(temp0))*rdg*pkz_ad(i, j, k)/&
1518 temp_ad0 = temp1*temp_ad/temp2
1519 delp_ad(i, j, k) = delp_ad(i, j, k) + temp*pt(i, j, k)*&
1521 pt_ad(i, j, k) = pt_ad(i, j, k) + temp*delp(i, j, k)*&
1523 dp1_ad(i, j, k) = dp1_ad(i, j, k) + temp_ad0
1524 delz_ad(i, j, k) = delz_ad(i, j, k) - temp*temp_ad0
1525 pkz_ad(i, j, k) = 0.0
1526 q_ad(i, j, k, sphum) = q_ad(i, j, k, sphum) + zvir*dp1_ad(&
1528 dp1_ad(i, j, k) = 0.0
1537 IF (branch .EQ. 0)
THEN 1539 & , bd, 1., 1., neststruct%pt_bc, &
1540 & neststruct%nestbctype)
1541 ELSE IF (branch .NE. 1)
THEN 1545 & v, v_ad, w, pt, delp, delz, q, uc, uc_ad, &
1546 & vc, vc_ad, pkz, neststruct%nested, &
1547 & flagstruct%inline_q, flagstruct%make_nh, ng&
1548 & , gridstruct, flagstruct, neststruct, &
1549 & neststruct%nest_timestep, neststruct%&
1550 & tracer_nest_timestep, domain, bd, nwat)
1556 SUBROUTINE fv_dynamics(npx, npy, npz, nq_tot, ng, bdt, consv_te, fill&
1557 & , reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, &
1558 & q_split, u, v, w, delz, hydrostatic, pt, delp, q, ps, pe, pk, peln, &
1559 & pkz, phis, q_con, omga, ua, va, uc, vc, ak, bk, mfx, mfy, cx, cy, &
1560 & ze0, hybrid_z, gridstruct, flagstruct, flagstructp, neststruct, &
1561 & idiag, bd, parent_grid, domain, time_total)
1564 REAL,
INTENT(IN) :: bdt
1565 REAL,
INTENT(IN) :: consv_te
1566 REAL,
INTENT(IN) :: kappa, cp_air
1567 REAL,
INTENT(IN) :: zvir, ptop
1568 REAL,
INTENT(IN),
OPTIONAL :: time_total
1569 INTEGER,
INTENT(IN) :: npx
1570 INTEGER,
INTENT(IN) :: npy
1571 INTEGER,
INTENT(IN) :: npz
1573 INTEGER,
INTENT(IN) :: nq_tot
1574 INTEGER,
INTENT(IN) :: ng
1575 INTEGER,
INTENT(IN) :: ks
1576 INTEGER,
INTENT(IN) :: ncnst
1578 INTEGER,
INTENT(IN) :: n_split
1580 INTEGER,
INTENT(IN) :: q_split
1581 LOGICAL,
INTENT(IN) :: fill
1582 LOGICAL,
INTENT(IN) :: reproduce_sum
1583 LOGICAL,
INTENT(IN) :: hydrostatic
1585 LOGICAL,
INTENT(IN) :: hybrid_z
1588 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz),
INTENT(INOUT) &
1591 REAL,
DIMENSION(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz),
INTENT(INOUT) &
1594 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1596 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1598 REAL,
INTENT(INOUT) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1600 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, ncnst)
1602 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1604 REAL,
INTENT(INOUT) :: ze0(bd%is:bd%is, bd%js:bd%js, 1)
1612 REAL,
INTENT(INOUT) :: ps(bd%isd:bd%ied, bd%jsd:bd%jed)
1614 REAL,
INTENT(INOUT) :: pe(bd%is-1:bd%ie+1, npz+1, bd%js-1:bd%je+1)
1616 REAL,
INTENT(INOUT) :: pk(bd%is:bd%ie, bd%js:bd%je, npz+1)
1618 REAL,
INTENT(INOUT) :: peln(bd%is:bd%ie, npz+1, bd%js:bd%je)
1620 REAL,
INTENT(INOUT) :: pkz(bd%is:bd%ie, bd%js:bd%je, npz)
1621 REAL,
INTENT(INOUT) :: q_con(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1626 REAL,
INTENT(INOUT) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
1628 REAL,
INTENT(INOUT) :: omga(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1630 REAL,
INTENT(INOUT) :: uc(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
1631 REAL,
INTENT(INOUT) :: vc(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
1632 REAL,
DIMENSION(bd%isd:bd%ied, bd%jsd:bd%jed, npz),
INTENT(INOUT) ::&
1634 REAL,
DIMENSION(npz+1),
INTENT(IN) :: ak, bk
1636 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
1637 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
1639 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1640 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1641 TYPE(
fv_grid_type),
INTENT(INOUT),
TARGET :: gridstruct
1645 TYPE(
domain2d),
INTENT(INOUT) :: domain
1649 REAL :: ws(bd%is:bd%ie, bd%js:bd%je)
1650 REAL :: te_2d(bd%is:bd%ie, bd%js:bd%je)
1651 REAL :: teq(bd%is:bd%ie, bd%js:bd%je)
1652 REAL :: ps2(bd%isd:bd%ied, bd%jsd:bd%jed)
1653 REAL :: m_fac(bd%is:bd%ie, bd%js:bd%je)
1655 REAL,
DIMENSION(bd%is:bd%ie) :: cvm
1656 REAL :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz), dtdt_m(bd%is:bd%ie, &
1657 & bd%js:bd%je, npz), cappa(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1658 REAL(kind=8) :: psx(bd%isd:bd%ied, bd%jsd:bd%jed)
1659 REAL(kind=8) :: dpx(bd%is:bd%ie, bd%js:bd%je)
1660 REAL :: akap, rdg, ph1, ph2, mdt, gam, amdt, u0
1661 INTEGER :: kord_tracer(ncnst), kord_mt, kord_wz, kord_tm
1662 INTEGER :: kord_tracer_pert(ncnst), kord_mt_pert, kord_wz_pert, &
1664 INTEGER :: i, j, k, n, iq, n_map, nq, nwat, k_split
1667 INTEGER,
SAVE :: liq_wat=-999
1668 INTEGER,
SAVE :: ice_wat=-999
1669 INTEGER,
SAVE :: rainwat=-999
1670 INTEGER,
SAVE :: snowwat=-999
1671 INTEGER,
SAVE :: graupel=-999
1672 INTEGER,
SAVE :: cld_amt=-999
1673 INTEGER,
SAVE :: theta_d=-999
1674 LOGICAL :: used, last_step, do_omega
1675 INTEGER,
PARAMETER :: max_packs=12
1676 TYPE(group_halo_update_type),
SAVE :: i_pack(max_packs)
1677 INTEGER :: is, ie, js, je
1678 INTEGER :: isd, ied, jsd, jed
1680 REAL(kind=8) :: t1, t2
1683 REAL :: gz(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1684 REAL :: pkc(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1685 REAL :: ptc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1686 REAL :: crx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1687 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1688 REAL :: cry(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1689 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1690 REAL :: divgd(bd%isd:bd%ied+1, bd%jsd:bd%jed+1, npz)
1691 REAL :: delpc(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1692 REAL :: ut(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1693 REAL :: vt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1694 REAL :: zh(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1695 REAL :: pk3(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1696 REAL :: du(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
1697 REAL :: dv(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
1709 REAL,
DIMENSION(bd%is:bd%ie, bd%js:bd%je) :: arg12
1739 k_split = flagstruct%k_split
1740 nwat = flagstruct%nwat
1741 nq = nq_tot - flagstruct%dnats
1752 IF (gridstruct%nested .OR. any(neststruct%child_grids))
THEN 1754 CALL setup_nested_grid_bcs(npx, npy, npz, zvir, ncnst, u, v, w, pt&
1755 & , delp, delz, q, uc, vc, pkz, neststruct%&
1756 & nested, flagstruct%inline_q, flagstruct%&
1757 & make_nh, ng, gridstruct, flagstruct, &
1758 & neststruct, neststruct%nest_timestep, &
1759 & neststruct%tracer_nest_timestep, domain, bd, &
1761 IF (gridstruct%nested)
CALL nested_grid_bc_apply_intt(pt, 0, 0, &
1762 & npx, npy, npz, bd&
1764 & neststruct%pt_bc, &
1770 IF (flagstruct%no_dycore)
THEN 1775 IF (
fpp%fpp_mapl_mode)
THEN 1813 IF (nwat .EQ. 0)
THEN 1832 ph1 = ak(k) + bk(k)*flagstruct%p_ref
1833 ph2 = ak(k+1) + bk(k+1)*flagstruct%p_ref
1834 pfull(k) = (ph2-ph1)/log(ph2/ph1)
1836 IF (hydrostatic)
THEN 1842 dp1(i, j, k) = zvir*q(i, j, k, sphum)
1852 IF (flagstruct%moist_phys)
THEN 1855 dp1(i, j, k) = zvir*q(i, j, k, sphum)
1856 pkz(i, j, k) = exp(kappa*log(rdg*delp(i, j, k)*pt(i, j, k)&
1857 & *(1.+dp1(i, j, k))/delz(i, j, k)))
1867 pkz(i, j, k) = exp(kappa*log(rdg*delp(i, j, k)*pt(i, j, k)&
1874 IF (flagstruct%fv_debug)
THEN 1875 CALL prt_mxm(
'PS', ps, is, ie, js, je, ng, 1, 0.01, gridstruct%&
1877 CALL prt_mxm(
'T_dyn_b', pt, is, ie, js, je, ng, npz, 1., &
1878 & gridstruct%area_64, domain)
1879 IF (.NOT.hydrostatic)
CALL prt_mxm(
'delz', delz, is, ie, js, je, &
1880 & ng, npz, 1., gridstruct%area_64, &
1882 CALL prt_mxm(
'delp_b ', delp, is, ie, js, je, ng, npz, 0.01, &
1883 & gridstruct%area_64, domain)
1885 CALL prt_mxm(
'pk_b', pk, is, ie, js, je, 0, arg1, 1., gridstruct%&
1887 CALL prt_mxm(
'pkz_b', pkz, is, ie, js, je, 0, npz, 1., gridstruct%&
1894 CALL compute_total_energy(is, ie, js, je, isd, ied, jsd, jed, npz&
1895 & , u, v, w, delz, pt, delp, q, dp1, pe, peln, &
1896 & phis, gridstruct%rsin2, gridstruct%cosa_s, &
1897 & zvir, cp_air,
rdgas,
hlv, te_2d, ua, va, teq, &
1898 & flagstruct%moist_phys, nwat, sphum, liq_wat, &
1899 & rainwat, ice_wat, snowwat, graupel, &
1900 & hydrostatic, idiag%id_te)
1906 IF ((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .AND. (.NOT.&
1908 & ied, jsd, jed, gridstruct, bd, &
1909 & ptop, ua, va, u, v, delp, teq, &
1911 IF (flagstruct%tau .GT. 0.)
THEN 1912 IF (gridstruct%grid_type .LT. 4)
THEN 1913 IF (bdt .GE. 0.)
THEN 1918 arg10 = .NOT.neststruct%nested
1920 & flagstruct%tau, u, v, w, pt, ua, va, delz, &
1921 & gridstruct%agrid, cp_air,
rdgas, ptop, hydrostatic&
1922 & , arg10, flagstruct%rf_cutoff,
rf, gridstruct, &
1925 IF (bdt .GE. 0.)
THEN 1931 & flagstruct%tau, u, v, w, pt, ua, va, delz, &
1932 & cp_air,
rdgas, ptop, hydrostatic, .true., &
1933 & flagstruct%rf_cutoff,
rf, gridstruct, domain, &
1938 IF (flagstruct%adiabatic)
THEN 1943 pt(i, j, k) = pt(i, j, k)/pkz(i, j, k)
1946 IF (theta_d .GT. 0)
THEN 1949 q(i, j, k, theta_d) = pt(i, j, k)
1959 pt(i, j, k) = pt(i, j, k)*(1.+dp1(i, j, k))/pkz(i, j, k)
1965 mdt = bdt/
REAL(k_split)
1972 dtdt_m(i, j, k) = 0.
1979 IF (
fpp%fpp_overload_r4)
THEN 1982 psx(i, j) = pe(i, npz+1, j)
2002 dp1(i, j, k) = delp(i, j, k)
2006 IF (n_map .EQ. k_split) last_step = .true.
2008 arg10 = n_map .EQ. 1
2009 CALL dyn_core(npx, npy, npz, ng, sphum, nq, mdt, n_split, zvir, &
2010 & cp_air, akap, cappa,
grav, hydrostatic, u, v, w, delz, pt&
2011 & , q, delp, pe, pk, phis, ws, omga, ptop, pfull, ua, va, uc&
2012 & , vc, mfx, mfy, cx, cy, pkz, peln, q_con, ak, bk, dpx, ks&
2013 & , gridstruct, flagstruct, flagstructp, neststruct, idiag, &
2014 & bd, domain, arg10, i_pack, last_step, gz, pkc, ptc, crx, &
2015 & xfx, cry, yfx, divgd, delpc, ut, vt, zh, pk3, du, dv, &
2020 IF (
fpp%fpp_overload_r4)
THEN 2023 psx(i, j) = psx(i, j) + dpx(i, j)
2031 pe(i, npz+1, j) = psx(i, j)
2037 IF (.NOT.flagstruct%inline_q .AND. nq .NE. 0)
THEN 2043 IF (gridstruct%nested)
THEN 2044 CALL tracer_2d_nested(q, dp1, mfx, mfy, cx, cy, gridstruct, bd&
2045 & , domain, npx, npy, npz, nq, flagstruct%&
2046 & hord_tr, q_split, mdt, idiag%id_divg, i_pack(&
2047 & 10), flagstruct%nord_tr, flagstruct%trdm2, &
2048 & k_split, neststruct, parent_grid, flagstructp%&
2049 & hord_tr_pert, flagstructp%nord_tr_pert, &
2050 & flagstructp%trdm2_pert, flagstructp%&
2052 ELSE IF (flagstruct%z_tracer)
THEN 2053 CALL tracer_2d_1l(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, &
2054 & domain, npx, npy, npz, nq, flagstruct%hord_tr, &
2055 & q_split, mdt, idiag%id_divg, i_pack(10), &
2056 & flagstruct%nord_tr, flagstruct%trdm2, flagstructp%&
2057 & hord_tr_pert, flagstructp%nord_tr_pert, &
2058 & flagstructp%trdm2_pert, flagstructp%split_damp_tr)
2060 CALL tracer_2d(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, &
2061 & domain, npx, npy, npz, nq, flagstruct%hord_tr, &
2062 & q_split, mdt, idiag%id_divg, i_pack(10), flagstruct%&
2063 & nord_tr, flagstruct%trdm2, flagstructp%hord_tr_pert, &
2064 & flagstructp%nord_tr_pert, flagstructp%trdm2_pert, &
2065 & flagstructp%split_damp_tr)
2068 IF (flagstruct%hord_tr .LT. 8 .AND. flagstruct%moist_phys)
THEN 2070 IF (liq_wat .GT. 0)
CALL fill2d(is, ie, js, je, ng, npz, q(isd&
2071 & :ied, jsd:jed, 1, liq_wat), delp, &
2072 & gridstruct%area, domain, neststruct%&
2074 IF (rainwat .GT. 0)
CALL fill2d(is, ie, js, je, ng, npz, q(isd&
2075 & :ied, jsd:jed, 1, rainwat), delp, &
2076 & gridstruct%area, domain, neststruct%&
2078 IF (ice_wat .GT. 0)
CALL fill2d(is, ie, js, je, ng, npz, q(isd&
2079 & :ied, jsd:jed, 1, ice_wat), delp, &
2080 & gridstruct%area, domain, neststruct%&
2082 IF (snowwat .GT. 0)
CALL fill2d(is, ie, js, je, ng, npz, q(isd&
2083 & :ied, jsd:jed, 1, snowwat), delp, &
2084 & gridstruct%area, domain, neststruct%&
2086 IF (graupel .GT. 0)
CALL fill2d(is, ie, js, je, ng, npz, q(isd&
2087 & :ied, jsd:jed, 1, graupel), delp, &
2088 & gridstruct%area, domain, neststruct%&
2092 IF (last_step .AND. idiag%id_divg .GT. 0)
THEN 2094 IF (flagstruct%fv_debug)
CALL prt_mxm(
'divg', dp1, is, ie, js&
2095 & , je, 0, npz, 1., gridstruct%&
2099 IF (npz .GT. 4)
THEN 2107 kord_tracer(iq) = flagstruct%kord_tr
2109 IF (iq .EQ. cld_amt) kord_tracer(iq) = 9
2110 kord_tracer_pert(iq) = flagstructp%kord_tr_pert
2112 IF (iq .EQ. cld_amt) kord_tracer_pert(iq) = 17
2114 do_omega = hydrostatic .AND. last_step
2116 kord_mt = flagstruct%kord_mt
2117 kord_wz = flagstruct%kord_wz
2118 kord_tm = flagstruct%kord_tm
2119 kord_mt_pert = flagstructp%kord_mt_pert
2120 kord_wz_pert = flagstructp%kord_wz_pert
2121 kord_tm_pert = flagstructp%kord_tm_pert
2122 IF (n_map .EQ. k_split)
THEN 2123 kord_mt = kord_mt_pert
2124 kord_wz = kord_wz_pert
2125 kord_tm = kord_tm_pert
2126 kord_tracer = kord_tracer_pert
2128 arg10 = idiag%id_mdt .GT. 0
2129 CALL lagrangian_to_eulerian(last_step, consv_te, ps, pe, delp, &
2130 & pkz, pk, mdt, bdt, npz, is, ie, js, je, &
2131 & isd, ied, jsd, jed, nq, nwat, sphum, q_con&
2132 & , u, v, w, delz, pt, q, phis, zvir, cp_air&
2133 & , akap, cappa, kord_mt, kord_wz, &
2134 & kord_tracer, kord_tm, peln, te_2d, ng, ua&
2135 & , va, omga, dp1, ws, fill, reproduce_sum, &
2136 & arg10, dtdt_m, ptop, ak, bk, pfull, &
2137 & flagstruct, gridstruct, domain, flagstruct&
2138 & %do_sat_adj, hydrostatic, hybrid_z, &
2139 & do_omega, flagstruct%adiabatic, &
2141 & remap_option, kord_mt_pert, kord_wz_pert, &
2142 & kord_tracer_pert, kord_tm_pert)
2145 IF (.NOT.hydrostatic)
THEN 2150 omga(i, j, k) = delp(i, j, k)/delz(i, j, k)*w(i, j, k)
2158 IF (flagstruct%nf_omega .GT. 0)
THEN 2159 arg11 = 0.18*gridstruct%da_min
2160 CALL del2_cubed(omga, arg11, gridstruct, domain, npx, npy, &
2161 & npz, flagstruct%nf_omega, bd)
2174 dtdt_m(i, j, k) = dtdt_m(i, j, k)/bdt*86400.
2182 IF (nwat .EQ. 6)
THEN 2183 IF (cld_amt .GT. 0)
THEN 2184 CALL neg_adj3(is, ie, js, je, ng, npz, flagstruct%hydrostatic, &
2185 & peln, delz, pt, delp, q(isd:ied, jsd:jed, 1, sphum), q(&
2186 & isd:ied, jsd:jed, 1, liq_wat), q(isd:ied, jsd:jed, 1, &
2187 & rainwat), q(isd:ied, jsd:jed, 1, ice_wat), q(isd:ied, &
2188 & jsd:jed, 1, snowwat), q(isd:ied, jsd:jed, 1, graupel), q&
2189 & (isd:ied, jsd:jed, 1, cld_amt), flagstruct%&
2192 CALL neg_adj3(is, ie, js, je, ng, npz, flagstruct%hydrostatic, &
2193 & peln, delz, pt, delp, q(isd:ied, jsd:jed, 1, sphum), q(&
2194 & isd:ied, jsd:jed, 1, liq_wat), q(isd:ied, jsd:jed, 1, &
2195 & rainwat), q(isd:ied, jsd:jed, 1, ice_wat), q(isd:ied, &
2196 & jsd:jed, 1, snowwat), q(isd:ied, jsd:jed, 1, graupel), &
2197 & check_negative=flagstruct%check_negative)
2199 IF (flagstruct%fv_debug)
THEN 2200 CALL prt_mxm(
'T_dyn_a3', pt, is, ie, js, je, ng, npz, 1., &
2201 & gridstruct%area_64, domain)
2202 CALL prt_mxm(
'SPHUM_dyn', q(isd:ied, jsd:jed, 1, sphum), is, ie&
2203 & , js, je, ng, npz, 1., gridstruct%area_64, domain)
2204 CALL prt_mxm(
'liq_wat_dyn', q(isd:ied, jsd:jed, 1, liq_wat), is&
2205 & , ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
2206 CALL prt_mxm(
'rainwat_dyn', q(isd:ied, jsd:jed, 1, rainwat), is&
2207 & , ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
2208 CALL prt_mxm(
'ice_wat_dyn', q(isd:ied, jsd:jed, 1, ice_wat), is&
2209 & , ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
2210 CALL prt_mxm(
'snowwat_dyn', q(isd:ied, jsd:jed, 1, snowwat), is&
2211 & , ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
2212 CALL prt_mxm(
'graupel_dyn', q(isd:ied, jsd:jed, 1, graupel), is&
2213 & , ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
2216 IF (((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .OR. idiag%&
2218 CALL compute_aam(npz, is, ie, js, je, isd, ied, jsd, jed, &
2219 & gridstruct, bd, ptop, ua, va, u, v, delp, te_2d, ps, &
2221 IF (idiag%id_aam .GT. 0)
THEN 2223 IF (
prt_minmax) gam = g_sum(domain, te_2d, is, ie, js, je, ng, &
2224 & gridstruct%area_64, 0)
2228 IF ((flagstruct%consv_am .OR. idiag%id_amdt .GT. 0) .AND. (.NOT.&
2235 te_2d(i, j) = te_2d(i, j) - teq(i, j) + dt2*(ps2(i, j)+ps(i, j&
2236 & ))*idiag%zxg(i, j)
2239 IF (idiag%id_amdt .GT. 0)
THEN 2240 arg12(:, :) = te_2d/bdt
2243 IF (flagstruct%consv_am .OR.
prt_minmax)
THEN 2244 amdt = g_sum(domain, te_2d, is, ie, js, je, ng, gridstruct%&
2245 & area_64, 0, .true.)
2246 result1 = g_sum(domain, m_fac, is, ie, js, je, ng, gridstruct%&
2247 & area_64, 0, .true.)
2248 u0 = -(
radius*amdt/result1)
2249 IF (is_master() .AND.
prt_minmax)
WRITE(6, *) &
2250 &
'Dynamic AM tendency (Hadleys)='&
2251 & , amdt/(bdt*1.e18), &
2252 &
'del-u (per day)=', u0*86400./&
2256 IF (flagstruct%consv_am)
THEN 2260 m_fac(i, j) = u0*cos(gridstruct%agrid(i, j, 2))
2268 u(i, j, k) = u(i, j, k) + u0*gridstruct%l2c_u(i, j)
2273 v(i, j, k) = v(i, j, k) + u0*gridstruct%l2c_v(i, j)
2283 IF (flagstruct%fv_debug)
THEN 2284 CALL prt_mxm(
'UA', ua, is, ie, js, je, ng, npz, 1., gridstruct%&
2286 CALL prt_mxm(
'VA', va, is, ie, js, je, ng, npz, 1., gridstruct%&
2288 CALL prt_mxm(
'TA', pt, is, ie, js, je, ng, npz, 1., gridstruct%&
2290 IF (.NOT.hydrostatic)
CALL prt_mxm(
'W ', w, is, ie, js, je, ng, &
2291 & npz, 1., gridstruct%area_64, domain)
2293 IF (flagstruct%range_warn)
THEN 2294 CALL range_check(
'UA_dyn', ua, is, ie, js, je, ng, npz, gridstruct&
2296 CALL range_check(
'VA_dyn', ua, is, ie, js, je, ng, npz, gridstruct&
2298 CALL range_check(
'TA_dyn', pt, is, ie, js, je, ng, npz, gridstruct&
2300 IF (.NOT.hydrostatic)
CALL range_check(
'W_dyn', w, is, ie, js, je&
2301 & , ng, npz, gridstruct%agrid, -50.&
2328 & , v, w, pt, ua, va, delz, agrid, cp, rg, ptop, hydrostatic, conserve&
2329 & , rf_cutoff, rf, gridstruct, domain, bd)
2332 REAL,
INTENT(IN) :: dt
2334 REAL,
INTENT(IN) :: tau
2335 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
2336 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
2337 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
2338 LOGICAL,
INTENT(IN) :: hydrostatic
2339 LOGICAL,
INTENT(IN) :: conserve
2340 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
2342 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
2344 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
2346 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2348 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2350 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2352 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2354 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2355 REAL,
INTENT(INOUT) :: rf(npz)
2356 REAL,
INTENT(IN) :: agrid(bd%isd:bd%ied, bd%jsd:bd%jed, 2)
2358 REAL,
INTENT(IN) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
2359 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
2360 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
2362 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2364 REAL,
PARAMETER :: u0=60.
2365 REAL,
PARAMETER :: sday=86400.
2368 INTEGER :: is, ie, js, je
2369 INTEGER :: isd, ied, jsd, jed
2400 IF (res)
WRITE(6, *)
'Rayleigh friction E-folding time (days):' 2403 IF (pm(k) .LT. rf_cutoff)
THEN 2404 rf(k) = dt/tau0*sin(0.5*
pi*log(rf_cutoff/pm(k))/log(rf_cutoff/&
2408 ad_count = ad_count + 1
2424 CALL c2l_ord2_fwd(u, v, ua, va, gridstruct, npz, gridstruct%&
2431 IF (pm(k) .LT. rf_cutoff)
THEN 2433 u2f(:, :, k) = 1./(1.+rf(k))
2443 IF (pm(k) .LT. rf_cutoff)
THEN 2446 IF (hydrostatic)
THEN 2450 pt(i, j, k) = pt(i, j, k) + 0.5*(ua(i, j, k)**2+va(i, j&
2451 & , k)**2)*(1.-u2f(i, j, k)**2)/(cp-rg*ptop/pm(k))
2459 pt(i, j, k) = pt(i, j, k) + 0.5*(ua(i, j, k)**2+va(i, j&
2460 & , k)**2+w(i, j, k)**2)*(1.-u2f(i, j, k)**2)*rcv
2471 u(i, j, k) = 0.5*(u2f(i, j-1, k)+u2f(i, j, k))*u(i, j, k)
2477 v(i, j, k) = 0.5*(u2f(i-1, j, k)+u2f(i, j, k))*v(i, j, k)
2480 IF (.NOT.hydrostatic)
THEN 2484 w(i, j, k) = u2f(i, j, k)*w(i, j, k)
2495 CALL pushrealarray(u2f, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
2523 & , u_ad, v, v_ad, w, w_ad, pt, pt_ad, ua, ua_ad, va, va_ad, delz, &
2524 & agrid, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, &
2525 & gridstruct, domain, bd)
2528 REAL,
INTENT(IN) :: dt
2529 REAL,
INTENT(IN) :: tau
2530 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
2531 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
2532 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
2533 LOGICAL,
INTENT(IN) :: hydrostatic
2534 LOGICAL,
INTENT(IN) :: conserve
2535 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
2536 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
2537 REAL,
INTENT(INOUT) :: u_ad(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
2538 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
2539 REAL,
INTENT(INOUT) :: v_ad(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
2540 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2541 REAL,
INTENT(INOUT) :: w_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2542 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2543 REAL,
INTENT(INOUT) :: pt_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2544 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2545 REAL,
INTENT(INOUT) :: ua_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2546 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2547 REAL,
INTENT(INOUT) :: va_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2548 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2549 REAL,
INTENT(INOUT) :: rf(npz)
2550 REAL,
INTENT(IN) :: agrid(bd%isd:bd%ied, bd%jsd:bd%jed, 2)
2551 REAL,
INTENT(IN) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
2552 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
2553 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
2554 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2555 REAL,
PARAMETER :: u0=60.
2556 REAL,
PARAMETER :: sday=86400.
2559 INTEGER :: is, ie, js, je
2560 INTEGER :: isd, ied, jsd, jed
2588 CALL poprealarray(u2f, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
2591 IF (branch .NE. 0)
THEN 2592 IF (branch .NE. 1)
THEN 2596 w_ad(i, j, k) = u2f(i, j, k)*w_ad(i, j, k)
2603 v_ad(i, j, k) = (u2f(i-1, j, k)+u2f(i, j, k))*0.5*v_ad(i, j&
2610 u_ad(i, j, k) = (u2f(i, j-1, k)+u2f(i, j, k))*0.5*u_ad(i, j&
2615 IF (branch .NE. 0)
THEN 2616 IF (branch .EQ. 1)
THEN 2620 temp_ad0 = (1.-u2f(i, j, k)**2)*rcv*0.5*pt_ad(i, j, k)
2621 ua_ad(i, j, k) = ua_ad(i, j, k) + 2*ua(i, j, k)*temp_ad0
2622 va_ad(i, j, k) = va_ad(i, j, k) + 2*va(i, j, k)*temp_ad0
2623 w_ad(i, j, k) = w_ad(i, j, k) + 2*w(i, j, k)*temp_ad0
2630 temp_ad = (1.-u2f(i, j, k)**2)*0.5*pt_ad(i, j, k)/(cp-rg&
2632 ua_ad(i, j, k) = ua_ad(i, j, k) + 2*ua(i, j, k)*temp_ad
2633 va_ad(i, j, k) = va_ad(i, j, k) + 2*va(i, j, k)*temp_ad
2643 CALL c2l_ord2_bwd(u, u_ad, v, v_ad, ua, ua_ad, va, va_ad, gridstruct&
2644 & , npz, gridstruct%grid_type, bd, gridstruct%nested)
2646 IF (branch .EQ. 0)
THEN 2653 SUBROUTINE rayleigh_super(dt, npx, npy, npz, ks, pm, phis, tau, u, v, &
2654 & w, pt, ua, va, delz, agrid, cp, rg, ptop, hydrostatic, conserve, &
2655 & rf_cutoff, rf, gridstruct, domain, bd)
2658 REAL,
INTENT(IN) :: dt
2660 REAL,
INTENT(IN) :: tau
2661 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
2662 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
2663 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
2664 LOGICAL,
INTENT(IN) :: hydrostatic
2665 LOGICAL,
INTENT(IN) :: conserve
2666 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
2668 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
2670 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
2672 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2674 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2676 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2678 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2680 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2681 REAL,
INTENT(INOUT) :: rf(npz)
2682 REAL,
INTENT(IN) :: agrid(bd%isd:bd%ied, bd%jsd:bd%jed, 2)
2684 REAL,
INTENT(IN) :: phis(bd%isd:bd%ied, bd%jsd:bd%jed)
2685 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
2686 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
2688 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2690 REAL,
PARAMETER :: u0=60.
2691 REAL,
PARAMETER :: sday=86400.
2694 INTEGER :: is, ie, js, je
2695 INTEGER :: isd, ied, jsd, jed
2713 IF (is_master())
WRITE(6, *) &
2714 &
'Rayleigh friction E-folding time (days):' 2716 IF (pm(k) .LT. rf_cutoff)
THEN 2717 rf(k) = dt/tau0*sin(0.5*
pi*log(rf_cutoff/pm(k))/log(rf_cutoff/&
2727 CALL c2l_ord2(u, v, ua, va, gridstruct, npz, gridstruct%grid_type, &
2728 & bd, gridstruct%nested)
2734 IF (pm(k) .LT. rf_cutoff)
THEN 2735 u2f(:, :, k) = 1./(1.+rf(k))
2746 IF (pm(k) .LT. rf_cutoff)
THEN 2749 IF (hydrostatic)
THEN 2752 pt(i, j, k) = pt(i, j, k) + 0.5*(ua(i, j, k)**2+va(i, j&
2753 & , k)**2)*(1.-u2f(i, j, k)**2)/(cp-rg*ptop/pm(k))
2759 pt(i, j, k) = pt(i, j, k) + 0.5*(ua(i, j, k)**2+va(i, j&
2760 & , k)**2+w(i, j, k)**2)*(1.-u2f(i, j, k)**2)*rcv
2767 u(i, j, k) = 0.5*(u2f(i, j-1, k)+u2f(i, j, k))*u(i, j, k)
2772 v(i, j, k) = 0.5*(u2f(i-1, j, k)+u2f(i, j, k))*v(i, j, k)
2775 IF (.NOT.hydrostatic)
THEN 2778 w(i, j, k) = u2f(i, j, k)*w(i, j, k)
2806 & , w, pt, ua, va, delz, cp, rg, ptop, hydrostatic, conserve, &
2807 & rf_cutoff, rf, gridstruct, domain, bd)
2810 REAL,
INTENT(IN) :: dt
2812 REAL,
INTENT(IN) :: tau
2813 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
2814 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
2815 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
2816 LOGICAL,
INTENT(IN) :: hydrostatic
2817 LOGICAL,
INTENT(IN) :: conserve
2818 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
2820 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
2822 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
2824 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2826 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2828 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2830 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2832 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2833 REAL,
INTENT(INOUT) :: rf(npz)
2834 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
2835 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
2837 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
2838 REAL,
PARAMETER :: sday=86400.
2840 REAL,
PARAMETER :: u000=4900.
2843 INTEGER :: is, ie, js, je
2844 INTEGER :: isd, ied, jsd, jed
2872 IF (res)
WRITE(6, *)
'Rayleigh friction E-folding time (days):' 2875 IF (pm(k) .LT. rf_cutoff)
THEN 2876 rf(k) = dt/(tau*sday)*sin(0.5*
pi*log(rf_cutoff/pm(k))/log(&
2877 & rf_cutoff/ptop))**2
2880 ad_count = ad_count + 1
2897 CALL c2l_ord2_fwd(u, v, ua, va, gridstruct, npz, gridstruct%&
2901 IF (hydrostatic)
THEN 2904 u2f(i, j, k) = ua(i, j, k)**2 + va(i, j, k)**2
2911 u2f(i, j, k) = ua(i, j, k)**2 + va(i, j, k)**2 + w(i, j, k)&
2923 IF (hydrostatic)
THEN 2927 pt(i, j, k) = pt(i, j, k) + 0.5*u2f(i, j, k)/(cp-rg*ptop/&
2928 & pm(k))*(1.-1./(1.+rf(k)*sqrt(u2f(i, j, k)/u000))**2)
2936 delz(i, j, k) = delz(i, j, k)/pt(i, j, k)
2938 pt(i, j, k) = pt(i, j, k) + 0.5*u2f(i, j, k)*rcv*(1.-1./(&
2939 & 1.+rf(k)*sqrt(u2f(i, j, k)/u000))**2)
2941 delz(i, j, k) = delz(i, j, k)*pt(i, j, k)
2952 u2f(i, j, k) = rf(k)*sqrt(u2f(i, j, k)/u000)
2958 u(i, j, k) = u(i, j, k)/(1.+0.5*(u2f(i, j-1, k)+u2f(i, j, k)))
2964 v(i, j, k) = v(i, j, k)/(1.+0.5*(u2f(i-1, j, k)+u2f(i, j, k)))
2967 IF (.NOT.hydrostatic)
THEN 2971 w(i, j, k) = w(i, j, k)/(1.+u2f(i, j, k))
2979 CALL pushrealarray(u2f, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
3007 & u_ad, v, v_ad, w, w_ad, pt, pt_ad, ua, ua_ad, va, va_ad, delz, &
3008 & delz_ad, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, &
3009 & gridstruct, domain, bd)
3012 REAL,
INTENT(IN) :: dt
3013 REAL,
INTENT(IN) :: tau
3014 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
3015 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
3016 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
3017 LOGICAL,
INTENT(IN) :: hydrostatic
3018 LOGICAL,
INTENT(IN) :: conserve
3019 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
3020 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
3021 REAL,
INTENT(INOUT) :: u_ad(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
3022 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
3023 REAL,
INTENT(INOUT) :: v_ad(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
3024 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3025 REAL,
INTENT(INOUT) :: w_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3026 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3027 REAL,
INTENT(INOUT) :: pt_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3028 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3029 REAL,
INTENT(INOUT) :: ua_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3030 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3031 REAL,
INTENT(INOUT) :: va_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3032 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3033 REAL,
INTENT(INOUT) :: delz_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3034 REAL,
INTENT(INOUT) :: rf(npz)
3035 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
3036 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
3037 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3038 REAL :: u2f_ad(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3039 REAL,
PARAMETER :: sday=86400.
3040 REAL,
PARAMETER :: u000=4900.
3043 INTEGER :: is, ie, js, je
3044 INTEGER :: isd, ied, jsd, jed
3086 CALL poprealarray(u2f, (bd%ied-bd%isd+1)*(bd%jed-bd%jsd+1)*npz)
3090 IF (branch .NE. 0)
THEN 3094 temp_ad3 = w_ad(i, j, k)/(u2f(i, j, k)+1.)
3095 u2f_ad(i, j, k) = u2f_ad(i, j, k) - w(i, j, k)*temp_ad3/(u2f&
3097 w_ad(i, j, k) = temp_ad3
3104 temp9 = 0.5*(u2f(i-1, j, k)+u2f(i, j, k)) + 1.
3105 temp_ad2 = -(v(i, j, k)*0.5*v_ad(i, j, k)/temp9**2)
3106 u2f_ad(i-1, j, k) = u2f_ad(i-1, j, k) + temp_ad2
3107 u2f_ad(i, j, k) = u2f_ad(i, j, k) + temp_ad2
3108 v_ad(i, j, k) = v_ad(i, j, k)/temp9
3114 temp8 = 0.5*(u2f(i, j-1, k)+u2f(i, j, k)) + 1.
3115 temp_ad1 = -(u(i, j, k)*0.5*u_ad(i, j, k)/temp8**2)
3116 u2f_ad(i, j-1, k) = u2f_ad(i, j-1, k) + temp_ad1
3117 u2f_ad(i, j, k) = u2f_ad(i, j, k) + temp_ad1
3118 u_ad(i, j, k) = u_ad(i, j, k)/temp8
3124 IF (u2f(i, j, k)/u000 .EQ. 0.0)
THEN 3125 u2f_ad(i, j, k) = 0.0
3127 u2f_ad(i, j, k) = rf(k)*u2f_ad(i, j, k)/(2.0*sqrt(u2f(i, j, &
3133 IF (branch .NE. 0)
THEN 3134 IF (branch .EQ. 1)
THEN 3138 pt_ad(i, j, k) = pt_ad(i, j, k) + delz(i, j, k)*delz_ad(i&
3140 delz_ad(i, j, k) = pt(i, j, k)*delz_ad(i, j, k)
3142 temp7 = u2f(i, j, k)/u000
3144 temp5 = rf(k)*temp6 + 1.
3146 temp_ad = rcv*0.5*pt_ad(i, j, k)
3147 IF (temp7 .EQ. 0.0)
THEN 3148 u2f_ad(i, j, k) = u2f_ad(i, j, k) + (1.-1.0/temp4)*&
3151 u2f_ad(i, j, k) = u2f_ad(i, j, k) + (rf(k)*2*temp5*u2f(i&
3152 & , j, k)/(2.0*temp6*temp4**2*u000)-1.0/temp4+1.)*&
3156 temp_ad0 = delz_ad(i, j, k)/pt(i, j, k)
3157 pt_ad(i, j, k) = pt_ad(i, j, k) - delz(i, j, k)*temp_ad0/&
3159 delz_ad(i, j, k) = temp_ad0
3166 temp3 = cp - rg*ptop/pm(k)
3167 temp2 = u2f(i, j, k)/u000
3169 temp0 = rf(k)*temp1 + 1.
3171 IF (temp2 .EQ. 0.0)
THEN 3172 u2f_ad(i, j, k) = u2f_ad(i, j, k) + (1.-1.0/temp)*0.5*&
3173 & pt_ad(i, j, k)/temp3
3175 u2f_ad(i, j, k) = u2f_ad(i, j, k) + ((1.-1.0/temp)*0.5/&
3176 & temp3+rf(k)*2*temp0*u2f(i, j, k)*0.5/(2.0*temp1*temp**&
3177 & 2*temp3*u000))*pt_ad(i, j, k)
3187 IF (branch .EQ. 0)
THEN 3190 ua_ad(i, j, k) = ua_ad(i, j, k) + 2*ua(i, j, k)*u2f_ad(i, j&
3192 va_ad(i, j, k) = va_ad(i, j, k) + 2*va(i, j, k)*u2f_ad(i, j&
3194 w_ad(i, j, k) = w_ad(i, j, k) + 2*w(i, j, k)*u2f_ad(i, j, k)
3195 u2f_ad(i, j, k) = 0.0
3201 ua_ad(i, j, k) = ua_ad(i, j, k) + 2*ua(i, j, k)*u2f_ad(i, j&
3203 va_ad(i, j, k) = va_ad(i, j, k) + 2*va(i, j, k)*u2f_ad(i, j&
3205 u2f_ad(i, j, k) = 0.0
3210 CALL c2l_ord2_bwd(u, u_ad, v, v_ad, ua, ua_ad, va, va_ad, gridstruct&
3211 & , npz, gridstruct%grid_type, bd, gridstruct%nested)
3213 IF (branch .EQ. 0)
THEN 3220 SUBROUTINE rayleigh_friction(dt, npx, npy, npz, ks, pm, tau, u, v, w, &
3221 & pt, ua, va, delz, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf&
3222 & , gridstruct, domain, bd)
3225 REAL,
INTENT(IN) :: dt
3227 REAL,
INTENT(IN) :: tau
3228 REAL,
INTENT(IN) :: cp, rg, ptop, rf_cutoff
3229 INTEGER,
INTENT(IN) :: npx, npy, npz, ks
3230 REAL,
DIMENSION(npz),
INTENT(IN) :: pm
3231 LOGICAL,
INTENT(IN) :: hydrostatic
3232 LOGICAL,
INTENT(IN) :: conserve
3233 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
3235 REAL,
INTENT(INOUT) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1, npz)
3237 REAL,
INTENT(INOUT) :: v(bd%isd:bd%ied+1, bd%jsd:bd%jed, npz)
3239 REAL,
INTENT(INOUT) :: w(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3241 REAL,
INTENT(INOUT) :: pt(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3243 REAL,
INTENT(INOUT) :: ua(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3245 REAL,
INTENT(INOUT) :: va(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3247 REAL,
INTENT(INOUT) :: delz(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3248 REAL,
INTENT(INOUT) :: rf(npz)
3249 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
3250 TYPE(DOMAIN2D),
INTENT(INOUT) :: domain
3252 REAL :: u2f(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
3253 REAL,
PARAMETER :: sday=86400.
3255 REAL,
PARAMETER :: u000=4900.
3258 INTEGER :: is, ie, js, je
3259 INTEGER :: isd, ied, jsd, jed
3275 IF (is_master())
WRITE(6, *) &
3276 &
'Rayleigh friction E-folding time (days):' 3278 IF (pm(k) .LT. rf_cutoff)
THEN 3279 rf(k) = dt/(tau*sday)*sin(0.5*
pi*log(rf_cutoff/pm(k))/log(&
3280 & rf_cutoff/ptop))**2
3290 CALL c2l_ord2(u, v, ua, va, gridstruct, npz, gridstruct%grid_type, &
3291 & bd, gridstruct%nested)
3294 IF (hydrostatic)
THEN 3297 u2f(i, j, k) = ua(i, j, k)**2 + va(i, j, k)**2
3303 u2f(i, j, k) = ua(i, j, k)**2 + va(i, j, k)**2 + w(i, j, k)&
3316 IF (hydrostatic)
THEN 3319 pt(i, j, k) = pt(i, j, k) + 0.5*u2f(i, j, k)/(cp-rg*ptop/&
3320 & pm(k))*(1.-1./(1.+rf(k)*sqrt(u2f(i, j, k)/u000))**2)
3326 delz(i, j, k) = delz(i, j, k)/pt(i, j, k)
3327 pt(i, j, k) = pt(i, j, k) + 0.5*u2f(i, j, k)*rcv*(1.-1./(&
3328 & 1.+rf(k)*sqrt(u2f(i, j, k)/u000))**2)
3329 delz(i, j, k) = delz(i, j, k)*pt(i, j, k)
3336 u2f(i, j, k) = rf(k)*sqrt(u2f(i, j, k)/u000)
3341 u(i, j, k) = u(i, j, k)/(1.+0.5*(u2f(i, j-1, k)+u2f(i, j, k)))
3346 v(i, j, k) = v(i, j, k)/(1.+0.5*(u2f(i-1, j, k)+u2f(i, j, k)))
3349 IF (.NOT.hydrostatic)
THEN 3352 w(i, j, k) = w(i, j, k)/(1.+u2f(i, j, k))
3379 & gridstruct, bd, ptop, ua, va, u, v, delp, aam, ps, m_fac)
3382 INTEGER,
INTENT(IN) :: npz
3383 INTEGER,
INTENT(IN) :: is, ie, js, je
3384 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed
3385 REAL,
INTENT(IN) :: ptop
3387 REAL,
INTENT(INOUT) :: u(isd:ied, jsd:jed+1, npz)
3389 REAL,
INTENT(INOUT) :: v(isd:ied+1, jsd:jed, npz)
3390 REAL,
INTENT(INOUT) :: delp(isd:ied, jsd:jed, npz)
3391 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(INOUT) :: ua, va
3392 REAL :: aam(is:ie, js:je)
3393 REAL :: m_fac(is:ie, js:je)
3394 REAL :: ps(isd:ied, jsd:jed)
3395 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
3396 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
3398 REAL,
DIMENSION(is:ie) :: r1, r2, dm
3406 CALL c2l_ord2_fwd(u, v, ua, va, gridstruct, npz, gridstruct%&
3413 r1(i) =
radius*cos(gridstruct%agrid(i, j, 2))
3423 dm(i) = delp(i, j, k)
3424 ps(i, j) = ps(i, j) + dm(i)
3426 aam(i, j) = aam(i, j) + (r2(i)*
omega+r1(i)*ua(i, j, k))*dm(i)
3427 m_fac(i, j) = m_fac(i, j) + dm(i)*r2(i)
3456 & gridstruct, bd, ptop, ua, ua_ad, va, va_ad, u, u_ad, v, v_ad, delp, &
3457 & delp_ad, aam, aam_ad, ps, ps_ad, m_fac, m_fac_ad)
3459 INTEGER,
INTENT(IN) :: npz
3460 INTEGER,
INTENT(IN) :: is, ie, js, je
3461 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed
3462 REAL,
INTENT(IN) :: ptop
3463 REAL,
INTENT(INOUT) :: u(isd:ied, jsd:jed+1, npz)
3464 REAL,
INTENT(INOUT) :: u_ad(isd:ied, jsd:jed+1, npz)
3465 REAL,
INTENT(INOUT) :: v(isd:ied+1, jsd:jed, npz)
3466 REAL,
INTENT(INOUT) :: v_ad(isd:ied+1, jsd:jed, npz)
3467 REAL,
INTENT(INOUT) :: delp(isd:ied, jsd:jed, npz)
3468 REAL,
INTENT(INOUT) :: delp_ad(isd:ied, jsd:jed, npz)
3469 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(INOUT) :: ua, va
3470 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(INOUT) :: ua_ad, &
3472 REAL :: aam(is:ie, js:je)
3473 REAL :: aam_ad(is:ie, js:je)
3474 REAL :: m_fac(is:ie, js:je)
3475 REAL :: m_fac_ad(is:ie, js:je)
3476 REAL :: ps(isd:ied, jsd:jed)
3477 REAL :: ps_ad(isd:ied, jsd:jed)
3478 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
3479 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
3480 REAL,
DIMENSION(is:ie) :: r1, r2, dm
3481 REAL,
DIMENSION(is:ie) :: dm_ad
3496 dm_ad(i) = dm_ad(i) + (r2(i)*
omega+r1(i)*ua(i, j, k))*aam_ad(i&
3497 & , j) + r2(i)*m_fac_ad(i, j)
3498 ua_ad(i, j, k) = ua_ad(i, j, k) + dm(i)*r1(i)*aam_ad(i, j)
3499 dm_ad(i) = ps_ad(i, j) +
agrav*dm_ad(i)
3501 delp_ad(i, j, k) = delp_ad(i, j, k) + dm_ad(i)
3507 m_fac_ad(i, j) = 0.0
3513 CALL c2l_ord2_bwd(u, u_ad, v, v_ad, ua, ua_ad, va, va_ad, gridstruct&
3514 & , npz, gridstruct%grid_type, bd, gridstruct%nested)
3516 SUBROUTINE compute_aam(npz, is, ie, js, je, isd, ied, jsd, jed, &
3517 & gridstruct, bd, ptop, ua, va, u, v, delp, aam, ps, m_fac)
3520 INTEGER,
INTENT(IN) :: npz
3521 INTEGER,
INTENT(IN) :: is, ie, js, je
3522 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed
3523 REAL,
INTENT(IN) :: ptop
3525 REAL,
INTENT(INOUT) :: u(isd:ied, jsd:jed+1, npz)
3527 REAL,
INTENT(INOUT) :: v(isd:ied+1, jsd:jed, npz)
3528 REAL,
INTENT(INOUT) :: delp(isd:ied, jsd:jed, npz)
3529 REAL,
DIMENSION(isd:ied, jsd:jed, npz),
INTENT(INOUT) :: ua, va
3530 REAL,
INTENT(OUT) :: aam(is:ie, js:je)
3531 REAL,
INTENT(OUT) :: m_fac(is:ie, js:je)
3532 REAL,
INTENT(OUT) :: ps(isd:ied, jsd:jed)
3533 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
3534 TYPE(FV_GRID_TYPE),
INTENT(IN) :: gridstruct
3536 REAL,
DIMENSION(is:ie) :: r1, r2, dm
3539 CALL c2l_ord2(u, v, ua, va, gridstruct, npz, gridstruct%grid_type, &
3540 & bd, gridstruct%nested)
3545 r1(i) =
radius*cos(gridstruct%agrid(i, j, 2))
3553 dm(i) = delp(i, j, k)
3554 ps(i, j) = ps(i, j) + dm(i)
3556 aam(i, j) = aam(i, j) + (r2(i)*
omega+r1(i)*ua(i, j, k))*dm(i)
3557 m_fac(i, j) = m_fac(i, j) + dm(i)*r2(i)
subroutine rayleigh_super_fwd(dt, npx, npy, npz, ks, pm, phis, tau, u, v, w, pt, ua, va, delz, agrid, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine, public nested_grid_bc_apply_intt(var_nest, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
real, parameter, public radius
Radius of the Earth [m].
integer, parameter, public model_atmos
real, parameter, public omega
Rotation rate of the Earth [1/s].
subroutine, public del2_cubed(q, cd, gridstruct, domain, npx, npy, km, nmax, bd)
subroutine, public compute_total_energy_bwd(is, ie, js, je, isd, ied, jsd, jed, km, u, u_ad, v, v_ad, w, w_ad, delz, delz_ad, pt, pt_ad, delp, delp_ad, q, q_ad, qc, qc_ad, pe, pe_ad, peln, peln_ad, hs, rsin2_l, cosa_s_l, r_vir, cp, rg, hlv, te_2d, te_2d_ad, ua, va, teq, teq_ad, moist_phys, nwat, sphum, liq_wat, rainwat, ice_wat, snowwat, graupel, hydrostatic, id_te)
real(kind=8), parameter, public pi_8
Ratio of circle circumference to diameter [N/A].
subroutine, public del2_cubed_bwd(q, q_ad, cd, gridstruct, domain, npx, npy, km, nmax, bd)
logical, save, public idealtest
real, parameter, public hlv
Latent heat of evaporation [J/kg].
subroutine, public nested_grid_bc_apply_intt_adm(var_nest, var_nest_ad, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine, public pushcontrol(ctype, field)
subroutine, public tracer_2d_bwd(q, q_ad, dp1, dp1_ad, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad, cy, cy_ad, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public g_sum_adm(domain, p, p_ad, ifirst, ilast, jfirst, jlast, ngc, area, mode, reproduce, g_sum_ad)
subroutine compute_aam(npz, is, ie, js, je, isd, ied, jsd, jed, gridstruct, bd, ptop, ua, va, u, v, delp, aam, ps, m_fac)
real, parameter, public rdgas
Gas constant for dry air [J/kg/deg].
subroutine, public dyn_core_bwd(npx, npy, npz, ng, sphum, nq, bdt, n_split, zvir, cp, akap, cappa, grav, hydrostatic, u, u_ad, v, v_ad, w, w_ad, delz, delz_ad, pt, pt_ad, q, q_ad, delp, delp_ad, pe, pe_ad, pk, pk_ad, phis, ws, ws_ad, omga, omga_ad, ptop, pfull, ua, ua_ad, va, va_ad, uc, uc_ad, vc, vc_ad, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad, cy, cy_ad, pkz, pkz_ad, peln, peln_ad, q_con, ak, bk, dpx, dpx_ad, ks, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, domain, init_step, i_pack, end_step, gz, gz_ad, pkc, pkc_ad, ptc, ptc_ad, crx, crx_ad, xfx, xfx_ad, cry, cry_ad, yfx, yfx_ad, divgd, divgd_ad, delpc, delpc_ad, ut, ut_ad, vt, vt_ad, zh, zh_ad, pk3, pk3_ad, du, du_ad, dv, dv_ad, time_total)
real, parameter, public cp_vapor
Specific heat capacity of water vapor at constant pressure [J/kg/deg].
subroutine rayleigh_super_bwd(dt, npx, npy, npz, ks, pm, phis, tau, u, u_ad, v, v_ad, w, w_ad, pt, pt_ad, ua, ua_ad, va, va_ad, delz, agrid, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine rayleigh_friction_fwd(dt, npx, npy, npz, ks, pm, tau, u, v, w, pt, ua, va, delz, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine, public tracer_2d_nested(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr)
subroutine, public tracer_2d_1l(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public compute_total_energy(is, ie, js, je, isd, ied, jsd, jed, km, u, v, w, delz, pt, delp, q, qc, pe, peln, hs, rsin2_l, cosa_s_l, r_vir, cp, rg, hlv, te_2d, ua, va, teq, moist_phys, nwat, sphum, liq_wat, rainwat, ice_wat, snowwat, graupel, hydrostatic, id_te)
subroutine compute_aam_bwd(npz, is, ie, js, je, isd, ied, jsd, jed, gridstruct, bd, ptop, ua, ua_ad, va, va_ad, u, u_ad, v, v_ad, delp, delp_ad, aam, aam_ad, ps, ps_ad, m_fac, m_fac_ad)
subroutine, public fv_dynamics_bwd(npx, npy, npz, nq_tot, ng, bdt, consv_te, fill, reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, q_split, u, u_ad, v, v_ad, w, w_ad, delz, delz_ad, hydrostatic, pt, pt_ad, delp, delp_ad, q, q_ad, ps, ps_ad, pe, pe_ad, pk, pk_ad, peln, peln_ad, pkz, pkz_ad, phis, q_con, omga, omga_ad, ua, ua_ad, va, va_ad, uc, uc_ad, vc, vc_ad, ak, bk, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad, cy, cy_ad, ze0, hybrid_z, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, parent_grid, domain, time_total)
subroutine compute_aam_fwd(npz, is, ie, js, je, isd, ied, jsd, jed, gridstruct, bd, ptop, ua, va, u, v, delp, aam, ps, m_fac)
subroutine, public moist_cp(is, ie, isd, ied, jsd, jed, km, j, k, nwat, sphum, liq_wat, rainwat, ice_wat, snowwat, graupel, q, qd, cpm, t1)
subroutine, public setup_nested_grid_bcs_adm(npx, npy, npz, zvir, ncnst, u, u_ad, v, v_ad, w, pt, delp, delz, q, uc, uc_ad, vc, vc_ad, pkz, nested, inline_q, make_nh, ng, gridstruct, flagstruct, neststruct, nest_timestep, tracer_nest_timestep, domain, bd, nwat)
real, parameter, public rvgas
Gas constant for water vapor [J/kg/deg].
subroutine, public c2l_ord2_fwd(u, v, ua, va, gridstruct, km, grid_type, bd, do_halo)
subroutine, public lagrangian_to_eulerian_bwd(last_step, consv, ps, ps_ad, pe, pe_ad, delp, delp_ad, pkz, pkz_ad, pk, pk_ad, mdt, pdt, km, is, ie, js, je, isd, ied, jsd, jed, nq, nwat, sphum, q_con, u, u_ad, v, v_ad, w, w_ad, delz, delz_ad, pt, pt_ad, q, q_ad, hs, r_vir, cp, akap, cappa, kord_mt, kord_wz, kord_tr, kord_tm, peln, peln_ad, te0_2d, te0_2d_ad, ng, ua, ua_ad, va, omga, omga_ad, te, te_ad, ws, ws_ad, fill, reproduce_sum, out_dt, dtdt, ptop, ak, bk, pfull, flagstruct, gridstruct, domain, do_sat_adj, hydrostatic, hybrid_z, do_omega, adiabatic, do_adiabatic_init, mfx, mfy, remap_option, kord_mt_pert, kord_wz_pert, kord_tr_pert, kord_tm_pert)
subroutine timing_on(blk_name)
subroutine, public moist_cv(is, ie, isd, ied, jsd, jed, km, j, k, nwat, sphum, liq_wat, rainwat, ice_wat, snowwat, graupel, q, qd, cvm, t1)
subroutine rayleigh_super(dt, npx, npy, npz, ks, pm, phis, tau, u, v, w, pt, ua, va, delz, agrid, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine, public c2l_ord2(u, v, ua, va, gridstruct, km, grid_type, bd, do_halo)
subroutine, public tracer_2d_1l_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public init_ijk_mem(i1, i2, j1, j2, km, array, var)
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)
integer, parameter, public r_grid
logical, public do_adiabatic_init
subroutine, public tracer_2d_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public tracer_2d_1l_bwd(q, q_ad, dp1, dp1_ad, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad, cy, cy_ad, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine rayleigh_friction(dt, npx, npy, npz, ks, pm, tau, u, v, w, pt, ua, va, delz, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine, public tracer_2d(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public lagrangian_to_eulerian_fwd(last_step, consv, ps, pe, delp, pkz, pk, mdt, pdt, km, is, ie, js, je, isd, ied, jsd, jed, nq, nwat, sphum, q_con, u, v, w, delz, pt, q, hs, r_vir, cp, akap, cappa, kord_mt, kord_wz, kord_tr, kord_tm, peln, te0_2d, ng, ua, va, omga, te, ws, fill, reproduce_sum, out_dt, dtdt, ptop, ak, bk, pfull, flagstruct, gridstruct, domain, do_sat_adj, hydrostatic, hybrid_z, do_omega, adiabatic, do_adiabatic_init, mfx, mfy, remap_option, kord_mt_pert, kord_wz_pert, kord_tr_pert, kord_tm_pert)
subroutine, public complete_group_halo_update(group, groupp, domain)
real, dimension(:), allocatable rf
subroutine, public tracer_2d_nested_bwd(q, q_ad, dp1, dp1_ad, mfx, mfx_ad, mfy, mfy_ad, cx, cx_ad, cy, cy_ad, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr)
real, parameter, public grav
Acceleration due to gravity [m/s^2].
subroutine, public dyn_core_fwd(npx, npy, npz, ng, sphum, nq, bdt, n_split, zvir, cp, akap, cappa, grav, hydrostatic, u, v, w, delz, pt, q, delp, pe, pk, phis, ws, omga, ptop, pfull, ua, va, uc, vc, mfx, mfy, cx, cy, pkz, peln, q_con, ak, bk, dpx, ks, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, domain, init_step, i_pack, end_step, gz, pkc, ptc, crx, xfx, cry, yfx, divgd, delpc, ut, vt, zh, pk3, du, dv, time_total)
subroutine, public neg_adj3(is, ie, js, je, ng, kbot, hydrostatic, peln, delz, pt, dp, qv, ql, qr, qi, qs, qg, qa, check_negative)
real function, public g_sum(domain, p, ifirst, ilast, jfirst, jlast, ngc, area, mode, reproduce)
subroutine, public lagrangian_to_eulerian(last_step, consv, ps, pe, delp, pkz, pk, mdt, pdt, km, is, ie, js, je, isd, ied, jsd, jed, nq, nwat, sphum, q_con, u, v, w, delz, pt, q, hs, r_vir, cp, akap, cappa, kord_mt, kord_wz, kord_tr, kord_tm, peln, te0_2d, ng, ua, va, omga, te, ws, fill, reproduce_sum, out_dt, dtdt, ptop, ak, bk, pfull, flagstruct, gridstruct, domain, do_sat_adj, hydrostatic, hybrid_z, do_omega, adiabatic, do_adiabatic_init, mfx, mfy, remap_option, kord_mt_pert, kord_wz_pert, kord_tr_pert, kord_tm_pert)
subroutine, public cubed_to_latlon(u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, nested, c2l_ord, bd)
subroutine, public tracer_2d_nested_fwd(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr)
subroutine, public prt_mxm(qname, q, is, ie, js, je, n_g, km, fac, area, domain)
subroutine rayleigh_friction_bwd(dt, npx, npy, npz, ks, pm, tau, u, u_ad, v, v_ad, w, w_ad, pt, pt_ad, ua, ua_ad, va, va_ad, delz, delz_ad, cp, rg, ptop, hydrostatic, conserve, rf_cutoff, rf, gridstruct, domain, bd)
subroutine, public c2l_ord2_bwd(u, u_ad, v, v_ad, ua, ua_ad, va, va_ad, gridstruct, km, grid_type, bd, do_halo)
subroutine, public fill2d(is, ie, js, je, ng, km, q, delp, area, domain, nested, npx, npy)
logical, public prt_minmax
subroutine, public fv_dynamics(npx, npy, npz, nq_tot, ng, bdt, consv_te, fill, reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, q_split, u, v, w, delz, hydrostatic, pt, delp, q, ps, pe, pk, peln, pkz, phis, q_con, omga, ua, va, uc, vc, ak, bk, mfx, mfy, cx, cy, ze0, hybrid_z, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, parent_grid, domain, time_total)
subroutine, public compute_total_energy_fwd(is, ie, js, je, isd, ied, jsd, jed, km, u, v, w, delz, pt, delp, q, qc, pe, peln, hs, rsin2_l, cosa_s_l, r_vir, cp, rg, hlv, te_2d, ua, va, teq, moist_phys, nwat, sphum, liq_wat, rainwat, ice_wat, snowwat, graupel, hydrostatic, id_te)
subroutine, public del2_cubed_fwd(q, cd, gridstruct, domain, npx, npy, km, nmax, bd)
subroutine, public popcontrol(ctype, field)
subroutine, public range_check(qname, q, is, ie, js, je, n_g, km, pos, q_low, q_hi, bad_range)
subroutine, public fv_dynamics_fwd(npx, npy, npz, nq_tot, ng, bdt, consv_te, fill, reproduce_sum, kappa, cp_air, zvir, ptop, ks, ncnst, n_split, q_split, u, v, w, delz, hydrostatic, pt, delp, q, ps, pe, pk, peln, pkz, phis, q_con, omga, ua, va, uc, vc, ak, bk, mfx, mfy, cx, cy, ze0, hybrid_z, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, parent_grid, domain, time_total)
type(time_type), public fv_time
Derived type containing the data.
subroutine, public dyn_core(npx, npy, npz, ng, sphum, nq, bdt, n_split, zvir, cp, akap, cappa, grav, hydrostatic, u, v, w, delz, pt, q, delp, pe, pk, phis, ws, omga, ptop, pfull, ua, va, uc, vc, mfx, mfy, cx, cy, pkz, peln, q_con, ak, bk, dpx, ks, gridstruct, flagstruct, flagstructp, neststruct, idiag, bd, domain, init_step, i_pack, end_step, gz, pkc, ptc, crx, xfx, cry, yfx, divgd, delpc, ut, vt, zh, pk3, du, dv, time_total)
real(fp), parameter, public pi
subroutine timing_off(blk_name)