Skip to content

Commit

Permalink
Fixes the annual C budget in ELM
Browse files Browse the repository at this point in the history
The C-states for all budgets (daily/monthly/annual/instantaneous/all time) are
updated when the timestep is 1.

Fixes #6337
[BFB]
  • Loading branch information
bishtgautam committed May 9, 2024
1 parent 4fab3c8 commit d1a7353
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/elm/src/biogeochem/CNPBudgetMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,12 @@ subroutine Accum(s_size, budg_fluxN, budg_fluxL, budg_stateL, budg_stateG)
if (sec_prev == 0 .and. day_prev == 1 .and. month_prev == 1) update_state_beg = .true.
if (sec_curr == 0 .and. day_curr == 1 .and. month_curr == 1) update_state_end = .true.
case (p_inf)
if (get_nstep() == 1) update_state_beg = .true.
update_state_end = .true.
end select

! If this is the first time step, update the states for all budget types
if (get_nstep() == 1) update_state_beg = .true.

if (update_state_beg) then
do is = 1, s_size/2 - 1
budg_stateL(is,ip) = budg_stateL(is, p_inst)
Expand Down

0 comments on commit d1a7353

Please sign in to comment.