92 use constants_mod,
only: kappa, rdgas, rvgas, grav, cp_air, cp_vapor, pi=>pi_8, radius
93 use field_manager_mod,
only: model_atmos
94 use mpp_domains_mod,
only: mpp_update_domains, domain2d
95 use mpp_parameter_mod,
only: agrid_param=>agrid
96 use mpp_mod,
only: fatal, mpp_error
97 use mpp_mod,
only: mpp_error, note, warning
98 use time_manager_mod,
only: time_type
99 use tracer_manager_mod,
only: get_tracer_index, adjust_mass, get_tracer_names
100 use fv_mp_mod,
only: start_group_halo_update, complete_group_halo_update
101 use fv_mp_mod,
only: group_halo_update_type
109 #if defined (ATMOS_NUDGE) 110 use atmos_nudge_mod,
only: get_atmos_nudge, do_ps
111 #elif defined (CLIMATE_NUDGE) 112 use fv_climate_nudge_mod,
only: fv_climate_nudge, do_ps
113 #elif defined (ADA_NUDGE) 114 use fv_ada_nudge_mod,
only: fv_ada_nudge
135 subroutine fv_update_phys ( dt, is, ie, js, je, isd, ied, jsd, jed, ng, nq, &
136 u, v, w, delp, pt, q, qdiag, ua, va, ps, pe, peln, pk, pkz, &
137 ak, bk, phis, u_srf, v_srf, ts, delz, hydrostatic, &
138 u_dt, v_dt, t_dt, moist_phys, Time, nudge, &
139 gridstruct, lona, lata, npx, npy, npz, flagstruct, &
140 neststruct, bd, domain, ptop, q_dt)
141 real,
intent(in) :: dt, ptop
142 integer,
intent(in):: is, ie, js, je, ng
143 integer,
intent(in):: isd, ied, jsd, jed
144 integer,
intent(in):: nq
146 logical,
intent(in):: moist_phys
147 logical,
intent(in):: hydrostatic
148 logical,
intent(in):: nudge
150 type(time_type),
intent(in) :: time
152 real,
intent(in),
dimension(npz+1):: ak, bk
153 real,
intent(in) :: phis(isd:ied,jsd:jed)
154 real,
intent(inout):: delz(isd:,jsd:,1:)
157 real,
intent(in),
dimension(isd:ied,jsd:jed),
optional :: &
161 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: ua, va
162 real,
intent(inout),
dimension(isd: ,jsd: ,1: ):: w
165 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
166 real,
intent(inout):: t_dt(is:ie,js:je,npz)
167 real,
intent(inout),
optional :: q_dt(is:ie,js:je,npz,nq)
170 real,
intent(out),
dimension(is:ie,js:je):: u_srf, v_srf, ts
174 type(domain2d),
intent(INOUT) :: domain
176 real,
intent(inout):: u(isd:ied ,jsd:jed+1,npz)
177 real,
intent(inout):: v(isd:ied+1,jsd:jed ,npz)
178 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: pt, delp
179 real,
intent(inout):: q(isd:ied,jsd:jed,npz,nq)
180 real,
intent(inout):: qdiag(isd:ied,jsd:jed,npz,nq+1:flagstruct%ncnst)
187 real,
intent(inout):: ps (isd:ied ,jsd:jed)
188 real,
intent(inout):: pe (is-1:ie+1, npz+1,js-1:je+1)
189 real,
intent(inout):: pk (is:ie,js:je , npz+1)
190 real,
intent(inout):: peln(is:ie,npz+1,js:je)
191 real,
intent(inout):: pkz (is:ie,js:je,npz)
192 real,
parameter:: tice = 273.16
197 integer,
intent(IN) :: npx, npy, npz
202 real,
parameter:: q1_h2o = 2.2e-6
203 real,
parameter:: q7_h2o = 3.8e-6
204 real,
parameter:: q100_h2o = 3.8e-6
205 real,
parameter:: q1000_h2o = 3.1e-6
206 real,
parameter:: q2000_h2o = 2.8e-6
207 real,
parameter:: q3000_h2o = 3.0e-6
210 real ps_dt(is:ie,js:je)
211 real cvm(is:ie), qc(is:ie)
212 real phalf(npz+1), pfull(npz)
218 type(group_halo_update_type),
save :: i_pack(2)
219 integer i, j, k, m, n, nwat
220 integer sphum, liq_wat, ice_wat, cld_amt
221 integer rainwat, snowwat, graupel
223 real:: qstar, dbk, rdg, zvir, p_fac, cv_air, gama_dt
225 real,
dimension(1,1,1) :: parent_u_dt, parent_v_dt
229 logical,
dimension(nq) :: conv_vmr_mmr
230 real :: adj_vmr(is:ie,js:je,npz)
231 character(len=32) :: tracer_units, tracer_name
233 cv_air = cp_air - rdgas
237 nwat = flagstruct%nwat
239 if ( moist_phys .or. nwat/=0 )
then 240 zvir = rvgas/rdgas - 1.
246 conv_vmr_mmr(1:nq) = .false.
247 if (flagstruct%adj_mass_vmr)
then 249 call get_tracer_names (model_atmos, m, name = tracer_name, &
250 units = tracer_units)
251 if ( trim(tracer_units) .eq.
'vmr' )
then 252 conv_vmr_mmr(m) = .true.
254 conv_vmr_mmr(m) = .false.
259 sphum = get_tracer_index(model_atmos,
'sphum')
260 liq_wat = get_tracer_index(model_atmos,
'liq_wat')
261 ice_wat = get_tracer_index(model_atmos,
'ice_wat')
262 rainwat = get_tracer_index(model_atmos,
'rainwat')
263 snowwat = get_tracer_index(model_atmos,
'snowwat')
264 graupel = get_tracer_index(model_atmos,
'graupel')
265 cld_amt = get_tracer_index(model_atmos,
'cld_amt')
267 if ( .not. hydrostatic )
then 268 w_diff = get_tracer_index(model_atmos,
'w_diff')
274 if ( .not. hydrostatic .and. .not. flagstruct%phys_hydrostatic .and. nwat == 0 )
then 275 gama_dt = dt*cp_air/cv_air
280 if ( flagstruct%fv_debug )
then 281 call prt_maxmin(
'delp_b_update', delp, is, ie, js, je, ng, npz, 0.01)
282 if (
present(q_dt))
then 284 call prt_maxmin(
'q_dt', q_dt(is,js,1,m), is, ie, js, je, 0, npz, 1.)
287 call prt_maxmin(
'u_dt', u_dt, is, ie, js, je, ng, npz, 1.)
288 call prt_maxmin(
'v_dt', v_dt, is, ie, js, je, ng, npz, 1.)
289 call prt_maxmin(
'T_dt', t_dt, is, ie, js, je, 0, npz, 1.)
296 nn = max(flagstruct%nwat,
num_gas)
311 if (
present(q_dt))
then 313 if (flagstruct%tau_h2o<0.0 .and. pfull(k) < 100.e2 )
then 316 p_fac = -flagstruct%tau_h2o*86400.
319 q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (3.e-6-q(i,j,k,sphum))/p_fac
322 elseif ( flagstruct%tau_h2o>0.0 .and. pfull(k) < 3000. )
then 325 if ( pfull(k) < 1. )
then 327 p_fac = 0.2 * flagstruct%tau_h2o*86400.
328 elseif ( pfull(k) < 7. .and. pfull(k) >= 1. )
then 329 qstar = q1_h2o + (q7_h2o-q1_h2o)*log(pfull(k)/1.)/log(7.)
330 p_fac = 0.3 * flagstruct%tau_h2o*86400.
331 elseif ( pfull(k) < 100. .and. pfull(k) >= 7. )
then 332 qstar = q7_h2o + (q100_h2o-q7_h2o)*log(pfull(k)/7.)/log(100./7.)
333 p_fac = 0.4 * flagstruct%tau_h2o*86400.
334 elseif ( pfull(k) < 1000. .and. pfull(k) >= 100. )
then 335 qstar = q100_h2o + (q1000_h2o-q100_h2o)*log(pfull(k)/1.e2)/log(10.)
336 p_fac = 0.5 * flagstruct%tau_h2o*86400.
337 elseif ( pfull(k) < 2000. .and. pfull(k) >= 1000. )
then 338 qstar = q1000_h2o + (q2000_h2o-q1000_h2o)*log(pfull(k)/1.e3)/log(2.)
339 p_fac = 0.75 * flagstruct%tau_h2o*86400.
342 p_fac = flagstruct%tau_h2o*86400.
347 q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (qstar-q(i,j,k,sphum))/p_fac
356 if( m /= w_diff )
then 359 q(i,j,k,m) = q(i,j,k,m) + dt*q_dt(i,j,k,m)
371 ps_dt(i,j) = 1. + dt*sum(q_dt(i,j,k,1:nm))
373 ps_dt(i,j) = 1. + dt*sum(q_dt(i,j,k,1:nwat))
375 delp(i,j,k) = delp(i,j,k) * ps_dt(i,j)
376 if (flagstruct%adj_mass_vmr)
then 379 (ps_dt(i,j) - sum(q(i,j,k,1:nn))) / &
380 (1.d0 - sum(q(i,j,k,1:nn)))
383 (ps_dt(i,j) - sum(q(i,j,k,1:flagstruct%nwat))) / &
384 (1.d0 - sum(q(i,j,k,1:flagstruct%nwat)))
394 do m=1,flagstruct%ncnst
396 if( m /= cld_amt .and. m /= w_diff .and. adjust_mass(model_atmos,m))
then 398 q(is:ie,js:je,k,m) = q(is:ie,js:je,k,m) / ps_dt(is:ie,js:je)
399 if (conv_vmr_mmr(m)) &
400 q(is:ie,js:je,k,m) = q(is:ie,js:je,k,m) * adj_vmr(is:ie,js:je,k)
402 qdiag(is:ie,js:je,k,m) = qdiag(is:ie,js:je,k,m) / ps_dt(is:ie,js:je)
410 if ( hydrostatic )
then 412 call moist_cp(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
413 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k) )
415 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
419 if ( flagstruct%phys_hydrostatic )
then 422 call moist_cp(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
423 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k) )
425 delz(i,j,k) = delz(i,j,k) / pt(i,j,k)
426 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
427 delz(i,j,k) = delz(i,j,k) * pt(i,j,k)
435 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*gama_dt
440 call moist_cv(is,ie,isd,ied,jsd,jed, npz, j, k, nwat, sphum, liq_wat, rainwat, &
441 ice_wat, snowwat, graupel, q, qc, cvm, pt(is:ie,j,k))
443 pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*
con_cp/cvm(i)
453 ua(i,j,k) = ua(i,j,k) + dt*u_dt(i,j,k)
454 va(i,j,k) = va(i,j,k) + dt*v_dt(i,j,k)
467 #if defined (ATMOS_NUDGE) 471 call get_atmos_nudge ( time, dt, is, ie, js, je, &
472 npz, ng, ps(is:ie,js:je), ua(is:ie, js:je,:), &
473 va(is:ie,js:je,:), pt(is:ie,js:je,:), &
474 q(is:ie,js:je,:,:), ps_dt(is:ie,js:je), u_dt(is:ie,js:je,:), &
475 v_dt(is:ie,js:je,:), t_dt(is:ie,js:je,:), &
476 q_dt(is:ie,js:je,:,:) )
484 dbk = dt * (bk(k+1) - bk(k))
487 delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
492 #elif defined (CLIMATE_NUDGE) 496 call fv_climate_nudge ( time, dt, is, ie, js, je, npz, pfull, &
497 lona(is:ie,js:je), lata(is:ie,js:je), phis(is:ie,js:je), &
499 ps(is:ie,js:je), ua(is:ie,js:je,:), va(is:ie,js:je,:), &
500 pt(is:ie,js:je,:), q(is:ie,js:je,:,sphum:sphum), &
501 ps_dt(is:ie,js:je), u_dt(is:ie,js:je,:), &
502 v_dt(is:ie,js:je,:), t_dt(is:ie,js:je,:), &
503 q_dt(is:ie,js:je,:,sphum:sphum) )
511 dbk = dt * (bk(k+1) - bk(k))
514 delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
519 #elif defined (ADA_NUDGE) 525 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
529 ps(i,j) = pe(i,npz+1,j)
532 call fv_ada_nudge ( time, dt, npx, npy, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, &
533 zvir, ptop, ak, bk, ts, ps, delp, ua, va, pt, &
534 nwat, q, phis, gridstruct, bd, domain )
541 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
545 ps(i,j) = pe(i,npz+1,j)
548 call fv_nwp_nudge ( time, dt, npx, npy, npz, ps_dt, u_dt, v_dt, t_dt, q_dt, &
549 zvir, ptop, ak, bk, ts, ps, delp, ua, va, pt, &
550 nwat, q, phis, gridstruct, bd, domain )
554 if ( .not.flagstruct%dwind_2d )
then 557 if ( gridstruct%square_domain )
then 558 call start_group_halo_update(i_pack(1), u_dt, domain, whalo=1, ehalo=1, shalo=1, nhalo=1, complete=.false.)
559 call start_group_halo_update(i_pack(1), v_dt, domain, whalo=1, ehalo=1, shalo=1, nhalo=1, complete=.true.)
561 call start_group_halo_update(i_pack(1), u_dt, domain, complete=.false.)
562 call start_group_halo_update(i_pack(1), v_dt, domain, complete=.true.)
570 if ( flagstruct%fv_debug )
then 571 call prt_maxmin(
'PS_b_update', ps, is, ie, js, je, ng, 1, 0.01)
572 call prt_maxmin(
'delp_a_update', delp, is, ie, js, je, ng, npz, 0.01)
583 pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
584 peln(i,k,j) = log( pe(i,k,j) )
585 pk(i,j,k) = exp( kappa*peln(i,k,j) )
590 ps(i,j) = pe(i,npz+1,j)
591 u_srf(i,j) = ua(i,j,npz)
592 v_srf(i,j) = va(i,j,npz)
595 if ( hydrostatic )
then 598 pkz(i,j,k) = (pk(i,j,k+1)-pk(i,j,k))/(kappa*(peln(i,k+1,j)-peln(i,k,j)))
600 pkz(i,j,k) = exp(
virqd(q(i,j,k,:))/
vicpqd(q(i,j,k,:)) * log( pkz(i,j,k) ) )
608 if ( flagstruct%dwind_2d )
then 609 call update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, &
617 call complete_group_halo_update(i_pack(1), domain)
619 if (
size(neststruct%child_grids) > 1)
then 620 if (gridstruct%nested)
then 621 call nested_grid_bc(u_dt, parent_u_dt, neststruct%nest_domain, neststruct%ind_h, neststruct%wt_h, 0, 0, &
622 npx, npy, npz, bd, 1, npx-1, 1, npy-1)
623 call nested_grid_bc(v_dt, parent_v_dt, neststruct%nest_domain, neststruct%ind_h, neststruct%wt_h, 0, 0, &
624 npx, npy, npz, bd, 1, npx-1, 1, npy-1)
626 do n=1,
size(neststruct%child_grids)
627 if (neststruct%child_grids(n))
then 642 if (gridstruct%regional)
then 646 u_dt(is-1,j,k) = u_dt(is,j,k)
647 v_dt(is-1,j,k) = v_dt(is,j,k)
654 u_dt(ie+1,j,k) = u_dt(ie,j,k)
655 v_dt(ie+1,j,k) = v_dt(ie,j,k)
662 u_dt(i,js-1,k) = u_dt(i,js,k)
663 v_dt(i,js-1,k) = v_dt(i,js,k)
670 u_dt(i,je+1,k) = u_dt(i,je,k)
671 v_dt(i,je+1,k) = v_dt(i,je,k)
679 if (is == 1 .and. js == 1)
then 680 u_dt(is-1,js-1,k) = u_dt(is,js,k)
681 v_dt(is-1,js-1,k) = v_dt(is,js,k)
682 elseif (is == 1 .and. je == npy)
then 683 u_dt(is-1,je+1,k) = u_dt(is,je,k)
684 v_dt(is-1,je+1,k) = v_dt(is,je,k)
685 elseif (ie == npx .and. js == 1)
then 686 u_dt(ie+1,js-1,k) = u_dt(ie,je,k)
687 v_dt(ie+1,js-1,k) = v_dt(ie,je,k)
688 elseif (ie == npx .and. je == npy)
then 689 u_dt(ie+1,je+1,k) = u_dt(ie,je,k)
690 v_dt(ie+1,je+1,k) = v_dt(ie,je,k)
695 call update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
700 npx, npy, npz, 1, gridstruct%grid_type, domain, gridstruct%nested, flagstruct%c2l_ord, bd)
703 if ( flagstruct%fv_debug )
then 704 call prt_maxmin(
'PS_a_update', ps, is, ie, js, je, ng, 1, 0.01)
710 subroutine del2_phys(qdt, delp, gridstruct, cd, npx, npy, km, is, ie, js, je, &
711 isd, ied, jsd, jed, ngc, domain)
713 integer,
intent(in):: npx, npy, km
714 integer,
intent(in):: is, ie, js, je, isd, ied, jsd, jed, ngc
715 real,
intent(in):: cd
716 real,
intent(in ):: delp(isd:ied,jsd:jed,km)
717 real,
intent(inout):: qdt(is-ngc:ie+ngc,js-ngc:je+ngc,km)
719 type(domain2d),
intent(INOUT) :: domain
721 real,
pointer,
dimension(:,:) :: rarea, dx, dy, sina_u, sina_v, rdxc, rdyc
722 real,
pointer,
dimension(:,:,:) :: sin_sg
724 real :: q(isd:ied,jsd:jed,km)
725 real :: fx(is:ie+1,js:je), fy(is:ie,js:je+1)
726 real :: mask(is:ie+1,js:je+1)
727 real :: f1(is:ie+1), f2(js:je+1)
731 rarea => gridstruct%rarea
734 sina_u => gridstruct%sina_u
735 sina_v => gridstruct%sina_v
736 rdxc => gridstruct%rdxc
737 rdyc => gridstruct%rdyc
738 sin_sg => gridstruct%sin_sg
741 damp = 0.25 * cd * gridstruct%da_min
747 f1(i) = (1. - sin(
real(i-1)/
real(npx-1)*pi))**2
752 f2(j) = (1. - sin(
real(j-1)/
real(npy-1)*pi))**2
754 mask(i,j) = damp * (f1(i) + f2(j))
764 q(i,j,k) = qdt(i,j,k)*delp(i,j,k)
769 call mpp_update_domains(q, domain, complete=.true.)
779 (mask(i,j)+mask(i,j+1))*dy(i,j)*sina_u(i,j)* &
780 (q(i-1,j,k)-q(i,j,k))*rdxc(i,j)
782 if (is == 1 .and. .not. gridstruct%nested) fx(i,j) = &
783 (mask(is,j)+mask(is,j+1))*dy(is,j)*(q(is-1,j,k)-q(is,j,k))*rdxc(is,j)* &
784 0.5*(sin_sg(1,j,1) + sin_sg(0,j,3))
785 if (ie+1==npx .and. .not. gridstruct%nested) fx(i,j) = &
786 (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)* &
787 0.5*(sin_sg(npx,j,1) + sin_sg(npx-1,j,3))
790 if ((j == 1 .OR. j == npy) .and. .not. gridstruct%nested)
then 792 fy(i,j) = (mask(i,j)+mask(i+1,j))*dx(i,j)*&
793 (q(i,j-1,k)-q(i,j,k))*rdyc(i,j) &
794 *0.5*(sin_sg(i,j,2) + sin_sg(i,j-1,4) )
798 fy(i,j) = (mask(i,j)+mask(i+1,j))*dx(i,j)*sina_v(i,j)*&
799 (q(i,j-1,k)-q(i,j,k))*rdyc(i,j)
805 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)
814 subroutine update_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
818 integer,
intent(in) :: is, ie, js, je
819 integer,
intent(in) :: isd, ied, jsd, jed
820 integer,
intent(IN) :: npx,npy, npz
821 real,
intent(in) :: dt
822 real,
intent(inout) :: u(isd:ied, jsd:jed+1,npz)
823 real,
intent(inout) :: v(isd:ied+1,jsd:jed ,npz)
824 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
825 type(fv_grid_type),
intent(IN),
target :: gridstruct
826 type(domain2d),
intent(INOUT) :: domain
829 real v3(is-1:ie+1,js-1:je+1,3)
830 real ue(is-1:ie+1,js:je+1,3)
831 real ve(is:ie+1,js-1:je+1,3)
832 real,
dimension(is:ie) :: ut1, ut2, ut3
833 real,
dimension(js:je) :: vt1, vt2, vt3
835 integer i, j, k, m, im2, jm2
837 real(kind=R_GRID),
pointer,
dimension(:,:,:) :: vlon, vlat
838 real(kind=R_GRID),
pointer,
dimension(:,:,:,:) :: es, ew
839 real(kind=R_GRID),
pointer,
dimension(:) :: edge_vect_w, edge_vect_e, edge_vect_s, edge_vect_n
843 vlon => gridstruct%vlon
844 vlat => gridstruct%vlat
846 edge_vect_w => gridstruct%edge_vect_w
847 edge_vect_e => gridstruct%edge_vect_e
848 edge_vect_s => gridstruct%edge_vect_s
849 edge_vect_n => gridstruct%edge_vect_n
861 if ( gridstruct%grid_type > 3 )
then 865 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
870 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
878 v3(i,j,1) = u_dt(i,j,k)*vlon(i,j,1) + v_dt(i,j,k)*vlat(i,j,1)
879 v3(i,j,2) = u_dt(i,j,k)*vlon(i,j,2) + v_dt(i,j,k)*vlat(i,j,2)
880 v3(i,j,3) = u_dt(i,j,k)*vlon(i,j,3) + v_dt(i,j,k)*vlat(i,j,3)
887 ue(i,j,1) = v3(i,j-1,1) + v3(i,j,1)
888 ue(i,j,2) = v3(i,j-1,2) + v3(i,j,2)
889 ue(i,j,3) = v3(i,j-1,3) + v3(i,j,3)
895 ve(i,j,1) = v3(i-1,j,1) + v3(i,j,1)
896 ve(i,j,2) = v3(i-1,j,2) + v3(i,j,2)
897 ve(i,j,3) = v3(i-1,j,3) + v3(i,j,3)
902 if ( is==1 .and. .not. (gridstruct%nested .or. gridstruct%regional))
then 906 vt1(j) = edge_vect_w(j)*ve(i,j-1,1) + (1.-edge_vect_w(j))*ve(i,j,1)
907 vt2(j) = edge_vect_w(j)*ve(i,j-1,2) + (1.-edge_vect_w(j))*ve(i,j,2)
908 vt3(j) = edge_vect_w(j)*ve(i,j-1,3) + (1.-edge_vect_w(j))*ve(i,j,3)
910 vt1(j) = edge_vect_w(j)*ve(i,j+1,1) + (1.-edge_vect_w(j))*ve(i,j,1)
911 vt2(j) = edge_vect_w(j)*ve(i,j+1,2) + (1.-edge_vect_w(j))*ve(i,j,2)
912 vt3(j) = edge_vect_w(j)*ve(i,j+1,3) + (1.-edge_vect_w(j))*ve(i,j,3)
921 if ( (ie+1)==npx .and. .not. (gridstruct%nested .or. gridstruct%regional))
then 925 vt1(j) = edge_vect_e(j)*ve(i,j-1,1) + (1.-edge_vect_e(j))*ve(i,j,1)
926 vt2(j) = edge_vect_e(j)*ve(i,j-1,2) + (1.-edge_vect_e(j))*ve(i,j,2)
927 vt3(j) = edge_vect_e(j)*ve(i,j-1,3) + (1.-edge_vect_e(j))*ve(i,j,3)
929 vt1(j) = edge_vect_e(j)*ve(i,j+1,1) + (1.-edge_vect_e(j))*ve(i,j,1)
930 vt2(j) = edge_vect_e(j)*ve(i,j+1,2) + (1.-edge_vect_e(j))*ve(i,j,2)
931 vt3(j) = edge_vect_e(j)*ve(i,j+1,3) + (1.-edge_vect_e(j))*ve(i,j,3)
941 if ( js==1 .and. .not. (gridstruct%nested .or. gridstruct%regional))
then 945 ut1(i) = edge_vect_s(i)*ue(i-1,j,1) + (1.-edge_vect_s(i))*ue(i,j,1)
946 ut2(i) = edge_vect_s(i)*ue(i-1,j,2) + (1.-edge_vect_s(i))*ue(i,j,2)
947 ut3(i) = edge_vect_s(i)*ue(i-1,j,3) + (1.-edge_vect_s(i))*ue(i,j,3)
949 ut1(i) = edge_vect_s(i)*ue(i+1,j,1) + (1.-edge_vect_s(i))*ue(i,j,1)
950 ut2(i) = edge_vect_s(i)*ue(i+1,j,2) + (1.-edge_vect_s(i))*ue(i,j,2)
951 ut3(i) = edge_vect_s(i)*ue(i+1,j,3) + (1.-edge_vect_s(i))*ue(i,j,3)
960 if ( (je+1)==npy .and. .not. (gridstruct%nested .or. gridstruct%regional))
then 964 ut1(i) = edge_vect_n(i)*ue(i-1,j,1) + (1.-edge_vect_n(i))*ue(i,j,1)
965 ut2(i) = edge_vect_n(i)*ue(i-1,j,2) + (1.-edge_vect_n(i))*ue(i,j,2)
966 ut3(i) = edge_vect_n(i)*ue(i-1,j,3) + (1.-edge_vect_n(i))*ue(i,j,3)
968 ut1(i) = edge_vect_n(i)*ue(i+1,j,1) + (1.-edge_vect_n(i))*ue(i,j,1)
969 ut2(i) = edge_vect_n(i)*ue(i+1,j,2) + (1.-edge_vect_n(i))*ue(i,j,2)
970 ut3(i) = edge_vect_n(i)*ue(i+1,j,3) + (1.-edge_vect_n(i))*ue(i,j,3)
981 u(i,j,k) = u(i,j,k) + dt5*( ue(i,j,1)*es(1,i,j,1) + &
982 ue(i,j,2)*es(2,i,j,1) + &
983 ue(i,j,3)*es(3,i,j,1) )
988 v(i,j,k) = v(i,j,k) + dt5*( ve(i,j,1)*ew(1,i,j,2) + &
989 ve(i,j,2)*ew(2,i,j,2) + &
990 ve(i,j,3)*ew(3,i,j,2) )
1002 subroutine update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
1006 integer,
intent(in):: is, ie, js, je
1007 integer,
intent(in):: isd, ied, jsd, jed
1008 real,
intent(in):: dt
1009 real,
intent(inout):: u(isd:ied, jsd:jed+1,npz)
1010 real,
intent(inout):: v(isd:ied+1,jsd:jed ,npz)
1011 real,
intent(inout),
dimension(isd:ied,jsd:jed,npz):: u_dt, v_dt
1012 type(fv_grid_type),
intent(IN),
target :: gridstruct
1013 integer,
intent(IN) :: npx,npy, npz
1014 type(domain2d),
intent(INOUT) :: domain
1017 real ut(isd:ied,jsd:jed)
1021 real(kind=R_GRID),
pointer,
dimension(:,:,:) :: vlon, vlat
1022 real(kind=R_GRID),
pointer,
dimension(:,:,:,:) :: es, ew
1023 real(kind=R_GRID),
pointer,
dimension(:) :: edge_vect_w, edge_vect_e, edge_vect_s, edge_vect_n
1024 real,
pointer,
dimension(:,:) :: z11, z12, z21, z22, dya, dxa
1028 vlon => gridstruct%vlon
1029 vlat => gridstruct%vlat
1031 edge_vect_w => gridstruct%edge_vect_w
1032 edge_vect_e => gridstruct%edge_vect_e
1033 edge_vect_s => gridstruct%edge_vect_s
1034 edge_vect_n => gridstruct%edge_vect_n
1036 z11 => gridstruct%z11
1037 z21 => gridstruct%z21
1038 z12 => gridstruct%z12
1039 z22 => gridstruct%z22
1041 dxa => gridstruct%dxa
1042 dya => gridstruct%dya
1051 ut(i,j) = z11(i,j)*u_dt(i,j,k) + z12(i,j)*v_dt(i,j,k)
1052 v_dt(i,j,k) = z21(i,j)*u_dt(i,j,k) + z22(i,j)*v_dt(i,j,k)
1053 u_dt(i,j,k) = ut(i,j)
1059 call mpp_update_domains(u_dt, v_dt, domain, gridtype=agrid_param)
1069 if ( gridstruct%grid_type > 3 .or. gridstruct%nested)
then 1073 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
1078 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
1090 gratio = dya(i,2) / dya(i,1)
1091 u(i,1,k) = u(i,1,k) + dt5*((2.+gratio)*(u_dt(i,0,k)+u_dt(i,1,k)) &
1092 -(u_dt(i,-1,k)+u_dt(i,2,k)))/(1.+gratio)
1097 do j=max(2,js),min(npy-1,je+1)
1099 u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k)+u_dt(i,j,k))
1103 if ( (je+1)==npy )
then 1105 gratio = dya(i,npy-2) / dya(i,npy-1)
1106 u(i,npy,k) = u(i,npy,k) + dt5*((2.+gratio)*(u_dt(i,npy-1,k)+u_dt(i,npy,k)) &
1107 -(u_dt(i,npy-2,k)+u_dt(i,npy+1,k)))/(1.+gratio)
1117 gratio = dxa(2,j) / dxa(1,j)
1118 v(1,j,k) = v(1,j,k) + dt5*((2.+gratio)*(v_dt(0,j,k)+v_dt(1,j,k)) &
1119 -(v_dt(-1,j,k)+v_dt(2,j,k)))/(1.+gratio)
1125 do i=max(2,is),min(npx-1,ie+1)
1126 v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k)+v_dt(i,j,k))
1131 if ( (ie+1)==npx )
then 1133 gratio = dxa(npx-2,j) / dxa(npx-1,j)
1134 v(npx,j,k) = v(npx,j,k) + dt5*((2.+gratio)*(v_dt(npx-1,j,k)+v_dt(npx,j,k)) &
1135 -(v_dt(npx-2,j,k)+v_dt(npx+1,j,k)))/(1.+gratio)
subroutine update2d_dwinds_phys(is, ie, js, je, isd, ied, jsd, jed, dt, u_dt, v_dt, u, v, gridstruct, npx, npy, npz, domain)
The subroutine 'update2d_dwinds_phys' transforms the wind tendencies from the A grid to the D grid fo...
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)
pure real function, public vicpqd(q)
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, 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)
The subroutine 'moist_cv' computes the FV3-consistent moist heat capacity under constant volume...
The module 'multi_gases' peforms multi constitutents computations.
subroutine, public get_eta_level(npz, p_s, pf, ph, ak, bk, pscale)
The subroutine 'get_eta_level' returns the interface and layer-mean pressures for reference...
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...
The module 'fv_timing' contains FV3 timers.
pure real function, public virq(q)
The module 'boundary' contains utility routines for grid nesting and boundary conditions.
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)
Ths subroutine 'fv_nwp_nudge' computes and returns time tendencies for nudging to analysis...
The module 'fv_mapz' contains the vertical mapping routines .
The module 'fv_arrays' contains the 'fv_atmos_type' and associated datatypes.
interface 'nested_grid_BC' includes subroutines 'nested_grid_BC_2d' and 'nested_grid_BC_3d' that fetc...
subroutine, public del2_phys(qdt, delp, gridstruct, cd, npx, npy, km, is, ie, js, je, isd, ied, jsd, jed, ngc, domain)
The subroutine 'del2_phys' is for filtering the physics tendency.
The module 'fv_eta' contains routine to set up the reference (Eulerian) pressure coordinate.
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)
The subroutine 'moist_cp' computes the FV3-consistent moist heat capacity under constant pressure...
subroutine timing_on(blk_name)
The subroutine 'timing_on' starts a timer.
@ The module 'fv_diagnostics' contains routines to compute diagnosic fields.
The module 'fv_grid_utils' contains routines for setting up and computing grid-related quantities...
subroutine, public prt_maxmin(qname, q, is, ie, js, je, n_g, km, fac)
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 cubed_to_latlon(u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, nested, c2l_ord, bd)
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.