Skip to content

Commit

Permalink
remove unused subroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 1, 2024
1 parent 0341aeb commit 27c2af7
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module esm_time_mod
implicit none
private ! default private

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

private :: esm_time_date2ymd

Expand Down Expand Up @@ -52,7 +52,7 @@ module esm_time_mod
contains
!===============================================================================

subroutine esm_time_clockInit(ensemble_driver, instance_driver, logunit, maintask, rc)
subroutine esm_time_clockinit(ensemble_driver, instance_driver, logunit, maintask, rc)
use nuopc_shr_methods, only : get_minimum_timestep, dtime_drv
! input/output variables
type(ESMF_GridComp) :: ensemble_driver, instance_driver
Expand Down Expand Up @@ -134,25 +134,17 @@ subroutine esm_time_clockInit(ensemble_driver, instance_driver, logunit, maintas
call NUOPC_CompAttributeGet(instance_driver, name='drv_restart_pointer', value=restart_pfile, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if (trim(restart_file) /= 'none') then
if (trim(restart_pfile) /= 'none') then

call NUOPC_CompAttributeGet(instance_driver, name="inst_suffix", isPresent=isPresent, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if(isPresent) then
call NUOPC_CompAttributeGet(instance_driver, name="inst_suffix", value=inst_suffix, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
restart_pfile = replace_text(restart_file, ".cpl", ".cpl."//inst_suffix)
else
inst_suffix = ""
endif
if (maintask) then
write(logunit,*) " read rpointer file = "//trim(restart_pfile)
inquire( file=trim(restart_pfile), exist=exists)
print *,__FILE__,__LINE__,trim(restart_pfile), exists
if (.not. exists) then
restart_pfile = "rpointer.cpl"
if (inst_suffix .ne. "") restart_pfile = trim(restart_pfile)//'.'//inst_suffix
rc = ESMF_FAILURE
call ESMF_LogWrite(trim(subname)//' ERROR rpointer file '//trim(restart_pfile)//' not found', &
ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__)
return
endif

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)
Expand Down Expand Up @@ -329,20 +321,7 @@ subroutine esm_time_clockInit(ensemble_driver, instance_driver, logunit, maintas
if (ChkErr(rc,__LINE__,u_FILE_u)) return
firsttime = .false.
endif
contains
FUNCTION Replace_Text (s,text,rep) RESULT(outs)
CHARACTER(len=*) :: s,text,rep
CHARACTER(LEN(s)+100) :: outs ! provide outs with extra 100 char len
INTEGER :: i, nt, nr

outs = s ; nt = LEN_TRIM(text) ; nr = LEN_TRIM(rep)
DO
i = INDEX(outs,text(:nt)) ; IF (i == 0) EXIT
outs = outs(:i-1) // rep(:nr) // outs(i+nt:)
END DO
END FUNCTION Replace_Text

end subroutine esm_time_clockInit
end subroutine esm_time_clockinit

!===============================================================================

Expand Down

0 comments on commit 27c2af7

Please sign in to comment.