Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests for nstep starting at 1 instead of 0 #1

Merged
merged 1 commit into from
Jul 26, 2023
Merged
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
8 changes: 1 addition & 7 deletions src/unit_test_shr/unittestTimeManagerMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ subroutine unittest_timemgr_set_nstep(nstep)
! !DESCRIPTION:
! Set the time step number
!
!KO
! Comment not needed now?
!KO
! Note that the starting time step number is 0, so calling this with nstep = 1
! advances the time step beyond the starting time step.
!
! !USES:
use clm_time_manager, only : advance_timestep
!
Expand All @@ -195,7 +189,7 @@ subroutine unittest_timemgr_set_nstep(nstep)
character(len=*), parameter :: subname = 'unittest_timemgr_set_nstep'
!-----------------------------------------------------------------------

do n = 1, nstep
do n = 2, nstep
call advance_timestep()
end do

Expand Down
8 changes: 4 additions & 4 deletions src/utils/test/clm_time_manager_test/test_clm_time_manager.pf
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,16 @@ contains
end subroutine getPrevYearfrac_leapYearAtYearBoundary_returnsCorrectValue

@Test
subroutine getNstep_step0(this)
subroutine getNstep_step1(this)
class(TestTimeManager), intent(inout) :: this
integer :: nstep

call unittest_timemgr_setup(dtime=dtime)

nstep = get_nstep()

@assertEqual(0, nstep)
end subroutine getNstep_step0
@assertEqual(1, nstep)
end subroutine getNstep_step1

@Test
subroutine getNstep_step3(this)
Expand Down Expand Up @@ -378,7 +378,7 @@ contains

call unittest_timemgr_setup(dtime=dtime)

call set_nstep(1)
call set_nstep(2)

is_first = is_first_step()

Expand Down