107 use constants_mod,
only: rdgas, radius, cp_air, pi
108 use mpp_mod,
only: mpp_pe
109 use mpp_domains_mod,
only: cgrid_ne, dgrid_ne, mpp_get_boundary, mpp_update_domains, &
111 use mpp_parameter_mod,
only: corner
113 use fv_mp_mod,
only: start_group_halo_update, complete_group_halo_update
114 use fv_mp_mod,
only: group_halo_update_type
124 #if defined (ADA_NUDGE) 125 use fv_ada_nudge_mod,
only: breed_slp_inline_ada
129 use diag_manager_mod,
only: send_data
153 real,
allocatable,
dimension(:,:,:) ::
ut,
vt,
crx,
cry,
xfx,
yfx,
divgd, &
159 real,
allocatable ::
rf(:)
171 subroutine dyn_core(npx, npy, npz, ng, sphum, nq, bdt, n_split, zvir, cp, akap, cappa, &
176 u, v, w, delz, pt, q, delp, pe, pk, phis, ws, omga, ptop, pfull, ua, va, &
177 uc, vc, mfx, mfy, cx, cy, pkz, peln, q_con, ak, bk, &
178 ks, gridstruct, flagstruct, neststruct, idiag, bd, domain, &
179 init_step, i_pack, end_step, diss_est,time_total)
181 integer,
intent(IN) :: npx
182 integer,
intent(IN) :: npy
183 integer,
intent(IN) :: npz
184 integer,
intent(IN) :: ng, nq, sphum
185 integer,
intent(IN) :: n_split
186 real ,
intent(IN) :: bdt
187 real ,
intent(IN) :: zvir, cp, akap, grav
188 real ,
intent(IN) :: ptop
189 logical,
intent(IN) :: hydrostatic
190 logical,
intent(IN) :: init_step, end_step
191 real,
intent(in) :: pfull(npz)
192 real,
intent(in),
dimension(npz+1) :: ak, bk
193 integer,
intent(IN) :: ks
194 type(group_halo_update_type),
intent(inout) :: i_pack(*)
196 real,
intent(inout),
dimension(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz):: u
197 real,
intent(inout),
dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed ,npz):: v
198 real,
intent(inout) :: w( bd%isd:,bd%jsd:,1:)
199 real,
intent(inout) :: delz(bd%isd:,bd%jsd:,1:)
200 real,
intent(inout) :: cappa(bd%isd:,bd%jsd:,1:)
202 real,
intent(inout) :: kapad(bd%isd:bd%ied,bd%jsd:bd%jed,1:npz)
204 real,
intent(inout) :: pt( bd%isd:bd%ied ,bd%jsd:bd%jed ,npz)
205 real,
intent(inout) :: delp(bd%isd:bd%ied ,bd%jsd:bd%jed ,npz)
206 real,
intent(inout) :: q( bd%isd:bd%ied ,bd%jsd:bd%jed ,npz, nq)
207 real,
intent(in),
optional:: time_total
208 real,
intent(inout) :: diss_est(bd%isd:bd%ied ,bd%jsd:bd%jed ,npz)
215 real,
intent(inout):: phis(bd%isd:bd%ied,bd%jsd:bd%jed)
216 real,
intent(inout):: pe(bd%is-1:bd%ie+1, npz+1,bd%js-1:bd%je+1)
217 real,
intent(inout):: peln(bd%is:bd%ie,npz+1,bd%js:bd%je)
218 real,
intent(inout):: pk(bd%is:bd%ie,bd%js:bd%je, npz+1)
222 real,
parameter:: near0 = 1.e-8
224 real,
parameter:: huge_r = 1.e8
226 real,
parameter:: huge_r = 1.e40
229 real,
intent(out ):: ws(bd%is:bd%ie,bd%js:bd%je)
230 real,
intent(inout):: omga(bd%isd:bd%ied,bd%jsd:bd%jed,npz)
231 real,
intent(inout):: uc(bd%isd:bd%ied+1,bd%jsd:bd%jed ,npz)
232 real,
intent(inout):: vc(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz)
233 real,
intent(inout),
dimension(bd%isd:bd%ied,bd%jsd:bd%jed,npz):: ua, va
234 real,
intent(inout):: q_con(bd%isd:, bd%jsd:, 1:)
237 real,
intent(inout):: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
238 real,
intent(inout):: mfy(bd%is:bd%ie , bd%js:bd%je+1, npz)
240 real,
intent(inout):: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
241 real,
intent(inout):: cy(bd%isd:bd%ied ,bd%js:bd%je+1, npz)
242 real,
intent(inout),
dimension(bd%is:bd%ie,bd%js:bd%je,npz):: pkz
248 type(domain2d),
intent(INOUT) :: domain
250 real,
allocatable,
dimension(:,:,:):: pem, heat_source
252 real,
dimension(bd%isd:bd%ied,bd%jsd:bd%jed):: ws3, z_rat
254 real:: zs(bd%isd:bd%ied,bd%jsd:bd%jed)
255 real:: p1d(bd%is:bd%ie)
256 real:: om2d(bd%is:bd%ie,npz)
257 real wbuffer(npy+2,npz)
258 real ebuffer(npy+2,npz)
259 real nbuffer(npx+2,npz)
260 real sbuffer(npx+2,npz)
262 real divg2(bd%is:bd%ie+1,bd%js:bd%je+1)
263 real wk(bd%isd:bd%ied,bd%jsd:bd%jed)
264 real fz(bd%is: bd%ie+1,bd%js: bd%je+1)
265 real heat_s(bd%is:bd%ie,bd%js:bd%je)
267 real diss_e(bd%is:bd%ie,bd%js:bd%je)
269 integer nord_v(npz+1)
271 integer :: hord_m, hord_v, hord_t, hord_p
272 integer :: nord_k, nord_w, nord_t
275 integer :: i,j,k, it, iq, n_con, nf_ke
276 integer :: iep1, jep1
277 real :: beta, beta_d, d_con_k, damp_w, damp_t, kgb, cv_air
280 real :: k1k, rdg, dtmp, delt
281 real :: recip_k_split_n_split
282 real :: reg_bc_update_time
283 logical :: last_step, remap_step
285 real :: split_timestep_bc
287 integer :: is, ie, js, je
288 integer :: isd, ied, jsd, jed
305 dt = bdt /
real(n_split)
308 ms = max(1, flagstruct%m_split/2)
309 beta = flagstruct%beta
311 cv_air = cp_air - rdgas
312 recip_k_split_n_split=1./
real(flagstruct%k_split*n_split)
318 if ( .not.hydrostatic )
then 321 k1k = akap / (1.-akap)
325 dp_ref(k) = ak(k+1)-ak(k) + (bk(k+1)-bk(k))*1.e5
331 zs(i,j) = phis(i,j) *
rgrav 337 if ( init_step )
then 339 allocate(
gz(isd:ied, jsd:jed ,npz+1) )
341 allocate(
pkc(isd:ied, jsd:jed ,npz+1) )
342 allocate(
ptc(isd:ied, jsd:jed ,npz ) )
343 allocate(
crx(is :ie+1, jsd:jed, npz) )
344 allocate(
xfx(is :ie+1, jsd:jed, npz) )
345 allocate(
cry(isd:ied, js :je+1, npz) )
346 allocate(
yfx(isd:ied, js :je+1, npz) )
347 allocate(
divgd(isd:ied+1,jsd:jed+1,npz) )
348 allocate(
delpc(isd:ied, jsd:jed ,npz ) )
350 allocate(
ut(isd:ied, jsd:jed, npz) )
352 allocate(
vt(isd:ied, jsd:jed, npz) )
355 if ( .not. hydrostatic )
then 356 allocate(
zh(isd:ied, jsd:jed, npz+1) )
358 allocate (
pk3(isd:ied,jsd:jed,npz+1) )
361 if ( beta > near0 )
then 362 allocate(
du(isd:ied, jsd:jed+1,npz) )
364 allocate(
dv(isd:ied+1,jsd:jed, npz) )
383 if ( flagstruct%d_con > 1.0e-5 )
then 384 allocate( heat_source(isd:ied, jsd:jed, npz) )
385 call init_ijk_mem(isd, ied, jsd, jed, npz, heat_source, 0.)
388 if ( flagstruct%convert_ke .or. flagstruct%vtdm4> 1.e-4 )
then 391 if ( flagstruct%d2_bg_k1 < 1.e-3 )
then 394 if ( flagstruct%d2_bg_k2 < 1.e-3 )
then 407 call start_group_halo_update(i_pack(8), u, v, domain, gridtype=dgrid_ne)
409 if ( flagstruct%breed_vortex_inline .or. it==n_split )
then 415 if ( flagstruct%fv_debug )
then 416 if(is_master())
write(*,*)
'n_split loop, it=', it
417 if ( .not. flagstruct%hydrostatic ) &
418 call prt_mxm(
'delz', delz, is, ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
421 if (gridstruct%nested)
then 424 split_timestep_bc =
real(n_split*flagstruct%k_split+neststruct%nest_timestep)
430 if ( flagstruct%inline_q )
then 431 call start_group_halo_update(i_pack(10), q, domain)
437 if ( .not. hydrostatic )
then 439 call start_group_halo_update(i_pack(7), w, domain)
443 if (gridstruct%nested .or. gridstruct%regional)
then 447 gz(i,j,npz+1) = zs(i,j)
451 gz(i,j,k) =
gz(i,j,k+1) - delz(i,j,k)
459 gz(i,j,npz+1) = zs(i,j)
463 gz(i,j,k) =
gz(i,j,k+1) - delz(i,j,k)
469 call start_group_halo_update(i_pack(5),
gz, domain)
484 call complete_group_halo_update(i_pack(1), domain)
491 if ( it==n_split .and. end_step )
then 492 if ( flagstruct%use_old_omega )
then 493 allocate ( pem(is-1:ie+1,npz+1,js-1:je+1) )
501 pem(i,k+1,j) = pem(i,k,j) + delp(i,j,k)
512 call complete_group_halo_update(i_pack(8), domain)
513 if( .not. hydrostatic ) &
514 call complete_group_halo_update(i_pack(7), domain)
522 call c_sw(
delpc(isd,jsd,k), delp(isd,jsd,k),
ptc(isd,jsd,k), &
523 pt(isd,jsd,k), u(isd,jsd,k), v(isd,jsd,k), &
524 w(isd:,jsd:,k), uc(isd,jsd,k), vc(isd,jsd,k), &
525 ua(isd,jsd,k), va(isd,jsd,k), omga(isd,jsd,k), &
526 ut(isd,jsd,k),
vt(isd,jsd,k),
divgd(isd,jsd,k), &
527 flagstruct%nord, dt2, hydrostatic, .true., bd, &
528 gridstruct, flagstruct)
531 if ( flagstruct%nord > 0 )
then 533 call start_group_halo_update(i_pack(3),
divgd, domain, position=corner)
537 if (gridstruct%nested)
then 539 0, 0, npx, npy, npz, bd, split_timestep_bc+0.5,
real(n_split*flagstruct%k_split), &
540 neststruct%delp_bc, bctype=neststruct%nestbctype)
543 0, 0, npx, npy, npz, bd, split_timestep_bc+0.5,
real(n_split*flagstruct%k_split), &
544 neststruct%pt_bc, bctype=neststruct%nestbctype )
548 if (flagstruct%regional)
then 549 reg_bc_update_time=current_time_in_seconds+(0.5+(it-1))*dt
550 call regional_boundary_update(
delpc,
'delp', &
551 isd, ied, jsd, jed, npz, &
553 isd, ied, jsd, jed, &
556 call regional_boundary_update(
ptc,
'pt', &
557 isd, ied, jsd, jed, npz, &
559 isd, ied, jsd, jed, &
564 if ( hydrostatic )
then 569 q_con, pkz, npz, akap, .true., &
570 gridstruct%nested, .false., npx, npy, flagstruct%a2b_ord, bd)
576 call complete_group_halo_update(i_pack(5), domain)
584 zh(i,j,k) =
gz(i,j,k)
594 gz(i,j,k) =
zh(i,j,k)
600 call update_dz_c(is, ie, js, je, npz, ng, dt2, dp_ref, zs, gridstruct%area,
ut,
vt,
gz, ws3, &
601 npx, npy, gridstruct%sw_corner, gridstruct%se_corner, &
602 gridstruct%ne_corner, gridstruct%nw_corner, bd, gridstruct%grid_type)
606 call riem_solver_c( ms, dt2, is, ie, js, je, npz, ng, &
611 ptop, phis, omga,
ptc, &
612 q_con,
delpc,
gz,
pkc, ws3, flagstruct%p_fac, &
613 flagstruct%a_imp, flagstruct%scale_z )
616 if (gridstruct%nested)
then 618 0, 0, npx, npy, npz, bd, split_timestep_bc+0.5,
real(n_split*flagstruct%k_split), &
619 neststruct%delz_bc, bctype=neststruct%nestbctype )
622 if (flagstruct%regional)
then 623 reg_bc_update_time=current_time_in_seconds+(0.5+(it-1))*dt
624 call regional_boundary_update(delz,
'delz', &
625 isd, ied, jsd, jed, ubound(delz,3), &
627 isd, ied, jsd, jed, &
631 if (gridstruct%nested .or. flagstruct%regional)
then 636 call nest_halo_nh(ptop, grav, akap, cp,
delpc, delz,
ptc, phis, &
647 npx, npy, npz, gridstruct%nested, .false., .false., .false., bd, flagstruct%regional)
653 call p_grad_c(dt2, npz,
delpc,
pkc,
gz, uc, vc, bd, gridstruct%rdxc, gridstruct%rdyc, hydrostatic)
656 call start_group_halo_update(i_pack(9), uc, vc, domain, gridtype=cgrid_ne)
666 if (flagstruct%inline_q .and. nq>0)
call complete_group_halo_update(i_pack(10), domain)
667 if (flagstruct%nord > 0)
call complete_group_halo_update(i_pack(3), domain)
668 call complete_group_halo_update(i_pack(9), domain)
671 if (gridstruct%nested)
then 684 0, 1, npx, npy, npz, bd, split_timestep_bc+0.5,
real(n_split*flagstruct%k_split), &
685 neststruct%vc_bc, bctype=neststruct%nestbctype )
687 1, 0, npx, npy, npz, bd, split_timestep_bc+0.5,
real(n_split*flagstruct%k_split), &
688 neststruct%uc_bc, bctype=neststruct%nestbctype )
691 1, 1, npx, npy, npz, bd, split_timestep_bc,
real(n_split*flagstruct%k_split), &
692 neststruct%divg_bc, bctype=neststruct%nestbctype )
696 if (flagstruct%regional)
then 698 call exch_uv(domain, bd, npz, vc, uc)
700 reg_bc_update_time=current_time_in_seconds+(0.5+(it-1))*dt
701 call regional_boundary_update(vc,
'vc', &
702 isd, ied, jsd, jed+1, npz, &
704 isd, ied, jsd, jed, &
706 call regional_boundary_update(uc,
'uc', &
707 isd, ied+1, jsd, jed, npz, &
709 isd, ied, jsd, jed, &
712 reg_bc_update_time=current_time_in_seconds+(it-1)*dt
713 call regional_boundary_update(
divgd,
'divgd', &
714 isd, ied+1, jsd, jed+1, npz, &
716 isd, ied, jsd, jed, &
720 if ( flagstruct%inline_q )
then 721 if ( gridstruct%nested )
then 724 0, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
725 neststruct%q_bc(iq), bctype=neststruct%nestbctype )
729 if (flagstruct%regional)
then 730 reg_bc_update_time=current_time_in_seconds+(it-1)*dt
732 call regional_boundary_update(q(:,:,:,iq),
'q', &
733 isd, ied, jsd, jed, npz, &
735 isd, ied, jsd, jed, &
742 if (flagstruct%regional)
call exch_uv(domain, bd, npz, vc, uc)
743 if (
first_call .and. is_master() .and. last_step)
write(6,*)
'Sponge layer divergence damping coefficent:' 754 hord_m = flagstruct%hord_mt
755 hord_t = flagstruct%hord_tm
756 hord_v = flagstruct%hord_vt
757 hord_p = flagstruct%hord_dp
758 nord_k = flagstruct%nord
761 kgb = flagstruct%ke_bg
766 nord_v(k) = min(2, flagstruct%nord)
768 d2_divg = min(0.20, flagstruct%d2_bg)
770 if ( flagstruct%do_vort_damp )
then 771 damp_vt(k) = flagstruct%vtdm4
780 d_con_k = flagstruct%d_con
782 if ( npz==1 .or. flagstruct%n_sponge<0 )
then 783 d2_divg = flagstruct%d2_bg
789 if (flagstruct%d2_bg_k2 > 0)
then 793 nord_k=0; d2_divg = max(0.01, flagstruct%d2_bg, flagstruct%d2_bg_k1)
795 nord_w=0; damp_w = d2_divg
796 if ( flagstruct%do_vort_damp )
then 800 damp_vt(k) = 0.5*d2_divg
804 elseif ( k==2 .and. flagstruct%d2_bg_k2>0.01 )
then 805 nord_k=0; d2_divg = max(flagstruct%d2_bg, flagstruct%d2_bg_k2)
806 nord_w=0; damp_w = d2_divg
807 if ( flagstruct%do_vort_damp )
then 810 damp_vt(k) = 0.5*d2_divg
814 elseif ( k==3 .and. flagstruct%d2_bg_k2>0.05 )
then 815 nord_k=0; d2_divg = max(flagstruct%d2_bg, 0.2*flagstruct%d2_bg_k2)
816 nord_w=0; damp_w = d2_divg
820 if ( pfull(k) < flagstruct%rf_cutoff )
then 822 d2_divg = max(flagstruct%d2_bg, flagstruct%d2_bg_k1* &
823 sin(0.5*pi*log(flagstruct%rf_cutoff/pfull(k))/log(flagstruct%rf_cutoff/ptop))**2)
824 if (
first_call .and. is_master() .and. last_step)
write(6,*) k, 0.01*pfull(k), d2_divg
826 if ( flagstruct%do_vort_damp )
then 829 damp_vt(k) = 0.5*d2_divg
836 if( hydrostatic .and. (.not.flagstruct%use_old_omega) .and. last_step )
then 840 omga(i,j,k) = delp(i,j,k)
846 if ( flagstruct%d_ext > 0. ) &
847 call a2b_ord2(delp(isd,jsd,k), wk, gridstruct, npx, npy, is, &
848 ie, js, je, ng, .false.)
850 if ( .not.hydrostatic .and. flagstruct%do_f3d )
then 854 z_rat(i,j) = 1. + (
zh(i,j,k)+
zh(i,j,k+1))/radius
859 call d_sw(
vt(isd,jsd,k), delp(isd,jsd,k),
ptc(isd,jsd,k), pt(isd,jsd,k), &
860 u(isd,jsd,k), v(isd,jsd,k), w(isd:,jsd:,k), uc(isd,jsd,k), &
861 vc(isd,jsd,k), ua(isd,jsd,k), va(isd,jsd,k),
divgd(isd,jsd,k), &
862 mfx(is, js, k), mfy(is, js, k), cx(is, jsd,k), cy(isd,js, k), &
863 crx(is, jsd,k),
cry(isd,js, k),
xfx(is, jsd,k),
yfx(isd,js, k), &
865 q_con(isd:,jsd:,k), z_rat(isd,jsd), &
867 q_con(isd:,jsd:,1), z_rat(isd,jsd), &
869 kgb, heat_s, diss_e,zvir, sphum, nq, q, k, npz, flagstruct%inline_q, dt, &
870 flagstruct%hord_tr, hord_m, hord_v, hord_t, hord_p, &
871 nord_k, nord_v(k), nord_w, nord_t, flagstruct%dddmp, d2_divg, flagstruct%d4_bg, &
872 damp_vt(k), damp_w, damp_t, d_con_k, hydrostatic, gridstruct, flagstruct, bd)
874 if( hydrostatic .and. (.not.flagstruct%use_old_omega) .and. last_step )
then 878 omga(i,j,k) = omga(i,j,k)*(
xfx(i,j,k)-
xfx(i+1,j,k)+
yfx(i,j,k)-
yfx(i,j+1,k))*gridstruct%rarea(i,j)*rdt
883 if ( flagstruct%d_ext > 0. )
then 890 if ( flagstruct%d_con > 1.0e-5 .OR. flagstruct%do_skeb )
then 895 heat_source(i,j,k) = heat_source(i,j,k) + heat_s(i,j)
896 diss_est(i,j,k) = diss_est(i,j,k) + diss_e(i,j)
902 if (flagstruct%regional)
then 903 call exch_uv(domain, bd, npz, vc, uc)
904 call exch_uv(domain, bd, npz, u, v )
908 if( flagstruct%fill_dp )
call mix_dp(hydrostatic, w, delp, pt, npz, ak, bk, .false., flagstruct%fv_debug, bd)
911 call start_group_halo_update(i_pack(1), delp, domain, complete=.false.)
912 call start_group_halo_update(i_pack(1), pt, domain, complete=.true.)
914 call start_group_halo_update(i_pack(11), q_con, domain)
918 if ( flagstruct%d_ext > 0. )
then 919 d2_divg = flagstruct%d_ext * gridstruct%da_min_c
924 divg2(i,j) = wk(i,j)*
vt(i,j,1)
928 wk(i,j) = wk(i,j) +
ptc(i,j,k)
929 divg2(i,j) = divg2(i,j) +
ptc(i,j,k)*
vt(i,j,k)
933 divg2(i,j) = d2_divg*divg2(i,j)/wk(i,j)
941 call complete_group_halo_update(i_pack(1), domain)
943 call complete_group_halo_update(i_pack(11), domain)
946 if ( flagstruct%fv_debug )
then 947 if ( .not. flagstruct%hydrostatic ) &
948 call prt_mxm(
'delz', delz, is, ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
952 if (gridstruct%nested)
then 954 0, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
955 neststruct%delp_bc, bctype=neststruct%nestbctype )
960 0, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
961 neststruct%pt_bc, bctype=neststruct%nestbctype )
965 0, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
966 neststruct%q_con_bc, bctype=neststruct%nestbctype )
973 if (flagstruct%regional)
then 974 reg_bc_update_time=current_time_in_seconds+bdt+(it-1)*dt
975 call regional_boundary_update(delp,
'delp', &
976 isd, ied, jsd, jed, npz, &
978 isd, ied, jsd, jed, &
981 call regional_boundary_update(pt,
'pt', &
982 isd, ied, jsd, jed, npz, &
984 isd, ied, jsd, jed, &
988 call regional_boundary_update(q_con,
'q_con', &
989 isd, ied, jsd, jed, npz, &
991 isd, ied, jsd, jed, &
998 if ( hydrostatic )
then 999 call geopk(ptop, pe, peln, delp,
pkc,
gz, phis, pt, &
1003 q_con, pkz, npz, akap, .false., &
1004 gridstruct%nested, .true., npx, npy, flagstruct%a2b_ord, bd)
1008 call update_dz_d(nord_v, damp_vt, flagstruct%hord_tm, is, ie, js, je, npz, ng, npx, npy, gridstruct%area, &
1009 gridstruct%rarea, dp_ref, zs,
zh,
crx,
cry,
xfx,
yfx, delz, ws, rdt, gridstruct, bd, flagstruct%lim_fac, &
1010 flagstruct%regional)
1012 if ( flagstruct%fv_debug )
then 1013 if ( .not. flagstruct%hydrostatic ) &
1014 call prt_mxm(
'delz updated', delz, is, ie, js, je, ng, npz, 1., gridstruct%area_64, domain)
1017 if (idiag%id_ws>0 .and. last_step)
then 1019 used=send_data(idiag%id_ws, ws,
fv_time)
1023 call riem_solver3(flagstruct%m_split, dt, is, ie, js, je, npz, ng, &
1024 isd, ied, jsd, jed, &
1029 ptop, zs, q_con, w, delz, pt, delp,
zh, &
1030 pe,
pkc,
pk3, pk, peln, ws, &
1031 flagstruct%scale_z, flagstruct%p_fac, flagstruct%a_imp, &
1032 flagstruct%use_logp, remap_step, beta<-0.1)
1036 if ( gridstruct%square_domain )
then 1037 call start_group_halo_update(i_pack(4),
zh , domain)
1038 call start_group_halo_update(i_pack(5),
pkc, domain, whalo=2, ehalo=2, shalo=2, nhalo=2)
1040 call start_group_halo_update(i_pack(4),
zh , domain, complete=.false.)
1041 call start_group_halo_update(i_pack(4),
pkc, domain, complete=.true.)
1045 call pe_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, pe, delp)
1047 if ( flagstruct%use_logp )
then 1048 call pln_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop,
pk3, delp)
1050 call pk3_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, akap,
pk3, delp)
1052 if (gridstruct%nested)
then 1054 0, 0, npx, npy, npz, bd, split_timestep_bc+1.,
real(n_split*flagstruct%k_split), &
1055 neststruct%delz_bc, bctype=neststruct%nestbctype )
1058 if (flagstruct%regional)
then 1059 reg_bc_update_time=current_time_in_seconds+it*dt
1060 call regional_boundary_update(delz,
'delz', &
1061 isd, ied, jsd, jed, ubound(delz,3), &
1063 isd, ied, jsd, jed, &
1064 reg_bc_update_time )
1067 if (gridstruct%nested .or. flagstruct%regional)
then 1070 call nest_halo_nh(ptop, grav, akap, cp, delp, delz, pt, phis, &
1080 pkc,
gz,
pk3, npx, npy, npz, gridstruct%nested, .true., .true., .true., bd, flagstruct%regional)
1084 call complete_group_halo_update(i_pack(4), domain)
1090 gz(i,j,k) =
zh(i,j,k)*grav
1094 if ( gridstruct%square_domain )
then 1096 call complete_group_halo_update(i_pack(5), domain)
1105 if ( remap_step .and. hydrostatic )
then 1110 pk(i,j,k) =
pkc(i,j,k)
1121 if ( hydrostatic )
then 1122 if ( beta > 0. )
then 1123 call grad1_p_update(divg2, u, v,
pkc,
gz, dt, ng, gridstruct, bd, npx, npy, npz, ptop, beta_d, flagstruct%a2b_ord)
1125 call one_grad_p(u, v,
pkc,
gz, divg2, delp, dt, ng, gridstruct, bd, npx, npy, npz, ptop, hydrostatic, flagstruct%a2b_ord, flagstruct%d_ext)
1131 if ( beta > 0. )
then 1132 call split_p_grad( u, v,
pkc,
gz, delp,
pk3, beta_d, dt, ng, gridstruct, bd, npx, npy, npz, flagstruct%use_logp)
1133 elseif ( beta < -0.1 )
then 1134 call one_grad_p(u, v,
pkc,
gz, divg2, delp, dt, ng, gridstruct, bd, npx, npy, npz, ptop, hydrostatic, flagstruct%a2b_ord, flagstruct%d_ext)
1136 call nh_p_grad(u, v,
pkc,
gz, delp,
pk3, dt, ng, gridstruct, bd, npx, npy, npz, flagstruct%use_logp)
1140 if ( flagstruct%do_f3d )
then 1145 ua(i,j,k) = -gridstruct%w00(i,j)*w(i,j,k)
1154 call mpp_update_domains(ua, domain, complete=.true.)
1155 call update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, ua, va, u, v, gridstruct, npx, npy, npz, domain)
1162 if( flagstruct%RF_fast .and. flagstruct%tau > 0. ) &
1163 call ray_fast(abs(dt), npx, npy, npz, pfull, flagstruct%tau, u, v, w, &
1164 ks, dp_ref, ptop, hydrostatic, flagstruct%rf_cutoff, bd)
1167 if ( flagstruct%breed_vortex_inline )
then 1168 if ( .not. hydrostatic )
then 1175 pkz(i,j,k) = exp(cappa(i,j,k)/(1.-cappa(i,j,k))*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1178 pkz(i,j,k) = exp( k1k*
virqd(q(i,j,k,:))/
vicvqd(q(i,j,k,:))*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1180 pkz(i,j,k) = exp( k1k*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1187 #if defined (ADA_NUDGE) 1188 call breed_slp_inline_ada( it, dt, npz, ak, bk, phis, pe, pk, peln, pkz, &
1189 delp, u, v, pt, q, flagstruct%nwat, zvir, gridstruct, ks, domain, bd )
1191 call breed_slp_inline( it, dt, npz, ak, bk, phis, pe, pk, peln, pkz, delp, u, v, pt, q, &
1192 flagstruct%nwat, zvir, gridstruct, ks, domain, bd, hydrostatic )
1198 if( it==n_split .and. gridstruct%grid_type<4 .and. .not. (gridstruct%nested .or. gridstruct%regional))
then 1200 call mpp_get_boundary(u, v, domain, ebuffery=ebuffer, &
1201 nbufferx=nbuffer, gridtype=dgrid_ne )
1205 u(i,je+1,k) = nbuffer(i-is+1,k)
1208 v(ie+1,j,k) = ebuffer(j-js+1,k)
1216 call start_group_halo_update(i_pack(8), u, v, domain, gridtype=dgrid_ne)
1223 if ( gridstruct%nested )
then 1224 neststruct%nest_timestep = neststruct%nest_timestep + 1
1229 if ( hydrostatic .and. last_step )
then 1230 if ( flagstruct%use_old_omega )
then 1235 omga(i,j,k) = (pe(i,k+1,j) - pem(i,k+1,j)) * rdt
1242 call adv_pe(ua, va, pem, omga, gridstruct, bd, npx, npy, npz, ng)
1248 om2d(i,k) = omga(i,j,k)
1253 om2d(i,k) = om2d(i,k-1) + omga(i,j,k)
1258 omga(i,j,k) = om2d(i,k)
1263 if (idiag%id_ws>0 .and. hydrostatic)
then 1267 ws(i,j) = delz(i,j,npz)/delp(i,j,npz) * omga(i,j,npz)
1270 used=send_data(idiag%id_ws, ws,
fv_time)
1275 if (gridstruct%nested)
then 1280 if (.not. hydrostatic)
then 1282 0, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
1283 neststruct%w_bc, bctype=neststruct%nestbctype )
1287 0, 1, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
1288 neststruct%u_bc, bctype=neststruct%nestbctype )
1290 1, 0, npx, npy, npz, bd, split_timestep_bc+1,
real(n_split*flagstruct%k_split), &
1291 neststruct%v_bc, bctype=neststruct%nestbctype )
1295 if (flagstruct%regional)
then 1298 if (.not. hydrostatic)
then 1299 reg_bc_update_time=current_time_in_seconds+it*dt
1300 call regional_boundary_update(w,
'w', &
1301 isd, ied, jsd, jed, ubound(w,3), &
1303 isd, ied, jsd, jed, &
1304 reg_bc_update_time )
1308 call regional_boundary_update(u,
'u', &
1309 isd, ied, jsd, jed+1, npz, &
1311 isd, ied, jsd, jed, &
1312 reg_bc_update_time )
1313 call regional_boundary_update(v,
'v', &
1314 isd, ied+1, jsd, jed, npz, &
1316 isd, ied, jsd, jed, &
1317 reg_bc_update_time )
1319 call exch_uv(domain, bd, npz, u, v )
1326 if ( nq > 0 .and. .not. flagstruct%inline_q )
then 1329 call start_group_halo_update(i_pack(10), q, domain)
1334 if ( flagstruct%fv_debug )
then 1335 if(is_master())
write(*,*)
'End of n_split loop' 1339 if ( n_con/=0 .and. flagstruct%d_con > 1.e-5 )
then 1340 nf_ke = min(3, flagstruct%nord+1)
1341 call del2_cubed(heat_source,
cnst_0p20*gridstruct%da_min, gridstruct, domain, npx, npy, npz, nf_ke, bd)
1344 if ( hydrostatic )
then 1354 pt(i,j,k) = pt(i,j,k) + heat_source(i,j,k)/(cp_air*delp(i,j,k)*pkz(i,j,k))
1358 dtmp = heat_source(i,j,k) / (cp_air*delp(i,j,k))
1359 pt(i,j,k) = pt(i,j,k) + sign(min(abs(bdt)*flagstruct%delt_max,abs(dtmp)), dtmp)/pkz(i,j,k)
1369 delt = abs(bdt*flagstruct%delt_max)
1371 if ( k == 1 ) delt = 0.1*delt
1372 if ( k == 2 ) delt = 0.5*delt
1376 pkz(i,j,k) = exp( cappa(i,j,k)/(1.-cappa(i,j,k))*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1379 pkz(i,j,k) = exp( k1k*
virqd(q(i,j,k,:))/
vicvqd(q(i,j,k,:))*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1381 pkz(i,j,k) = exp( k1k*log(rdg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k)) )
1384 dtmp = heat_source(i,j,k) / (cv_air*delp(i,j,k))
1385 pt(i,j,k) = pt(i,j,k) + sign(min(delt, abs(dtmp)),dtmp) / pkz(i,j,k)
1392 if (
allocated(heat_source))
deallocate( heat_source )
1394 if ( end_step )
then 1405 if(
allocated(
ut))
deallocate(
ut )
1406 if(
allocated(
vt))
deallocate(
vt )
1407 if (
allocated (
du) )
deallocate(
du )
1408 if (
allocated (
dv) )
deallocate(
dv )
1409 if ( .not. hydrostatic )
then 1411 if(
allocated(
pk3) )
deallocate (
pk3 )
1415 if(
allocated(pem) )
deallocate ( pem )
1419 subroutine pk3_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, akap, pk3, delp)
1420 integer,
intent(in):: is, ie, js, je, isd, ied, jsd, jed, npz
1421 real,
intent(in):: ptop, akap
1422 real,
intent(in ),
dimension(isd:ied,jsd:jed,npz):: delp
1423 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz+1):: pk3
1435 pei(is-2) = pei(is-2) + delp(is-2,j,k)
1436 pei(is-1) = pei(is-1) + delp(is-1,j,k)
1437 pk3(is-2,j,k+1) = exp(akap*log(pei(is-2)))
1438 pk3(is-1,j,k+1) = exp(akap*log(pei(is-1)))
1443 pei(ie+1) = pei(ie+1) + delp(ie+1,j,k)
1444 pei(ie+2) = pei(ie+2) + delp(ie+2,j,k)
1445 pk3(ie+1,j,k+1) = exp(akap*log(pei(ie+1)))
1446 pk3(ie+2,j,k+1) = exp(akap*log(pei(ie+2)))
1456 pej(js-2) = pej(js-2) + delp(i,js-2,k)
1457 pej(js-1) = pej(js-1) + delp(i,js-1,k)
1458 pk3(i,js-2,k+1) = exp(akap*log(pej(js-2)))
1459 pk3(i,js-1,k+1) = exp(akap*log(pej(js-1)))
1464 pej(je+1) = pej(je+1) + delp(i,je+1,k)
1465 pej(je+2) = pej(je+2) + delp(i,je+2,k)
1466 pk3(i,je+1,k+1) = exp(akap*log(pej(je+1)))
1467 pk3(i,je+2,k+1) = exp(akap*log(pej(je+2)))
1473 subroutine pln_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, pk3, delp)
1474 integer,
intent(in):: is, ie, js, je, isd, ied, jsd, jed, npz
1475 real,
intent(in):: ptop
1476 real,
intent(in ),
dimension(isd:ied,jsd:jed,npz):: delp
1477 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz+1):: pk3
1488 pet = pet + delp(i,j,k)
1489 pk3(i,j,k+1) = log(pet)
1495 pet = pet + delp(i,j,k)
1496 pk3(i,j,k+1) = log(pet)
1507 pet = pet + delp(i,j,k)
1508 pk3(i,j,k+1) = log(pet)
1514 pet = pet + delp(i,j,k)
1515 pk3(i,j,k+1) = log(pet)
1522 subroutine pe_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, pe, delp)
1523 integer,
intent(in):: is, ie, js, je, isd, ied, jsd, jed, npz
1524 real,
intent(in):: ptop
1525 real,
intent(in ),
dimension(isd:ied,jsd:jed,npz):: delp
1526 real,
intent(inout),
dimension(is-1:ie+1,npz+1,js-1:je+1):: pe
1535 pe(is-1,k+1,j) = pe(is-1,k,j) + delp(is-1,j,k)
1536 pe(ie+1,k+1,j) = pe(ie+1,k,j) + delp(ie+1,j,k)
1545 pe(i,k+1,js-1) = pe(i,k,js-1) + delp(i,js-1,k)
1546 pe(i,k+1,je+1) = pe(i,k,je+1) + delp(i,je+1,k)
1553 subroutine adv_pe(ua, va, pem, om, gridstruct, bd, npx, npy, npz, ng)
1555 integer,
intent(in) :: npx, npy, npz, ng
1556 type(fv_grid_bounds_type),
intent(IN) :: bd
1558 real,
intent(in),
dimension(bd%isd:bd%ied,bd%jsd:bd%jed,npz):: ua, va
1560 real,
intent(in) :: pem(bd%is-1:bd%ie+1,1:npz+1,bd%js-1:bd%je+1)
1561 real,
intent(inout) :: om(bd%isd:bd%ied,bd%jsd:bd%jed,npz)
1562 type(fv_grid_type),
intent(INOUT),
target :: gridstruct
1565 real,
dimension(bd%is:bd%ie,bd%js:bd%je):: up, vp
1566 real v3(3,bd%is:bd%ie,bd%js:bd%je)
1568 real pin(bd%isd:bd%ied,bd%jsd:bd%jed)
1569 real pb(bd%isd:bd%ied,bd%jsd:bd%jed)
1571 real grad(3,bd%is:bd%ie,bd%js:bd%je)
1572 real pdx(3,bd%is:bd%ie,bd%js:bd%je+1)
1573 real pdy(3,bd%is:bd%ie+1,bd%js:bd%je)
1576 integer :: is, ie, js, je
1589 up(i,j) = ua(i,j,npz)
1590 vp(i,j) = va(i,j,npz)
1596 up(i,j) = 0.5*(ua(i,j,k)+ua(i,j,k+1))
1597 vp(i,j) = 0.5*(va(i,j,k)+va(i,j,k+1))
1606 v3(n,i,j) = up(i,j)*gridstruct%ec1(n,i,j) + vp(i,j)*gridstruct%ec2(n,i,j)
1613 pin(i,j) = pem(i,k+1,j)
1618 call a2b_ord2(pin, pb, gridstruct, npx, npy, is, ie, js, je, ng)
1624 pdx(n,i,j) = (pb(i,j)+pb(i+1,j))*gridstruct%dx(i,j)*gridstruct%en1(n,i,j)
1631 pdy(n,i,j) = (pb(i,j)+pb(i,j+1))*gridstruct%dy(i,j)*gridstruct%en2(n,i,j)
1640 grad(n,i,j) = pdx(n,i,j+1) - pdx(n,i,j) - pdy(n,i,j) + pdy(n,i+1,j)
1648 om(i,j,k) = om(i,j,k) + 0.5*gridstruct%rarea(i,j)*(v3(1,i,j)*grad(1,i,j) + &
1649 v3(2,i,j)*grad(2,i,j) + v3(3,i,j)*grad(3,i,j))
1659 subroutine p_grad_c(dt2, npz, delpc, pkc, gz, uc, vc, bd, rdxc, rdyc, hydrostatic)
1661 integer,
intent(in):: npz
1662 real,
intent(in):: dt2
1663 type(fv_grid_bounds_type),
intent(IN) :: bd
1664 real,
intent(in),
dimension(bd%isd:, bd%jsd: ,: ):: delpc
1667 real,
intent(in),
dimension(bd%isd:bd%ied, bd%jsd:bd%jed ,npz+1):: pkc, gz
1668 real,
intent(inout):: uc(bd%isd:bd%ied+1,bd%jsd:bd%jed ,npz)
1669 real,
intent(inout):: vc(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz)
1670 real,
intent(IN) :: rdxc(bd%isd:bd%ied+1,bd%jsd:bd%jed+1)
1671 real,
intent(IN) :: rdyc(bd%isd:bd%ied ,bd%jsd:bd%jed)
1672 logical,
intent(in):: hydrostatic
1674 real:: wk(bd%is-1:bd%ie+1,bd%js-1:bd%je+1)
1677 integer :: is, ie, js, je
1688 if ( hydrostatic )
then 1691 wk(i,j) = pkc(i,j,k+1) - pkc(i,j,k)
1697 wk(i,j) = delpc(i,j,k)
1704 uc(i,j,k) = uc(i,j,k) + dt2*rdxc(i,j) / (wk(i-1,j)+wk(i,j)) * &
1705 ( (gz(i-1,j,k+1)-gz(i,j,k ))*(pkc(i,j,k+1)-pkc(i-1,j,k)) &
1706 + (gz(i-1,j,k) - gz(i,j,k+1))*(pkc(i-1,j,k+1)-pkc(i,j,k)) )
1711 vc(i,j,k) = vc(i,j,k) + dt2*rdyc(i,j) / (wk(i,j-1)+wk(i,j)) * &
1712 ( (gz(i,j-1,k+1)-gz(i,j,k ))*(pkc(i,j,k+1)-pkc(i,j-1,k)) &
1713 + (gz(i,j-1,k) - gz(i,j,k+1))*(pkc(i,j-1,k+1)-pkc(i,j,k)) )
1721 subroutine nh_p_grad(u, v, pp, gz, delp, pk, dt, ng, gridstruct, bd, npx, npy, npz, use_logp)
1722 integer,
intent(IN) :: ng, npx, npy, npz
1723 real,
intent(IN) :: dt
1724 logical,
intent(in) :: use_logp
1725 type(fv_grid_bounds_type),
intent(IN) :: bd
1726 real,
intent(inout) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1727 real,
intent(inout) :: pp(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1728 real,
intent(inout) :: pk(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1729 real,
intent(inout) :: gz(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1730 real,
intent(inout) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1,npz)
1731 real,
intent(inout) :: v(bd%isd:bd%ied+1,bd%jsd:bd%jed, npz)
1732 type(fv_grid_type),
intent(INOUT),
target :: gridstruct
1734 real wk1(bd%isd:bd%ied, bd%jsd:bd%jed)
1735 real wk(bd%is: bd%ie+1,bd%js: bd%je+1)
1736 real du1, dv1, top_value
1738 integer :: is, ie, js, je
1739 integer :: isd, ied, jsd, jed
1750 if ( use_logp )
then 1763 pk(i,j,1) = top_value
1767 call a2b_ord4(pp(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1768 call a2b_ord4(pk(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1770 call a2b_ord4( gz(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1777 call a2b_ord4(delp(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng)
1780 wk(i,j) = pk(i,j,k+1) - pk(i,j,k)
1787 du1 = dt / (wk(i,j)+wk(i+1,j)) * &
1788 ( (gz(i,j,k+1)-gz(i+1,j,k))*(pk(i+1,j,k+1)-pk(i,j,k)) + &
1789 (gz(i,j,k)-gz(i+1,j,k+1))*(pk(i,j,k+1)-pk(i+1,j,k)) )
1791 dul = (1.-0.5*(q_con(i,j-1,k)+q_con(i,j,k)))*
du 1794 u(i,j,k) = (u(i,j,k) + du1 + dt/(wk1(i,j)+wk1(i+1,j)) * &
1795 ((gz(i,j,k+1)-gz(i+1,j,k))*(pp(i+1,j,k+1)-pp(i,j,k)) &
1796 + (gz(i,j,k)-gz(i+1,j,k+1))*(pp(i,j,k+1)-pp(i+1,j,k))))*gridstruct%rdx(i,j)
1802 dv1 = dt / (wk(i,j)+wk(i,j+1)) * &
1803 ((gz(i,j,k+1)-gz(i,j+1,k))*(pk(i,j+1,k+1)-pk(i,j,k)) + &
1804 (gz(i,j,k)-gz(i,j+1,k+1))*(pk(i,j,k+1)-pk(i,j+1,k)))
1806 dvl = (1.-0.5*(q_con(i-1,j,k)+q_con(i,j,k)))*
dv 1809 v(i,j,k) = (v(i,j,k) + dv1 + dt/(wk1(i,j)+wk1(i,j+1)) * &
1810 ((gz(i,j,k+1)-gz(i,j+1,k))*(pp(i,j+1,k+1)-pp(i,j,k)) &
1811 + (gz(i,j,k)-gz(i,j+1,k+1))*(pp(i,j,k+1)-pp(i,j+1,k))))*gridstruct%rdy(i,j)
1819 subroutine split_p_grad( u, v, pp, gz, delp, pk, beta, dt, ng, gridstruct, bd, npx, npy, npz, use_logp)
1820 integer,
intent(IN) :: ng, npx, npy, npz
1821 real,
intent(IN) :: beta, dt
1822 logical,
intent(in):: use_logp
1823 type(fv_grid_bounds_type),
intent(IN) :: bd
1824 real,
intent(inout) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1825 real,
intent(inout) :: pp(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1826 real,
intent(inout) :: pk(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1827 real,
intent(inout) :: gz(bd%isd:bd%ied, bd%jsd:bd%jed, npz+1)
1830 real,
intent(inout) :: u(bd%isd:bd%ied, bd%jsd:bd%jed+1,npz)
1831 real,
intent(inout) :: v(bd%isd:bd%ied+1,bd%jsd:bd%jed, npz)
1832 type(fv_grid_type),
intent(INOUT),
target :: gridstruct
1834 real wk1(bd%isd:bd%ied, bd%jsd:bd%jed)
1835 real wk(bd%is: bd%ie+1,bd%js: bd%je+1)
1836 real alpha, top_value
1838 integer :: is, ie, js, je
1839 integer :: isd, ied, jsd, jed
1850 if ( use_logp )
then 1862 pk(i,j,1) = top_value
1870 call a2b_ord4(pp(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1871 call a2b_ord4(pk(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1873 call a2b_ord4( gz(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1880 call a2b_ord4(delp(isd,jsd,k), wk1, gridstruct, npx, npy, is, ie, js, je, ng)
1884 wk(i,j) = pk(i,j,k+1) - pk(i,j,k)
1890 u(i,j,k) = u(i,j,k) + beta*
du(i,j,k)
1894 du(i,j,k) = dt / (wk(i,j)+wk(i+1,j)) * &
1895 ((gz(i,j,k+1)-gz(i+1,j,k))*(pk(i+1,j,k+1)-pk(i,j,k)) + &
1896 (gz(i,j,k)-gz(i+1,j,k+1))*(pk(i,j,k+1)-pk(i+1,j,k)))
1898 du = (1.-0.5*(q_con(i,j-1,k)+q_con(i,j,k)))*
du 1902 u(i,j,k) = (u(i,j,k) + alpha*
du(i,j,k) + dt/(wk1(i,j)+wk1(i+1,j)) * &
1903 ((gz(i,j,k+1)-gz(i+1,j,k))*(pp(i+1,j,k+1)-pp(i,j,k)) &
1904 + (gz(i,j,k)-gz(i+1,j,k+1))*(pp(i,j,k+1)-pp(i+1,j,k))))*gridstruct%rdx(i,j)
1909 v(i,j,k) = v(i,j,k) + beta*
dv(i,j,k)
1912 dv(i,j,k) = dt / (wk(i,j)+wk(i,j+1)) * &
1913 ((gz(i,j,k+1)-gz(i,j+1,k))*(pk(i,j+1,k+1)-pk(i,j,k)) + &
1914 (gz(i,j,k)-gz(i,j+1,k+1))*(pk(i,j,k+1)-pk(i,j+1,k)))
1916 dv = (1.-0.5*(q_con(i-1,j,k)+q_con(i,j,k)))*
dv 1920 v(i,j,k) = (v(i,j,k) + alpha*
dv(i,j,k) + dt/(wk1(i,j)+wk1(i,j+1)) * &
1921 ((gz(i,j,k+1)-gz(i,j+1,k))*(pp(i,j+1,k+1)-pp(i,j,k)) &
1922 + (gz(i,j,k)-gz(i,j+1,k+1))*(pp(i,j,k+1)-pp(i,j+1,k))))*gridstruct%rdy(i,j)
1933 subroutine one_grad_p(u, v, pk, gz, divg2, delp, dt, ng, gridstruct, bd, npx, npy, npz, &
1934 ptop, hydrostatic, a2b_ord, d_ext)
1936 integer,
intent(IN) :: ng, npx, npy, npz, a2b_ord
1937 real,
intent(IN) :: dt, ptop, d_ext
1938 logical,
intent(in) :: hydrostatic
1939 type(fv_grid_bounds_type),
intent(IN) :: bd
1940 real,
intent(in) :: divg2(bd%is:bd%ie+1,bd%js:bd%je+1)
1941 real,
intent(inout) :: pk(bd%isd:bd%ied, bd%jsd:bd%jed ,npz+1)
1942 real,
intent(inout) :: gz(bd%isd:bd%ied, bd%jsd:bd%jed ,npz+1)
1943 real,
intent(inout) :: delp(bd%isd:bd%ied, bd%jsd:bd%jed ,npz)
1944 real,
intent(inout) :: u(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz)
1945 real,
intent(inout) :: v(bd%isd:bd%ied+1,bd%jsd:bd%jed ,npz)
1946 type(fv_grid_type),
intent(INOUT),
target :: gridstruct
1948 real,
dimension(bd%isd:bd%ied,bd%jsd:bd%jed):: wk
1949 real:: wk1(bd%is:bd%ie+1,bd%js:bd%je+1)
1950 real:: wk2(bd%is:bd%ie,bd%js:bd%je+1)
1954 integer :: is, ie, js, je
1955 integer :: isd, ied, jsd, jed
1966 if ( hydrostatic )
then 1977 pk(i,j,1) = top_value
1984 if ( a2b_ord==4 )
then 1985 call a2b_ord4(pk(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1987 call a2b_ord2(pk(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1994 if ( a2b_ord==4 )
then 1995 call a2b_ord4( gz(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
1997 call a2b_ord2( gz(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
2001 if ( d_ext > 0. )
then 2006 wk2(i,j) = divg2(i,j)-divg2(i+1,j)
2013 wk1(i,j) = divg2(i,j)-divg2(i,j+1)
2036 if ( hydrostatic )
then 2039 wk(i,j) = pk(i,j,k+1) - pk(i,j,k)
2043 if ( a2b_ord==4 )
then 2044 call a2b_ord4(delp(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng)
2046 call a2b_ord2(delp(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng)
2052 u(i,j,k) = gridstruct%rdx(i,j)*(wk2(i,j)+u(i,j,k) + dt/(wk(i,j)+wk(i+1,j)) * &
2053 ((gz(i,j,k+1)-gz(i+1,j,k))*(pk(i+1,j,k+1)-pk(i,j,k)) &
2054 + (gz(i,j,k)-gz(i+1,j,k+1))*(pk(i,j,k+1)-pk(i+1,j,k))))
2059 v(i,j,k) = gridstruct%rdy(i,j)*(wk1(i,j)+v(i,j,k) + dt/(wk(i,j)+wk(i,j+1)) * &
2060 ((gz(i,j,k+1)-gz(i,j+1,k))*(pk(i,j+1,k+1)-pk(i,j,k)) &
2061 + (gz(i,j,k)-gz(i,j+1,k+1))*(pk(i,j,k+1)-pk(i,j+1,k))))
2069 subroutine grad1_p_update(divg2, u, v, pk, gz, dt, ng, gridstruct, bd, npx, npy, npz, ptop, beta, a2b_ord)
2071 integer,
intent(in) :: ng, npx, npy, npz, a2b_ord
2072 real,
intent(in) :: dt, ptop, beta
2073 type(fv_grid_bounds_type),
intent(IN) :: bd
2074 real,
intent(in):: divg2(bd%is:bd%ie+1,bd%js:bd%je+1)
2075 real,
intent(inout) :: pk(bd%isd:bd%ied, bd%jsd:bd%jed ,npz+1)
2076 real,
intent(inout) :: gz(bd%isd:bd%ied, bd%jsd:bd%jed ,npz+1)
2077 real,
intent(inout) :: u(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz)
2078 real,
intent(inout) :: v(bd%isd:bd%ied+1,bd%jsd:bd%jed ,npz)
2079 type(fv_grid_type),
intent(INOUT),
target :: gridstruct
2082 real:: wk(bd%isd:bd%ied,bd%jsd:bd%jed)
2083 real top_value, alpha
2086 integer :: is, ie, js, je
2087 integer :: isd, ied, jsd, jed
2106 pk(i,j,1) = top_value
2112 if ( a2b_ord==4 )
then 2113 call a2b_ord4(pk(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
2115 call a2b_ord2(pk(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
2122 if ( a2b_ord==4 )
then 2123 call a2b_ord4( gz(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
2125 call a2b_ord2( gz(isd,jsd,k), wk, gridstruct, npx, npy, is, ie, js, je, ng, .true.)
2136 wk(i,j) = pk(i,j,k+1) - pk(i,j,k)
2142 u(i,j,k) = u(i,j,k) + beta*
du(i,j,k)
2143 du(i,j,k) = dt/(wk(i,j)+wk(i+1,j)) * &
2144 ((gz(i,j,k+1)-gz(i+1,j,k))*(pk(i+1,j,k+1)-pk(i,j,k)) &
2145 + (gz(i,j,k)-gz(i+1,j,k+1))*(pk(i,j,k+1)-pk(i+1,j,k)))
2146 u(i,j,k) = (u(i,j,k) + divg2(i,j)-divg2(i+1,j) + alpha*
du(i,j,k))*gridstruct%rdx(i,j)
2151 v(i,j,k) = v(i,j,k) + beta*
dv(i,j,k)
2152 dv(i,j,k) = dt/(wk(i,j)+wk(i,j+1)) * &
2153 ((gz(i,j,k+1)-gz(i,j+1,k))*(pk(i,j+1,k+1)-pk(i,j,k)) &
2154 + (gz(i,j,k)-gz(i,j+1,k+1))*(pk(i,j,k+1)-pk(i,j+1,k)))
2155 v(i,j,k) = (v(i,j,k) + divg2(i,j)-divg2(i,j+1) + alpha*
dv(i,j,k))*gridstruct%rdy(i,j)
2163 subroutine mix_dp(hydrostatic, w, delp, pt, km, ak, bk, CG, fv_debug, bd)
2164 integer,
intent(IN) :: km
2165 real ,
intent(IN) :: ak(km+1), bk(km+1)
2166 type(fv_grid_bounds_type),
intent(IN) :: bd
2167 real,
intent(INOUT),
dimension(bd%isd:bd%ied,bd%jsd:bd%jed,km):: pt, delp
2168 real,
intent(INOUT),
dimension(bd%isd:,bd%jsd:,1:):: w
2169 logical,
intent(IN) :: hydrostatic, CG, fv_debug
2173 integer ifirst, ilast
2174 integer jfirst, jlast
2176 integer :: is, ie, js, je
2177 integer :: isd, ied, jsd, jed
2190 ifirst = is-1; ilast = ie+1
2191 jfirst = js-1; jlast = je+1
2193 ifirst = is; ilast = ie
2194 jfirst = js; jlast = je
2201 do 1000 j=jfirst,jlast
2206 dpmin = 0.01 * ( ak(k+1)-ak(k) + (bk(k+1)-bk(k))*1.e5 )
2208 if(delp(i,j,k) < dpmin)
then 2209 if (fv_debug)
write(*,*)
'Mix_dp: ', i, j, k, mpp_pe(), delp(i,j,k), pt(i,j,k)
2211 dp = dpmin - delp(i,j,k)
2212 pt(i,j,k) = (pt(i,j,k)*delp(i,j,k) + pt(i,j,k+1)*dp) / dpmin
2213 if ( .not.hydrostatic ) w(i,j,k) = (w(i,j,k)*delp(i,j,k) + w(i,j,k+1)*dp) / dpmin
2215 delp(i,j,k+1) = delp(i,j,k+1) - dp
2222 dpmin = 0.01 * ( ak(km+1)-ak(km) + (bk(km+1)-bk(km))*1.e5 )
2224 if(delp(i,j,km) < dpmin)
then 2225 if (fv_debug)
write(*,*)
'Mix_dp: ', i, j, km, mpp_pe(), delp(i,j,km), pt(i,j,km)
2227 dp = dpmin - delp(i,j,km)
2228 pt(i,j,km) = (pt(i,j,km)*delp(i,j,km) + pt(i,j,km-1)*dp)/dpmin
2229 if ( .not.hydrostatic ) w(i,j,km) = (w(i,j,km)*delp(i,j,km) + w(i,j,km-1)*dp) / dpmin
2230 delp(i,j,km) = dpmin
2231 delp(i,j,km-1) = delp(i,j,km-1) - dp
2235 if ( fv_debug .and. ip/=0 )
write(*,*)
'Warning: Mix_dp', mpp_pe(), j, ip
2242 subroutine geopk(ptop, pe, peln, delp, pk, gz, hs, pt, &
2246 q_con, pkz, km, akap, CG, nested, computehalo, npx, npy, a2b_ord, bd)
2248 integer,
intent(IN) :: km, npx, npy, a2b_ord
2249 real ,
intent(IN) :: akap, ptop
2250 type(fv_grid_bounds_type),
intent(IN) :: bd
2251 real ,
intent(IN) :: hs(bd%isd:bd%ied,bd%jsd:bd%jed)
2252 real,
intent(IN),
dimension(bd%isd:bd%ied,bd%jsd:bd%jed,km):: pt, delp
2254 real,
intent(IN) :: kapad(bd%isd:bd%ied,bd%jsd:bd%jed,km)
2256 real,
intent(IN),
dimension(bd%isd:,bd%jsd:,1:):: q_con
2257 logical,
intent(IN) :: CG, nested, computehalo
2259 real,
intent(OUT),
dimension(bd%isd:bd%ied,bd%jsd:bd%jed,km+1):: gz, pk
2260 real,
intent(OUT) :: pe(bd%is-1:bd%ie+1,km+1,bd%js-1:bd%je+1)
2261 real,
intent(out) :: peln(bd%is:bd%ie,km+1,bd%js:bd%je)
2262 real,
intent(out) :: pkz(bd%is:bd%ie,bd%js:bd%je,km)
2266 real peg(bd%isd:bd%ied,km+1)
2267 real pkg(bd%isd:bd%ied,km+1)
2268 real p1d(bd%isd:bd%ied)
2269 real logp(bd%isd:bd%ied)
2271 real pkx (bd%isd:bd%ied,km)
2272 real pkgx(bd%isd:bd%ied,km)
2277 integer ifirst, ilast
2278 integer jfirst, jlast
2280 integer :: is, ie, js, je
2281 integer :: isd, ied, jsd, jed
2292 if ( (.not. cg .and. a2b_ord==4) .or. (nested .and. .not. cg) )
then 2293 ifirst = is-2; ilast = ie+2
2294 jfirst = js-2; jlast = je+2
2296 ifirst = is-1; ilast = ie+1
2297 jfirst = js-1; jlast = je+1
2300 if (nested .and. computehalo)
then 2301 if (is == 1) ifirst = isd
2302 if (ie == npx-1) ilast = ied
2303 if (js == 1) jfirst = jsd
2304 if (je == npy-1) jlast = jed
2316 do 2000 j=jfirst,jlast
2321 gz(i,j,km+1) = hs(i,j)
2329 if( j>=js .and. j<=je)
then 2336 if( j>(js-2) .and. j<(je+2) )
then 2337 do i=max(ifirst,is-1), min(ilast,ie+1)
2345 p1d(i) = p1d(i) + delp(i,j,k-1)
2346 logp(i) = log(p1d(i))
2347 pk(i,j,k) = exp( akap*logp(i) )
2349 peg(i,k) = peg(i,k-1) + delp(i,j,k-1)*(1.-q_con(i,j,k-1))
2350 pkg(i,k) = exp( akap*log(peg(i,k)) )
2354 if( j>(js-2) .and. j<(je+2) )
then 2355 do i=max(ifirst,is-1), min(ilast,ie+1)
2358 if( j>=js .and. j<=je)
then 2360 peln(i,k,j) = logp(i)
2369 akapx = (kapad(i,j,k)-akap)/akap
2371 pkgx(i,k) = (pkg(i,k+1)-pkg(i,k))/(akap*(log(peg(i,k+1))-log(peg(i,k))))
2372 pkgx(i,k) = exp( akapx*log(pkgx(i,k)) )
2374 pkx(i,k) = (pk(i,j,k+1)-pk(i,j,k))/(akap*(peln(i,k+1,j)-peln(i,k,j)))
2375 pkx(i,k) = exp( akapx*log(pkx(i,k)) )
2385 gz(i,j,k) = gz(i,j,k+1) + pt(i,j,k)*(pk(i,j,k+1)-pk(i,j,k))
2389 gz(i,j,k) = gz(i,j,k+1) + cp_air*pkgx(i,k)*pt(i,j,k)*(pkg(i,k+1)-pkg(i,k))
2391 gz(i,j,k) = gz(i,j,k+1) + cp_air*pt(i,j,k)*(pkg(i,k+1)-pkg(i,k))
2395 gz(i,j,k) = gz(i,j,k+1) + cp_air*pkx(i,k)*pt(i,j,k)*(pk(i,j,k+1)-pk(i,j,k))
2397 gz(i,j,k) = gz(i,j,k+1) + cp_air*pt(i,j,k)*(pk(i,j,k+1)-pk(i,j,k))
2404 if ( .not. cg .and. j .ge. js .and. j .le. je )
then 2407 pkz(i,j,k) = (pk(i,j,k+1)-pk(i,j,k))/(akap*(peln(i,k+1,j)-peln(i,k,j)))
2409 akapx = kapad(i,j,k) / akap
2410 pkz(i,j,k) = exp( akapx * log( pkz(i,j,k) ) )
2417 end subroutine geopk 2420 subroutine del2_cubed(q, cd, gridstruct, domain, npx, npy, km, nmax, bd)
2424 integer,
intent(in):: npx, npy, km, nmax
2425 real(kind=R_GRID),
intent(in):: cd
2427 real,
intent(inout):: q(bd%isd:bd%ied,bd%jsd:bd%jed,km)
2429 type(domain2d),
intent(INOUT) :: domain
2430 real,
parameter:: r3 = 1./3.
2431 real :: fx(bd%isd:bd%ied+1,bd%jsd:bd%jed), fy(bd%isd:bd%ied,bd%jsd:bd%jed+1)
2432 real :: q2(bd%isd:bd%ied,bd%jsd:bd%jed)
2433 integer i,j,k, n, nt, ntimes
2434 integer :: is, ie, js, je
2435 integer :: isd, ied, jsd, jed
2460 ntimes = min(3, nmax)
2463 call mpp_update_domains(q, domain, complete=.true.)
2476 if ( gridstruct%sw_corner )
then 2477 q(1,1,k) = (q(1,1,k)+q(0,1,k)+q(1,0,k)) * r3
2481 if ( gridstruct%se_corner )
then 2482 q(ie, 1,k) = (q(ie,1,k)+q(npx,1,k)+q(ie,0,k)) * r3
2483 q(npx,1,k) = q(ie,1,k)
2484 q(ie, 0,k) = q(ie,1,k)
2486 if ( gridstruct%ne_corner )
then 2487 q(ie, je,k) = (q(ie,je,k)+q(npx,je,k)+q(ie,npy,k)) * r3
2488 q(npx,je,k) = q(ie,je,k)
2489 q(ie,npy,k) = q(ie,je,k)
2491 if ( gridstruct%nw_corner )
then 2492 q(1, je,k) = (q(1,je,k)+q(0,je,k)+q(1,npy,k)) * r3
2493 q(0, je,k) = q(1,je,k)
2494 q(1,npy,k) = q(1,je,k)
2497 if(nt>0 .and. (.not. gridstruct%regional))
call copy_corners(q(isd,jsd,k), npx, npy, 1, gridstruct%nested, bd, &
2498 gridstruct%sw_corner, gridstruct%se_corner, gridstruct%nw_corner, gridstruct%ne_corner )
2502 fx(i,j) = gridstruct%dy(i,j)*gridstruct%sina_u(i,j)*(q(i-1,j,k)-q(i,j,k))*gridstruct%rdxc(i,j)
2504 fx(i,j) = gridstruct%del6_v(i,j)*(q(i-1,j,k)-q(i,j,k))
2509 if(nt>0 .and. (.not. gridstruct%regional))
call copy_corners(q(isd,jsd,k), npx, npy, 2, gridstruct%nested, bd, &
2510 gridstruct%sw_corner, gridstruct%se_corner, gridstruct%nw_corner, gridstruct%ne_corner)
2514 fy(i,j) = gridstruct%dx(i,j)*gridstruct%sina_v(i,j)*(q(i,j-1,k)-q(i,j,k))*gridstruct%rdyc(i,j)
2516 fy(i,j) = gridstruct%del6_u(i,j)*(q(i,j-1,k)-q(i,j,k))
2523 q(i,j,k) = q(i,j,k) + cd*gridstruct%rarea(i,j)*(fx(i,j)-fx(i+1,j)+fy(i,j)-fy(i,j+1))
2531 subroutine init_ijk_mem(i1, i2, j1, j2, km, array, var)
2532 integer,
intent(in):: i1, i2, j1, j2, km
2533 real,
intent(inout):: array(i1:i2,j1:j2,km)
2534 real,
intent(in):: var
2549 subroutine ray_fast(dt, npx, npy, npz, pfull, tau, u, v, w, &
2550 ks, dp, ptop, hydrostatic, rf_cutoff, bd)
2552 real,
intent(in):: dt
2553 real,
intent(in):: tau
2554 real,
intent(in):: ptop, rf_cutoff
2555 real,
intent(in),
dimension(npz):: pfull
2556 integer,
intent(in):: npx, npy, npz, ks
2557 logical,
intent(in):: hydrostatic
2558 type(fv_grid_bounds_type),
intent(IN) :: bd
2559 real,
intent(inout):: u(bd%isd:bd%ied ,bd%jsd:bd%jed+1,npz)
2560 real,
intent(inout):: v(bd%isd:bd%ied+1,bd%jsd:bd%jed,npz)
2561 real,
intent(inout):: w(bd%isd: ,bd%jsd: ,1: )
2562 real,
intent(in):: dp(npz)
2564 real(kind=R_GRID):: rff(npz)
2565 real,
parameter:: sday = 86400.
2566 real,
dimension(bd%is:bd%ie+1):: dmv
2567 real,
dimension(bd%is:bd%ie):: dmu
2571 integer :: is, ie, js, je
2572 integer :: isd, ied, jsd, jed
2588 if( is_master() )
write(6,*)
'Fast Rayleigh friction E-folding time (days):' 2590 if ( pfull(k) < rf_cutoff )
then 2591 rff(k) = dt/tau0*sin(0.5*pi*log(rf_cutoff/pfull(k))/log(rf_cutoff/ptop))**2
2593 if( is_master() )
write(6,*) k, 0.01*pfull(k), dt/(rff(k)*sday)
2595 rff(k) = 1.d0 / (1.0d0+rff(k))
2603 if ( pfull(k) < rf_cutoff + min(100., 10.*ptop) )
then 2610 if( is_master() )
write(6,*)
'k_rf=',
k_rf, 0.01*pfull(
k_rf),
'dm=', dm
2627 dmu(i) = dmu(i) + (1.-
rf(k))*dp(k)*u(i,j,k)
2628 u(i,j,k) =
rf(k)*u(i,j,k)
2632 dmv(i) = dmv(i) + (1.-
rf(k))*dp(k)*v(i,j,k)
2633 v(i,j,k) =
rf(k)*v(i,j,k)
2635 if ( .not. hydrostatic )
then 2637 w(i,j,k) =
rf(k)*w(i,j,k)
2644 dmu(i) = dmu(i) / dm
2648 dmv(i) = dmv(i) / dm
2654 u(i,j,k) = u(i,j,k) + dmu(i)
2658 v(i,j,k) = v(i,j,k) + dmv(i)
subroutine, public init_ijk_mem(i1, i2, j1, j2, km, array, var)
real, dimension(:,:,:), allocatable vt
subroutine split_p_grad(u, v, pp, gz, delp, pk, beta, dt, ng, gridstruct, bd, npx, npy, npz, use_logp)
real, dimension(:,:,:), allocatable crx
real, dimension(:,:,:), allocatable delpc
logical, public do_adiabatic_init
subroutine, public regional_boundary_update(array, bc_vbl_name, lbnd_x, ubnd_x, lbnd_y, ubnd_y, ubnd_z, is, ie, js, je, isd, ied, jsd, jed, fcst_time, index4)
subroutine pe_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, pe, delp)
real, public current_time_in_seconds
The module 'fv_mp_mod' is a single program multiple data (SPMD) parallel decompostion/communication m...
subroutine timing_off(blk_name)
The subroutine 'timing_off' stops a timer.
The type 'fv_grid_type' is made up of grid-dependent information from fv_grid_tools and fv_grid_utils...
subroutine pk3_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, akap, pk3, delp)
integer, parameter, public h_stagger
subroutine, public c_sw(delpc, delp, ptc, pt, u, v, w, uc, vc, ua, va, wc, ut, vt, divg_d, nord, dt2, hydrostatic, dord4, bd, gridstruct, flagstruct)
The subroutine 'c_sw' performs a half-timestep advance of the C-grid winds.
The module 'sw_core' advances the forward step of the Lagrangian dynamics as described by ...
The module 'multi_gases' peforms multi constitutents computations.
subroutine, public a2b_ord2(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace)
integer, public test_case
subroutine nh_p_grad(u, v, pp, gz, delp, pk, dt, ng, gridstruct, bd, npx, npy, npz, use_logp)
The module 'fv_update_phys' applies physics tendencies consistent with the FV3 discretization and def...
integer, parameter, public r_grid
pure real function, public virqd(q)
The module fv_nwp_nudge contains routines for nudging to input analyses. note This module is currentl...
subroutine, public prt_mxm(qname, q, is, ie, js, je, n_g, km, fac, area, domain)
real, dimension(:,:,:), allocatable divgd
The module 'fv_timing' contains FV3 timers.
The module 'boundary' contains utility routines for grid nesting and boundary conditions.
The module 'tp_core' is a collection of routines to support FV transport.
The module 'a2b_edge' performs FV-consistent interpolation of pressure to corners.
real, dimension(:,:,:), allocatable ptc
subroutine geopk(ptop, pe, peln, delp, pk, gz, hs, pt, q_con, pkz, km, akap, CG, nested, computehalo, npx, npy, a2b_ord, bd)
The subroutine 'geopk' calculates geopotential and pressure to the kappa.
subroutine mix_dp(hydrostatic, w, delp, pt, km, ak, bk, CG, fv_debug, bd)
subroutine, public copy_corners(q, npx, npy, dir, nested, bd, sw_corner, se_corner, nw_corner, ne_corner)
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, ks, gridstruct, flagstruct, neststruct, idiag, bd, domain, init_step, i_pack, end_step, diss_est, time_total)
subroutine, public breed_slp_inline(nstep, dt, npz, ak, bk, phis, pe, pk, peln, pkz, delp, u, v, pt, q, nwat, zvir, gridstruct, ks, domain_local, bd, hydrostatic)
The subroutine 'breed_slp_inline' performs vortex breeding by nudging sea level pressure toward singl...
real, dimension(:,:,:), allocatable zh
The module 'fv_arrays' contains the 'fv_atmos_type' and associated datatypes.
subroutine, public riem_solver3(ms, dt, is, ie, js, je, km, ng, isd, ied, jsd, jed, akap, cappa, cp, ptop, zs, q_con, w, delz, pt, delp, zh, pe, ppe, pk3, pk, peln, ws, scale_m, p_fac, a_imp, use_logp, last_call, fp_out)
real, dimension(:,:,:), allocatable xfx
subroutine grad1_p_update(divg2, u, v, pk, gz, dt, ng, gridstruct, bd, npx, npy, npz, ptop, beta, a2b_ord)
subroutine adv_pe(ua, va, pem, om, gridstruct, bd, npx, npy, npz, ng)
subroutine, public case9_forcing2(phis)
subroutine one_grad_p(u, v, pk, gz, divg2, delp, dt, ng, gridstruct, bd, npx, npy, npz, ptop, hydrostatic, a2b_ord, d_ext)
subroutine, public del2_cubed(q, cd, gridstruct, domain, npx, npy, km, nmax, bd)
The subroutine 'del2-cubed' filters the omega field for the physics.
type(time_type), public fv_time
subroutine timing_on(blk_name)
The subroutine 'timing_on' starts a timer.
real, dimension(:,:,:), allocatable cry
subroutine pln_halo(is, ie, js, je, isd, ied, jsd, jed, npz, ptop, pk3, delp)
integer, parameter, public v_stagger
real, dimension(:,:,:), allocatable yfx
subroutine, public case9_forcing1(phis, time_since_start)
@ The module 'fv_diagnostics' contains routines to compute diagnosic fields.
The module 'dyn_core' peforms the Lagrangian acoustic dynamics described by .
subroutine p_grad_c(dt2, npz, delpc, pkc, gz, uc, vc, bd, rdxc, rdyc, hydrostatic)
subroutine, public prt_maxmin(qname, q, is, ie, js, je, n_g, km, fac)
subroutine, public d_sw(delpc, delp, ptc, pt, u, v, w, uc, vc, ua, va, divg_d, xflux, yflux, cx, cy, crx_adv, cry_adv, xfx_adv, yfx_adv, q_con, z_rat, kgb, heat_source, diss_est, zvir, sphum, nq, q, k, km, inline_q, dt, hord_tr, hord_mt, hord_vt, hord_tm, hord_dp, nord, nord_v, nord_w, nord_t, dddmp, d2_bg, d4_bg, damp_v, damp_w, damp_t, d_con, hydrostatic, gridstruct, flagstruct, bd)
The subroutine 'd_sw' peforms a full-timestep advance of the D-grid winds and other prognostic varaia...
real, dimension(:,:,:), allocatable ut
real, dimension(:,:,:), allocatable pkc
subroutine ray_fast(dt, npx, npy, npz, pfull, tau, u, v, w, ks, dp, ptop, hydrostatic, rf_cutoff, bd)
The subroutine 'Ray_fast' computes a simple "inline" version of the Rayleigh friction (EXPERIMENTAL -...
real, dimension(:), allocatable rf
subroutine, public a2b_ord4(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace)
subroutine, public exch_uv(domain, bd, npz, u, v)
real, dimension(:,:,:), allocatable du
real, dimension(:,:,:), allocatable pk3
subroutine update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
The subroutine 'update_dwinds_phys' transforms the wind tendencies from the A grid to the D grid for ...
subroutine, public nested_grid_bc_apply_intt(var_nest, istag, jstag, npx, npy, npz, bd, step, split, BC, bctype)
The subroutine 'nested_grid_BC_apply_intT' performs linear interpolation or extrapolation in time for...
real, dimension(:,:,:), allocatable dv
The module 'nh_core' peforms non-hydrostatic computations.
real, dimension(:,:,:), allocatable gz
pure real function, public vicvqd(q)
subroutine, public extrapolation_bc(q, istag, jstag, npx, npy, bd, pd_in, debug_in)
The subroutine 'extrapolation_BC' performs linear extrapolation into the halo region.
real(kind=r_grid), parameter cnst_0p20
integer, parameter, public u_stagger