30 use fv_mp_nlm_mod,
only: start_group_halo_update, complete_group_halo_update
39 #if defined (ATMOS_NUDGE) 40 use atmos_nudge_mod,
only: get_atmos_nudge, do_ps
41 #elif defined (CLIMATE_NUDGE) 43 #elif defined (ADA_NUDGE) 44 use fv_ada_nudge_mod,
only: fv_ada_nudge
62 subroutine fv_update_phys ( dt, is, ie, js, je, isd, ied, jsd, jed, ng, nq, &
63 u, v, w, delp, pt, q, qdiag, ua, va, ps, pe, peln, pk, pkz, &
64 ak, bk, phis, u_srf, v_srf, ts, delz, hydrostatic, &
65 u_dt, v_dt, t_dt, moist_phys, Time, nudge, &
66 gridstruct, lona, lata, npx, npy, npz, flagstruct, &
67 neststruct, bd, domain, ptop, q_dt)
68 real,
intent(in) :: dt, ptop
69 integer,
intent(in):: is, ie, js, je, ng
70 integer,
intent(in):: isd, ied, jsd, jed
71 integer,
intent(in):: nq
73 logical,
intent(in):: moist_phys
74 logical,
intent(in):: hydrostatic
75 logical,
intent(in):: nudge
79 real,
intent(in),
dimension(npz+1):: ak, bk
80 real,
intent(in) :: phis(isd:ied,jsd:jed)
81 real,
intent(inout):: delz(isd:,jsd:,1:)
84 real,
intent(in),
dimension(isd:ied,jsd:jed),
optional :: &
88 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: ua, va
89 real,
intent(inout),
dimension(isd: ,jsd: ,1: ):: w
92 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
93 real,
intent(inout):: t_dt(is:ie,js:je,npz)
94 real,
intent(inout),
optional :: q_dt(is:ie,js:je,npz,nq)
97 real,
intent(out),
dimension(is:ie,js:je):: u_srf, v_srf, ts
101 type(
domain2d),
intent(INOUT) :: domain
103 real,
intent(inout):: u(isd:ied ,jsd:jed+1,npz)
104 real,
intent(inout):: v(isd:ied+1,jsd:jed ,npz)
105 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: pt, delp
106 real,
intent(inout):: q(isd:ied,jsd:jed,npz,nq)
107 real,
intent(inout):: qdiag(isd:ied,jsd:jed,npz,nq+1:flagstruct%ncnst)
114 real,
intent(inout):: ps (isd:ied ,jsd:jed)
115 real,
intent(inout):: pe (is-1:ie+1, npz+1,js-1:je+1)
116 real,
intent(inout):: pk (is:ie,js:je , npz+1)
117 real,
intent(inout):: peln(is:ie,npz+1,js:je)
118 real,
intent(inout):: pkz (is:ie,js:je,npz)
119 real,
parameter:: tice = 273.16
124 integer,
intent(IN) :: npx, npy, npz
129 real,
parameter:: q1_h2o = 2.2e-6
130 real,
parameter:: q7_h2o = 3.8e-6
131 real,
parameter:: q100_h2o = 3.8e-6
132 real,
parameter:: q1000_h2o = 3.1e-6
133 real,
parameter:: q2000_h2o = 2.8e-6
134 real,
parameter:: q3000_h2o = 3.0e-6
137 real ps_dt(is:ie,js:je)
138 real cvm(is:ie), qc(is:ie)
139 real phalf(npz+1), pfull(npz)
141 type(group_halo_update_type),
save :: i_pack(2)
142 integer i, j, k, m, n, nwat
143 integer sphum, liq_wat, ice_wat, cld_amt
144 integer rainwat, snowwat, graupel
146 real:: qstar, dbk, rdg, zvir, p_fac, cv_air, gama_dt
148 real,
dimension(1,1,1) :: parent_u_dt, parent_v_dt
152 logical,
dimension(nq) :: conv_vmr_mmr
153 real :: adj_vmr(is:ie,js:je,npz)
154 character(len=32) :: tracer_units, tracer_name
160 nwat = flagstruct%nwat
162 if ( moist_phys .or. nwat/=0 )
then 169 conv_vmr_mmr(1:nq) = .false.
189 conv_vmr_mmr(1:nq) = .false.
190 if (flagstruct%adj_mass_vmr)
then 193 units = tracer_units)
194 if ( trim(tracer_units) .eq.
'vmr' )
then 195 conv_vmr_mmr(m) = .true.
197 conv_vmr_mmr(m) = .false.
210 if ( .not. hydrostatic )
then 218 if ( .not. hydrostatic .and. .not. flagstruct%phys_hydrostatic .and. nwat == 0 )
then 219 gama_dt = dt*
cp_air/cv_air
224 if ( flagstruct%fv_debug )
then 225 call prt_maxmin(
'delp_b_update', delp, is, ie, js, je, ng, npz, 0.01)
226 if (
present(q_dt))
then 228 call prt_maxmin(
'q_dt', q_dt(is,js,1,m), is, ie, js, je, 0, npz, 1.)
231 call prt_maxmin(
'u_dt', u_dt, is, ie, js, je, ng, npz, 1.)
232 call prt_maxmin(
'v_dt', v_dt, is, ie, js, je, ng, npz, 1.)
233 call prt_maxmin(
'T_dt', t_dt, is, ie, js, je, 0, npz, 1.)
247 if (
present(q_dt))
then 249 if (flagstruct%tau_h2o<0.0 .and. pfull(k) < 100.e2 )
then 252 p_fac = -flagstruct%tau_h2o*86400.
255 q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (3.e-6-q(i,j,k,sphum))/p_fac
258 elseif ( flagstruct%tau_h2o>0.0 .and. pfull(k) < 3000. )
then 261 if ( pfull(k) < 1. )
then 263 p_fac = 0.2 * flagstruct%tau_h2o*86400.
264 elseif ( pfull(k) < 7. .and. pfull(k) >= 1. )
then 265 qstar = q1_h2o + (q7_h2o-q1_h2o)*log(pfull(k)/1.)/log(7.)
266 p_fac = 0.3 * flagstruct%tau_h2o*86400.
267 elseif ( pfull(k) < 100. .and. pfull(k) >= 7. )
then 268 qstar = q7_h2o + (q100_h2o-q7_h2o)*log(pfull(k)/7.)/log(100./7.)
269 p_fac = 0.4 * flagstruct%tau_h2o*86400.
270 elseif ( pfull(k) < 1000. .and. pfull(k) >= 100. )
then 271 qstar = q100_h2o + (q1000_h2o-q100_h2o)*log(pfull(k)/1.e2)/log(10.)
272 p_fac = 0.5 * flagstruct%tau_h2o*86400.
273 elseif ( pfull(k) < 2000. .and. pfull(k) >= 1000. )
then 274 qstar = q1000_h2o + (q2000_h2o-q1000_h2o)*log(pfull(k)/1.e3)/log(2.)
275 p_fac = 0.75 * flagstruct%tau_h2o*86400.
278 p_fac = flagstruct%tau_h2o*86400.
283 q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (qstar-q(i,j,k,sphum))/p_fac
292 if( m /= w_diff )
then 295 q(i,j,k,m) = q(i,j,k,m) + dt*q_dt(i,j,k,m)
306 ps_dt(i,j) = 1. + dt*sum(q_dt(i,j,k,1:nwat))
307 delp(i,j,k) = delp(i,j,k) * ps_dt(i,j)
308 if (flagstruct%adj_mass_vmr)
then 310 (ps_dt(i,j) - sum(q(i,j,k,1:flagstruct%nwat))) / &
311 (1.d0 - sum(q(i,j,k,1:flagstruct%nwat)))
320 do m=1,flagstruct%ncnst
324 q(is:ie,js:je,k,m) = q(is:ie,js:je,k,m) / ps_dt(is:ie,js:je)
325 if (conv_vmr_mmr(m)) &
326 q(is:ie,js:je,k,m) = q(is:ie,js:je,k,m) * adj_vmr(is:ie,js:je,k)
328 qdiag(is:ie,js:je,k,m) = qdiag(is:ie,js:je,k,m) / ps_dt(is:ie,js:je)
336 if ( hydrostatic )
then 338 call moist_cp(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
339 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k) )
342 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
346 if ( flagstruct%phys_hydrostatic )
then 349 call moist_cp(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
350 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k) )
352 delz(i,j,k) = delz(i,j,k) / pt(i,j,k)
354 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
355 delz(i,j,k) = delz(i,j,k) * pt(i,j,k)
363 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*gama_dt
368 call moist_cv(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
369 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k))
372 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
379 #if !defined(GFS_PHYS) && !defined(MAPL_MODE) 382 ua(i,j,k) = ua(i,j,k) + dt*u_dt(i,j,k)
383 va(i,j,k) = va(i,j,k) + dt*v_dt(i,j,k)
396 #if defined (ATMOS_NUDGE) 400 call get_atmos_nudge ( time, dt, is, ie, js, je, &
401 npz, ng, ps(is:ie,js:je), ua(is:ie, js:je,:), &
402 va(is:ie,js:je,:), pt(is:ie,js:je,:), &
403 q(is:ie,js:je,:,:), ps_dt(is:ie,js:je), u_dt(is:ie,js:je,:), &
404 v_dt(is:ie,js:je,:), t_dt(is:ie,js:je,:), &
405 q_dt(is:ie,js:je,:,:) )
413 dbk = dt * (bk(k+1) - bk(k))
416 delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
421 #elif defined (CLIMATE_NUDGE) 426 lona(is:ie,js:je), lata(is:ie,js:je), phis(is:ie,js:je), &
428 ps(is:ie,js:je), ua(is:ie,js:je,:), va(is:ie,js:je,:), &
429 pt(is:ie,js:je,:), q(is:ie,js:je,:,sphum:sphum), &
430 ps_dt(is:ie,js:je), u_dt(is:ie,js:je,:), &
431 v_dt(is:ie,js:je,:), t_dt(is:ie,js:je,:), &
432 q_dt(is:ie,js:je,:,sphum:sphum) )
440 dbk = dt * (bk(k+1) - bk(k))
443 delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
448 #elif defined (ADA_NUDGE) 454 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
458 ps(i,j) = pe(i,npz+1,j)
461 call fv_ada_nudge ( time, dt, npx, npy, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, &
462 zvir, ptop, ak, bk, ts, ps, delp, ua, va, pt, &
463 nwat, q, phis, gridstruct, bd, domain )
470 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
474 ps(i,j) = pe(i,npz+1,j)
477 call fv_nwp_nudge ( time, dt, npx, npy, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, &
478 zvir, ptop, ak, bk, ts, ps, delp, ua, va, pt, &
479 nwat, q, phis, gridstruct, bd, domain )
483 if ( .not.flagstruct%dwind_2d )
then 486 if ( gridstruct%square_domain )
then 487 call start_group_halo_update(i_pack(1), u_dt, domain, whalo=1, ehalo=1, shalo=1, nhalo=1, complete=.false.)
488 call start_group_halo_update(i_pack(1), v_dt, domain, whalo=1, ehalo=1, shalo=1, nhalo=1, complete=.true.)
490 call start_group_halo_update(i_pack(1), u_dt, domain, complete=.false.)
491 call start_group_halo_update(i_pack(1), v_dt, domain, complete=.true.)
499 if ( flagstruct%fv_debug )
then 500 call prt_maxmin(
'PS_b_update', ps, is, ie, js, je, ng, 1, 0.01)
501 call prt_maxmin(
'delp_a_update', delp, is, ie, js, je, ng, npz, 0.01)
509 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
510 peln(i,k,j) = log( pe(i,k,j) )
511 pk(i,j,k) = exp(
kappa*peln(i,k,j) )
516 ps(i,j) = pe(i,npz+1,j)
517 u_srf(i,j) = ua(i,j,npz)
518 v_srf(i,j) = va(i,j,npz)
521 if ( hydrostatic )
then 524 pkz(i,j,k) = (pk(i,j,k+1)-pk(i,j,k))/(
kappa*(peln(i,k+1,j)-peln(i,k,j)))
531 if ( flagstruct%dwind_2d )
then 532 call update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, &
540 call complete_group_halo_update(i_pack(1), domain)
542 if (
size(neststruct%child_grids) > 1)
then 543 if (gridstruct%nested)
then 544 call nested_grid_bc(u_dt, parent_u_dt, neststruct%nest_domain, neststruct%ind_h, neststruct%wt_h, 0, 0, &
545 npx, npy, npz, bd, 1, npx-1, 1, npy-1)
546 call nested_grid_bc(v_dt, parent_v_dt, neststruct%nest_domain, neststruct%ind_h, neststruct%wt_h, 0, 0, &
547 npx, npy, npz, bd, 1, npx-1, 1, npy-1)
549 do n=1,
size(neststruct%child_grids)
550 if (neststruct%child_grids(n))
then 558 call update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
561 #if defined(GFS_PHYS) || defined(MAPL_MODE) 563 npx, npy, npz, 1, gridstruct%grid_type, domain, gridstruct%nested, flagstruct%c2l_ord, bd)
566 if ( flagstruct%fv_debug )
then 567 call prt_maxmin(
'PS_a_update', ps, is, ie, js, je, ng, 1, 0.01)
573 subroutine del2_phys(qdt, delp, gridstruct, cd, npx, npy, km, is, ie, js, je, &
574 isd, ied, jsd, jed, ngc, domain)
576 integer,
intent(in):: npx, npy, km
577 integer,
intent(in):: is, ie, js, je, isd, ied, jsd, jed, ngc
578 real,
intent(in):: cd
579 real,
intent(in ):: delp(isd:ied,jsd:jed,km)
580 real,
intent(inout):: qdt(is-ngc:ie+ngc,js-ngc:je+ngc,km)
582 type(
domain2d),
intent(INOUT) :: domain
584 real,
pointer,
dimension(:,:) :: rarea, dx, dy, sina_u, sina_v, rdxc, rdyc
585 real,
pointer,
dimension(:,:,:) :: sin_sg
587 real :: q(isd:ied,jsd:jed,km)
588 real :: fx(is:ie+1,js:je), fy(is:ie,js:je+1)
589 real :: mask(is:ie+1,js:je+1)
590 real :: f1(is:ie+1), f2(js:je+1)
594 rarea => gridstruct%rarea
597 sina_u => gridstruct%sina_u
598 sina_v => gridstruct%sina_v
599 rdxc => gridstruct%rdxc
600 rdyc => gridstruct%rdyc
601 sin_sg => gridstruct%sin_sg
604 damp = 0.25 * cd * gridstruct%da_min
610 f1(i) = (1. - sin(
real(i-1)/
real(npx-1)*
pi))**2
615 f2(j) = (1. - sin(
real(j-1)/
real(npy-1)*
pi))**2
617 mask(i,j) = damp * (f1(i) + f2(j))
627 q(i,j,k) = qdt(i,j,k)*delp(i,j,k)
642 (mask(i,j)+mask(i,j+1))*dy(i,j)*sina_u(i,j)* &
643 (q(i-1,j,k)-q(i,j,k))*rdxc(i,j)
645 if (is == 1 .and. .not. gridstruct%nested) fx(i,j) = &
646 (mask(is,j)+mask(is,j+1))*dy(is,j)*(q(is-1,j,k)-q(is,j,k))*rdxc(is,j)* &
647 0.5*(sin_sg(1,j,1) + sin_sg(0,j,3))
648 if (ie+1==npx .and. .not. gridstruct%nested) fx(i,j) = &
649 (mask(ie+1,j)+mask(ie+1,j+1))*dy(ie+1,j)*(q(ie,j,k)-q(ie+1,j,k))*rdxc(ie+1,j)* &
650 0.5*(sin_sg(npx,j,1) + sin_sg(npx-1,j,3))
653 if ((j == 1 .OR. j == npy) .and. .not. gridstruct%nested)
then 655 fy(i,j) = (mask(i,j)+mask(i+1,j))*dx(i,j)*&
656 (q(i,j-1,k)-q(i,j,k))*rdyc(i,j) &
657 *0.5*(sin_sg(i,j,2) + sin_sg(i,j-1,4) )
661 fy(i,j) = (mask(i,j)+mask(i+1,j))*dx(i,j)*sina_v(i,j)*&
662 (q(i,j-1,k)-q(i,j,k))*rdyc(i,j)
668 qdt(i,j,k) = qdt(i,j,k) + rarea(i,j)*(fx(i,j)-fx(i+1,j)+fy(i,j)-fy(i,j+1))/delp(i,j,k)
676 subroutine update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
680 integer,
intent(in):: is, ie, js, je
681 integer,
intent(in):: isd, ied, jsd, jed
682 integer,
intent(IN) :: npx,npy, npz
683 real,
intent(in):: dt
684 real,
intent(inout):: u(isd:ied, jsd:jed+1,npz)
685 real,
intent(inout):: v(isd:ied+1,jsd:jed ,npz)
686 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
687 type(fv_grid_type),
intent(IN),
target :: gridstruct
688 type(domain2d),
intent(INOUT) :: domain
691 real v3(is-1:ie+1,js-1:je+1,3)
692 real ue(is-1:ie+1,js:je+1,3)
693 real ve(is:ie+1,js-1:je+1, 3)
694 real,
dimension(is:ie):: ut1, ut2, ut3
695 real,
dimension(js:je):: vt1, vt2, vt3
697 integer i, j, k, m, im2, jm2
699 real(kind=R_GRID),
pointer,
dimension(:,:,:) :: vlon, vlat
700 real(kind=R_GRID),
pointer,
dimension(:,:,:,:) :: es, ew
701 real(kind=R_GRID),
pointer,
dimension(:) :: edge_vect_w, edge_vect_e, edge_vect_s, edge_vect_n
705 vlon => gridstruct%vlon
706 vlat => gridstruct%vlat
708 edge_vect_w => gridstruct%edge_vect_w
709 edge_vect_e => gridstruct%edge_vect_e
710 edge_vect_s => gridstruct%edge_vect_s
711 edge_vect_n => gridstruct%edge_vect_n
723 if ( gridstruct%grid_type > 3 )
then 727 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
732 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
740 v3(i,j,1) = u_dt(i,j,k)*vlon(i,j,1) + v_dt(i,j,k)*vlat(i,j,1)
741 v3(i,j,2) = u_dt(i,j,k)*vlon(i,j,2) + v_dt(i,j,k)*vlat(i,j,2)
742 v3(i,j,3) = u_dt(i,j,k)*vlon(i,j,3) + v_dt(i,j,k)*vlat(i,j,3)
749 ue(i,j,1) = v3(i,j-1,1) + v3(i,j,1)
750 ue(i,j,2) = v3(i,j-1,2) + v3(i,j,2)
751 ue(i,j,3) = v3(i,j-1,3) + v3(i,j,3)
757 ve(i,j,1) = v3(i-1,j,1) + v3(i,j,1)
758 ve(i,j,2) = v3(i-1,j,2) + v3(i,j,2)
759 ve(i,j,3) = v3(i-1,j,3) + v3(i,j,3)
764 if ( is==1 .and. .not. gridstruct%nested )
then 768 vt1(j) = edge_vect_w(j)*ve(i,j-1,1)+(1.-edge_vect_w(j))*ve(i,j,1)
769 vt2(j) = edge_vect_w(j)*ve(i,j-1,2)+(1.-edge_vect_w(j))*ve(i,j,2)
770 vt3(j) = edge_vect_w(j)*ve(i,j-1,3)+(1.-edge_vect_w(j))*ve(i,j,3)
772 vt1(j) = edge_vect_w(j)*ve(i,j+1,1)+(1.-edge_vect_w(j))*ve(i,j,1)
773 vt2(j) = edge_vect_w(j)*ve(i,j+1,2)+(1.-edge_vect_w(j))*ve(i,j,2)
774 vt3(j) = edge_vect_w(j)*ve(i,j+1,3)+(1.-edge_vect_w(j))*ve(i,j,3)
783 if ( (ie+1)==npx .and. .not. gridstruct%nested )
then 787 vt1(j) = edge_vect_e(j)*ve(i,j-1,1)+(1.-edge_vect_e(j))*ve(i,j,1)
788 vt2(j) = edge_vect_e(j)*ve(i,j-1,2)+(1.-edge_vect_e(j))*ve(i,j,2)
789 vt3(j) = edge_vect_e(j)*ve(i,j-1,3)+(1.-edge_vect_e(j))*ve(i,j,3)
791 vt1(j) = edge_vect_e(j)*ve(i,j+1,1)+(1.-edge_vect_e(j))*ve(i,j,1)
792 vt2(j) = edge_vect_e(j)*ve(i,j+1,2)+(1.-edge_vect_e(j))*ve(i,j,2)
793 vt3(j) = edge_vect_e(j)*ve(i,j+1,3)+(1.-edge_vect_e(j))*ve(i,j,3)
803 if ( js==1 .and. .not. gridstruct%nested)
then 807 ut1(i) = edge_vect_s(i)*ue(i-1,j,1)+(1.-edge_vect_s(i))*ue(i,j,1)
808 ut2(i) = edge_vect_s(i)*ue(i-1,j,2)+(1.-edge_vect_s(i))*ue(i,j,2)
809 ut3(i) = edge_vect_s(i)*ue(i-1,j,3)+(1.-edge_vect_s(i))*ue(i,j,3)
811 ut1(i) = edge_vect_s(i)*ue(i+1,j,1)+(1.-edge_vect_s(i))*ue(i,j,1)
812 ut2(i) = edge_vect_s(i)*ue(i+1,j,2)+(1.-edge_vect_s(i))*ue(i,j,2)
813 ut3(i) = edge_vect_s(i)*ue(i+1,j,3)+(1.-edge_vect_s(i))*ue(i,j,3)
822 if ( (je+1)==npy .and. .not. gridstruct%nested)
then 826 ut1(i) = edge_vect_n(i)*ue(i-1,j,1)+(1.-edge_vect_n(i))*ue(i,j,1)
827 ut2(i) = edge_vect_n(i)*ue(i-1,j,2)+(1.-edge_vect_n(i))*ue(i,j,2)
828 ut3(i) = edge_vect_n(i)*ue(i-1,j,3)+(1.-edge_vect_n(i))*ue(i,j,3)
830 ut1(i) = edge_vect_n(i)*ue(i+1,j,1)+(1.-edge_vect_n(i))*ue(i,j,1)
831 ut2(i) = edge_vect_n(i)*ue(i+1,j,2)+(1.-edge_vect_n(i))*ue(i,j,2)
832 ut3(i) = edge_vect_n(i)*ue(i+1,j,3)+(1.-edge_vect_n(i))*ue(i,j,3)
843 u(i,j,k) = u(i,j,k) + dt5*( ue(i,j,1)*es(1,i,j,1) + &
844 ue(i,j,2)*es(2,i,j,1) + &
845 ue(i,j,3)*es(3,i,j,1) )
850 v(i,j,k) = v(i,j,k) + dt5*( ve(i,j,1)*ew(1,i,j,2) + &
851 ve(i,j,2)*ew(2,i,j,2) + &
852 ve(i,j,3)*ew(3,i,j,2) )
863 subroutine update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
867 integer,
intent(in):: is, ie, js, je
868 integer,
intent(in):: isd, ied, jsd, jed
869 real,
intent(in):: dt
870 real,
intent(inout):: u(isd:ied, jsd:jed+1,npz)
871 real,
intent(inout):: v(isd:ied+1,jsd:jed ,npz)
872 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
873 type(fv_grid_type),
intent(IN),
target :: gridstruct
874 integer,
intent(IN) :: npx,npy, npz
875 type(domain2d),
intent(INOUT) :: domain
878 real ut(isd:ied,jsd:jed)
882 real(kind=R_GRID),
pointer,
dimension(:,:,:) :: vlon, vlat
883 real(kind=R_GRID),
pointer,
dimension(:,:,:,:) :: es, ew
884 real(kind=R_GRID),
pointer,
dimension(:) :: edge_vect_w, edge_vect_e, edge_vect_s, edge_vect_n
885 real,
pointer,
dimension(:,:) :: z11, z12, z21, z22, dya, dxa
889 vlon => gridstruct%vlon
890 vlat => gridstruct%vlat
892 edge_vect_w => gridstruct%edge_vect_w
893 edge_vect_e => gridstruct%edge_vect_e
894 edge_vect_s => gridstruct%edge_vect_s
895 edge_vect_n => gridstruct%edge_vect_n
897 z11 => gridstruct%z11
898 z21 => gridstruct%z21
899 z12 => gridstruct%z12
900 z22 => gridstruct%z22
902 dxa => gridstruct%dxa
903 dya => gridstruct%dya
912 ut(i,j) = z11(i,j)*u_dt(i,j,k) + z12(i,j)*v_dt(i,j,k)
913 v_dt(i,j,k) = z21(i,j)*u_dt(i,j,k) + z22(i,j)*v_dt(i,j,k)
914 u_dt(i,j,k) = ut(i,j)
930 if ( gridstruct%grid_type > 3 .or. gridstruct%nested)
then 934 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
939 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
951 gratio = dya(i,2) / dya(i,1)
952 u(i,1,k) = u(i,1,k) + dt5*((2.+gratio)*(u_dt(i,0,k)+u_dt(i,1,k)) &
953 -(u_dt(i,-1,k)+u_dt(i,2,k)))/(1.+gratio)
958 do j=
max(2,js),
min(npy-1,je+1)
960 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k)+u_dt(i,j,k))
964 if ( (je+1)==npy )
then 966 gratio = dya(i,npy-2) / dya(i,npy-1)
967 u(i,npy,k) = u(i,npy,k) + dt5*((2.+gratio)*(u_dt(i,npy-1,k)+u_dt(i,npy,k)) &
968 -(u_dt(i,npy-2,k)+u_dt(i,npy+1,k)))/(1.+gratio)
978 gratio = dxa(2,j) / dxa(1,j)
979 v(1,j,k) = v(1,j,k) + dt5*((2.+gratio)*(v_dt(0,j,k)+v_dt(1,j,k)) &
980 -(v_dt(-1,j,k)+v_dt(2,j,k)))/(1.+gratio)
986 do i=
max(2,is),
min(npx-1,ie+1)
987 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k)+v_dt(i,j,k))
992 if ( (ie+1)==npx )
then 994 gratio = dxa(npx-2,j) / dxa(npx-1,j)
995 v(npx,j,k) = v(npx,j,k) + dt5*((2.+gratio)*(v_dt(npx-1,j,k)+v_dt(npx,j,k)) &
996 -(v_dt(npx-2,j,k)+v_dt(npx+1,j,k)))/(1.+gratio)
real, parameter, public radius
Radius of the Earth [m].
integer, parameter, public model_atmos
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)
real(kind=8), parameter, public pi_8
Ratio of circle circumference to diameter [N/A].
subroutine, public fv_climate_nudge(Time, dt, is, ie, js, je, npz, pfull, lon, lat, phis, ptop, ak, bk, ps, u, v, t, q, psdt, udt, vdt, tdt, qdt)
real, parameter, public rdgas
Gas constant for dry air [J/kg/deg].
real, parameter, public cp_vapor
Specific heat capacity of water vapor at constant pressure [J/kg/deg].
subroutine, public get_eta_level(npz, p_s, pf, ph, ak, bk, pscale)
subroutine, public cubed_to_latlon(u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, nested, c2l_ord, bd)
integer, parameter, public agrid
logical function, public adjust_mass(model, n, err_msg)
real, parameter, public rvgas
Gas constant for water vapor [J/kg/deg].
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 timing_on(blk_name)
real, parameter, public cp_air
Specific heat capacity of dry air at constant pressure [J/kg/deg].
subroutine, public del2_phys(qdt, delp, gridstruct, cd, npx, npy, km, is, ie, js, je, isd, ied, jsd, jed, ngc, domain)
integer, parameter, public r_grid
subroutine, public extrapolation_bc(q, istag, jstag, npx, npy, bd, pd_in, debug_in)
real, parameter, public grav
Acceleration due to gravity [m/s^2].
subroutine, public get_tracer_names(model, n, name, longname, units, err_msg)
subroutine, public fv_update_phys(dt, is, ie, js, je, isd, ied, jsd, jed, ng, nq, u, v, w, delp, pt, q, qdiag, ua, va, ps, pe, peln, pk, pkz, ak, bk, phis, u_srf, v_srf, ts, delz, hydrostatic, u_dt, v_dt, t_dt, moist_phys, Time, nudge, gridstruct, lona, lata, npx, npy, npz, flagstruct, neststruct, bd, domain, ptop, q_dt)
subroutine update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
subroutine, public prt_maxmin(qname, q, is, ie, js, je, n_g, km, fac)
subroutine, public fv_nwp_nudge(Time, dt, npx, npy, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, zvir, ptop, ak, bk, ts, ps, delp, ua, va, pt, nwat, q, phis, gridstruct, bd, domain)
subroutine update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
real, parameter, public kappa
RDGAS / CP_AIR [dimensionless].
real(fp), parameter, public pi
subroutine timing_off(blk_name)