FV3 Bundle
fv_update_phys_nlm.F90
Go to the documentation of this file.
1 !***********************************************************************
2 !* GNU General Public License *
3 !* This file is a part of fvGFS. *
4 !* *
5 !* fvGFS is free software; you can redistribute it and/or modify it *
6 !* and are expected to follow the terms of the GNU General Public *
7 !* License as published by the Free Software Foundation; either *
8 !* version 2 of the License, or (at your option) any later version. *
9 !* *
10 !* fvGFS is distributed in the hope that it will be useful, but *
11 !* WITHOUT ANY WARRANTY; without even the implied warranty of *
12 !* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 !* General Public License for more details. *
14 !* *
15 !* For the full text of the GNU General Public License, *
16 !* write to: Free Software Foundation, Inc., *
17 !* 675 Mass Ave, Cambridge, MA 02139, USA. *
18 !* or see: http://www.gnu.org/licenses/gpl.html *
19 !***********************************************************************
21 
25  use mpp_parameter_mod, only: agrid_param=>agrid
26  use mpp_mod, only: fatal, mpp_error
27  use mpp_mod, only: mpp_error, note, warning
28  use time_manager_mod, only: time_type
30  use fv_mp_nlm_mod, only: start_group_halo_update, complete_group_halo_update
31  use fv_mp_nlm_mod, only: group_halo_update_type
35  use fv_eta_nlm_mod, only: get_eta_level
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
45 #else
47 #endif
50 
51  implicit none
52 
53  public :: fv_update_phys, del2_phys
54 #ifdef ROT3
55  public :: update_dwinds_phys
56 #endif
57 
58  real,parameter:: con_cp = cp_air
59 
60  contains
61 
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 ! tracers modified by physics
72  ! ncnst is the total nmber of tracers
73  logical, intent(in):: moist_phys
74  logical, intent(in):: hydrostatic
75  logical, intent(in):: nudge
76 
77  type(time_type), intent(in) :: time
78 
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:)
82 
83 ! optional arguments for atmospheric nudging
84  real, intent(in), dimension(isd:ied,jsd:jed), optional :: &
85  lona, lata ! A-grid (physics) lon and lat
86 
87 ! Winds on lat-lon grid:
88  real, intent(inout), dimension(isd:ied,jsd:jed,npz):: ua, va
89  real, intent(inout), dimension(isd: ,jsd: ,1: ):: w
90 
91 ! Tendencies from Physics:
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)
95 
96 ! Saved Bottom winds for GFDL Physics Interface
97  real, intent(out), dimension(is:ie,js:je):: u_srf, v_srf, ts
98 
99  type(fv_flags_type) :: flagstruct
100  type(fv_grid_bounds_type), intent(IN) :: bd
101  type(domain2d), intent(INOUT) :: domain
102 
103  real, intent(inout):: u(isd:ied ,jsd:jed+1,npz) ! D grid zonal wind (m/s)
104  real, intent(inout):: v(isd:ied+1,jsd:jed ,npz) ! D grid meridional wind (m/s)
105  real, intent(inout), dimension(isd:ied,jsd:jed,npz):: pt, delp
106  real, intent(inout):: q(isd:ied,jsd:jed,npz,nq) ! specific humidity and constituents
107  real, intent(inout):: qdiag(isd:ied,jsd:jed,npz,nq+1:flagstruct%ncnst) ! diagnostic tracers
108 
109 !-----------------------------------------------------------------------
110 ! Auxilliary pressure arrays:
111 ! The 5 vars below can be re-computed from delp and ptop.
112 !-----------------------------------------------------------------------
113 ! dyn_aux:
114  real, intent(inout):: ps (isd:ied ,jsd:jed) ! Surface pressure (pascal)
115  real, intent(inout):: pe (is-1:ie+1, npz+1,js-1:je+1) ! edge pressure (pascal)
116  real, intent(inout):: pk (is:ie,js:je , npz+1) ! pe**cappa
117  real, intent(inout):: peln(is:ie,npz+1,js:je) ! ln(pe)
118  real, intent(inout):: pkz (is:ie,js:je,npz) ! finite-volume mean pk
119  real, parameter:: tice = 273.16
120 
121  type(fv_grid_type) :: gridstruct
122  type(fv_nest_type) :: neststruct
123 
124  integer, intent(IN) :: npx, npy, npz
125 
126 !***********
127 ! Haloe Data
128 !***********
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
135 
136 ! Local arrays:
137  real ps_dt(is:ie,js:je)
138  real cvm(is:ie), qc(is:ie)
139  real phalf(npz+1), pfull(npz)
140 
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 ! GFDL AM physics
144  integer rainwat, snowwat, graupel ! Lin Micro-physics
145  integer w_diff ! w-tracer for PBL diffusion
146  real:: qstar, dbk, rdg, zvir, p_fac, cv_air, gama_dt
147 
148  real, dimension(1,1,1) :: parent_u_dt, parent_v_dt ! dummy variables for nesting
149 
150 !f1p
151 !account for change in air molecular weight because of H2O change
152  logical, dimension(nq) :: conv_vmr_mmr
153  real :: adj_vmr(is:ie,js:je,npz)
154  character(len=32) :: tracer_units, tracer_name
155 
156  cv_air = cp_air - rdgas ! = rdgas * (7/2-1) = 2.5*rdgas=717.68
157 
158  rdg = -rdgas / grav
159 
160  nwat = flagstruct%nwat
161 
162  if ( moist_phys .or. nwat/=0 ) then
163  zvir = rvgas/rdgas - 1.
164  else
165  zvir = 0.
166  endif
167 
168 #ifdef MAPL_MODE
169  conv_vmr_mmr(1:nq) = .false.
170  sphum = 1
171  select case(nwat)
172  case(1)
173  liq_wat = -1
174  ice_wat = -1
175  rainwat = -1
176  snowwat = -1
177  graupel = -1
178  cld_amt = -1
179  case(3)
180  liq_wat = 2
181  ice_wat = 3
182  rainwat = -1
183  snowwat = -1
184  graupel = -1
185  cld_amt = -1
186  end select
187 #else
188 !f1p
189  conv_vmr_mmr(1:nq) = .false.
190  if (flagstruct%adj_mass_vmr) then
191  do m=1,nq
192  call get_tracer_names (model_atmos, m, name = tracer_name, &
193  units = tracer_units)
194  if ( trim(tracer_units) .eq. 'vmr' ) then
195  conv_vmr_mmr(m) = .true.
196  else
197  conv_vmr_mmr(m) = .false.
198  end if
199  end do
200  end if
201 
202  sphum = get_tracer_index(model_atmos, 'sphum')
203  liq_wat = get_tracer_index(model_atmos, 'liq_wat')
204  ice_wat = get_tracer_index(model_atmos, 'ice_wat')
205  rainwat = get_tracer_index(model_atmos, 'rainwat')
206  snowwat = get_tracer_index(model_atmos, 'snowwat')
207  graupel = get_tracer_index(model_atmos, 'graupel')
208  cld_amt = get_tracer_index(model_atmos, 'cld_amt')
209 
210  if ( .not. hydrostatic ) then
211  w_diff = get_tracer_index(model_atmos, 'w_diff')
212 ! if ( w_diff<8 ) call mpp_error(FATAL,'W_tracer index error')
213  else
214  w_diff = 0
215  endif
216 #endif
217 
218  if ( .not. hydrostatic .and. .not. flagstruct%phys_hydrostatic .and. nwat == 0 ) then
219  gama_dt = dt*cp_air/cv_air
220  else
221  gama_dt = -1.e24
222  endif
223 
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
227  do m=1,nq
228  call prt_maxmin('q_dt', q_dt(is,js,1,m), is, ie, js, je, 0, npz, 1.)
229  enddo
230  endif
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.)
234  endif
235 
236  call get_eta_level(npz, 1.0e5, pfull, phalf, ak, bk)
237 
238 !$OMP parallel do default(none) &
239 !$OMP shared(is,ie,js,je,npz,flagstruct,pfull,q_dt,sphum,q,qdiag, &
240 !$OMP nq,w_diff,dt,nwat,liq_wat,rainwat,ice_wat,snowwat, &
241 !$OMP graupel,delp,cld_amt,hydrostatic,pt,t_dt,delz,adj_vmr,&
242 !$OMP gama_dt,cv_air,ua,u_dt,va,v_dt,isd,ied,jsd,jed, &
243 !$OMP conv_vmr_mmr) &
244 !$OMP private(cvm, qc, qstar, ps_dt, p_fac)
245  do k=1, npz
246 
247  if (present(q_dt)) then
248 
249  if (flagstruct%tau_h2o<0.0 .and. pfull(k) < 100.e2 ) then
250 ! Wipe the stratosphere clean:
251 ! This should only be used for initialization from a bad model state
252  p_fac = -flagstruct%tau_h2o*86400.
253  do j=js,je
254  do i=is,ie
255  q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (3.e-6-q(i,j,k,sphum))/p_fac
256  enddo
257  enddo
258  elseif ( flagstruct%tau_h2o>0.0 .and. pfull(k) < 3000. ) then
259 ! Do idealized Ch4 chemistry
260 
261  if ( pfull(k) < 1. ) then
262  qstar = q1_h2o
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.
276  else
277  qstar = q3000_h2o
278  p_fac = flagstruct%tau_h2o*86400.
279  endif
280 
281  do j=js,je
282  do i=is,ie
283  q_dt(i,j,k,sphum) = q_dt(i,j,k,sphum) + (qstar-q(i,j,k,sphum))/p_fac
284  enddo
285  enddo
286  endif
287 
288 !----------------
289 ! Update tracers:
290 !----------------
291  do m=1,nq
292  if( m /= w_diff ) then
293  do j=js,je
294  do i=is,ie
295  q(i,j,k,m) = q(i,j,k,m) + dt*q_dt(i,j,k,m)
296  enddo
297  enddo
298  endif
299  enddo
300 
301 !--------------------------------------------------------
302 ! Adjust total air mass due to changes in water substance
303 !--------------------------------------------------------
304  do j=js,je
305  do i=is,ie
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
309  adj_vmr(i,j,k) = &
310  (ps_dt(i,j) - sum(q(i,j,k,1:flagstruct%nwat))) / &
311  (1.d0 - sum(q(i,j,k,1:flagstruct%nwat)))
312  end if
313  enddo
314  enddo
315 
316 !-----------------------------------------
317 ! Adjust mass mixing ratio of all tracers
318 !-----------------------------------------
319  if ( nwat /=0 ) then
320  do m=1,flagstruct%ncnst
321 !-- check to query field_table to determine if tracer needs mass adjustment
322  if( m /= cld_amt .and. m /= w_diff .and. adjust_mass(model_atmos,m)) then
323  if (m <= nq) then
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)
327  else
328  qdiag(is:ie,js:je,k,m) = qdiag(is:ie,js:je,k,m) / ps_dt(is:ie,js:je)
329  endif
330  endif
331  enddo
332  endif
333 
334  endif ! present(q_dt)
335 
336  if ( hydrostatic ) then
337  do j=js,je
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) )
340  do i=is,ie
341 !!! pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt
342  pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*con_cp/cvm(i)
343  enddo
344  enddo
345  else
346  if ( flagstruct%phys_hydrostatic ) then
347 ! Constant pressure
348  do j=js,je
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) )
351  do i=is,ie
352  delz(i,j,k) = delz(i,j,k) / pt(i,j,k)
353 !!! pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt
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)
356  enddo
357  enddo
358  else
359  !NOTE: only works for either no physics or Lin MP
360  if (nwat == 0) then
361  do j=js,je
362  do i=is,ie
363  pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*gama_dt
364  enddo
365  enddo
366  else
367  do j=js,je
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))
370  do i=is,ie
371 !!! pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*con_cp/cv_air
372  pt(i,j,k) = pt(i,j,k) + t_dt(i,j,k)*dt*con_cp/cvm(i)
373  enddo
374  enddo
375  endif
376  endif
377  endif
378 
379 #if !defined(GFS_PHYS) && !defined(MAPL_MODE)
380  do j=js,je
381  do i=is,ie
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)
384  enddo
385  enddo
386 #endif
387 
388  enddo ! k-loop
389 
390 ! [delp, (ua, va), pt, q] updated. Perform nudging if requested
391 !------- nudging of atmospheric variables toward specified data --------
392 
393  ps_dt(:,:) = 0.
394 
395  if ( nudge ) then
396 #if defined (ATMOS_NUDGE)
397 !--------------------------------------------
398 ! All fields will be updated; tendencies added
399 !--------------------------------------------
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,:,:) )
406 
407 !--------------
408 ! Update delp
409 !--------------
410  if (do_ps) then
411 !$omp parallel do default(none) shared(is,ie,js,je,npz,bk,delp,ps_dt) private(dbk)
412  do k=1,npz
413  dbk = dt * (bk(k+1) - bk(k))
414  do j=js,je
415  do i=is,ie
416  delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
417  enddo
418  enddo
419  enddo
420  endif
421 #elif defined (CLIMATE_NUDGE)
422 !--------------------------------------------
423 ! All fields will be updated; tendencies added
424 !--------------------------------------------
425  call fv_climate_nudge ( time, dt, is, ie, js, je, npz, pfull, &
426  lona(is:ie,js:je), lata(is:ie,js:je), phis(is:ie,js:je), &
427  ptop, ak, bk, &
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) )
433 
434 !--------------
435 ! Update delp
436 !--------------
437  if (do_ps) then
438 !$omp parallel do default(none) shared(is,ie,js,je,npz,dt,bk,delp,ps_dt) private(dbk)
439  do k=1,npz
440  dbk = dt * (bk(k+1) - bk(k))
441  do j=js,je
442  do i=is,ie
443  delp(i,j,k) = delp(i,j,k) + dbk*ps_dt(i,j)
444  enddo
445  enddo
446  enddo
447  endif
448 #elif defined (ADA_NUDGE)
449 ! All fields will be updated except winds; wind tendencies added
450 !$omp parallel do default(shared)
451  do j=js,je
452  do k=2,npz+1
453  do i=is,ie
454  pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
455  enddo
456  enddo
457  do i=is,ie
458  ps(i,j) = pe(i,npz+1,j)
459  enddo
460  enddo
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 )
464 #else
465 ! All fields will be updated except winds; wind tendencies added
466 !$OMP parallel do default(none) shared(is,ie,js,je,npz,pe,delp,ps)
467  do j=js,je
468  do k=2,npz+1
469  do i=is,ie
470  pe(i,k,j) = pe(i,k-1,j) + delp(i,j,k-1)
471  enddo
472  enddo
473  do i=is,ie
474  ps(i,j) = pe(i,npz+1,j)
475  enddo
476  enddo
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 )
480 #endif
481  endif ! end nudging
482 
483  if ( .not.flagstruct%dwind_2d ) then
484 
485  call timing_on('COMM_TOTAL')
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.)
489  else
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.)
492  endif
493  call timing_off('COMM_TOTAL')
494  endif
495 
496 !----------------------------------------
497 ! Update pe, peln, pkz, and surface winds
498 !----------------------------------------
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)
502  endif
503 
504 !$OMP parallel do default(none) shared(is,ie,js,je,npz,pe,delp,peln,pk,ps,u_srf,v_srf, &
505 !$OMP ua,va,pkz,hydrostatic)
506  do j=js,je
507  do k=2,npz+1
508  do i=is,ie
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) )
512  enddo
513  enddo
514 
515  do i=is,ie
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)
519  enddo
520 
521  if ( hydrostatic ) then
522  do k=1,npz
523  do i=is,ie
524  pkz(i,j,k) = (pk(i,j,k+1)-pk(i,j,k))/(kappa*(peln(i,k+1,j)-peln(i,k,j)))
525  enddo
526  enddo
527  endif
528  enddo ! j-loop
529 
530  call timing_on(' Update_dwinds')
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, &
533  npx,npy,npz,domain)
534  else
535 
536  !I have not seen dwind_2d be used for anything; so we will only handle nesting assuming dwind_2d == .false.
537 
538  call timing_on('COMM_TOTAL')
539 
540  call complete_group_halo_update(i_pack(1), domain)
541 
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)
548  endif
549  do n=1,size(neststruct%child_grids)
550  if (neststruct%child_grids(n)) then
551  call nested_grid_bc(u_dt, neststruct%nest_domain_all(n), 0, 0)
552  call nested_grid_bc(v_dt, neststruct%nest_domain_all(n), 0, 0)
553  endif
554  enddo
555  endif
556 
557  call timing_off('COMM_TOTAL')
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)
559  endif
560  call timing_off(' Update_dwinds')
561 #if defined(GFS_PHYS) || defined(MAPL_MODE)
562  call cubed_to_latlon(u, v, ua, va, gridstruct, &
563  npx, npy, npz, 1, gridstruct%grid_type, domain, gridstruct%nested, flagstruct%c2l_ord, bd)
564 #endif
565 
566  if ( flagstruct%fv_debug ) then
567  call prt_maxmin('PS_a_update', ps, is, ie, js, je, ng, 1, 0.01)
568  endif
569 
570  end subroutine fv_update_phys
571 
572 
573  subroutine del2_phys(qdt, delp, gridstruct, cd, npx, npy, km, is, ie, js, je, &
574  isd, ied, jsd, jed, ngc, domain)
575 ! This routine is for filtering the physics tendency
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 ! cd = K * da_min; 0 < K < 0.25
579  real, intent(in ):: delp(isd:ied,jsd:jed,km)
580  real, intent(inout):: qdt(is-ngc:ie+ngc,js-ngc:je+ngc,km)
581  type(fv_grid_type), intent(IN), target :: gridstruct
582  type(domain2d), intent(INOUT) :: domain
583 
584  real, pointer, dimension(:,:) :: rarea, dx, dy, sina_u, sina_v, rdxc, rdyc
585  real, pointer, dimension(:,:,:) :: sin_sg
586 !
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)
591  real :: damp
592  integer i,j,k
593 
594  rarea => gridstruct%rarea
595  dx => gridstruct%dx
596  dy => gridstruct%dy
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
602 
603 ! Applying mask to cd, the damping coefficient?
604  damp = 0.25 * cd * gridstruct%da_min
605 
606 ! Mask defined at corners
607 
608 !$OMP parallel do default(none) shared(is,ie,f1,npx)
609  do i=is,ie+1
610  f1(i) = (1. - sin(real(i-1)/real(npx-1)*pi))**2
611  enddo
612 
613 !$OMP parallel do default(none) shared(is,ie,js,je,f1,f2,npy,mask,damp)
614  do j=js,je+1
615  f2(j) = (1. - sin(real(j-1)/real(npy-1)*pi))**2
616  do i=is,ie+1
617  mask(i,j) = damp * (f1(i) + f2(j))
618  enddo
619  enddo
620 
621 ! mass weighted tendency from physics is filtered
622 
623 !$OMP parallel do default(none) shared(is,ie,js,je,km,q,qdt,delp)
624  do k=1,km
625  do j=js,je
626  do i=is,ie
627  q(i,j,k) = qdt(i,j,k)*delp(i,j,k)
628  enddo
629  enddo
630  enddo
631  call timing_on('COMM_TOTAL')
632  call mpp_update_domains(q, domain, complete=.true.)
633  call timing_off('COMM_TOTAL')
634 
635 !$OMP parallel do default(none) shared(is,ie,js,je,km,mask,dy,sina_u,q,rdxc,gridstruct, &
636 !$OMP sin_sg,npx,dx,npy,rdyc,sina_v,qdt,rarea,delp) &
637 !$OMP private(fx, fy)
638  do k=1,km
639  do j=js,je
640  do i=is,ie+1
641  fx(i,j) = &
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)
644  enddo
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))
651  enddo
652  do j=js,je+1
653  if ((j == 1 .OR. j == npy) .and. .not. gridstruct%nested) then
654  do i=is,ie
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) )
658  enddo
659  else
660  do i=is,ie
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)
663  enddo
664  end if
665  enddo
666  do j=js,je
667  do i=is,ie
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)
669  enddo
670  enddo
671  enddo
672 
673  end subroutine del2_phys
674 
675 
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)
678 ! Purpose; Transform wind tendencies on A grid to D grid for the final update
679 
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
689 
690 ! local:
691  real v3(is-1:ie+1,js-1:je+1,3)
692  real ue(is-1:ie+1,js:je+1,3) ! 3D winds at edges
693  real ve(is:ie+1,js-1:je+1, 3) ! 3D winds at edges
694  real, dimension(is:ie):: ut1, ut2, ut3
695  real, dimension(js:je):: vt1, vt2, vt3
696  real dt5, gratio
697  integer i, j, k, m, im2, jm2
698 
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
702 
703  es => gridstruct%es
704  ew => gridstruct%ew
705  vlon => gridstruct%vlon
706  vlat => gridstruct%vlat
707 
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
712 
713  dt5 = 0.5 * dt
714  im2 = (npx-1)/2
715  jm2 = (npy-1)/2
716 
717 !$OMP parallel do default(none) shared(is,ie,js,je,npz,gridstruct,u,dt5,u_dt,v,v_dt, &
718 !$OMP vlon,vlat,jm2,edge_vect_w,npx,edge_vect_e,im2, &
719 !$OMP edge_vect_s,npy,edge_vect_n,es,ew) &
720 !$OMP private(ut1, ut2, ut3, vt1, vt2, vt3, ue, ve, v3)
721  do k=1, npz
722 
723  if ( gridstruct%grid_type > 3 ) then ! Local & one tile configurations
724 
725  do j=js,je+1
726  do i=is,ie
727  u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
728  enddo
729  enddo
730  do j=js,je
731  do i=is,ie+1
732  v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
733  enddo
734  enddo
735 
736  else
737 ! Compute 3D wind tendency on A grid
738  do j=js-1,je+1
739  do i=is-1,ie+1
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)
743  enddo
744  enddo
745 
746 ! Interpolate to cell edges
747  do j=js,je+1
748  do i=is-1,ie+1
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)
752  enddo
753  enddo
754 
755  do j=js-1,je+1
756  do i=is,ie+1
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)
760  enddo
761  enddo
762 
763 ! --- E_W edges (for v-wind):
764  if ( is==1 .and. .not. gridstruct%nested ) then
765  i = 1
766  do j=js,je
767  if ( j>jm2 ) 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)
771  else
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)
775  endif
776  enddo
777  do j=js,je
778  ve(i,j,1) = vt1(j)
779  ve(i,j,2) = vt2(j)
780  ve(i,j,3) = vt3(j)
781  enddo
782  endif
783  if ( (ie+1)==npx .and. .not. gridstruct%nested ) then
784  i = npx
785  do j=js,je
786  if ( j>jm2 ) 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)
790  else
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)
794  endif
795  enddo
796  do j=js,je
797  ve(i,j,1) = vt1(j)
798  ve(i,j,2) = vt2(j)
799  ve(i,j,3) = vt3(j)
800  enddo
801  endif
802 ! N-S edges (for u-wind):
803  if ( js==1 .and. .not. gridstruct%nested) then
804  j = 1
805  do i=is,ie
806  if ( i>im2 ) 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)
810  else
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)
814  endif
815  enddo
816  do i=is,ie
817  ue(i,j,1) = ut1(i)
818  ue(i,j,2) = ut2(i)
819  ue(i,j,3) = ut3(i)
820  enddo
821  endif
822  if ( (je+1)==npy .and. .not. gridstruct%nested) then
823  j = npy
824  do i=is,ie
825  if ( i>im2 ) 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)
829  else
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)
833  endif
834  enddo
835  do i=is,ie
836  ue(i,j,1) = ut1(i)
837  ue(i,j,2) = ut2(i)
838  ue(i,j,3) = ut3(i)
839  enddo
840  endif
841  do j=js,je+1
842  do i=is,ie
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) )
846  enddo
847  enddo
848  do j=js,je
849  do i=is,ie+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) )
853  enddo
854  enddo
855 ! Update:
856  endif ! end grid_type
857 
858  enddo ! k-loop
859 
860  end subroutine update_dwinds_phys
861 
862 
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)
865 ! Purpose; Transform wind tendencies on A grid to D grid for the final update
866 
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
876 
877 ! local:
878  real ut(isd:ied,jsd:jed)
879  real:: dt5, gratio
880  integer i, j, k
881 
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
886 
887  es => gridstruct%es
888  ew => gridstruct%ew
889  vlon => gridstruct%vlon
890  vlat => gridstruct%vlat
891 
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
896 
897  z11 => gridstruct%z11
898  z21 => gridstruct%z21
899  z12 => gridstruct%z12
900  z22 => gridstruct%z22
901 
902  dxa => gridstruct%dxa
903  dya => gridstruct%dya
904 
905 ! Transform wind tendency on A grid to local "co-variant" components:
906 
907 !$OMP parallel do default(none) shared(is,ie,js,je,npz,z11,u_dt,z12,v_dt,z21,z22) &
908 !$OMP private(ut)
909  do k=1,npz
910  do j=js,je
911  do i=is,ie
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)
915  enddo
916  enddo
917  enddo
918 ! (u_dt,v_dt) are now on local coordinate system
919  call timing_on('COMM_TOTAL')
920  call mpp_update_domains(u_dt, v_dt, domain, gridtype=agrid_param)
921  call timing_off('COMM_TOTAL')
922 
923  dt5 = 0.5 * dt
924 
925 !$OMP parallel do default(none) shared(is,ie,js,je,npz,gridstruct,u,dt5,u_dt,v,v_dt, &
926 !$OMP dya,npy,dxa,npx) &
927 !$OMP private(gratio)
928  do k=1, npz
929 
930  if ( gridstruct%grid_type > 3 .or. gridstruct%nested) then ! Local & one tile configurations
931 
932  do j=js,je+1
933  do i=is,ie
934  u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k) + u_dt(i,j,k))
935  enddo
936  enddo
937  do j=js,je
938  do i=is,ie+1
939  v(i,j,k) = v(i,j,k) + dt5*(v_dt(i-1,j,k) + v_dt(i,j,k))
940  enddo
941  enddo
942 
943  else
944 
945 !--------
946 ! u-wind
947 !--------
948 ! Edges:
949  if ( js==1 ) then
950  do i=is,ie
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)
954  enddo
955  endif
956 
957 ! Interior
958  do j=max(2,js),min(npy-1,je+1)
959  do i=is,ie
960  u(i,j,k) = u(i,j,k) + dt5*(u_dt(i,j-1,k)+u_dt(i,j,k))
961  enddo
962  enddo
963 
964  if ( (je+1)==npy ) then
965  do i=is,ie
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)
969  enddo
970  endif
971 
972 !--------
973 ! v-wind
974 !--------
975 ! West Edges:
976  if ( is==1 ) then
977  do j=js,je
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)
981  enddo
982  endif
983 
984 ! Interior
985  do j=js,je
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))
988  enddo
989  enddo
990 
991 ! East Edges:
992  if ( (ie+1)==npx ) then
993  do j=js,je
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)
997  enddo
998  endif
999 
1000  endif ! end grid_type
1001 
1002  enddo ! k-loop
1003 
1004  end subroutine update2d_dwinds_phys
1005 
1006 end module fv_update_phys_nlm_mod
real, parameter, public radius
Radius of the Earth [m].
Definition: constants.F90:72
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].
Definition: constants.F90:73
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].
Definition: constants.F90:77
real, parameter, public cp_vapor
Specific heat capacity of water vapor at constant pressure [J/kg/deg].
Definition: constants.F90:89
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)
Definition: mpp.F90:39
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].
Definition: constants.F90:78
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].
Definition: constants.F90:83
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].
Definition: constants.F90:76
#define max(a, b)
Definition: mosaic_util.h:33
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)
#define min(a, b)
Definition: mosaic_util.h:32
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].
Definition: constants.F90:82
real(fp), parameter, public pi
subroutine timing_off(blk_name)