-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntime_opts.F90
698 lines (615 loc) · 26.5 KB
/
runtime_opts.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
module runtime_opts
!-----------------------------------------------------------------------
!
! Purpose: This module is responsible for reading CAM namelist cam_inparm
! and broadcasting namelist values if needed.
!
! Author:
! Original routines: CMS
! Module: T. Henderson, September 2003
!
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!- use statements ------------------------------------------------------
!-----------------------------------------------------------------------
use shr_kind_mod, only: r8 => shr_kind_r8, SHR_KIND_CL
use spmd_utils, only: masterproc
use namelist_utils, only: find_group_name
use pmgrid, only: plon
use cam_instance, only: inst_suffix
use cam_history
use cam_control_mod
use cam_logfile, only: iulog
use pspect
use units
use constituents, only: pcnst, readtrace
use tracers, only: tracers_flag
use time_manager, only: dtime
use filenames, only: ncdata, bnd_topo, &
caseid, &
brnch_retain_casename
use dycore, only: dycore_is
use cam_abortutils, only: endrun
use rayleigh_friction, only: rayk0, raykrange, raytau0
!-----------------------------------------------------------------------
!- module boilerplate --------------------------------------------------
!-----------------------------------------------------------------------
implicit none
private
save
!-----------------------------------------------------------------------
! Public interfaces ----------------------------------------------------
!-----------------------------------------------------------------------
public read_namelist ! Set and/or get all runtime options
!-----------------------------------------------------------------------
! Private data ---------------------------------------------------------
!-----------------------------------------------------------------------
character(len=SHR_KIND_CL), private :: nlfilename = 'atm_in' ! Namelist filename
!-----------------------------------------------------------------------
!
! SOMEWHAT ALPHABETICAL listing of variables in the cam_inparm namelist:
!
! variable description
! -------- -----------------
!
! bnd_topo Path and filename of topography dataset
!
! dtime = nnnn, Model time step in seconds. Default is dycore dependent.
!
! nlvdry = nn, Number of layers over which to do dry
! adjustment. Defaults to 3.
!
! cam_branch_file Filepath of restart file to branch from (nsrest=3)
! Full pathname required.
character(len=256) :: cam_branch_file = ' '
!
!------------------------------------------------------------------
! The following 3 are specific to Rayleigh friction
! integer rayk0 vertical level at which rayleigh friction term is centered
! real(r8) raykrange range of rayleigh friction profile; if 0, range is set automatically
! real(r8) raytau0 approximate value of decay time at model top (days);
! if 0., no rayleigh friction is applied
!------------------------------------------------------------------
!
!
! pertlim = n.n Max size of perturbation to apply to initial
! temperature field.
!
! new_random logical: if .true., use RNG in dynamics/se/random_xgc.F90
! instead of the fortran intrinsic.
!
! seed_custom integer: if > 0, use new seeding mechanism that uses a
! custom seed rather than a custom limit. Default 0
!
! seed_clock logical: if .true., XOR the system_clock with the seed,
! wheter it includes a custom seed or not. Default .false.
!
! phys_chnk_fdim Declared first dimension for physics variables (chunks).
! If <= 0, then value calculated based on problem specifics.
! See phys_grid module.
integer :: phys_chnk_fdim
!
! phys_chnk_fdim_max Upper bound on declared first dimension for physics
! variables (chunks), for when phys_chnk_fdim <= 0.
! See phys_grid module.
integer :: phys_chnk_fdim_max
!
! phys_chnk_fdim_mult Restriction on declared first dimension for physics
! variables (chunks) to be a multiple of this value,
! for when phys_chnk_fdim <= 0. See phys_grid module.
integer :: phys_chnk_fdim_mult
!
! phys_alltoall Dynamics/physics transpose option. See phys_grid module.
!
integer :: phys_alltoall
!
! phys_loadbalance Load balance option for performance tuning of
! physics chunks. See phys_grid module.
integer :: phys_loadbalance
!
! phys_twin_algorithm Load balance option for performance tuning of
! physics chunks. See phys_grid module.
integer :: phys_twin_algorithm
!
! phys_chnk_per_thd Performance tuning option for physics chunks. See
! phys_grid module.
integer :: phys_chnk_per_thd
!
! phys_chnk_cost_write Output option for evaluating physics chunk load balance. See
! phys_grid module.
logical :: phys_chnk_cost_write
!
! tracers_flag = .F. If true, implement tracer test code. Number of tracers determined
! in tracers_suite.F90 must agree with PCNST
!
! readtrace = .T. If true, tracer initial conditions obtained from
! initial file.
!
! print_step_cost true => print per timestep cost info
!
!
! logical indirect
! ! true => include indirect radiative effects of
! ! sulfate aerosols. Default is false.
!
!
! met_data_file name of file that contains the offline meteorology data
! met_data_path name of directory that contains the offline meteorology data
!
! met_filenames_list name of file that contains names of the offline
! meteorology data files
!
! met_remove_file true => the offline meteorology file will be removed
!
! met_cell_wall_winds true => the offline meteorology winds are defined on the model
! grid cell walls
! Physics buffer
logical :: pbuf_global_allocate ! allocate all buffers as global (default: .true.)
! Conservation checks
logical :: print_energy_errors ! switch for diagnostic output from check_energy module
! SCM Options
logical :: single_column
real(r8) :: scmlat,scmlon
real(r8) :: scm_relaxation_low
real(r8) :: scm_relaxation_high
integer, parameter :: max_chars = 128
character(len=max_chars) iopfile
character(len=200) :: scm_clubb_iop_name
logical :: scm_iop_srf_prop
logical :: scm_relaxation
logical :: scm_diurnal_avg
logical :: scm_crm_mode
logical :: scm_observed_aero
logical :: precip_off
logical :: scm_zero_non_iop_tracers
contains
!=======================================================================
subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, nlfilename_in )
!-----------------------------------------------------------------------
!
! Purpose:
! Read data from namelist cam_inparm to define the run. Process some of the
! namelist variables to determine history and restart/branch file path
! names. Check input namelist variables for validity and print them
! to standard output.
!
! Method:
! Important Note for running on SUN systems: "implicit automatic (a-z)"
! will not work because namelist data must be static.
!
! Author:
! Original version: CCM1
! Standardized: L. Bath, June 1992
! T. Acker, March 1996
!
!-----------------------------------------------------------------------
! Note that the following interfaces are prototypes proposed by Henderson
! and Eaton. They minimize coupling with other modules. Design of these
! interfaces should be refined via review by other CAM developers.
! Interface *_defaultopts() gets default values from the responsible
! module (Expert) prior to namelist read.
! Interface *_setopts() sends values to the responsible module (Expert)
! after namelist read. Erroneous values are handled by Experts.
! TBH 9/8/03
!
use phys_grid, only: phys_grid_defaultopts, phys_grid_setopts
use chem_surfvals, only: chem_surfvals_readnl
use check_energy, only: check_energy_defaultopts, check_energy_setopts
use cam_restart, only: restart_defaultopts, restart_setopts, restart_printopts
use co2_cycle, only: co2_cycle_readnl
use shr_string_mod, only: shr_string_toUpper
use scamMod, only: scam_setopts,scam_default_opts
! Some modules read their own namelist input.
use spmd_utils, only: spmd_utils_readnl
use physconst, only: physconst_readnl
use phys_control, only: phys_ctl_readnl
use wv_saturation, only: wv_sat_readnl
use ref_pres, only: ref_pres_readnl
use cam3_aero_data, only: cam3_aero_data_readnl
use cam3_ozone_data, only: cam3_ozone_data_readnl
use macrop_driver, only: macrop_driver_readnl
use microp_driver, only: microp_driver_readnl
use microp_aero, only: microp_aero_readnl
use subcol, only: subcol_readnl
use cloud_fraction, only: cldfrc_readnl
use cldfrc2m, only: cldfrc2m_readnl
use cldwat, only: cldwat_readnl
use zm_conv, only: zmconv_readnl
use hk_conv, only: hkconv_readnl
use uwshcu, only: uwshcu_readnl
use pkg_cld_sediment, only: cld_sediment_readnl
use gw_drag, only: gw_drag_readnl
use qbo, only: qbo_readnl
use iondrag, only: iondrag_readnl
use phys_debug_util, only: phys_debug_readnl
use rad_constituents, only: rad_cnst_readnl
use radiation_data, only: rad_data_readnl
use modal_aer_opt, only: modal_aer_opt_readnl
use clubb_intr, only: clubb_readnl
use chemistry, only: chem_readnl
use lin_strat_chem, only: linoz_readnl
use prescribed_volcaero, only: prescribed_volcaero_readnl
use aerodep_flx, only: aerodep_flx_readnl
use solar_data, only: solar_data_readnl
use tropopause, only: tropopause_readnl
use aoa_tracers, only: aoa_tracers_readnl
use prescribed_ozone, only: prescribed_ozone_readnl
use prescribed_aero, only: prescribed_aero_readnl
use prescribed_ghg, only: prescribed_ghg_readnl
use aircraft_emit, only: aircraft_emit_readnl
use cospsimulator_intr, only: cospsimulator_intr_readnl
use sat_hist, only: sat_hist_readnl
! Needed by sat_hist_readnl
use cam_history, only: hfilename_spec, mfilt, fincl, nhtfrq, avgflag_pertape
use vertical_diffusion, only: vd_readnl
use cam_history_support, only: fieldname_len, fieldname_lenp2
use cam_diagnostics, only: diag_readnl
use nudging, only: nudging_readnl
use radheat, only: radheat_readnl
#if ( defined OFFLINE_DYN )
use metdata, only: metdata_readnl
#endif
use radiation, only: radiation_readnl
use climsim, only: climsim_readnl
!---------------------------Arguments-----------------------------------
logical , intent(in), optional :: single_column_in
real(r8), intent(in), optional :: scmlon_in
real(r8), intent(in), optional :: scmlat_in
character(len=*) , optional :: nlfilename_in
!-----------------------------------------------------------------------
include 'netcdf.inc'
!---------------------------Local variables-----------------------------
character(len=*), parameter :: subname = "read_namelist"
integer ntspdy ! number of timesteps per day
integer t ! history tape index
integer lastchar ! index to last char of a char variable
integer ierr ! error code
integer unitn ! namelist unit number
integer f, i
integer, parameter :: max_chars = 128
! Define the cam_inparm namelist
! ***NOTE*** If a namelist option is not described in the CAM Users Guide,
! it is not supported.
namelist /cam_inparm/ ncdata, bnd_topo, &
cam_branch_file , &
dtime, &
nlvdry, &
pertlim ,&
new_random ,&
seed_custom ,&
seed_clock ,&
readtrace, rayk0, raykrange, raytau0, &
tracers_flag, &
indirect, &
print_step_cost, &
phys_chnk_fdim, &
phys_chnk_fdim_max, &
phys_chnk_fdim_mult, &
phys_alltoall, phys_loadbalance, phys_twin_algorithm, &
phys_chnk_per_thd, phys_chnk_cost_write
! physics buffer
namelist /cam_inparm/ pbuf_global_allocate
! conservation checks
namelist /cam_inparm/ print_energy_errors
! scam
namelist /cam_inparm/ iopfile,scm_iop_srf_prop,scm_relaxation, &
scm_relaxation_low, scm_relaxation_high, &
scm_diurnal_avg,scm_crm_mode,scm_clubb_iop_name, &
scm_observed_aero, precip_off, &
scm_zero_non_iop_tracers
!-----------------------------------------------------------------------
if (present(nlfilename_in)) then
nlfilename = nlfilename_in
end if
! Determine preset values (this is currently being phased out)
call preset ()
! Preset sulfate aerosol related variables
indirect = .false.
! restart write interval
call restart_defaultopts( &
cam_branch_file_out =cam_branch_file )
! Get default values of runtime options for physics chunking.
call phys_grid_defaultopts( &
phys_chnk_fdim_out =phys_chnk_fdim, &
phys_chnk_fdim_max_out =phys_chnk_fdim_max, &
phys_chnk_fdim_mult_out =phys_chnk_fdim_mult, &
phys_loadbalance_out =phys_loadbalance, &
phys_twin_algorithm_out =phys_twin_algorithm, &
phys_alltoall_out =phys_alltoall, &
phys_chnk_per_thd_out =phys_chnk_per_thd, &
phys_chnk_cost_write_out=phys_chnk_cost_write )
! conservation
call check_energy_defaultopts( &
print_energy_errors_out = print_energy_errors )
! Set default options for single column model
if (present(single_column_in)) then
call scam_default_opts(scmlat_out=scmlat,scmlon_out=scmlon, &
single_column_out=single_column, &
scm_iop_srf_prop_out=scm_iop_srf_prop,&
scm_relaxation_out=scm_relaxation, &
scm_relaxation_low_out=scm_relaxation_low, &
scm_relaxation_high_out=scm_relaxation_high, &
scm_diurnal_avg_out=scm_diurnal_avg, &
scm_crm_mode_out=scm_crm_mode, &
scm_observed_aero_out=scm_observed_aero, &
precip_off_out=precip_off, &
scm_clubb_iop_name_out=scm_clubb_iop_name, &
scm_zero_non_iop_tracers_out=scm_zero_non_iop_tracers)
end if
! Read in the cam_inparm namelist from input filename
if (masterproc) then
write(iulog,*) 'Read in cam_inparm namelist from: ', trim(nlfilename)
unitn = getunit()
open( unitn, file=trim(nlfilename), status='old' )
! Look for cam_inparm group name in the input file. If found, leave the
! file positioned at that namelist group.
call find_group_name(unitn, 'cam_inparm', status=ierr)
if (ierr == 0) then ! found cam_inparm
read(unitn, cam_inparm, iostat=ierr) ! read the cam_inparm namelist group
if (ierr /= 0) then
call endrun( subname//':: namelist read returns an'// &
' error condition for cam_inparm' )
end if
else
call endrun(subname // ':: can''t find cam_inparm in file ' // trim(nlfilename))
end if
close( unitn )
call freeunit( unitn )
! Check CASE namelist variable
if (caseid==' ') then
call endrun ('READ_NAMELIST: Namelist variable CASEID must be set')
end if
lastchar = len(caseid)
if (caseid(lastchar:lastchar) /= ' ') then
write(iulog,*)'READ_NAMELIST: CASEID must not exceed ', len(caseid)-1, ' characters'
call endrun
end if
end if
#if ( defined SPMD )
! Scatter namelist data to all processes
call distnl ( )
#endif
! restart write interval
call restart_setopts( nsrest, &
cam_branch_file_in =cam_branch_file )
! Set runtime options for physics chunking.
call phys_grid_setopts( &
phys_chnk_fdim_in =phys_chnk_fdim, &
phys_chnk_fdim_max_in =phys_chnk_fdim_max, &
phys_chnk_fdim_mult_in =phys_chnk_fdim_mult, &
phys_loadbalance_in =phys_loadbalance, &
phys_twin_algorithm_in =phys_twin_algorithm, &
phys_alltoall_in =phys_alltoall, &
phys_chnk_per_thd_in =phys_chnk_per_thd, &
phys_chnk_cost_write_in=phys_chnk_cost_write )
! conservation
call check_energy_setopts( &
print_energy_errors_in = print_energy_errors )
! Set runtime options for single column mode
if (present(single_column_in) .and. present(scmlon_in) .and. present(scmlat_in)) then
if (single_column_in) then
single_column = single_column_in
scmlon = scmlon_in
scmlat = scmlat_in
call scam_setopts( scmlat_in=scmlat,scmlon_in=scmlon, &
iopfile_in=iopfile,single_column_in=single_column,&
scm_iop_srf_prop_in=scm_iop_srf_prop,&
scm_relaxation_in=scm_relaxation, &
scm_relaxation_low_in=scm_relaxation_low, &
scm_relaxation_high_in=scm_relaxation_high, &
scm_diurnal_avg_in=scm_diurnal_avg, &
scm_crm_mode_in=scm_crm_mode, &
scm_observed_aero_in=scm_observed_aero, &
precip_off_in=precip_off, &
scm_clubb_iop_name_in=scm_clubb_iop_name, &
scm_zero_non_iop_tracers_in=scm_zero_non_iop_tracers)
end if
endif
! Call subroutines for modules to read their own namelist.
! In some cases namelist default values may depend on settings from
! other modules, so there may be an order dependence in the following
! calls.
! ***N.B.*** In particular, physconst_readnl should be called before
! the other readnl methods in case that method is used to set
! physical constants, some of which are set at runtime
! by the physconst_readnl method.
! Modules that read their own namelist are responsible for making sure
! all processes receive the values.
call spmd_utils_readnl(nlfilename)
call history_readnl(nlfilename, dtime)
call physconst_readnl(nlfilename)
call chem_surfvals_readnl(nlfilename)
call phys_ctl_readnl(nlfilename)
call wv_sat_readnl(nlfilename)
call ref_pres_readnl(nlfilename)
call cam3_aero_data_readnl(nlfilename)
call cam3_ozone_data_readnl(nlfilename)
call macrop_driver_readnl(nlfilename)
call microp_driver_readnl(nlfilename)
call microp_aero_readnl(nlfilename)
call clubb_readnl(nlfilename)
call subcol_readnl(nlfilename)
call cldfrc_readnl(nlfilename)
call cldfrc2m_readnl(nlfilename)
call zmconv_readnl(nlfilename)
call cldwat_readnl(nlfilename)
call hkconv_readnl(nlfilename)
call uwshcu_readnl(nlfilename)
call cld_sediment_readnl(nlfilename)
call gw_drag_readnl(nlfilename)
call qbo_readnl(nlfilename)
call iondrag_readnl(nlfilename)
call phys_debug_readnl(nlfilename)
call rad_cnst_readnl(nlfilename)
call rad_data_readnl(nlfilename)
call modal_aer_opt_readnl(nlfilename)
call chem_readnl(nlfilename)
call linoz_readnl(nlfilename)
call prescribed_volcaero_readnl(nlfilename)
call solar_data_readnl(nlfilename)
call tropopause_readnl(nlfilename)
call aoa_tracers_readnl(nlfilename)
call aerodep_flx_readnl(nlfilename)
call prescribed_ozone_readnl(nlfilename)
call prescribed_aero_readnl(nlfilename)
call prescribed_ghg_readnl(nlfilename)
call co2_cycle_readnl(nlfilename)
call aircraft_emit_readnl(nlfilename)
call cospsimulator_intr_readnl(nlfilename)
call sat_hist_readnl(nlfilename, hfilename_spec, mfilt, fincl, nhtfrq, avgflag_pertape)
call diag_readnl(nlfilename)
call nudging_readnl(nlfilename)
call radheat_readnl(nlfilename)
call vd_readnl(nlfilename)
#if ( defined OFFLINE_DYN )
call metdata_readnl(nlfilename)
#endif
! Read radiation namelist
call radiation_readnl(nlfilename, dtime_in=dtime)
! Read CLIMSIM namelist
call climsim_readnl(nlfilename)
! Print cam_inparm input variables to standard output
if (masterproc) then
write(iulog,*)' ------------------------------------------'
write(iulog,*)' *** INPUT VARIABLES (CAM_INPARM) ***'
write(iulog,*)' ------------------------------------------'
if (nsrest/=0) then
write(iulog,*) ' Continuation of an earlier run'
else
write(iulog,*) ' Initial run'
end if
write(iulog,*) ' ********** CASE = ',trim(caseid),' **********'
write(iulog,'(1x,a)') ctitle
if (len_trim(ncdata) > 0) then
write(iulog,*) 'Initial dataset is: ',trim(ncdata)
end if
write(iulog,*)'Topography dataset is: ', trim(bnd_topo)
! Type of run
write(iulog,*)'Run type flag (NSREST) 0=initial, 1=restart, 3=branch ',nsrest
call restart_printopts()
! Write physics variables from namelist cam_inparm to std. output
write(iulog,9108) nlvdry
9108 format('Lowest level for dry adiabatic adjust (NLVDRY)',i10)
if ( (adiabatic .and. ideal_phys) .or. (adiabatic .and. aqua_planet) .or. &
(ideal_phys .and. aqua_planet) ) then
call endrun ('READ_NAMELIST: Only one of ADIABATIC, IDEAL_PHYS, or AQUA_PLANET can be .true.')
end if
#ifdef COUP_SOM
if (adiabatic .or. ideal_phys .or. aqua_planet )then
call endrun ('READ_NAMELIST: adiabatic, ideal_phys or aqua_planet can not be used with SOM')
end if
#else
if (adiabatic) write(iulog,*) 'Model will run ADIABATICALLY (i.e. no physics)'
if (ideal_phys) write(iulog,*) 'Run ONLY the "idealized" dynamical core of the ', &
'model (dynamics + Held&Suarez-specified physics)'
if (aqua_planet) then
write(iulog,*) 'Running model in "AQUA_PLANET" mode'
else
write(iulog,*) 'NOT Running model in "AQUA_PLANET" mode'
end if
#endif
end if
! set public data in cam_control_mod
moist_physics = (.not. adiabatic) .and. (.not. ideal_phys)
#ifdef PERGRO
if (masterproc) then
write(iulog,*)'pergro for cloud water is true'
end if
#endif
ntspdy = nint(86400._r8/dtime) ! no. timesteps per day
end subroutine read_namelist
!=======================================================================
#ifdef SPMD
subroutine distnl
!-----------------------------------------------------------------------
!
! Purpose:
! Distribute namelist data to all processors.
!
! The cpp SPMD definition provides for the funnelling of all program i/o
! through the master processor. Processor 0 either reads restart/history
! data from the disk and distributes it to all processors, or collects
! data from all processors and writes it to disk.
!
!---------------------------Code history-------------------------------
!
! Original version: CCM2
! Standardized: J. Rosinski, Oct 1995
! J. Truesdale, Feb. 1996
!
!-----------------------------------------------------------------------
use mpishorthand
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
!
call mpibcast (dtime, 1,mpiint,0,mpicom)
call mpibcast (nsrest ,1,mpiint,0,mpicom)
call mpibcast (nlvdry ,1,mpiint,0,mpicom)
call mpibcast (rayk0 ,1,mpiint,0,mpicom)
call mpibcast (raykrange,1,mpir8,0,mpicom)
call mpibcast (raytau0 ,1,mpir8,0,mpicom)
call mpibcast (tracers_flag,1,mpilog,0,mpicom)
call mpibcast (readtrace ,1,mpilog,0,mpicom)
call mpibcast (adiabatic ,1,mpilog,0,mpicom)
call mpibcast (ideal_phys ,1,mpilog,0,mpicom)
call mpibcast (aqua_planet ,1,mpilog,0,mpicom)
call mpibcast (print_step_cost,1,mpilog,0,mpicom)
call mpibcast (pertlim ,1, mpir8 , 0, mpicom )
call mpibcast (new_random ,1, mpilog, 0, mpicom )
call mpibcast (seed_custom ,1, mpiint, 0, mpicom )
call mpibcast (seed_clock ,1, mpilog, 0, mpicom )
call mpibcast (caseid ,len(caseid) ,mpichar,0,mpicom)
call mpibcast (ctitle ,len(ctitle),mpichar,0,mpicom)
call mpibcast (ncdata ,len(ncdata) ,mpichar,0,mpicom)
call mpibcast (bnd_topo ,len(bnd_topo) ,mpichar,0,mpicom)
call mpibcast (cam_branch_file ,len(cam_branch_file) ,mpichar,0,mpicom)
call mpibcast (indirect , 1 ,mpilog, 0,mpicom)
! Physics chunk tuning
call mpibcast (phys_chnk_fdim ,1,mpiint,0,mpicom)
call mpibcast (phys_chnk_fdim_max ,1,mpiint,0,mpicom)
call mpibcast (phys_chnk_fdim_mult ,1,mpiint,0,mpicom)
call mpibcast (phys_loadbalance ,1,mpiint,0,mpicom)
call mpibcast (phys_twin_algorithm ,1,mpiint,0,mpicom)
call mpibcast (phys_alltoall ,1,mpiint,0,mpicom)
call mpibcast (phys_chnk_per_thd ,1,mpiint,0,mpicom)
call mpibcast (phys_chnk_cost_write,1,mpilog,0,mpicom)
! Physics buffer
call mpibcast (pbuf_global_allocate, 1, mpilog, 0, mpicom)
! Conservation
call mpibcast (print_energy_errors, 1, mpilog, 0, mpicom)
end subroutine distnl
#endif
subroutine preset
!-----------------------------------------------------------------------
!
! Purpose: Preset namelist CAM_INPARM input variables and initialize some other variables
!
! Method: Hardwire the values
!
! Author: CCM Core Group
!
!-----------------------------------------------------------------------
use rgrid
!-----------------------------------------------------------------------
include 'netcdf.inc'
!-----------------------------------------------------------------------
!
!
! Flags
!
print_step_cost = .false. ! print per timestep cost info
!
! rgrid: set default to full grid
!
nlon(:) = plon
!!
!! Unit numbers: set to invalid
!!
! ncid_ini = -1
! ncid_sst = -1
! ncid_trc = -1
!
return
end subroutine preset
end module runtime_opts