Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
===============================================================

Tag name:
Originator(s): nusbaume
Date:
One-line Summary: Start the MPAS dycore clock at the current date on restarts
Github PR URL:

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

Fixes #1721: MPAS dycore timer resets for restart runs

The MPAS dycore clock was always started at RUN_STARTDATE, so on
continue runs the MPAS time-step diagnostics in atm.log (and the MPAS
"xtime" field) were reset to the run start date. The MPAS clock now
starts at CAM's current date, which is the run start date for initial
runs and the restart date for continue and branch runs.

This change was developed with AI assistance (Claude Code).

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by:

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:

M src/dynamics/mpas/dyn_comp.F90
- Set MPAS config_start_time from get_curr_date instead of get_start_date
- Set MPAS config_run_duration to 'none' so the MPAS clock stop time
comes from config_stop_time

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

derecho/nvhpc/aux_cam:

izumi/nag/aux_cam:

izumi/gnu/aux_cam:

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: bit-for-bit unchanged (expected)

===============================================================

Tag name: cam6_4_213
Originator(s): peverwhee, billsacks
Date: Oct 16, 2026
Expand Down
14 changes: 8 additions & 6 deletions src/dynamics/mpas/dyn_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module dyn_comp
use pio, only: file_desc_t
use cam_pio_utils, only: clean_iodesc_list

use time_manager, only: get_start_date, get_stop_date, get_run_duration, &
use time_manager, only: get_curr_date, get_stop_date, &
timemgr_get_calendar_cf, get_step_size

use cam_logfile, only: iulog
Expand Down Expand Up @@ -273,7 +273,7 @@ subroutine dyn_readnl(NLFileName)

! Local variables
integer, dimension(2) :: logUnits ! stdout and stderr for MPAS logging
integer :: yr, mon, day, tod, ndate, nday, nsec
integer :: yr, mon, day, tod, ndate
character(len=*), parameter :: subname = 'dyn_comp:dyn_readnl'
!----------------------------------------------------------------------------

Expand All @@ -285,17 +285,19 @@ subroutine dyn_readnl(NLFileName)
! read namelist
call cam_mpas_namelist_read(NLFileName, domain_ptr % configs)

! Set config_start_date, etc. (these will not appear in the dycore namelist)
call get_start_date(yr, mon, day, tod)
! Set config_start_time, etc. (these will not appear in the dycore namelist)
! The MPAS clock starts at CAM's current time, which is the run start date for
! initial runs and the restart date for continuation and branch runs.
call get_curr_date(yr, mon, day, tod)
ndate = yr*10000 + mon*100 + day
call mpas_pool_add_config(domain_ptr % configs, 'config_start_time', date2yyyymmdd(ndate)//'_'//sec2hms(tod))

call get_stop_date(yr, mon, day, tod)
ndate = yr*10000 + mon*100 + day
call mpas_pool_add_config(domain_ptr % configs, 'config_stop_time', date2yyyymmdd(ndate)//'_'//sec2hms(tod))

call get_run_duration(nday, nsec)
call mpas_pool_add_config(domain_ptr % configs, 'config_run_duration', trim(int2str(nday))//'_'//sec2hms(nsec))
! Let the MPAS clock use config_stop_time to set its stop time.
call mpas_pool_add_config(domain_ptr % configs, 'config_run_duration', 'none')

! Although the following namelist options are not expected to be used by CAM-MPAS, the MPAS-A dycore
! references these options, and they therefore must be defined in the configs pool
Expand Down
Loading