Skip to content

Commit

Permalink
Change time check for end of month in CNPBudgetMod
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdschwartz committed Mar 1, 2024
1 parent 847ac98 commit 92a1a98
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions components/elm/src/biogeochem/CNPBudgetMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,7 @@ subroutine CBudget_SetEndingMonthlyStates(bounds, col_cs, grc_cs)
)

! Get current and previous dates to determine if a new month started
call get_prev_date(year_curr, month_curr, day_curr, sec_curr);
call get_prev_date(year_prev, month_prev, day_prev, sec_prev)
call get_curr_date(year_curr, month_curr, day_curr, sec_curr);

! If at the beginning of a simulation, save grid-level TCS based on
! 'begcb' from the current time step
Expand All @@ -1219,7 +1218,7 @@ subroutine CBudget_SetEndingMonthlyStates(bounds, col_cs, grc_cs)
! If multiple steps into a simulation and the last time step was the
! end of a month, save grid-level TCS based on 'endcb' from the last
! time step
if (get_nstep() > 1 .and. day_prev == 1 .and. sec_prev == 0) then
if (get_nstep() > 1 .and. day_curr == 1 .and. sec_curr == 0) then
call c2g( bounds, &
endcb(bounds%begc:bounds%endc), &
tcs_month_end_grc(bounds%begg:bounds%endg), &
Expand Down

0 comments on commit 92a1a98

Please sign in to comment.