Line data Source code
1 : module phys_control
2 : !-----------------------------------------------------------------------
3 : ! Purpose:
4 : !
5 : ! Provides a control interface to CAM physics packages
6 : !
7 : ! Revision history:
8 : ! 2006-05-01 D. B. Coleman, Creation of module
9 : ! 2009-02-13 Eaton Replace *_{default,set}opts methods with module namelist.
10 : ! Add vars to indicate physics version and chemistry type.
11 : !-----------------------------------------------------------------------
12 :
13 : use spmd_utils, only: masterproc
14 : use cam_logfile, only: iulog
15 : use cam_abortutils, only: endrun
16 : use shr_kind_mod, only: r8 => shr_kind_r8, cl=>shr_kind_cl
17 :
18 : implicit none
19 : private
20 : save
21 :
22 : public :: &
23 : phys_ctl_readnl, &! read namelist from file
24 : phys_getopts, &! generic query method
25 : phys_setopts, &! generic set method
26 : phys_deepconv_pbl, &! return true if deep convection is allowed in the PBL
27 : phys_do_flux_avg, &! return true to average surface fluxes
28 : cam_physpkg_is, &! query for the name of the physics package
29 : cam_chempkg_is, &! query for the name of the chemistry package
30 : waccmx_is
31 :
32 : ! Private module data
33 :
34 : character(len=16), parameter :: unset_str = 'UNSET'
35 : integer, parameter :: unset_int = huge(1)
36 :
37 : ! Namelist variables:
38 : character(len=16) :: cam_physpkg = unset_str ! CAM physics package
39 : character(len=32) :: cam_chempkg = unset_str ! CAM chemistry package
40 : character(len=16) :: waccmx_opt = unset_str ! WACCMX run option [ionosphere | neutral | off
41 : character(len=16) :: deep_scheme = unset_str ! deep convection package
42 : character(len=16) :: shallow_scheme = unset_str ! shallow convection package
43 : character(len=16) :: eddy_scheme = unset_str ! vertical diffusion package
44 : character(len=16) :: microp_scheme = unset_str ! microphysics package
45 : character(len=16) :: macrop_scheme = unset_str ! macrophysics package
46 : character(len=16) :: radiation_scheme = unset_str ! radiation package
47 : character(len=cl) :: cam_physics_mesh = unset_str ! SCRIP file for phys
48 : integer :: srf_flux_avg = unset_int ! 1 => smooth surface fluxes, 0 otherwise
49 :
50 : logical :: use_subcol_microp = .false. ! if .true. then use sub-columns in microphysics
51 :
52 : logical :: atm_dep_flux = .true. ! true => deposition fluxes will be provided
53 : ! to the coupler
54 : logical :: history_amwg = .true. ! output the variables used by the AMWG diag package
55 : logical :: history_vdiag = .false. ! output the variables used by the AMWG variability diag package
56 : logical :: history_aerosol = .false. ! output the MAM aerosol variables and tendencies
57 : logical :: history_aero_optics = .false. ! output the aerosol
58 : logical :: history_eddy = .false. ! output the eddy variables
59 : logical :: history_budget = .false. ! output tendencies and state variables for T, water vapor,
60 : ! cloud ice and cloud liquid budgets
61 : logical :: convproc_do_aer = .false. ! switch for new convective scavenging treatment for modal aerosols
62 :
63 : integer :: history_budget_histfile_num = 1 ! output history file number for budget fields
64 : logical :: history_waccm = .false. ! output variables of interest for WACCM runs
65 : logical :: history_waccmx = .false. ! output variables of interest for WACCM-X runs
66 : logical :: history_chemistry = .true. ! output default chemistry-related variables
67 : logical :: history_carma = .false. ! output default CARMA-related variables
68 : logical :: history_clubb = .true. ! output default CLUBB-related variables
69 : logical :: history_cesm_forcing = .false.
70 : logical :: history_dust = .false.
71 : logical :: history_scwaccm_forcing = .false.
72 : logical :: history_chemspecies_srf = .false.
73 :
74 : logical :: do_clubb_sgs
75 : logical :: do_hb_above_clubb = .false. ! enable HB vertical mixing above clubb top
76 :
77 : ! Check validity of physics_state objects in physics_update.
78 : logical :: state_debug_checks = .false.
79 :
80 : ! Macro/micro-physics co-substeps
81 : integer :: cld_macmic_num_steps = 1
82 :
83 : logical :: offline_driver = .false. ! true => offline driver is being used
84 :
85 :
86 : logical, public, protected :: use_simple_phys = .false. ! true => simple physics configuration
87 :
88 : logical :: use_spcam ! true => use super parameterized CAM
89 :
90 : logical :: prog_modal_aero ! determines whether prognostic modal aerosols are present in the run.
91 :
92 : ! Option to use heterogeneous freezing
93 : logical, public, protected :: use_hetfrz_classnuc = .false.
94 :
95 : ! Which gravity wave sources are used?
96 : logical, public, protected :: use_gw_oro = .true. ! Orography.
97 : logical, public, protected :: use_gw_front = .false. ! Frontogenesis.
98 : logical, public, protected :: use_gw_front_igw = .false. ! Frontogenesis to inertial spectrum.
99 : logical, public, protected :: use_gw_convect_dp = .false. ! Deep convection.
100 : logical, public, protected :: use_gw_convect_sh = .false. ! Shallow convection.
101 :
102 : ! FV dycore angular momentum correction
103 : logical, public, protected :: fv_am_correction = .false.
104 :
105 : ! Option for Harmonized Emissions Component (HEMCO)
106 : logical, public, protected :: use_hemco = .false.
107 :
108 : ! CAM snapshot before/after file numbers and control
109 : character(len=32) :: cam_take_snapshot_before = '' ! Physics routine to take a snopshot "before"
110 : character(len=32) :: cam_take_snapshot_after = '' ! Physics routine to take a snopshot "after"
111 : integer :: cam_snapshot_before_num = -1 ! output history file number for CAM "before" snapshot
112 : integer :: cam_snapshot_after_num = -1 ! output history file number for CAM "after" snapshot
113 :
114 : !=======================================================================
115 : contains
116 : !=======================================================================
117 :
118 1536 : subroutine phys_ctl_readnl(nlfile)
119 :
120 : use namelist_utils, only: find_group_name
121 : use units, only: getunit, freeunit
122 : use spmd_utils, only: mpi_character, mpi_integer, mpi_logical, masterprocid, mpicom
123 : use cam_control_mod, only: cam_ctrl_set_physics_type
124 :
125 : character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input
126 :
127 : ! Local variables
128 : integer :: unitn, ierr
129 : character(len=*), parameter :: subname = 'phys_ctl_readnl'
130 :
131 : namelist /phys_ctl_nl/ cam_physpkg, use_simple_phys, cam_chempkg, waccmx_opt, &
132 : deep_scheme, shallow_scheme, &
133 : eddy_scheme, microp_scheme, macrop_scheme, radiation_scheme, srf_flux_avg, &
134 : use_subcol_microp, atm_dep_flux, history_amwg, history_vdiag, history_aerosol, history_aero_optics, &
135 : history_eddy, history_budget, history_budget_histfile_num, history_waccm, &
136 : history_waccmx, history_chemistry, history_carma, history_clubb, history_dust, &
137 : history_cesm_forcing, history_scwaccm_forcing, history_chemspecies_srf, &
138 : do_clubb_sgs, state_debug_checks, use_hetfrz_classnuc, use_gw_oro, use_gw_front, &
139 : use_gw_front_igw, use_gw_convect_dp, use_gw_convect_sh, cld_macmic_num_steps, &
140 : offline_driver, convproc_do_aer, cam_snapshot_before_num, cam_snapshot_after_num, &
141 : cam_take_snapshot_before, cam_take_snapshot_after, cam_physics_mesh, use_hemco, do_hb_above_clubb
142 : !-----------------------------------------------------------------------------
143 :
144 1536 : if (masterproc) then
145 2 : unitn = getunit()
146 2 : open( unitn, file=trim(nlfile), status='old' )
147 2 : call find_group_name(unitn, 'phys_ctl_nl', status=ierr)
148 2 : if (ierr == 0) then
149 2 : read(unitn, phys_ctl_nl, iostat=ierr)
150 2 : if (ierr /= 0) then
151 0 : call endrun(subname // ':: ERROR reading namelist')
152 : end if
153 : end if
154 2 : close(unitn)
155 2 : call freeunit(unitn)
156 : end if
157 :
158 : ! Broadcast namelist variables
159 1536 : call mpi_bcast(deep_scheme, len(deep_scheme), mpi_character, masterprocid, mpicom, ierr)
160 1536 : call mpi_bcast(cam_physpkg, len(cam_physpkg), mpi_character, masterprocid, mpicom, ierr)
161 1536 : call mpi_bcast(use_simple_phys, 1, mpi_logical, masterprocid, mpicom, ierr)
162 1536 : call mpi_bcast(cam_chempkg, len(cam_chempkg), mpi_character, masterprocid, mpicom, ierr)
163 1536 : call mpi_bcast(waccmx_opt, len(waccmx_opt), mpi_character, masterprocid, mpicom, ierr)
164 1536 : call mpi_bcast(shallow_scheme, len(shallow_scheme), mpi_character, masterprocid, mpicom, ierr)
165 1536 : call mpi_bcast(eddy_scheme, len(eddy_scheme), mpi_character, masterprocid, mpicom, ierr)
166 1536 : call mpi_bcast(microp_scheme, len(microp_scheme), mpi_character, masterprocid, mpicom, ierr)
167 1536 : call mpi_bcast(radiation_scheme, len(radiation_scheme), mpi_character, masterprocid, mpicom, ierr)
168 1536 : call mpi_bcast(macrop_scheme, len(macrop_scheme), mpi_character, masterprocid, mpicom, ierr)
169 1536 : call mpi_bcast(srf_flux_avg, 1, mpi_integer, masterprocid, mpicom, ierr)
170 1536 : call mpi_bcast(use_subcol_microp, 1, mpi_logical, masterprocid, mpicom, ierr)
171 1536 : call mpi_bcast(atm_dep_flux, 1, mpi_logical, masterprocid, mpicom, ierr)
172 1536 : call mpi_bcast(history_amwg, 1, mpi_logical, masterprocid, mpicom, ierr)
173 1536 : call mpi_bcast(history_vdiag, 1, mpi_logical, masterprocid, mpicom, ierr)
174 1536 : call mpi_bcast(history_eddy, 1, mpi_logical, masterprocid, mpicom, ierr)
175 1536 : call mpi_bcast(history_aerosol, 1, mpi_logical, masterprocid, mpicom, ierr)
176 1536 : call mpi_bcast(history_aero_optics, 1, mpi_logical, masterprocid, mpicom, ierr)
177 1536 : call mpi_bcast(history_budget, 1, mpi_logical, masterprocid, mpicom, ierr)
178 1536 : call mpi_bcast(history_budget_histfile_num, 1, mpi_integer, masterprocid, mpicom, ierr)
179 1536 : call mpi_bcast(history_waccm, 1, mpi_logical, masterprocid, mpicom, ierr)
180 1536 : call mpi_bcast(history_waccmx, 1, mpi_logical, masterprocid, mpicom, ierr)
181 1536 : call mpi_bcast(history_chemistry, 1, mpi_logical, masterprocid, mpicom, ierr)
182 1536 : call mpi_bcast(history_carma, 1, mpi_logical, masterprocid, mpicom, ierr)
183 1536 : call mpi_bcast(history_clubb, 1, mpi_logical, masterprocid, mpicom, ierr)
184 1536 : call mpi_bcast(history_cesm_forcing, 1, mpi_logical, masterprocid, mpicom, ierr)
185 1536 : call mpi_bcast(history_chemspecies_srf, 1, mpi_logical, masterprocid, mpicom, ierr)
186 1536 : call mpi_bcast(history_dust, 1, mpi_logical, masterprocid, mpicom, ierr)
187 1536 : call mpi_bcast(history_scwaccm_forcing, 1, mpi_logical, masterprocid, mpicom, ierr)
188 1536 : call mpi_bcast(do_clubb_sgs, 1, mpi_logical, masterprocid, mpicom, ierr)
189 1536 : call mpi_bcast(state_debug_checks, 1, mpi_logical, masterprocid, mpicom, ierr)
190 1536 : call mpi_bcast(use_hetfrz_classnuc, 1, mpi_logical, masterprocid, mpicom, ierr)
191 1536 : call mpi_bcast(use_gw_oro, 1, mpi_logical, masterprocid, mpicom, ierr)
192 1536 : call mpi_bcast(use_gw_front, 1, mpi_logical, masterprocid, mpicom, ierr)
193 1536 : call mpi_bcast(use_gw_front_igw, 1, mpi_logical, masterprocid, mpicom, ierr)
194 1536 : call mpi_bcast(use_gw_convect_dp, 1, mpi_logical, masterprocid, mpicom, ierr)
195 1536 : call mpi_bcast(use_gw_convect_sh, 1, mpi_logical, masterprocid, mpicom, ierr)
196 1536 : call mpi_bcast(cld_macmic_num_steps, 1, mpi_integer, masterprocid, mpicom, ierr)
197 1536 : call mpi_bcast(offline_driver, 1, mpi_logical, masterprocid, mpicom, ierr)
198 1536 : call mpi_bcast(convproc_do_aer, 1, mpi_logical, masterprocid, mpicom, ierr)
199 1536 : call mpi_bcast(cam_snapshot_before_num, 1, mpi_integer, masterprocid, mpicom, ierr)
200 1536 : call mpi_bcast(cam_snapshot_after_num, 1, mpi_integer, masterprocid, mpicom, ierr)
201 1536 : call mpi_bcast(cam_take_snapshot_before, len(cam_take_snapshot_before), mpi_character, masterprocid, mpicom, ierr)
202 1536 : call mpi_bcast(cam_take_snapshot_after, len(cam_take_snapshot_after), mpi_character, masterprocid, mpicom, ierr)
203 1536 : call mpi_bcast(cam_physics_mesh, len(cam_physics_mesh), mpi_character, masterprocid, mpicom, ierr)
204 1536 : call mpi_bcast(do_hb_above_clubb, 1, mpi_logical, masterprocid, mpicom, ierr)
205 1536 : call mpi_bcast(use_hemco, 1, mpi_logical, masterprocid, mpicom, ierr)
206 :
207 : use_spcam = ( cam_physpkg_is('spcam_sam1mom') &
208 1536 : .or. cam_physpkg_is('spcam_m2005'))
209 :
210 1536 : call cam_ctrl_set_physics_type(cam_physpkg)
211 :
212 : ! Error checking:
213 :
214 : ! Check compatibility of eddy & shallow schemes
215 1536 : if (( shallow_scheme .eq. 'UW' ) .and. ( eddy_scheme .ne. 'diag_TKE' )) then
216 0 : write(iulog,*)'Do you really want to run UW shallow scheme without diagnostic TKE eddy scheme? Quiting'
217 0 : call endrun('shallow convection and eddy scheme may be incompatible')
218 : endif
219 :
220 1536 : if (( shallow_scheme .eq. 'Hack' ) .and. ( ( eddy_scheme .ne. 'HB' ) .and. ( eddy_scheme .ne. 'HBR' ))) then
221 0 : write(iulog,*)'Do you really want to run Hack shallow scheme with a non-standard eddy scheme? Quiting.'
222 0 : call endrun('shallow convection and eddy scheme may be incompatible')
223 : endif
224 :
225 : ! Check compatibility of PBL and Microphysics schemes
226 1536 : if (( eddy_scheme .eq. 'diag_TKE' ) .and. ( microp_scheme .eq. 'RK' )) then
227 0 : write(iulog,*)'UW PBL is not compatible with RK microphysics. Quiting'
228 0 : call endrun('PBL and Microphysics schemes incompatible')
229 : endif
230 :
231 : ! Add a check to make sure CLUBB and MG are used together
232 1536 : if ( do_clubb_sgs .and. ( microp_scheme .ne. 'MG') .and. .not. use_spcam) then
233 0 : write(iulog,*)'CLUBB is only compatible with MG microphysics. Quiting'
234 0 : call endrun('CLUBB and microphysics schemes incompatible')
235 : endif
236 :
237 : ! Check that eddy_scheme, macrop_scheme, shallow_scheme are all set to CLUBB_SGS if do_clubb_sgs is true
238 1536 : if (do_clubb_sgs .and. .not. use_spcam) then
239 1536 : if (eddy_scheme .ne. 'CLUBB_SGS' .or. macrop_scheme .ne. 'CLUBB_SGS' .or. shallow_scheme .ne. 'CLUBB_SGS') then
240 0 : write(iulog,*)'eddy_scheme, macrop_scheme and shallow_scheme must all be CLUBB_SGS. Quiting'
241 0 : call endrun('CLUBB and eddy, macrop or shallow schemes incompatible')
242 : endif
243 : endif
244 :
245 1536 : if (cam_physpkg_is("cam7")) then
246 : ! Check that eddy_scheme, macrop_scheme, shallow_scheme are all set to CLUBB
247 1536 : if (eddy_scheme /= 'CLUBB_SGS' .or. macrop_scheme /= 'CLUBB_SGS' .or. shallow_scheme /= 'CLUBB_SGS') then
248 0 : write(iulog,*) 'cam7 is only compatible with CLUBB. Quitting'
249 0 : call endrun('cam7 is only compatible with eddy, macrop, and shallow schemes = CLUBB_SGS')
250 : end if
251 : ! Add a check to make sure SPCAM is not used
252 1536 : if (use_spcam) then
253 0 : write(iulog,*)'SPCAM not compatible with cam7 physics. Quitting'
254 0 : call endrun('SPCAM and cam7 incompatible')
255 : end if
256 : ! Add check to make sure we are not trying to use `camrt`
257 1536 : if (trim(radiation_scheme) == 'camrt') then
258 0 : write(iulog,*) ' camrt specified and it is not compatible with cam7'
259 0 : call endrun('cam7 is not compatible with camrt radiation scheme')
260 : end if
261 : end if
262 :
263 : ! do_hb_above_clubb requires that CLUBB is being used
264 1536 : if (do_hb_above_clubb .and. .not. do_clubb_sgs) then
265 0 : write(iulog,*)'do_hb_above_clubb requires CLUBB to be active'
266 0 : call endrun('do_hb_above_clubb incompatible with do_clubb_sgs = .false.')
267 : endif
268 :
269 : ! Macro/micro co-substepping support.
270 1536 : if (cld_macmic_num_steps > 1) then
271 1536 : if (microp_scheme /= "MG" .or. (macrop_scheme /= "park" .and. macrop_scheme /= "CLUBB_SGS")) then
272 : call endrun ("Setting cld_macmic_num_steps > 1 is only &
273 0 : &supported with Park or CLUBB macrophysics and MG microphysics.")
274 : end if
275 : end if
276 :
277 : ! prog_modal_aero determines whether prognostic modal aerosols are present in the run.
278 1536 : prog_modal_aero = index(cam_chempkg,'_mam')>0
279 :
280 1536 : end subroutine phys_ctl_readnl
281 :
282 : !===============================================================================
283 :
284 363404424 : logical function cam_physpkg_is(name)
285 :
286 : ! query for the name of the physics package
287 :
288 : character(len=*) :: name
289 :
290 363404424 : cam_physpkg_is = (trim(name) == trim(cam_physpkg))
291 363404424 : end function cam_physpkg_is
292 :
293 : !===============================================================================
294 :
295 125328 : logical function cam_chempkg_is(name)
296 :
297 : ! query for the name of the chemics package
298 :
299 : character(len=*) :: name
300 :
301 125328 : cam_chempkg_is = (trim(name) == trim(cam_chempkg))
302 125328 : end function cam_chempkg_is
303 :
304 : !===============================================================================
305 :
306 9232848 : logical function waccmx_is(name)
307 :
308 : ! query for the name of the waccmx run option
309 :
310 : character(len=*) :: name
311 :
312 9232848 : waccmx_is = (trim(name) == trim(waccmx_opt))
313 9232848 : end function waccmx_is
314 :
315 : !===============================================================================
316 :
317 0 : subroutine phys_getopts(deep_scheme_out, shallow_scheme_out, eddy_scheme_out, microp_scheme_out, &
318 0 : radiation_scheme_out, use_subcol_microp_out, atm_dep_flux_out, &
319 : history_amwg_out, history_vdiag_out, history_aerosol_out, history_aero_optics_out, history_eddy_out, &
320 : history_budget_out, history_budget_histfile_num_out, &
321 : history_waccm_out, history_waccmx_out, history_chemistry_out, &
322 : history_carma_out, history_clubb_out, history_dust_out, &
323 : history_cesm_forcing_out, history_scwaccm_forcing_out, history_chemspecies_srf_out, &
324 0 : cam_chempkg_out, prog_modal_aero_out, macrop_scheme_out, &
325 : do_clubb_sgs_out, use_spcam_out, state_debug_checks_out, cld_macmic_num_steps_out, &
326 : offline_driver_out, convproc_do_aer_out, cam_snapshot_before_num_out, cam_snapshot_after_num_out,&
327 0 : cam_take_snapshot_before_out, cam_take_snapshot_after_out, physics_grid_out, do_hb_above_clubb_out)
328 : !-----------------------------------------------------------------------
329 : ! Purpose: Return runtime settings
330 : ! deep_scheme_out : deep convection scheme
331 : ! shallow_scheme_out: shallow convection scheme
332 : ! eddy_scheme_out : vertical diffusion scheme
333 : ! microp_scheme_out : microphysics scheme
334 : ! radiation_scheme_out : radiation_scheme
335 : ! SPCAM_microp_scheme_out : SPCAM microphysics scheme
336 : !-----------------------------------------------------------------------
337 :
338 : character(len=16), intent(out), optional :: deep_scheme_out
339 : character(len=16), intent(out), optional :: shallow_scheme_out
340 : character(len=16), intent(out), optional :: eddy_scheme_out
341 : character(len=16), intent(out), optional :: microp_scheme_out
342 : character(len=16), intent(out), optional :: radiation_scheme_out
343 : character(len=16), intent(out), optional :: macrop_scheme_out
344 : logical, intent(out), optional :: use_subcol_microp_out
345 : logical, intent(out), optional :: use_spcam_out
346 : logical, intent(out), optional :: atm_dep_flux_out
347 : logical, intent(out), optional :: history_amwg_out
348 : logical, intent(out), optional :: history_vdiag_out
349 : logical, intent(out), optional :: history_eddy_out
350 : logical, intent(out), optional :: history_aerosol_out
351 : logical, intent(out), optional :: history_aero_optics_out
352 : logical, intent(out), optional :: history_budget_out
353 : integer, intent(out), optional :: history_budget_histfile_num_out
354 : logical, intent(out), optional :: history_waccm_out
355 : logical, intent(out), optional :: history_waccmx_out
356 : logical, intent(out), optional :: history_chemistry_out
357 : logical, intent(out), optional :: history_carma_out
358 : logical, intent(out), optional :: history_clubb_out
359 : logical, intent(out), optional :: history_cesm_forcing_out
360 : logical, intent(out), optional :: history_chemspecies_srf_out
361 : logical, intent(out), optional :: history_dust_out
362 : logical, intent(out), optional :: history_scwaccm_forcing_out
363 : logical, intent(out), optional :: do_clubb_sgs_out
364 : character(len=32), intent(out), optional :: cam_chempkg_out
365 : logical, intent(out), optional :: prog_modal_aero_out
366 : logical, intent(out), optional :: state_debug_checks_out
367 : integer, intent(out), optional :: cld_macmic_num_steps_out
368 : logical, intent(out), optional :: offline_driver_out
369 : logical, intent(out), optional :: convproc_do_aer_out
370 : integer, intent(out), optional :: cam_snapshot_before_num_out
371 : integer, intent(out), optional :: cam_snapshot_after_num_out
372 : character(len=32), intent(out), optional :: cam_take_snapshot_before_out
373 : character(len=32), intent(out), optional :: cam_take_snapshot_after_out
374 : character(len=cl), intent(out), optional :: physics_grid_out
375 : logical, intent(out), optional :: do_hb_above_clubb_out
376 :
377 2664936 : if ( present(deep_scheme_out ) ) deep_scheme_out = deep_scheme
378 2664936 : if ( present(shallow_scheme_out ) ) shallow_scheme_out = shallow_scheme
379 2664936 : if ( present(eddy_scheme_out ) ) eddy_scheme_out = eddy_scheme
380 2664936 : if ( present(microp_scheme_out ) ) microp_scheme_out = microp_scheme
381 2664936 : if ( present(radiation_scheme_out ) ) radiation_scheme_out = radiation_scheme
382 2664936 : if ( present(use_subcol_microp_out ) ) use_subcol_microp_out = use_subcol_microp
383 2664936 : if ( present(use_spcam_out ) ) use_spcam_out = use_spcam
384 :
385 2664936 : if ( present(macrop_scheme_out ) ) macrop_scheme_out = macrop_scheme
386 2664936 : if ( present(atm_dep_flux_out ) ) atm_dep_flux_out = atm_dep_flux
387 2664936 : if ( present(history_aerosol_out ) ) history_aerosol_out = history_aerosol
388 2664936 : if ( present(history_aero_optics_out ) ) history_aero_optics_out = history_aero_optics
389 2664936 : if ( present(history_budget_out ) ) history_budget_out = history_budget
390 2664936 : if ( present(history_amwg_out ) ) history_amwg_out = history_amwg
391 2664936 : if ( present(history_vdiag_out ) ) history_vdiag_out = history_vdiag
392 2664936 : if ( present(history_eddy_out ) ) history_eddy_out = history_eddy
393 2664936 : if ( present(history_budget_histfile_num_out ) ) history_budget_histfile_num_out = history_budget_histfile_num
394 2664936 : if ( present(history_waccm_out ) ) history_waccm_out = history_waccm
395 2664936 : if ( present(history_waccmx_out ) ) history_waccmx_out = history_waccmx
396 2664936 : if ( present(history_chemistry_out ) ) history_chemistry_out = history_chemistry
397 2664936 : if ( present(history_cesm_forcing_out) ) history_cesm_forcing_out = history_cesm_forcing
398 2664936 : if ( present(history_chemspecies_srf_out) ) history_chemspecies_srf_out = history_chemspecies_srf
399 2664936 : if ( present(history_scwaccm_forcing_out) ) history_scwaccm_forcing_out = history_scwaccm_forcing
400 2664936 : if ( present(history_carma_out ) ) history_carma_out = history_carma
401 2664936 : if ( present(history_clubb_out ) ) history_clubb_out = history_clubb
402 2664936 : if ( present(history_dust_out ) ) history_dust_out = history_dust
403 2664936 : if ( present(do_clubb_sgs_out ) ) do_clubb_sgs_out = do_clubb_sgs
404 2664936 : if ( present(cam_chempkg_out ) ) cam_chempkg_out = cam_chempkg
405 2664936 : if ( present(prog_modal_aero_out ) ) prog_modal_aero_out = prog_modal_aero
406 2664936 : if ( present(state_debug_checks_out ) ) state_debug_checks_out = state_debug_checks
407 2664936 : if ( present(cld_macmic_num_steps_out) ) cld_macmic_num_steps_out = cld_macmic_num_steps
408 2664936 : if ( present(offline_driver_out ) ) offline_driver_out = offline_driver
409 2664936 : if ( present(convproc_do_aer_out ) ) convproc_do_aer_out = convproc_do_aer
410 2664936 : if ( present(cam_snapshot_before_num_out ) ) cam_snapshot_before_num_out = cam_snapshot_before_num
411 2664936 : if ( present(cam_snapshot_after_num_out ) ) cam_snapshot_after_num_out = cam_snapshot_after_num
412 2664936 : if ( present(cam_take_snapshot_before_out) ) cam_take_snapshot_before_out = cam_take_snapshot_before
413 2664936 : if ( present(cam_take_snapshot_after_out ) ) cam_take_snapshot_after_out = cam_take_snapshot_after
414 2664936 : if ( present(physics_grid_out ) ) physics_grid_out = cam_physics_mesh
415 2664936 : if ( present(do_hb_above_clubb_out ) ) do_hb_above_clubb_out = do_hb_above_clubb
416 :
417 2664936 : end subroutine phys_getopts
418 :
419 : !===============================================================================
420 :
421 0 : subroutine phys_setopts(fv_am_correction_in)
422 :
423 : logical, intent(in), optional :: fv_am_correction_in
424 :
425 0 : if ( present(fv_am_correction_in) ) fv_am_correction = fv_am_correction_in
426 :
427 2664936 : end subroutine phys_setopts
428 :
429 : !===============================================================================
430 :
431 1536 : function phys_deepconv_pbl()
432 :
433 : logical phys_deepconv_pbl
434 :
435 : ! Don't allow deep convection in PBL if running UW PBL scheme
436 1536 : if ( (eddy_scheme .eq. 'diag_TKE' ) .or. (shallow_scheme .eq. 'UW' ) ) then
437 : phys_deepconv_pbl = .true.
438 : else
439 1536 : phys_deepconv_pbl = .false.
440 : endif
441 :
442 : return
443 :
444 : end function phys_deepconv_pbl
445 :
446 : !===============================================================================
447 :
448 76488 : function phys_do_flux_avg()
449 :
450 : logical :: phys_do_flux_avg
451 : !----------------------------------------------------------------------
452 :
453 76488 : phys_do_flux_avg = .false.
454 76488 : if (srf_flux_avg == 1) phys_do_flux_avg = .true.
455 :
456 76488 : end function phys_do_flux_avg
457 :
458 : !===============================================================================
459 : end module phys_control
|