Skip to content

Commit

Permalink
cleanup work
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Aug 21, 2024
1 parent 865adc1 commit 0b6518d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
5 changes: 1 addition & 4 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ module esm_time_mod

public :: esm_time_clockInit ! initialize driver clock (assumes default calendar)

! private :: esm_time_timeInit
! private :: esm_time_alarmInit
private :: esm_time_date2ymd

! Clock and alarm options
character(len=*), private, parameter :: &
optNONE = "none" , &
optNever = "never" , &
optNSteps = "nstep" , &
optNSeconds = "nsecond" , &
optNMinutes = "nminute" , &
optNHours = "nhour" , &
Expand Down Expand Up @@ -254,7 +251,7 @@ subroutine esm_time_clockInit(ensemble_driver, instance_driver, logunit, maintas
! Create the clock
clock = ESMF_ClockCreate(TimeStep, StartTime, refTime=RefTime, name='ESMF Driver Clock', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! Advance the clock to the current time (in case of a restart)
call ESMF_ClockGet(clock, currTime=clocktime, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down
2 changes: 0 additions & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
# determine coupling intervals
comps = case.get_values("COMP_CLASSES")
mindt = basedt


coupling_times = {}
for comp in comps:
ncpl = case.get_value(comp.upper() + "_NCPL")
Expand Down
17 changes: 1 addition & 16 deletions mediator/med_phases_restart_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module med_phases_restart_mod
!-----------------------------------------------------------------------------

use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
! use med_constants_mod , only : dbug_flag => med_constants_dbug_flag
use med_constants_mod , only : dbug_flag => med_constants_dbug_flag
use med_utils_mod , only : chkerr => med_utils_ChkErr
use med_internalstate_mod , only : maintask, logunit, InternalState
use med_internalstate_mod , only : ncomps, compname, compocn, complnd, compwav
Expand All @@ -25,7 +25,6 @@ module med_phases_restart_mod
logical :: write_restart_at_endofrun = .false.
logical :: whead(2) = (/.true. , .false./)
logical :: wdata(2) = (/.false., .true. /)
integer, parameter:: dbug_flag = 2
character(*), parameter :: u_FILE_u = &
__FILE__

Expand Down Expand Up @@ -302,7 +301,6 @@ subroutine med_phases_restart_write(gcomp, rc)
trim(nexttimestr),'.nc'

if (maintask) then
! restart_pfile = "rpointer.cpl"//trim(cpl_inst_tag)//'.'//trim(nexttimestr)
restart_pfile = "rpointer.cpl"//trim(cpl_inst_tag)
call ESMF_LogWrite(trim(subname)//" write rpointer file = "//trim(restart_pfile), ESMF_LOGMSG_INFO)
open(newunit=unitn, file=restart_pfile, form='FORMATTED')
Expand Down Expand Up @@ -548,23 +546,10 @@ subroutine med_phases_restart_read(gcomp, rc)
endif

! Get the restart file name from the pointer file
! restart_pfile = "rpointer.cpl"//trim(cpl_inst_tag)//'.'//trim(currtimestr)
restart_pfile = "rpointer.cpl"//trim(cpl_inst_tag)
if (maintask) then
call ESMF_LogWrite(trim(subname)//" read rpointer file = "//trim(restart_pfile), ESMF_LOGMSG_INFO)
open(newunit=unitn, file=restart_pfile, form='FORMATTED', status='old', iostat=ierr)

if (ierr < 0) then
! try without currtimestr
restart_pfile = "rpointer.cpl"//trim(cpl_inst_tag)
call ESMF_LogWrite(trim(subname)//" read rpointer file = "//trim(restart_pfile), ESMF_LOGMSG_INFO)
open(newunit=unitn, file=restart_pfile, form='FORMATTED', status='old', iostat=ierr)
if(ierr < 0) then
call ESMF_LogWrite(trim(subname)//' rpointer file open returns error', ESMF_LOGMSG_INFO)
rc=ESMF_Failure
return
end if
end if
read (unitn,'(a)', iostat=ierr) restart_file
if (ierr < 0) then
call ESMF_LogWrite(trim(subname)//' rpointer file read returns error', ESMF_LOGMSG_INFO)
Expand Down

0 comments on commit 0b6518d

Please sign in to comment.