@@ -16,7 +16,7 @@ module cam_comp
16
16
17
17
use spmd_utils, only: masterproc, mpicom
18
18
use cam_control_mod, only: cam_ctrl_init, cam_ctrl_set_orbit
19
- use cam_physics_control, only: cam_ctrl_set_physics_type
19
+ use cam_control_mod, only: cam_ctrl_set_physics_type
20
20
use cam_control_mod, only: caseid, ctitle
21
21
use runtime_opts, only: read_namelist
22
22
use runtime_obj, only: cam_runtime_opts
@@ -25,7 +25,8 @@ module cam_comp
25
25
use time_manager, only: is_first_step, is_first_restart_step
26
26
27
27
use camsrfexch, only: cam_out_t, cam_in_t
28
- use physics_types, only: phys_state, phys_tend, dtime_phys
28
+ use physics_types, only: phys_state, phys_tend
29
+ use physics_types, only: dtime_phys
29
30
use dyn_comp, only: dyn_import_t, dyn_export_t
30
31
31
32
use perf_mod, only: t_barrierf, t_startf, t_stopf
@@ -58,6 +59,7 @@ module cam_comp
58
59
! Private interface (here to avoid circular dependency)
59
60
private :: cam_register_constituents
60
61
62
+
61
63
!- ----------------------------------------------------------------------
62
64
CONTAINS
63
65
!- ----------------------------------------------------------------------
@@ -85,7 +87,7 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &
85
87
use dyn_comp, only: dyn_init
86
88
! use cam_restart, only: cam_read_restart
87
89
use camsrfexch, only: hub2atm_alloc, atm2hub_alloc
88
- use cam_history, only: history_init_files
90
+ ! use cam_history, only: hist_init_files
89
91
! use history_scam, only: scm_intht
90
92
use cam_pio_utils, only: init_pio_subsystem
91
93
use cam_instance, only: inst_suffix
@@ -233,7 +235,9 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &
233
235
! if (single_column) then
234
236
! call scm_intht()
235
237
! end if
236
- call history_init_files(model_doi_url, caseid, ctitle)
238
+ ! !XXgoldyXX: v need to import this
239
+ ! call hist_init_files(model_doi_url, caseid, ctitle)
240
+ ! !XXgoldyXX: ^ need to import this
237
241
238
242
end subroutine cam_init
239
243
@@ -392,8 +396,10 @@ subroutine cam_run4(cam_out, cam_in, rstwr, nlend, &
392
396
! file output.
393
397
!
394
398
!- ----------------------------------------------------------------------
399
+ ! use cam_history, only: wshist, wrapup
395
400
! use cam_restart, only: cam_write_restart
396
401
! use qneg_module, only: qneg_print_summary
402
+ use time_manager, only: is_last_step
397
403
398
404
type (cam_out_t), intent (inout ) :: cam_out ! Output from CAM to surface
399
405
type (cam_in_t), intent (inout ) :: cam_in ! Input from surface to CAM
@@ -404,6 +410,18 @@ subroutine cam_run4(cam_out, cam_in, rstwr, nlend, &
404
410
integer , intent (in ), optional :: day_spec ! Simulation day
405
411
integer , intent (in ), optional :: sec_spec ! Secs in current simulation day
406
412
413
+ !- ---------------------------------------------------------
414
+ ! History and restart logic: Write and/or dispose history
415
+ ! tapes if required
416
+ !- ---------------------------------------------------------
417
+ !
418
+ ! !XXgoldyXX: v need to import this
419
+ ! call t_barrierf('sync_wshist', mpicom)
420
+ ! call t_startf('wshist')
421
+ ! call wshist()
422
+ ! call t_stopf('wshist')
423
+ ! !XXgoldyXX: ^ need to import this
424
+
407
425
!
408
426
! Write restart files
409
427
!
@@ -423,39 +441,37 @@ subroutine cam_run4(cam_out, cam_in, rstwr, nlend, &
423
441
call t_stopf(' cam_write_restart' )
424
442
end if
425
443
444
+ ! !XXgoldyXX: v need to import this
445
+ ! call t_startf ('cam_run4_wrapup')
446
+ ! call wrapup(rstwr, nlend)
447
+ ! call t_stopf ('cam_run4_wrapup')
448
+ ! !XXgoldyXX: ^ need to import this
449
+
450
+ call shr_sys_flush(iulog)
451
+
426
452
end subroutine cam_run4
427
453
428
454
!
429
455
!- ----------------------------------------------------------------------
430
456
!
431
- subroutine cam_timestep_final (rstwr , nlend , do_ncdata_check )
457
+ subroutine cam_timestep_final (do_ncdata_check )
432
458
!- ----------------------------------------------------------------------
433
459
!
434
460
! Purpose: Timestep final runs at the end of each timestep
435
461
!
436
462
!- ----------------------------------------------------------------------
437
463
438
- use phys_comp, only: phys_timestep_final
439
- use cam_history, only: history_write_files
440
- use cam_history, only: history_wrap_up
441
- logical , intent (in ) :: rstwr ! write restart file
442
- logical , intent (in ) :: nlend ! this is final timestep
464
+ use phys_comp, only: phys_timestep_final
465
+
443
466
! Flag for whether a snapshot (ncdata) check should be run or not
444
- ! - flag is true if this is not the first or last step
445
- logical , intent (in ) :: do_ncdata_check
467
+ logical , intent (in ) :: do_ncdata_check
446
468
447
- if (do_ncdata_check .or. get_nstep() == 0 ) then
448
- call history_write_files()
449
- ! peverwhee - todo: handle restarts
450
- call history_wrap_up(rstwr, nlend)
451
- end if
452
469
!
453
470
!- ---------------------------------------------------------
454
471
! PHYS_TIMESTEP_FINAL Call the Physics package
455
472
!- ---------------------------------------------------------
456
473
!
457
474
call phys_timestep_final(do_ncdata_check)
458
- call shr_sys_flush(iulog)
459
475
460
476
end subroutine cam_timestep_final
461
477
@@ -526,6 +542,7 @@ subroutine cam_register_constituents(cam_runtime_opts)
526
542
! physics suite being invoked during this run.
527
543
use cam_abortutils, only: endrun, check_allocate
528
544
use runtime_obj, only: runtime_options
545
+ use runtime_obj, only: wv_stdname
529
546
use phys_comp, only: phys_suite_name
530
547
use cam_constituents, only: cam_constituents_init
531
548
use cam_constituents, only: const_set_qmin, const_get_index
@@ -535,7 +552,6 @@ subroutine cam_register_constituents(cam_runtime_opts)
535
552
use cam_ccpp_cap, only: cam_ccpp_number_constituents
536
553
use cam_ccpp_cap, only: cam_model_const_properties
537
554
use cam_ccpp_cap, only: cam_ccpp_is_scheme_constituent
538
- use runtime_obj, only: wv_stdname
539
555
540
556
! Dummy arguments
541
557
type (runtime_options), intent (in ) :: cam_runtime_opts
@@ -546,7 +562,6 @@ subroutine cam_register_constituents(cam_runtime_opts)
546
562
integer :: errflg
547
563
character (len= 512 ) :: errmsg
548
564
type (ccpp_constituent_prop_ptr_t), pointer :: const_props(:)
549
- type (ccpp_constituent_properties_t), allocatable , target :: dynamic_constituents(:)
550
565
character (len=* ), parameter :: subname = ' cam_register_constituents: '
551
566
552
567
! Initalize error flag and message:
0 commit comments