FV3DYCORE  Version 1.1.0
fv_control.F90
Go to the documentation of this file.
1 
2 !***********************************************************************
3 !* GNU Lesser General Public License
4 !*
5 !* This file is part of the FV3 dynamical core.
6 !*
7 !* The FV3 dynamical core is free software: you can redistribute it
8 !* and/or modify it under the terms of the
9 !* GNU Lesser General Public License as published by the
10 !* Free Software Foundation, either version 3 of the License, or
11 !* (at your option) any later version.
12 !*
13 !* The FV3 dynamical core is distributed in the hope that it will be
14 !* useful, but WITHOUT ANYWARRANTY; without even the implied warranty
15 !* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 !* See the GNU General Public License for more details.
17 !*
18 !* You should have received a copy of the GNU Lesser General Public
19 !* License along with the FV3 dynamical core.
20 !* If not, see <http://www.gnu.org/licenses/>.
21 !***********************************************************************
22 
25 !----------------
26 ! FV control panel
27 !----------------
28 
30 ! Modules Included:
31 ! <table>
32 ! <tr>
33 ! <th>Module Name</th>
34 ! <th>Functions Included</th>
35 ! </tr>
36 ! <table>
37 ! <tr>
38 ! <td>constants_mod</td>
39 ! <td>pi=>pi_8, kappa, radius, grav, rdgas</td>
40 ! </tr>
41 ! <tr>
42 ! <td>field_manager_mod</td>
43 ! <td>MODEL_ATMOS</td>
44 ! </tr>
45 ! <tr>
46 ! <td>fms_mod</td>
47 ! <td>write_version_number, open_namelist_file,
48 ! check_nml_error, close_file, file_exist</td>
49 ! </tr>
50 ! <tr>
51 ! <td>fv_arrays_mod</td>
52 ! <td>fv_atmos_type, allocate_fv_atmos_type, deallocate_fv_atmos_type,
53 ! R_GRID</td>
54 ! </tr>
55 ! <tr>
56 ! <td>fv_diagnostics_mod</td>
57 ! <td>fv_diag_init_gn</td>
58 ! </tr>
59 ! <tr>
60 ! <td>fv_eta_mod</td>
61 ! <td>set_eta</td>
62 ! </tr>
63 ! <tr>
64 ! <td>fv_grid_tools_mod</td>
65 ! <td>init_grid</td>
66 ! </tr>
67 ! <tr>
68 ! <td>fv_grid_utils_mod</td>
69 ! <td>grid_utils_init, grid_utils_end, ptop_min</td>
70 ! </tr>
71 ! <tr>
72 ! <td>fv_mp_mod</td>
73 ! <td>mp_start, mp_assign_gid, domain_decomp,ng, switch_current_Atm,
74 ! broadcast_domains, mp_barrier, is_master, setup_master </td>
75 ! </tr>
76 ! <tr>
77 ! <td>fv_io_mod</td>
78 ! <td>fv_io_exit</td>
79 ! </tr>
80 ! <tr>
81 ! <td>fv_restart_mod</td>
82 ! <td>fv_restart_init, fv_restart_end</td>
83 ! </tr>
84 ! <tr>
85 ! <td>fv_timing_mod</td>
86 ! <td>timing_on, timing_off, timing_init, timing_prt</td>
87 ! </tr>
88 ! <tr>
89 ! <td>mpp_mod</td>
90 ! <td>mpp_send, mpp_sync, mpp_transmit, mpp_set_current_pelist, mpp_declare_pelist,
91 ! mpp_root_pe, mpp_recv, mpp_sync_self, mpp_broadcast, read_input_nml,
92 ! FATAL, mpp_error, mpp_pe, stdlog, mpp_npes, mpp_get_current_pelist,
93 ! input_nml_file, get_unit, WARNING, read_ascii_file, INPUT_STR_LENGTH</td>
94 ! </tr>
95 ! <tr>
96 ! <td>mpp_domains_mod</td>
97 ! <td>mpp_get_data_domain, mpp_get_compute_domain, domain2D, mpp_define_nest_domains,
98 ! nest_domain_type, mpp_get_global_domain, mpp_get_C2F_index, mpp_get_F2C_index,
99 ! mpp_broadcast_domain, CENTER, CORNER, NORTH, EAST, WEST, SOUTH</td>
100 ! </tr>
101 ! <tr>
102 ! <td>mpp_parameter_mod</td>
103 ! <td>AGRID_PARAM=>AGRID</td>
104 ! </tr>
105 ! <tr>
106 ! <td>test_cases_mod</td>
107 ! <td>test_case, bubble_do, alpha, nsolitons, soliton_Umax, soliton_size</td>
108 ! </tr>
109 ! <tr>
110 ! <td>tracer_manager_mod</td>
111 ! <td>tm_get_number_tracers => get_number_tracers,tm_get_tracer_index => get_tracer_index,
112 ! tm_get_tracer_indices => get_tracer_indices, tm_set_tracer_profile => set_tracer_profile,
113 ! tm_get_tracer_names => get_tracer_names,tm_check_if_prognostic=> check_if_prognostic,
114 ! tm_register_tracers => register_tracers</td>
115 ! </tr>
116 ! </table>
117 
118  use constants_mod, only: pi=>pi_8, kappa, radius, grav, rdgas
119  use field_manager_mod, only: model_atmos
120  use fms_mod, only: write_version_number, open_namelist_file, &
121  check_nml_error, close_file, file_exist
122  use mpp_mod, only: fatal, mpp_error, mpp_pe, stdlog, &
123  mpp_npes, mpp_get_current_pelist, &
124  input_nml_file, get_unit, warning, &
125  read_ascii_file, input_str_length
126  use mpp_domains_mod, only: mpp_get_data_domain, mpp_get_compute_domain
127  use tracer_manager_mod, only: tm_get_number_tracers => get_number_tracers, &
128  tm_get_tracer_index => get_tracer_index, &
129  tm_get_tracer_indices => get_tracer_indices, &
130  tm_set_tracer_profile => set_tracer_profile, &
131  tm_get_tracer_names => get_tracer_names, &
132  tm_check_if_prognostic=> check_if_prognostic,&
133  tm_register_tracers => register_tracers
134 
135  use fv_io_mod, only: fv_io_exit
138  r_grid
140  use fv_eta_mod, only: set_eta
141  use fv_grid_tools_mod, only: init_grid
142  use fv_mp_mod, only: mp_start, mp_assign_gid, domain_decomp
143  use fv_mp_mod, only: ng, switch_current_atm
144  use fv_mp_mod, only: broadcast_domains, mp_barrier, is_master, setup_master
145 !!! CLEANUP: should be replaced by a getter function?
148  use mpp_domains_mod, only: domain2d
149  use mpp_domains_mod, only: mpp_define_nest_domains, nest_domain_type, mpp_get_global_domain
150  use mpp_domains_mod, only: mpp_get_c2f_index, mpp_get_f2c_index, mpp_broadcast_domain
151  use mpp_domains_mod, only: center, corner, north, east, west, south
152  use mpp_mod, only: mpp_send, mpp_sync, mpp_transmit, mpp_set_current_pelist, mpp_declare_pelist, mpp_root_pe, mpp_recv, mpp_sync_self, mpp_broadcast, read_input_nml
154 
155 #ifdef MULTI_GASES
156  use constants_mod, only: rvgas, cp_air
157  use multi_gases_mod, only: multi_gases_init, &
158  rilist => ri, &
159  cpilist => cpi
160 #endif
161 
162  implicit none
163  private
164 
165 !-----------------------------------------------------------------------
166 ! Grid descriptor file setup
167 !-----------------------------------------------------------------------
168 !------------------------------------------
169 ! Model Domain parameters
170 ! See fv_arrays.F90 for descriptions
171 !------------------------------------------
172 !CLEANUP module pointers
173  character(len=80) , pointer :: grid_name
174  character(len=120), pointer :: grid_file
175  integer, pointer :: grid_type
176  integer , pointer :: hord_mt
177  integer , pointer :: kord_mt
178  integer , pointer :: kord_wz
179  integer , pointer :: hord_vt
180  integer , pointer :: hord_tm
181  integer , pointer :: hord_dp
182  integer , pointer :: kord_tm
183  integer , pointer :: hord_tr
184  integer , pointer :: kord_tr
185  real , pointer :: scale_z
186  real , pointer :: w_max
187  real , pointer :: z_min
188  real , pointer :: lim_fac
189 
190  integer , pointer :: nord
191  integer , pointer :: nord_tr
192  real , pointer :: dddmp
193  real , pointer :: d2_bg
194  real , pointer :: d4_bg
195  real , pointer :: vtdm4
196  real , pointer :: trdm2
197  real , pointer :: d2_bg_k1
198  real , pointer :: d2_bg_k2
199  real , pointer :: d2_divg_max_k1
200  real , pointer :: d2_divg_max_k2
201  real , pointer :: damp_k_k1
202  real , pointer :: damp_k_k2
203  integer , pointer :: n_zs_filter
204  integer , pointer :: nord_zs_filter
205  logical , pointer :: full_zs_filter
206 
207  logical , pointer :: rf_fast
208  logical , pointer :: consv_am
209  logical , pointer :: do_sat_adj
210  logical , pointer :: do_f3d
211  logical , pointer :: no_dycore
212  logical , pointer :: convert_ke
213  logical , pointer :: do_vort_damp
214  logical , pointer :: use_old_omega
215 ! PG off centering:
216  real , pointer :: beta
217  integer , pointer :: n_sponge
218  real , pointer :: d_ext
219  integer , pointer :: nwat
220  logical , pointer :: warm_start
221  logical , pointer :: inline_q
222  real , pointer :: shift_fac
223  logical , pointer :: do_schmidt
224  real(kind=R_GRID) , pointer :: stretch_fac
225  real(kind=R_GRID) , pointer :: target_lat
226  real(kind=R_GRID) , pointer :: target_lon
227 
228  logical , pointer :: reset_eta
229  real , pointer :: p_fac
230  real , pointer :: a_imp
231  integer , pointer :: n_split
232 
233  real , pointer :: fac_n_spl
234  real , pointer :: fhouri
235  ! Default
236  integer , pointer :: m_split
237  integer , pointer :: k_split
238  logical , pointer :: use_logp
239 
240  integer , pointer :: q_split
241  integer , pointer :: print_freq
242  logical , pointer :: write_3d_diags
243 
244  integer , pointer :: npx
245  integer , pointer :: npy
246  integer , pointer :: npz
247  integer , pointer :: npz_rst
248 
249  integer , pointer :: ncnst
250  integer , pointer :: pnats
251  integer , pointer :: dnats
252  integer , pointer :: ntiles
253  integer , pointer :: nf_omega
254  integer , pointer :: fv_sg_adj
255 
256  integer , pointer :: na_init
257  logical , pointer :: nudge_dz
258  real , pointer :: p_ref
259  real , pointer :: dry_mass
260  integer , pointer :: nt_prog
261  integer , pointer :: nt_phys
262  real , pointer :: tau_h2o
263 
264  real , pointer :: delt_max
265  real , pointer :: d_con
266  real , pointer :: ke_bg
267  real , pointer :: consv_te
268  real , pointer :: tau
269  real , pointer :: rf_cutoff
270  logical , pointer :: filter_phys
271  logical , pointer :: dwind_2d
272  logical , pointer :: breed_vortex_inline
273  logical , pointer :: range_warn
274  logical , pointer :: fill
275  logical , pointer :: fill_dp
276  logical , pointer :: fill_wz
277  logical , pointer :: check_negative
278  logical , pointer :: non_ortho
279  logical , pointer :: adiabatic
280  logical , pointer :: moist_phys
281  logical , pointer :: do_held_suarez
282  logical , pointer :: do_reed_physics
283  logical , pointer :: reed_cond_only
284  logical , pointer :: reproduce_sum
285  logical , pointer :: adjust_dry_mass
286  logical , pointer :: fv_debug
287  logical , pointer :: srf_init
288  logical , pointer :: mountain
289  logical , pointer :: remap_t
290  logical , pointer :: z_tracer
291 
292  logical , pointer :: old_divg_damp
293  logical , pointer :: fv_land
294  logical , pointer :: nudge
295  logical , pointer :: nudge_ic
296  logical , pointer :: ncep_ic
297  logical , pointer :: nggps_ic
298  logical , pointer :: ecmwf_ic
299  logical , pointer :: gfs_phil
300  logical , pointer :: agrid_vel_rst
301  logical , pointer :: use_new_ncep
302  logical , pointer :: use_ncep_phy
303  logical , pointer :: fv_diag_ic
304  logical , pointer :: external_ic
305  logical , pointer :: external_eta
306  logical , pointer :: read_increment
307  character(len=128) , pointer :: res_latlon_dynamics
308  character(len=128) , pointer :: res_latlon_tracers
309  logical , pointer :: hydrostatic
310  logical , pointer :: phys_hydrostatic
311  logical , pointer :: use_hydro_pressure
312  logical , pointer :: do_uni_zfull !miz
313  logical , pointer :: adj_mass_vmr ! f1p
314  logical , pointer :: hybrid_z
315  logical , pointer :: make_nh
316  logical , pointer :: make_hybrid_z
317  logical , pointer :: nudge_qv
318  real, pointer :: add_noise
319 
320  integer , pointer :: a2b_ord
321  integer , pointer :: c2l_ord
322 
323  integer, pointer :: ndims
324 
325  real(kind=R_GRID), pointer :: dx_const
326  real(kind=R_GRID), pointer :: dy_const
327  real(kind=R_GRID), pointer :: deglon_start, deglon_stop, & ! boundaries of latlon patch
329  real(kind=R_GRID), pointer :: deglat
330 
331  logical, pointer :: nested, twowaynest
332  logical, pointer :: regional
333  integer, pointer :: bc_update_interval
335  real, pointer :: s_weight, update_blend
336 
337  integer, pointer :: layout(:), io_layout(:)
338 
339  integer :: ntilesme ! Number of tiles on this process =1 for now
340 
341 #ifdef OVERLOAD_R4
342  real :: too_big = 1.e8
343 #else
344  real :: too_big = 1.e35
345 #endif
346  public :: fv_init, fv_end
347 
348  integer, public :: ngrids = 1
349  integer, public, allocatable :: pelist_all(:)
351  integer :: gid
352 
353  real :: umax = 350.
354  integer :: parent_grid_num = -1
355 
356  integer :: halo_update_type = 1
359 
360 
361 
362 ! version number of this module
363 ! Include variable "version" to be written to log file.
364 #include<file_version.h>
365 
366  contains
367 
368 !-------------------------------------------------------------------------------
372  subroutine fv_init(Atm, dt_atmos, grids_on_this_pe, p_split)
374  type(fv_atmos_type), allocatable, intent(inout), target :: Atm(:)
375  real, intent(in) :: dt_atmos
376  logical, allocatable, intent(INOUT) :: grids_on_this_pe(:)
377  integer, intent(INOUT) :: p_split
378 
379  integer :: i, j, k, n, p
380  real :: sdt
381 
382 ! tracers
383  integer :: num_family
384 
385  integer :: isc_p, iec_p, jsc_p, jec_p, isg, ieg, jsg, jeg, upoff, jind
386  integer :: ic, jc
387 
388  gid = mpp_pe()
389  call init_nesting(atm, grids_on_this_pe, p_split)
390 
391  !This call is needed to set up the pointers for fv_current_grid, even for a single-grid run
392  !call switch_current_Atm(Atm(1), .false.)
393  call setup_pointers(atm(1))
394 
395 ! Start up MPI
396 
397  !call mp_assign_gid
398 
399  ! Initialize timing routines
400  call timing_init
401  call timing_on('TOTAL')
402 
403  ! Setup the run from namelist
404  ntilesme = size(atm(:)) !Full number of Atm arrays; one less than number of grids, if multiple grids
405 
406  call run_setup(atm,dt_atmos, grids_on_this_pe, p_split) ! initializes domain_decomp
407 
408  do n=1,ntilesme
409 
410  !In a single-grid run this will still be needed to correctly set the domain
411  call switch_current_atm(atm(n))
412  call setup_pointers(atm(n))
413 
414  target_lon = target_lon * pi/180.
415  target_lat = target_lat * pi/180.
416 
417 !--------------------------------------------------
418 ! override number of tracers by reading field_table
419 !--------------------------------------------------
420 
421  !not sure if this works with multiple grids
422  call tm_register_tracers (model_atmos, ncnst, nt_prog, pnats, num_family)
423  if(is_master()) then
424  write(*,*) 'ncnst=', ncnst,' num_prog=',nt_prog,' pnats=',pnats,' dnats=',dnats,' num_family=',num_family
425  print*, ''
426  endif
427 
428  if (grids_on_this_pe(n)) then
429  call allocate_fv_atmos_type(atm(n), atm(n)%bd%isd, atm(n)%bd%ied, atm(n)%bd%jsd, atm(n)%bd%jed, &
430  atm(n)%bd%isc, atm(n)%bd%iec, atm(n)%bd%jsc, atm(n)%bd%jec, &
431  npx, npy, npz, ndims, ncnst, ncnst-pnats, ng, .false., grids_on_this_pe(n), ngrids)
432 
433  if (grids_on_this_pe(n)) then
434 
435  call switch_current_atm(atm(n))
436  call setup_pointers(atm(n))
437 
438  if ( (atm(n)%bd%iec-atm(n)%bd%isc+1).lt.4 .or. (atm(n)%bd%jec-atm(n)%bd%jsc+1).lt.4 ) then
439  if (is_master()) write(*,'(6I6)') atm(n)%bd%isc, atm(n)%bd%iec, atm(n)%bd%jsc, atm(n)%bd%jec, n
440  call mpp_error(fatal,'Domain Decomposition: Cubed Sphere compute domain has a &
441  &minium requirement of 4 points in X and Y, respectively')
442  end if
443 
444  endif
445 
446  !!CLEANUP: Convenience pointers
447  atm(n)%gridstruct%nested => atm(n)%neststruct%nested
448  atm(n)%gridstruct%grid_type => atm(n)%flagstruct%grid_type
449  atm(n)%flagstruct%grid_number => atm(n)%grid_number
450  atm(n)%gridstruct%regional => atm(n)%flagstruct%regional
451 
452  call init_grid(atm(n), grid_name, grid_file, npx, npy, npz, ndims, ntiles, ng)
453 
454  ! Initialize the SW (2D) part of the model
455  !!!CLEANUP: this call could definitely use some cleaning up
457 
458  !!!CLEANUP: Are these correctly writing out on all pes?
459  if ( is_master() ) then
460  sdt = dt_atmos/real(n_split*k_split*abs(p_split))
461  write(*,*) ' '
462  write(*,*) 'Divergence damping Coefficients'
463  write(*,*) 'For small dt=', sdt
464  write(*,*) 'External mode del-2 (m**2/s)=', d_ext*atm(n)%gridstruct%da_min_c/sdt
465  write(*,*) 'Internal mode del-2 SMAG dimensionless coeff=', dddmp
466  write(*,*) 'Internal mode del-2 background diff=', d2_bg*atm(n)%gridstruct%da_min_c/sdt
467 
468  if (nord==1) then
469  write(*,*) 'Internal mode del-4 background diff=', d4_bg
470  write(*,*) 'Vorticity del-4 (m**4/s)=', (vtdm4*atm(n)%gridstruct%da_min)**2/sdt*1.e-6
471  endif
472  if (nord==2) write(*,*) 'Internal mode del-6 background diff=', d4_bg
473  if (nord==3) write(*,*) 'Internal mode del-8 background diff=', d4_bg
474  write(*,*) 'tracer del-2 diff=', trdm2
475 
476  write(*,*) 'Vorticity del-4 (m**4/s)=', (vtdm4*atm(n)%gridstruct%da_min)**2/sdt*1.e-6
477  write(*,*) 'beta=', beta
478  write(*,*) ' '
479  endif
480 
481 
482  atm(n)%ts = 300.
483  atm(n)%phis = too_big
484  ! The following statements are to prevent the phatom corner regions from
485  ! growing instability
486  atm(n)%u = 0.
487  atm(n)%v = 0.
488  atm(n)%ua = too_big
489  atm(n)%va = too_big
490 
491  else !this grid is NOT defined on this pe
492 
493  !Allocate dummy arrays
494  call allocate_fv_atmos_type(atm(n), atm(n)%bd%isd, atm(n)%bd%ied, atm(n)%bd%jsd, atm(n)%bd%jed, &
495  atm(n)%bd%isc, atm(n)%bd%iec, atm(n)%bd%jsc, atm(n)%bd%jec, &
496  npx, npy, npz, ndims, ncnst, ncnst-pnats, ng, .true., .false., ngrids)
497 
498  !Need to SEND grid_global to any child grids; this is received in setup_aligned_nest in fv_grid_tools
499  if (atm(n)%neststruct%nested) then
500 
501  call mpp_get_global_domain( atm(n)%parent_grid%domain, &
502  isg, ieg, jsg, jeg)
503 
504  !FIXME: Should replace this by generating the global grid (or at least one face thereof) on the
505  ! nested PEs instead of sending it around.
506  if (gid == atm(n)%parent_grid%pelist(1)) then
507  call mpp_send(atm(n)%parent_grid%grid_global(isg-ng:ieg+1+ng,jsg-ng:jeg+1+ng,1:2,parent_tile), &
508  size(atm(n)%parent_grid%grid_global(isg-ng:ieg+1+ng,jsg-ng:jeg+1+ng,1:2,parent_tile)), &
509  atm(n)%pelist(1)) !send to p_ind in setup_aligned_nest
510  call mpp_sync_self()
511  endif
512 
513  if (atm(n)%neststruct%twowaynest) then
514 
515  !This in reality should be very simple. With the
516  ! restriction that only the compute domain data is
517  ! sent from the coarse grid, we can compute
518  ! exactly which coarse grid cells should use
519  ! which nested-grid data. We then don't need to send around p_ind.
520 
521  atm(n)%neststruct%ind_update_h = -99999
522 
523  if (atm(n)%parent_grid%tile == atm(n)%neststruct%parent_tile) then
524 
525  isc_p = atm(n)%parent_grid%bd%isc
526  iec_p = atm(n)%parent_grid%bd%iec
527  jsc_p = atm(n)%parent_grid%bd%jsc
528  jec_p = atm(n)%parent_grid%bd%jec
529  upoff = atm(n)%neststruct%upoff
530 
531  atm(n)%neststruct%jsu = jsc_p
532  atm(n)%neststruct%jeu = jsc_p-1
533  do j=jsc_p,jec_p+1
534  if (j < joffset+upoff) then
535  do i=isc_p,iec_p+1
536  atm(n)%neststruct%ind_update_h(i,j,2) = -9999
537  enddo
538  atm(n)%neststruct%jsu = atm(n)%neststruct%jsu + 1
539  elseif (j > joffset + (npy-1)/refinement - upoff) then
540  do i=isc_p,iec_p+1
541  atm(n)%neststruct%ind_update_h(i,j,2) = -9999
542  enddo
543  else
544  jind = (j - joffset)*refinement + 1
545  do i=isc_p,iec_p+1
546  atm(n)%neststruct%ind_update_h(i,j,2) = jind
547  enddo
548  if ( (j < joffset + (npy-1)/refinement - upoff) .and. j <= jec_p) atm(n)%neststruct%jeu = j
549  endif
550  !write(mpp_pe()+4000,*) j, joffset, upoff, Atm(n)%neststruct%ind_update_h(isc_p,j,2)
551  enddo
552 
553  atm(n)%neststruct%isu = isc_p
554  atm(n)%neststruct%ieu = isc_p-1
555  do i=isc_p,iec_p+1
556  if (i < ioffset+upoff) then
557  atm(n)%neststruct%ind_update_h(i,:,1) = -9999
558  atm(n)%neststruct%isu = atm(n)%neststruct%isu + 1
559  elseif (i > ioffset + (npx-1)/refinement - upoff) then
560  atm(n)%neststruct%ind_update_h(i,:,1) = -9999
561  else
562  atm(n)%neststruct%ind_update_h(i,:,1) = (i-ioffset)*refinement + 1
563  if ( (i < ioffset + (npx-1)/refinement - upoff) .and. i <= iec_p) atm(n)%neststruct%ieu = i
564  end if
565  !write(mpp_pe()+5000,*) i, ioffset, upoff, Atm(n)%neststruct%ind_update_h(i,jsc_p,1)
566  enddo
567 
568  end if
569 
570 
571  end if
572 
573  endif
574  endif
575  end do
576 
577  ! Initialize restart functions
578  call fv_restart_init()
579 
580 ! if ( reset_eta ) then
581 ! do n=1, ntilesMe
582 ! call set_eta(npz, Atm(n)%ks, ptop, Atm(n)%ak, Atm(n)%bk)
583 ! enddo
584 ! if(is_master()) write(*,*) "Hybrid sigma-p coordinate has been reset"
585 ! endif
586 
587  if (ntilesme > 1) call switch_current_atm(atm(1))
588  if (ntilesme > 1) call setup_pointers(atm(1))
589 
590  end subroutine fv_init
591 !-------------------------------------------------------------------------------
592 
595  subroutine fv_end(Atm, grids_on_this_pe)
597  type(fv_atmos_type), intent(inout) :: Atm(:)
598  logical, intent(INOUT) :: grids_on_this_pe(:)
599 
600  integer :: n
601 
602  call timing_off('TOTAL')
603  call timing_prt( gid )
604 
605  call fv_restart_end(atm, grids_on_this_pe)
606  call fv_io_exit()
607 
608  ! Free temporary memory from sw_core routines
609 
610  ! Deallocate
611  call grid_utils_end
612 
613  do n = 1, ntilesme
614  call deallocate_fv_atmos_type(atm(n))
615  end do
616 
617 
618  end subroutine fv_end
619 !-------------------------------------------------------------------------------
620 
622  subroutine run_setup(Atm, dt_atmos, grids_on_this_pe, p_split)
623  type(fv_atmos_type), intent(inout), target :: Atm(:)
624  real, intent(in) :: dt_atmos
625  logical, intent(INOUT) :: grids_on_this_pe(:)
626  integer, intent(INOUT) :: p_split
627  !--- local variables ---
628  character(len=80) :: tracerName, errString
629  character(len=32) :: nested_grid_filename
630  integer :: ios, ierr, f_unit, unit
631  logical :: exists
632 
633  real :: dim0 = 180.
634  real :: dt0 = 1800.
635  real :: ns0 = 5.
637  !real :: umax = 350. ! max wave speed for grid_type>3 ! Now defined above
638  real :: dimx, dl, dp, dxmin, dymin, d_fac
639 
640  integer :: n0split
641  integer :: n, nn, i
642 
643  integer :: pe_counter
644 
645 ! local version of these variables to allow PGI compiler to compile
646  character(len=128) :: res_latlon_dynamics = ''
647  character(len=128) :: res_latlon_tracers = ''
648  character(len=80) :: grid_name = ''
649  character(len=120) :: grid_file = ''
667 
771 
982  namelist /fv_grid_nml/ grid_name, grid_file
983  namelist /fv_core_nml/npx, npy, ntiles, npz, npz_rst, layout, io_layout, ncnst, nwat, &
988  external_eta, res_latlon_dynamics, res_latlon_tracers, scale_z, w_max, z_min, lim_fac, &
1004 
1005  namelist /test_case_nml/test_case, bubble_do, alpha, nsolitons, soliton_umax, soliton_size
1006 #ifdef MULTI_GASES
1007  namelist /multi_gases_nml/ rilist,cpilist
1008 #endif
1009 
1010 
1011  pe_counter = mpp_root_pe()
1012 
1013 ! Make alpha = 0 the default:
1014  alpha = 0.
1015  bubble_do = .false.
1016  test_case = 11 ! (USGS terrain)
1017 
1018 #ifdef INTERNAL_FILE_NML
1019 ! Read Main namelist
1020  read (input_nml_file,fv_grid_nml,iostat=ios)
1021  ierr = check_nml_error(ios,'fv_grid_nml')
1022 #else
1023  f_unit=open_namelist_file()
1024  rewind(f_unit)
1025 ! Read Main namelist
1026  read (f_unit,fv_grid_nml,iostat=ios)
1027  ierr = check_nml_error(ios,'fv_grid_nml')
1028  call close_file(f_unit)
1029 #endif
1030 
1031  call write_version_number ( 'FV_CONTROL_MOD', version )
1032  unit = stdlog()
1033  write(unit, nml=fv_grid_nml)
1034 
1035  do n=1,size(atm)
1036 
1037  call switch_current_atm(atm(n), .false.)
1038  call setup_pointers(atm(n))
1039  atm(n)%grid_number = n
1040  if (grids_on_this_pe(n)) then
1041  call fv_diag_init_gn(atm(n))
1042  endif
1043 
1044 #ifdef INTERNAL_FILE_NML
1045  ! Set input_file_nml for correct parent/nest initialization
1046  if (n > 1) then
1047  write(nested_grid_filename,'(A4, I2.2)') 'nest', n
1048  call read_input_nml(nested_grid_filename)
1049  endif
1050  ! Read FVCORE namelist
1051  read (input_nml_file,fv_core_nml,iostat=ios)
1052  ierr = check_nml_error(ios,'fv_core_nml')
1053 #ifdef MULTI_GASES
1054  if( is_master() ) print *,' enter multi_gases: ncnst = ',ncnst
1055  allocate (rilist(0:ncnst))
1056  allocate (cpilist(0:ncnst))
1057  rilist = 0.0
1058  cpilist = 0.0
1059  rilist(0) = rdgas
1060  rilist(1) = rvgas
1061  cpilist(0) = cp_air
1062  cpilist(1) = 4*cp_air
1063  ! Read multi_gases namelist
1064  read (input_nml_file,multi_gases_nml,iostat=ios)
1065  ierr = check_nml_error(ios,'multi_gases_nml')
1066 #endif
1067  ! Read Test_Case namelist
1068  read (input_nml_file,test_case_nml,iostat=ios)
1069  ierr = check_nml_error(ios,'test_case_nml')
1070 
1071  ! Reset input_file_nml to default behavior
1072  call read_input_nml
1073 #else
1074  if (size(atm) == 1) then
1075  f_unit = open_namelist_file()
1076  else if (n == 1) then
1077  f_unit = open_namelist_file('input.nml')
1078  else
1079  write(nested_grid_filename,'(A10, I2.2, A4)') 'input_nest', n, '.nml'
1080  f_unit = open_namelist_file(nested_grid_filename)
1081  endif
1082 
1083  ! Read FVCORE namelist
1084  read (f_unit,fv_core_nml,iostat=ios)
1085  ierr = check_nml_error(ios,'fv_core_nml')
1086 
1087 #ifdef MULTI_GASES
1088  if( is_master() ) print *,' enter multi_gases: ncnst = ',ncnst
1089  allocate (rilist(0:ncnst))
1090  allocate (cpilist(0:ncnst))
1091  rilist = 0.0
1092  cpilist = 0.0
1093  rilist(0) = rdgas
1094  rilist(1) = rvgas
1095  cpilist(0) = cp_air
1096  cpilist(1) = 4*cp_air
1097  ! Read multi_gases namelist
1098  rewind(f_unit)
1099  read (f_unit,multi_gases_nml,iostat=ios)
1100  ierr = check_nml_error(ios,'multi_gases_nml')
1101 #endif
1102  ! Read Test_Case namelist
1103  rewind(f_unit)
1104  read (f_unit,test_case_nml,iostat=ios)
1105  ierr = check_nml_error(ios,'test_case_nml')
1106  call close_file(f_unit)
1107 #endif
1108  write(unit, nml=fv_core_nml)
1109  write(unit, nml=test_case_nml)
1110 #ifdef MULTI_GASES
1111  write(unit, nml=multi_gases_nml)
1113 #endif
1114 
1115  if (len_trim(grid_file) /= 0) atm(n)%flagstruct%grid_file = grid_file
1116  if (len_trim(grid_name) /= 0) atm(n)%flagstruct%grid_name = grid_name
1117  if (len_trim(res_latlon_dynamics) /= 0) atm(n)%flagstruct%res_latlon_dynamics = res_latlon_dynamics
1118  if (len_trim(res_latlon_tracers) /= 0) atm(n)%flagstruct%res_latlon_tracers = res_latlon_tracers
1119 
1120  !*** single tile for Cartesian grids
1121  if (grid_type>3) then
1122  ntiles=1
1123  non_ortho = .false.
1124  nf_omega = 0
1125  endif
1126 
1127  if (.not. (nested .or. regional)) atm(n)%neststruct%npx_global = npx
1128 
1129  ! Define n_split if not in namelist
1130  if (ntiles == 6) then
1131  dimx = 4.0*(npx-1)
1132  if ( hydrostatic ) then
1133  if ( npx >= 120 ) ns0 = 6
1134  else
1135  if ( npx <= 45 ) then
1136  ns0 = 6
1137  elseif ( npx <= 90 ) then
1138  ns0 = 7
1139  else
1140  ns0 = 8
1141  endif
1142  endif
1143  else
1144  dimx = max( npx, 2*(npy-1) )
1145  endif
1146 
1147  if (grid_type < 4) then
1148  n0split = nint( ns0*abs(dt_atmos)*dimx/(dt0*dim0) + 0.49 )
1149  elseif (grid_type == 4 .or. grid_type == 7) then
1150  n0split = nint( 2.*umax*dt_atmos/sqrt(dx_const**2 + dy_const**2) + 0.49 )
1151  elseif (grid_type == 5 .or. grid_type == 6) then
1152  if (grid_type == 6) then
1153  deglon_start = 0.; deglon_stop = 360.
1154  endif
1155  dl = (deglon_stop-deglon_start)*pi/(180.*(npx-1))
1156  dp = (deglat_stop-deglat_start)*pi/(180.*(npy-1))
1157 
1158  dxmin=dl*radius*min(cos(deglat_start*pi/180.-ng*dp), &
1159  cos(deglat_stop *pi/180.+ng*dp))
1160  dymin=dp*radius
1161  n0split = nint( 2.*umax*dt_atmos/sqrt(dxmin**2 + dymin**2) + 0.49 )
1162  endif
1163  n0split = max( 1, n0split )
1164 
1165  if ( n_split == 0 ) then
1166  n_split = nint( real(n0split)/real(k_split*abs(p_split)) * stretch_fac + 0.5 )
1167  if(is_master()) write(*,*) 'For k_split (remapping)=', k_split
1168  if(is_master()) write(*,198) 'n_split is set to ', n_split, ' for resolution-dt=',npx,npy,ntiles,dt_atmos
1169  else
1170  if(is_master()) write(*,199) 'Using n_split from the namelist: ', n_split
1171  endif
1172  if (is_master() .and. n == 1 .and. abs(p_split) > 1) then
1173  write(*,199) 'Using p_split = ', p_split
1174  endif
1175 
1176  if (atm(n)%neststruct%nested) then
1177  do i=1,n-1
1178  if (atm(i)%grid_number == parent_grid_num) then
1179  atm(n)%parent_grid => atm(i)
1180  exit
1181  end if
1182  end do
1183  if (.not. associated(atm(n)%parent_grid)) then
1184  write(errstring,'(2(A,I3))') "Could not find parent grid #", parent_grid_num, ' for grid #', n
1185  call mpp_error(fatal, errstring)
1186  end if
1187 
1188  !Note that if a gnomonic grid has a parent it is a NESTED gnomonic grid and therefore only has one tile
1189  if ( atm(n)%parent_grid%flagstruct%grid_type < 3 .and. &
1190  .not. associated(atm(n)%parent_grid%parent_grid)) then
1191  if (parent_tile > 6 .or. parent_tile < 1) then
1192  call mpp_error(fatal, 'parent tile must be between 1 and 6 if the parent is a cubed-sphere grid')
1193  end if
1194  else
1195  if (parent_tile /= 1) then
1196  call mpp_error(fatal, 'parent tile must be 1 if the parent is not a cubed-sphere grid')
1197  end if
1198  end if
1199 
1200  if ( refinement < 1 ) call mpp_error(fatal, 'grid refinement must be positive')
1201 
1202  if (nestupdate == 1 .or. nestupdate == 2) then
1203 
1204  if (mod(npx-1,refinement) /= 0 .or. mod(npy-1,refinement) /= 0) then
1205  call mpp_error(warning, 'npx-1 or npy-1 is not evenly divisible by the refinement ratio; averaging update cannot be mass-conservative.')
1206  end if
1207 
1208  end if
1209 
1210  if ( consv_te > 0.) then
1211  call mpp_error(fatal, 'The global energy fixer cannot be used on a nested grid. consv_te must be set to 0.')
1212  end if
1213 
1214  atm(n)%neststruct%refinement_of_global = atm(n)%neststruct%refinement * atm(n)%parent_grid%neststruct%refinement_of_global
1215  max_refinement_of_global = max(atm(n)%neststruct%refinement_of_global,max_refinement_of_global)
1216  atm(n)%neststruct%npx_global = atm(n)%neststruct%refinement * atm(n)%parent_grid%neststruct%npx_global
1217 
1218  else
1219  atm(n)%neststruct%ioffset = -999
1220  atm(n)%neststruct%joffset = -999
1221  atm(n)%neststruct%parent_tile = -1
1222  atm(n)%neststruct%refinement = -1
1223  end if
1224 
1225  if (atm(n)%neststruct%nested) then
1226  if (atm(n)%flagstruct%grid_type >= 4 .and. atm(n)%parent_grid%flagstruct%grid_type >= 4) then
1227  atm(n)%flagstruct%dx_const = atm(n)%parent_grid%flagstruct%dx_const / real(atm(n)%neststruct%refinement)
1228  atm(n)%flagstruct%dy_const = atm(n)%parent_grid%flagstruct%dy_const / real(atm(n)%neststruct%refinement)
1229  end if
1230  end if
1231 
1232 
1233 !----------------------------------------
1234 ! Adjust divergence damping coefficients:
1235 !----------------------------------------
1236 ! d_fac = real(n0split)/real(n_split)
1237 ! dddmp = dddmp * d_fac
1238 ! d2_bg = d2_bg * d_fac
1239 ! d4_bg = d4_bg * d_fac
1240 ! d_ext = d_ext * d_fac
1241 ! vtdm4 = vtdm4 * d_fac
1242  if (old_divg_damp) then
1243  if (is_master()) write(*,*) " fv_control: using original values for divergence damping "
1244  d2_bg_k1 = 6. ! factor for d2_bg (k=1) - default(4.)
1245  d2_bg_k2 = 4. ! factor for d2_bg (k=2) - default(2.)
1246  d2_divg_max_k1 = 0.02 ! d2_divg max value (k=1) - default(0.05)
1247  d2_divg_max_k2 = 0.01 ! d2_divg max value (k=2) - default(0.02)
1248  damp_k_k1 = 0. ! damp_k value (k=1) - default(0.05)
1249  damp_k_k2 = 0. ! damp_k value (k=2) - default(0.025)
1250  elseif (n_sponge == 0 ) then
1251  if ( d2_bg_k1 > 1. ) d2_bg_k1 = 0.20
1252  if ( d2_bg_k2 > 1. ) d2_bg_k2 = 0.015
1253  endif
1254 
1255 ! if ( beta < 1.e-5 ) beta = 0. ! beta < 0 is used for non-hydrostatic "one_grad_p"
1256 
1257  if ( .not.hydrostatic ) then
1258  if ( m_split==0 ) then
1259  m_split = 1. + abs(dt_atmos)/real(k_split*n_split*abs(p_split))
1260  if (abs(a_imp) < 0.5) then
1261  if(is_master()) write(*,199) 'm_split is set to ', m_split
1262  endif
1263  endif
1264  if(is_master()) then
1265  write(*,*) 'Off center implicit scheme param=', a_imp
1266  write(*,*) ' p_fac=', p_fac
1267  endif
1268  endif
1269 
1270  if(is_master()) then
1271  if (n_sponge >= 0) write(*,199) 'Using n_sponge : ', n_sponge
1272  write(*,197) 'Using non_ortho : ', non_ortho
1273  endif
1274 
1275  197 format(a,l7)
1276  198 format(a,i2.2,a,i4.4,'x',i4.4,'x',i1.1,'-',f9.3)
1277  199 format(a,i3.3)
1278 
1279  if (.not. (nested .or. regional)) alpha = alpha*pi
1280 
1281 
1282  allocate(atm(n)%neststruct%child_grids(size(atm)))
1283  atm(n)%neststruct%child_grids = .false.
1284 
1285  !Broadcast data
1286 
1287  !Check layout
1288 
1289  enddo
1290 
1291  !Set pelists
1292  do n=1,size(atm)
1293  if (any(atm(n)%pelist == gid)) then
1294  call mpp_set_current_pelist(atm(n)%pelist)
1295  call mpp_get_current_pelist(atm(n)%pelist, commid=commid)
1296  call mp_start(commid,halo_update_type)
1297  endif
1298 
1299  if (atm(n)%neststruct%nested) then
1300  atm(n)%neststruct%parent_proc = any(atm(n)%parent_grid%pelist == gid)
1301  atm(n)%neststruct%child_proc = any(atm(n)%pelist == gid)
1302  endif
1303  enddo
1304 
1305  do n=1,size(atm)
1306 
1307  call switch_current_atm(atm(n),.false.)
1308  call setup_pointers(atm(n))
1309  !! CLEANUP: WARNING not sure what changes to domain_decomp may cause
1310  call domain_decomp(npx,npy,ntiles,grid_type,nested,atm(n),layout,io_layout)
1311  enddo
1312 
1313  !!! CLEANUP: This sets the pelist to ALL, which is also
1314  !!! required for the define_nest_domains step in the next loop.
1315  !!! Later the pelist must be reset to the 'local' pelist.
1316  call broadcast_domains(atm)
1317 
1318  do n=1,size(atm)
1319  call switch_current_atm(atm(n))
1320  call setup_pointers(atm(n))
1321 
1322  if (nested) then
1323  if (mod(npx-1 , refinement) /= 0 .or. mod(npy-1, refinement) /= 0) &
1324  call mpp_error(fatal, 'npx or npy not an even refinement of its coarse grid.')
1325 
1326  !Pelist needs to be set to ALL (which should have been done
1327  !in broadcast_domains) to get this to work
1328  call mpp_define_nest_domains(atm(n)%neststruct%nest_domain, atm(n)%domain, atm(parent_grid_num)%domain, &
1329  7, parent_tile, &
1330  1, npx-1, 1, npy-1, & !Grid cells, not points
1331  ioffset, ioffset + (npx-1)/refinement - 1, &
1332  joffset, joffset + (npy-1)/refinement - 1, &
1333  (/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
1334  call mpp_define_nest_domains(atm(n)%neststruct%nest_domain, atm(n)%domain, atm(parent_grid_num)%domain, &
1335  7, parent_tile, &
1336  1, npx-1, 1, npy-1, & !Grid cells, not points
1337  ioffset, ioffset + (npx-1)/refinement - 1, &
1338  joffset, joffset + (npy-1)/refinement - 1, &
1339  (/ (i,i=0,mpp_npes()-1) /), extra_halo = 0, name="nest_domain") !What pelist to use?
1340 ! (/ (i,i=0,mpp_npes()-1) /), extra_halo = 2, name="nest_domain_for_BC") !What pelist to use?
1341 
1342  atm(parent_grid_num)%neststruct%child_grids(n) = .true.
1343 
1344  if (atm(n)%neststruct%nestbctype > 1) then
1345 
1346  call mpp_error(fatal, 'nestbctype > 1 not yet implemented')
1347 
1348  !This check is due to a bug which has not yet been identified. Beware.
1349 ! if (Atm(n)%parent_grid%flagstruct%hord_tr == 7) &
1350 ! call mpp_error(FATAL, "Flux-form nested BCs (nestbctype > 1) should not use hord_tr == 7 (on parent grid), since there is no guarantee of tracer mass conservation with this option.")
1351 
1352 !!$ if (Atm(n)%flagstruct%q_split > 0 .and. Atm(n)%parent_grid%flagstruct%q_split > 0) then
1353 !!$ if (mod(Atm(n)%flagstruct%q_split,Atm(n)%parent_grid%flagstruct%q_split) /= 0) call mpp_error(FATAL, &
1354 !!$ "Flux-form nested BCs (nestbctype > 1) require q_split on the nested grid to be evenly divisible by that on the coarse grid.")
1355 !!$ endif
1356 !!$ if (mod((Atm(n)%npx-1),Atm(n)%neststruct%refinement) /= 0 .or. mod((Atm(n)%npy-1),Atm(n)%neststruct%refinement) /= 0) call mpp_error(FATAL, &
1357 !!$ "Flux-form nested BCs (nestbctype > 1) requires npx and npy to be one more than a multiple of the refinement ratio.")
1358 !!$ Atm(n)%parent_grid%neststruct%do_flux_BCs = .true.
1359 !!$ if (Atm(n)%neststruct%nestbctype == 3 .or. Atm(n)%neststruct%nestbctype == 4) Atm(n)%parent_grid%neststruct%do_2way_flux_BCs = .true.
1360  atm(n)%neststruct%upoff = 0
1361  endif
1362 
1363  end if
1364 
1365  do nn=1,size(atm)
1366  if (n == 1) allocate(atm(nn)%neststruct%nest_domain_all(size(atm)))
1367  atm(nn)%neststruct%nest_domain_all(n) = atm(n)%neststruct%nest_domain
1368  enddo
1369 
1370  end do
1371 
1372  do n=1,size(atm)
1373  if (any(atm(n)%pelist == gid)) then
1374  call mpp_set_current_pelist(atm(n)%pelist)
1375  endif
1376  enddo
1377 
1378  end subroutine run_setup
1379  subroutine init_nesting(Atm, grids_on_this_pe, p_split)
1381  type(fv_atmos_type), intent(inout), allocatable :: Atm(:)
1382  logical, allocatable, intent(INOUT) :: grids_on_this_pe(:)
1383  integer, intent(INOUT) :: p_split
1384  character(100) :: pe_list_name
1385  integer :: nest_pes(100)
1386  integer :: n, npes, ntiles, pecounter, i
1387  integer, allocatable :: pelist(:)
1388  integer :: f_unit, ios, ierr
1389 
1390  !This is an OPTIONAL namelist, that needs to be read before everything else
1391  namelist /nest_nml/ ngrids, ntiles, nest_pes, p_split
1392 
1393  call mp_assign_gid
1394 
1395  nest_pes = 0
1396  ntiles = -999
1397 
1398 #ifdef INTERNAL_FILE_NML
1399  read (input_nml_file,nest_nml,iostat=ios)
1400  ierr = check_nml_error(ios,'nest_nml')
1401 #else
1402  f_unit=open_namelist_file()
1403  rewind(f_unit)
1404  read (f_unit,nest_nml,iostat=ios)
1405  ierr = check_nml_error(ios,'nest_nml')
1406  call close_file(f_unit)
1407 #endif
1408 
1409  if (ntiles /= -999) ngrids = ntiles
1410  if (ngrids > 10) call mpp_error(fatal, "More than 10 nested grids not supported")
1411 
1412  allocate(atm(ngrids))
1413 
1414  allocate(grids_on_this_pe(ngrids))
1415  grids_on_this_pe = .false. !initialization
1416 
1417  npes = mpp_npes()
1418 
1419  ! Need to get a global pelist to send data around later?
1420  allocate( pelist_all(npes) )
1421  pelist_all = (/ (i,i=0,npes-1) /)
1422  pelist_all = pelist_all + mpp_root_pe()
1423 
1424  if (ngrids == 1) then
1425 
1426  !Set up the single pelist
1427  allocate(atm(1)%pelist(npes))
1428  atm(1)%pelist = (/(i, i=0, npes-1)/)
1429  atm(1)%pelist = atm(1)%pelist + mpp_root_pe()
1430  call mpp_declare_pelist(atm(1)%pelist)
1431  call mpp_set_current_pelist(atm(1)%pelist)
1432  !Now set in domain_decomp
1433  !masterproc = Atm(1)%pelist(1)
1434  call setup_master(atm(1)%pelist)
1435  grids_on_this_pe(1) = .true.
1436  atm(1)%npes_this_grid = npes
1437 
1438  else
1439 
1440  pecounter = mpp_root_pe()
1441  do n=1,ngrids
1442  if (n == 1) then
1443  pe_list_name = ''
1444  else
1445  write(pe_list_name,'(A4, I2.2)') 'nest', n
1446  endif
1447 
1448  if (nest_pes(n) == 0) then
1449  if (n < ngrids) call mpp_error(fatal, 'Only nest_pes(ngrids) in nest_nml can be zero; preceeding values must be nonzero.')
1450  allocate(atm(n)%pelist(npes-pecounter))
1451  atm(n)%pelist = (/(i, i=pecounter, npes-1)/)
1452  if (n > 1) then
1453  call mpp_declare_pelist(atm(n)%pelist, trim(pe_list_name))
1454  !Make sure nested-grid input file exists
1455  if (.not. file_exist('input_'//trim(pe_list_name)//'.nml')) then
1456  call mpp_error(fatal, "Could not find nested grid namelist input_"//trim(pe_list_name)//".nml")
1457  endif
1458  endif
1459  exit
1460  else
1461  allocate(atm(n)%pelist(nest_pes(n)))
1462  atm(n)%pelist = (/ (i, i=pecounter, pecounter+nest_pes(n)-1) /)
1463  if (atm(n)%pelist(nest_pes(n)) >= npes) then
1464  call mpp_error(fatal, 'PEs assigned by nest_pes in nest_nml exceeds number of available PEs.')
1465  endif
1466 
1467  call mpp_declare_pelist(atm(n)%pelist, trim(pe_list_name))
1468  !Make sure nested-grid input file exists
1469  if (n > 1) then
1470  if (.not. file_exist('input_'//trim(pe_list_name)//'.nml')) then
1471  call mpp_error(fatal, "Could not find nested grid namelist input_"//trim(pe_list_name)//".nml")
1472  endif
1473  endif
1474  pecounter = pecounter+nest_pes(n)
1475  endif
1476  enddo
1477 
1478  !Set pelists
1479  do n=1,ngrids
1480  atm(n)%npes_this_grid = size(atm(n)%pelist)
1481  if (any(gid == atm(n)%pelist)) then
1482  call mpp_set_current_pelist(atm(n)%pelist)
1483  !now set in domain_decomp
1484  !masterproc = Atm(n)%pelist(1)
1485  call setup_master(atm(n)%pelist)
1486  grids_on_this_pe(n) = .true.
1487  exit
1488  endif
1489  enddo
1490 
1491  if (pecounter /= npes) then
1492  call mpp_error(fatal, 'nest_pes in nest_nml does not assign all of the available PEs.')
1493  endif
1494  endif
1495 
1496  !Layout is checked later, in fv_control
1497 
1498  end subroutine init_nesting
1499 
1503  subroutine setup_pointers(Atm)
1505  type(fv_atmos_type), intent(INOUT), target :: Atm
1506 
1507  !This routine associates the MODULE flag pointers with the ARRAY flag variables for the grid active on THIS pe so the flags can be read in from the namelist.
1508 
1509  res_latlon_dynamics => atm%flagstruct%res_latlon_dynamics
1510  res_latlon_tracers => atm%flagstruct%res_latlon_tracers
1511 
1512  grid_type => atm%flagstruct%grid_type
1513  grid_name => atm%flagstruct%grid_name
1514  grid_file => atm%flagstruct%grid_file
1515  hord_mt => atm%flagstruct%hord_mt
1516  kord_mt => atm%flagstruct%kord_mt
1517  kord_wz => atm%flagstruct%kord_wz
1518  hord_vt => atm%flagstruct%hord_vt
1519  hord_tm => atm%flagstruct%hord_tm
1520  hord_dp => atm%flagstruct%hord_dp
1521  kord_tm => atm%flagstruct%kord_tm
1522  hord_tr => atm%flagstruct%hord_tr
1523  kord_tr => atm%flagstruct%kord_tr
1524  scale_z => atm%flagstruct%scale_z
1525  w_max => atm%flagstruct%w_max
1526  z_min => atm%flagstruct%z_min
1527  lim_fac => atm%flagstruct%lim_fac
1528  nord => atm%flagstruct%nord
1529  nord_tr => atm%flagstruct%nord_tr
1530  dddmp => atm%flagstruct%dddmp
1531  d2_bg => atm%flagstruct%d2_bg
1532  d4_bg => atm%flagstruct%d4_bg
1533  vtdm4 => atm%flagstruct%vtdm4
1534  trdm2 => atm%flagstruct%trdm2
1535  d2_bg_k1 => atm%flagstruct%d2_bg_k1
1536  d2_bg_k2 => atm%flagstruct%d2_bg_k2
1537  d2_divg_max_k1 => atm%flagstruct%d2_divg_max_k1
1538  d2_divg_max_k2 => atm%flagstruct%d2_divg_max_k2
1539  damp_k_k1 => atm%flagstruct%damp_k_k1
1540  damp_k_k2 => atm%flagstruct%damp_k_k2
1541  n_zs_filter => atm%flagstruct%n_zs_filter
1542  nord_zs_filter => atm%flagstruct%nord_zs_filter
1543  full_zs_filter => atm%flagstruct%full_zs_filter
1544  rf_fast => atm%flagstruct%RF_fast
1545  consv_am => atm%flagstruct%consv_am
1546  do_sat_adj => atm%flagstruct%do_sat_adj
1547  do_f3d => atm%flagstruct%do_f3d
1548  no_dycore => atm%flagstruct%no_dycore
1549  convert_ke => atm%flagstruct%convert_ke
1550  do_vort_damp => atm%flagstruct%do_vort_damp
1551  use_old_omega => atm%flagstruct%use_old_omega
1552  beta => atm%flagstruct%beta
1553  n_sponge => atm%flagstruct%n_sponge
1554  d_ext => atm%flagstruct%d_ext
1555  nwat => atm%flagstruct%nwat
1556  use_logp => atm%flagstruct%use_logp
1557  warm_start => atm%flagstruct%warm_start
1558  inline_q => atm%flagstruct%inline_q
1559  shift_fac => atm%flagstruct%shift_fac
1560  do_schmidt => atm%flagstruct%do_schmidt
1561  stretch_fac => atm%flagstruct%stretch_fac
1562  target_lat => atm%flagstruct%target_lat
1563  target_lon => atm%flagstruct%target_lon
1564  regional => atm%flagstruct%regional
1565  bc_update_interval => atm%flagstruct%bc_update_interval
1566  reset_eta => atm%flagstruct%reset_eta
1567  p_fac => atm%flagstruct%p_fac
1568  a_imp => atm%flagstruct%a_imp
1569  n_split => atm%flagstruct%n_split
1570  fac_n_spl => atm%flagstruct%fac_n_spl
1571  fhouri => atm%flagstruct%fhouri
1572  m_split => atm%flagstruct%m_split
1573  k_split => atm%flagstruct%k_split
1574  use_logp => atm%flagstruct%use_logp
1575  q_split => atm%flagstruct%q_split
1576  print_freq => atm%flagstruct%print_freq
1577  write_3d_diags => atm%flagstruct%write_3d_diags
1578  npx => atm%flagstruct%npx
1579  npy => atm%flagstruct%npy
1580  npz => atm%flagstruct%npz
1581  npz_rst => atm%flagstruct%npz_rst
1582  ncnst => atm%flagstruct%ncnst
1583  pnats => atm%flagstruct%pnats
1584  dnats => atm%flagstruct%dnats
1585  ntiles => atm%flagstruct%ntiles
1586  nf_omega => atm%flagstruct%nf_omega
1587  fv_sg_adj => atm%flagstruct%fv_sg_adj
1588  na_init => atm%flagstruct%na_init
1589  nudge_dz => atm%flagstruct%nudge_dz
1590  p_ref => atm%flagstruct%p_ref
1591  dry_mass => atm%flagstruct%dry_mass
1592  nt_prog => atm%flagstruct%nt_prog
1593  nt_phys => atm%flagstruct%nt_phys
1594  tau_h2o => atm%flagstruct%tau_h2o
1595  delt_max => atm%flagstruct%delt_max
1596  d_con => atm%flagstruct%d_con
1597  ke_bg => atm%flagstruct%ke_bg
1598  consv_te => atm%flagstruct%consv_te
1599  tau => atm%flagstruct%tau
1600  rf_cutoff => atm%flagstruct%rf_cutoff
1601  filter_phys => atm%flagstruct%filter_phys
1602  dwind_2d => atm%flagstruct%dwind_2d
1603  breed_vortex_inline => atm%flagstruct%breed_vortex_inline
1604  range_warn => atm%flagstruct%range_warn
1605  fill => atm%flagstruct%fill
1606  fill_dp => atm%flagstruct%fill_dp
1607  fill_wz => atm%flagstruct%fill_wz
1608  check_negative => atm%flagstruct%check_negative
1609  non_ortho => atm%flagstruct%non_ortho
1610  adiabatic => atm%flagstruct%adiabatic
1611  moist_phys => atm%flagstruct%moist_phys
1612  do_held_suarez => atm%flagstruct%do_Held_Suarez
1613  do_reed_physics => atm%flagstruct%do_reed_physics
1614  reed_cond_only => atm%flagstruct%reed_cond_only
1615  reproduce_sum => atm%flagstruct%reproduce_sum
1616  adjust_dry_mass => atm%flagstruct%adjust_dry_mass
1617  fv_debug => atm%flagstruct%fv_debug
1618  srf_init => atm%flagstruct%srf_init
1619  mountain => atm%flagstruct%mountain
1620  remap_t => atm%flagstruct%remap_t
1621  z_tracer => atm%flagstruct%z_tracer
1622  old_divg_damp => atm%flagstruct%old_divg_damp
1623  fv_land => atm%flagstruct%fv_land
1624  nudge => atm%flagstruct%nudge
1625  nudge_ic => atm%flagstruct%nudge_ic
1626  ncep_ic => atm%flagstruct%ncep_ic
1627  nggps_ic => atm%flagstruct%nggps_ic
1628  ecmwf_ic => atm%flagstruct%ecmwf_ic
1629  gfs_phil => atm%flagstruct%gfs_phil
1630  agrid_vel_rst => atm%flagstruct%agrid_vel_rst
1631  use_new_ncep => atm%flagstruct%use_new_ncep
1632  use_ncep_phy => atm%flagstruct%use_ncep_phy
1633  fv_diag_ic => atm%flagstruct%fv_diag_ic
1634  external_ic => atm%flagstruct%external_ic
1635  external_eta => atm%flagstruct%external_eta
1636  read_increment => atm%flagstruct%read_increment
1637 
1638  hydrostatic => atm%flagstruct%hydrostatic
1639  phys_hydrostatic => atm%flagstruct%phys_hydrostatic
1640  use_hydro_pressure => atm%flagstruct%use_hydro_pressure
1641  do_uni_zfull => atm%flagstruct%do_uni_zfull !miz
1642  adj_mass_vmr => atm%flagstruct%adj_mass_vmr !f1p
1643  hybrid_z => atm%flagstruct%hybrid_z
1644  make_nh => atm%flagstruct%Make_NH
1645  make_hybrid_z => atm%flagstruct%make_hybrid_z
1646  nudge_qv => atm%flagstruct%nudge_qv
1647  add_noise => atm%flagstruct%add_noise
1648  a2b_ord => atm%flagstruct%a2b_ord
1649  c2l_ord => atm%flagstruct%c2l_ord
1650  ndims => atm%flagstruct%ndims
1651 
1652  dx_const => atm%flagstruct%dx_const
1653  dy_const => atm%flagstruct%dy_const
1654  deglon_start => atm%flagstruct%deglon_start
1655  deglon_stop => atm%flagstruct%deglon_stop
1656  deglat_start => atm%flagstruct%deglat_start
1657  deglat_stop => atm%flagstruct%deglat_stop
1658 
1659  deglat => atm%flagstruct%deglat
1660 
1661  nested => atm%neststruct%nested
1662  twowaynest => atm%neststruct%twowaynest
1663  parent_tile => atm%neststruct%parent_tile
1664  refinement => atm%neststruct%refinement
1665  nestbctype => atm%neststruct%nestbctype
1666  nestupdate => atm%neststruct%nestupdate
1667  nsponge => atm%neststruct%nsponge
1668  s_weight => atm%neststruct%s_weight
1669  ioffset => atm%neststruct%ioffset
1670  joffset => atm%neststruct%joffset
1671 
1672  layout => atm%layout
1673  io_layout => atm%io_layout
1674  end subroutine setup_pointers
1675 
1676 
1677 end module fv_control_mod
logical, pointer check_negative
Definition: fv_control.F90:277
logical, pointer reset_eta
Definition: fv_control.F90:228
real, pointer s_weight
Definition: fv_control.F90:335
logical, pointer do_schmidt
Definition: fv_control.F90:223
logical, pointer nggps_ic
Definition: fv_control.F90:297
real, pointer fhouri
Definition: fv_control.F90:234
logical, pointer warm_start
Definition: fv_control.F90:220
logical, public bubble_do
Definition: test_cases.F90:174
logical, pointer non_ortho
Definition: fv_control.F90:278
real, pointer shift_fac
Definition: fv_control.F90:222
real(kind=r_grid), pointer deglat
Definition: fv_control.F90:329
integer, dimension(:), pointer io_layout
Definition: fv_control.F90:337
logical, pointer make_nh
Definition: fv_control.F90:315
integer ntilesme
Definition: fv_control.F90:339
integer, pointer bc_update_interval
Definition: fv_control.F90:333
The module &#39;fv_mp_mod&#39; is a single program multiple data (SPMD) parallel decompostion/communication m...
Definition: fv_mp_mod.F90:24
subroutine timing_off(blk_name)
The subroutine &#39;timing_off&#39; stops a timer.
Definition: fv_timing.F90:180
logical, pointer adj_mass_vmr
Definition: fv_control.F90:313
integer, dimension(:), pointer layout
Definition: fv_control.F90:337
integer, pointer hord_tm
Definition: fv_control.F90:180
subroutine, public fv_init(Atm, dt_atmos, grids_on_this_pe, p_split)
The subroutine &#39;fv_init&#39; initializes FV3.
Definition: fv_control.F90:373
subroutine, public fv_restart_end(Atm, grids_on_this_pe)
The subroutine &#39;fv_restart_end&#39; writes ending restart files, terminates I/O, and prints out diagnosti...
integer, pointer nt_phys
Definition: fv_control.F90:261
logical, pointer dwind_2d
Definition: fv_control.F90:271
real umax
max wave speed for grid_type>3
Definition: fv_control.F90:353
logical, pointer write_3d_diags
Definition: fv_control.F90:242
integer parent_grid_num
Definition: fv_control.F90:354
integer, pointer grid_type
Definition: fv_control.F90:175
integer, dimension(:), allocatable, public pelist_all
Definition: fv_control.F90:349
logical, pointer ecmwf_ic
Definition: fv_control.F90:298
subroutine, public set_eta(km, ks, ptop, ak, bk)
This is the version of set_eta used in fvGFS and AM4.
Definition: fv_eta.F90:420
real, pointer consv_te
Definition: fv_control.F90:267
The module &#39;multi_gases&#39; peforms multi constitutents computations.
Definition: multi_gases.F90:25
real, pointer beta
Definition: fv_control.F90:216
real, pointer trdm2
Definition: fv_control.F90:196
logical, pointer ncep_ic
Definition: fv_control.F90:296
integer, pointer q_split
Definition: fv_control.F90:240
logical, pointer adiabatic
Definition: fv_control.F90:279
logical, pointer agrid_vel_rst
Definition: fv_control.F90:300
integer, pointer kord_tm
Definition: fv_control.F90:182
integer, pointer npz
Definition: fv_control.F90:246
integer, pointer fv_sg_adj
Definition: fv_control.F90:254
real, pointer lim_fac
Definition: fv_control.F90:188
real, pointer d4_bg
Definition: fv_control.F90:194
integer, public test_case
Definition: test_cases.F90:173
integer max_refinement_of_global
Definition: fv_control.F90:350
integer, public ngrids
Definition: fv_control.F90:348
integer, pointer npx
Definition: fv_control.F90:244
logical, pointer nudge_ic
Definition: fv_control.F90:295
logical, pointer fv_land
Definition: fv_control.F90:293
real, pointer p_ref
Definition: fv_control.F90:258
The module &#39;fv_io&#39; contains restart facilities for FV core.
Definition: fv_io.F90:30
real(kind=r_grid), pointer deglon_start
Definition: fv_control.F90:327
logical, pointer nudge_dz
Definition: fv_control.F90:257
logical, pointer use_logp
Definition: fv_control.F90:238
integer, parameter, public r_grid
Definition: fv_arrays.F90:35
integer, pointer pnats
Definition: fv_control.F90:250
real, dimension(:), allocatable ri
Definition: multi_gases.F90:48
logical, pointer fill_wz
Definition: fv_control.F90:276
subroutine, public fv_diag_init_gn(Atm)
integer, pointer nwat
Definition: fv_control.F90:219
real(kind=r_grid), pointer target_lat
Definition: fv_control.F90:225
subroutine init_nesting(Atm, grids_on_this_pe, p_split)
integer, pointer parent_tile
Definition: fv_control.F90:334
integer, pointer ntiles
Definition: fv_control.F90:252
logical, pointer external_ic
Definition: fv_control.F90:304
subroutine setup_pointers(Atm)
The subroutine &#39;setup_pointers&#39; associates the MODULE flag pointers with the ARRAY flag variables for...
logical, pointer do_vort_damp
Definition: fv_control.F90:213
logical, pointer mountain
Definition: fv_control.F90:288
real, pointer rf_cutoff
Definition: fv_control.F90:269
logical, pointer no_dycore
Definition: fv_control.F90:211
integer, pointer nestupdate
Definition: fv_control.F90:334
integer, pointer npz_rst
Definition: fv_control.F90:247
The module &#39;fv_timing&#39; contains FV3 timers.
Definition: fv_timing.F90:24
real, pointer damp_k_k1
Definition: fv_control.F90:201
integer, pointer ioffset
Definition: fv_control.F90:334
subroutine, public fv_restart_init()
Definition: fv_restart.F90:186
integer, pointer kord_wz
Definition: fv_control.F90:178
integer, pointer nord_tr
Definition: fv_control.F90:191
real(kind=r_grid), pointer deglon_stop
Definition: fv_control.F90:327
integer, pointer kord_tr
Definition: fv_control.F90:184
real, public alpha
Definition: test_cases.F90:175
real, pointer fac_n_spl
Definition: fv_control.F90:233
real, pointer d2_bg_k2
Definition: fv_control.F90:198
character(len=128), pointer res_latlon_tracers
Definition: fv_control.F90:308
real, pointer d2_divg_max_k2
Definition: fv_control.F90:200
logical, pointer moist_phys
Definition: fv_control.F90:280
real, parameter, public ptop_min
real, pointer p_fac
Definition: fv_control.F90:229
real, pointer ke_bg
Definition: fv_control.F90:266
logical, pointer remap_t
Definition: fv_control.F90:289
real, pointer vtdm4
Definition: fv_control.F90:195
integer, pointer nf_omega
Definition: fv_control.F90:253
subroutine, public init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions, ng)
The subroutine &#39;init_grid&#39; reads the grid from the input file and sets up grid descriptors.
real(kind=r_grid), pointer dx_const
Definition: fv_control.F90:325
logical, pointer twowaynest
Definition: fv_control.F90:331
logical, pointer filter_phys
Definition: fv_control.F90:270
logical, pointer hydrostatic
Definition: fv_control.F90:309
real, pointer d2_bg
Definition: fv_control.F90:193
logical, pointer convert_ke
Definition: fv_control.F90:212
logical, pointer make_hybrid_z
Definition: fv_control.F90:316
logical, pointer read_increment
Definition: fv_control.F90:306
logical, pointer use_old_omega
Definition: fv_control.F90:214
The module &#39;fv_arrays&#39; contains the &#39;fv_atmos_type&#39; and associated datatypes.
Definition: fv_arrays.F90:24
logical, pointer use_new_ncep
Definition: fv_control.F90:301
logical, pointer do_reed_physics
Definition: fv_control.F90:282
integer, pointer print_freq
Definition: fv_control.F90:241
real, pointer a_imp
Definition: fv_control.F90:230
real, public soliton_umax
Definition: test_cases.F90:177
integer, pointer nsponge
Definition: fv_control.F90:334
logical, pointer external_eta
Definition: fv_control.F90:305
The module &#39;fv_eta&#39; contains routine to set up the reference (Eulerian) pressure coordinate.
Definition: fv_eta.F90:25
integer, pointer nord_zs_filter
Definition: fv_control.F90:204
logical, pointer fv_debug
Definition: fv_control.F90:286
logical, pointer rf_fast
Definition: fv_control.F90:207
logical, pointer fill_dp
Definition: fv_control.F90:275
logical, pointer phys_hydrostatic
Definition: fv_control.F90:310
integer, pointer npy
Definition: fv_control.F90:245
integer, pointer n_zs_filter
Definition: fv_control.F90:203
logical, pointer breed_vortex_inline
Definition: fv_control.F90:272
subroutine, public fv_io_exit
Close the fv core restart facilities.
Definition: fv_io.F90:138
real, public soliton_size
Definition: test_cases.F90:177
integer, pointer k_split
Definition: fv_control.F90:237
real, pointer z_min
Definition: fv_control.F90:187
integer, public nsolitons
Definition: test_cases.F90:176
integer, pointer n_sponge
Definition: fv_control.F90:217
subroutine, public multi_gases_init(ngas, nwat)
Definition: multi_gases.F90:70
integer, pointer nt_prog
Definition: fv_control.F90:260
integer, pointer nord
Definition: fv_control.F90:190
real, pointer dry_mass
Definition: fv_control.F90:259
logical, pointer do_uni_zfull
Definition: fv_control.F90:312
subroutine, public grid_utils_init(Atm, npx, npy, npz, non_ortho, grid_type, c2l_order)
real, dimension(:), allocatable cpi
Definition: multi_gases.F90:49
logical, pointer fv_diag_ic
Definition: fv_control.F90:303
integer, pointer ncnst
Definition: fv_control.F90:249
character(len=120), pointer grid_file
Definition: fv_control.F90:174
character(len=128), pointer res_latlon_dynamics
Definition: fv_control.F90:307
real(kind=r_grid), pointer deglat_start
Definition: fv_control.F90:327
logical, pointer reed_cond_only
Definition: fv_control.F90:283
subroutine timing_on(blk_name)
The subroutine &#39;timing_on&#39; starts a timer.
Definition: fv_timing.F90:116
logical, pointer hybrid_z
Definition: fv_control.F90:314
logical, pointer regional
Definition: fv_control.F90:332
real, pointer d_ext
Definition: fv_control.F90:218
integer, parameter, public ng
Definition: fv_mp_mod.F90:2716
integer, pointer joffset
Definition: fv_control.F90:334
integer, pointer hord_vt
Definition: fv_control.F90:179
subroutine timing_prt(gid)
The subroutine &#39;timing_prt&#39; prints all timers.
Definition: fv_timing.F90:249
real, pointer d_con
Definition: fv_control.F90:265
logical, pointer adjust_dry_mass
Definition: fv_control.F90:285
logical, pointer inline_q
Definition: fv_control.F90:221
logical, pointer nested
Definition: fv_control.F90:331
@ The module &#39;fv_diagnostics&#39; contains routines to compute diagnosic fields.
logical, pointer gfs_phil
Definition: fv_control.F90:299
The module &#39;fv_grid_utils&#39; contains routines for setting up and computing grid-related quantities...
logical, pointer range_warn
Definition: fv_control.F90:273
real, pointer update_blend
Definition: fv_control.F90:335
real, pointer w_max
Definition: fv_control.F90:186
real, pointer d2_bg_k1
Definition: fv_control.F90:197
real(kind=r_grid), pointer target_lon
Definition: fv_control.F90:226
logical, pointer do_sat_adj
Definition: fv_control.F90:209
character(len=80), pointer grid_name
Definition: fv_control.F90:173
real(kind=r_grid), pointer deglat_stop
Definition: fv_control.F90:327
integer, pointer na_init
Definition: fv_control.F90:256
logical, pointer nudge_qv
Definition: fv_control.F90:317
real, pointer add_noise
Definition: fv_control.F90:318
real, pointer scale_z
Definition: fv_control.F90:185
integer, pointer refinement
Definition: fv_control.F90:334
real(kind=r_grid), pointer dy_const
Definition: fv_control.F90:326
real, pointer dddmp
Definition: fv_control.F90:192
logical, pointer fill
Definition: fv_control.F90:274
real, pointer damp_k_k2
Definition: fv_control.F90:202
integer, pointer hord_mt
Definition: fv_control.F90:176
real(kind=r_grid), pointer stretch_fac
Definition: fv_control.F90:224
integer, pointer a2b_ord
Definition: fv_control.F90:320
logical, pointer reproduce_sum
Definition: fv_control.F90:284
integer, pointer hord_tr
Definition: fv_control.F90:183
logical, pointer old_divg_damp
Definition: fv_control.F90:292
integer, pointer n_split
Definition: fv_control.F90:231
logical, pointer consv_am
Definition: fv_control.F90:208
logical, pointer do_f3d
Definition: fv_control.F90:210
subroutine timing_init
The subroutine &#39;timing_init&#39; initializes timers.
Definition: fv_timing.F90:79
subroutine allocate_fv_atmos_type(Atm, isd_in, ied_in, jsd_in, jed_in, is_in, ie_in, js_in, je_in, npx_in, npy_in, npz_in, ndims_in, ncnst_in, nq_in, ng_in, dummy, alloc_2d, ngrids_in)
The subroutine &#39;allocate_fv_atmos_type&#39; allocates the fv_atmos_type.
Definition: fv_arrays.F90:1324
logical, pointer use_ncep_phy
Definition: fv_control.F90:302
logical, pointer srf_init
Definition: fv_control.F90:287
integer, pointer kord_mt
Definition: fv_control.F90:177
subroutine, public grid_utils_end
logical, pointer use_hydro_pressure
Definition: fv_control.F90:311
real, pointer tau_h2o
Definition: fv_control.F90:262
real, pointer delt_max
Definition: fv_control.F90:264
integer, pointer hord_dp
Definition: fv_control.F90:181
logical, pointer nudge
Definition: fv_control.F90:294
The module &#39;FV3_control&#39; is for initialization and termination of the model, and controls namelist pa...
Definition: fv_control.F90:29
logical, pointer full_zs_filter
Definition: fv_control.F90:205
integer, pointer dnats
Definition: fv_control.F90:251
logical, pointer z_tracer
Definition: fv_control.F90:290
real, pointer d2_divg_max_k1
Definition: fv_control.F90:199
integer halo_update_type
1 for two-interfaces non-block 2 for block 3 for four-interfaces non-block
Definition: fv_control.F90:356
integer, pointer c2l_ord
Definition: fv_control.F90:321
subroutine, public fv_end(Atm, grids_on_this_pe)
The subroutine &#39;fv_end&#39; terminates FV3, deallocates memory, saves restart files, and stops I/O...
Definition: fv_control.F90:596
integer, pointer nestbctype
Definition: fv_control.F90:334
real, pointer tau
Definition: fv_control.F90:268
integer, pointer m_split
Definition: fv_control.F90:236
subroutine deallocate_fv_atmos_type(Atm)
The subroutine &#39;deallocate_fv_atmos_type&#39; deallocates the fv_atmos_type.
Definition: fv_arrays.F90:1770
logical, pointer do_held_suarez
Definition: fv_control.F90:281
integer, pointer ndims
Definition: fv_control.F90:323