From 1fb17a4fa42780f46f5abf32ecadc8bdf42b538c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 15 Jun 2023 13:48:25 -0600 Subject: [PATCH 1/4] 0th timestep fixes --- src/riverroute/RtmHistFile.F90 | 5 +++-- src/riverroute/RtmTimeManager.F90 | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/riverroute/RtmHistFile.F90 b/src/riverroute/RtmHistFile.F90 index 01eab6a..5772e71 100644 --- a/src/riverroute/RtmHistFile.F90 +++ b/src/riverroute/RtmHistFile.F90 @@ -1010,8 +1010,9 @@ subroutine RtmHistHtapesWrapup( rstwr, nlend ) ! and write data to history files if end of history interval. do t = 1, ntapes - ! Skip nstep=0 if monthly average - if (nstep==0 .and. tape(t)%nhtfrq==0) cycle +!KO ! Should no longer be needed +!KO ! Skip nstep=0 if monthly average +!KO if (nstep==0 .and. tape(t)%nhtfrq==0) cycle ! Determine if end of history interval tape(t)%is_endhist = .false. diff --git a/src/riverroute/RtmTimeManager.F90 b/src/riverroute/RtmTimeManager.F90 index d56fbc8..3c9f0f8 100644 --- a/src/riverroute/RtmTimeManager.F90 +++ b/src/riverroute/RtmTimeManager.F90 @@ -1001,7 +1001,10 @@ logical function is_first_step() call ESMF_ClockGet( tm_clock, advanceCount=step_no, rc=rc ) call chkrc(rc, sub//': error return from ESMF_ClockGet') nstep = step_no - is_first_step = (nstep == 0) +!KO is_first_step = (nstep == 0) +!KO + is_first_step = (nstep == 1) +!KO end function is_first_step From 813320fc53a07b4b7fc6b72db50adabcbd51fcf3 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 14 Dec 2023 16:45:30 -0700 Subject: [PATCH 2/4] Remove instances of !KO --- src/riverroute/RtmHistFile.F90 | 4 ---- src/riverroute/RtmTimeManager.F90 | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/riverroute/RtmHistFile.F90 b/src/riverroute/RtmHistFile.F90 index 5772e71..06784a1 100644 --- a/src/riverroute/RtmHistFile.F90 +++ b/src/riverroute/RtmHistFile.F90 @@ -1010,10 +1010,6 @@ subroutine RtmHistHtapesWrapup( rstwr, nlend ) ! and write data to history files if end of history interval. do t = 1, ntapes -!KO ! Should no longer be needed -!KO ! Skip nstep=0 if monthly average -!KO if (nstep==0 .and. tape(t)%nhtfrq==0) cycle - ! Determine if end of history interval tape(t)%is_endhist = .false. if (tape(t)%nhtfrq==0) then !monthly average diff --git a/src/riverroute/RtmTimeManager.F90 b/src/riverroute/RtmTimeManager.F90 index 3c9f0f8..4a9c3a1 100644 --- a/src/riverroute/RtmTimeManager.F90 +++ b/src/riverroute/RtmTimeManager.F90 @@ -1001,10 +1001,7 @@ logical function is_first_step() call ESMF_ClockGet( tm_clock, advanceCount=step_no, rc=rc ) call chkrc(rc, sub//': error return from ESMF_ClockGet') nstep = step_no -!KO is_first_step = (nstep == 0) -!KO is_first_step = (nstep == 1) -!KO end function is_first_step From a55fe8e7254cf24cdc3d4b8f51ce95e62e3af2f4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Nov 2024 12:04:24 -0700 Subject: [PATCH 3/4] Update docstring of is_first_step function --- src/riverroute/RtmTimeManager.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riverroute/RtmTimeManager.F90 b/src/riverroute/RtmTimeManager.F90 index 4a9c3a1..319933d 100644 --- a/src/riverroute/RtmTimeManager.F90 +++ b/src/riverroute/RtmTimeManager.F90 @@ -992,7 +992,7 @@ end function is_end_curr_month logical function is_first_step() - ! Return true on first step of initial run only. + ! Return true on first step of any run. character(len=*), parameter :: sub = 'rtm::is_first_step' integer :: rc integer :: nstep From 6dcdfbc27d289b594a739bb3808a00d6a3ebcb0d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Nov 2024 13:17:48 -0700 Subject: [PATCH 4/4] New update of function's docstring --- src/riverroute/RtmTimeManager.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riverroute/RtmTimeManager.F90 b/src/riverroute/RtmTimeManager.F90 index 319933d..96cef4a 100644 --- a/src/riverroute/RtmTimeManager.F90 +++ b/src/riverroute/RtmTimeManager.F90 @@ -992,7 +992,7 @@ end function is_end_curr_month logical function is_first_step() - ! Return true on first step of any run. + ! Return true on first step of startup and hybrid runs. character(len=*), parameter :: sub = 'rtm::is_first_step' integer :: rc integer :: nstep