Skip to content

Commit

Permalink
add per-timestep relative C error to output log
Browse files Browse the repository at this point in the history
  • Loading branch information
maltrud committed Sep 15, 2022
1 parent 2b7fe73 commit 55764b7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,7 @@ subroutine carbon_conservation(domain, err)
relativeCarbonErrorBoundsFac = 1.e-2
relativeCarbonErrorBounds = &
relativeCarbonErrorStepBounds*relativeCarbonErrorBoundsFac*totalTimeSteps
relativeCarbonErrorPerTimeStep = relativeCarbonError/accumulatedFluxCounter

!-------------------------------------------------------------
! Output to log file
Expand Down Expand Up @@ -1784,6 +1785,14 @@ subroutine carbon_conservation(domain, err)
call mpas_log_write(m)
call mpas_log_write(' ')

write(m,"('Relative carbon error per timestep = ', es16.8)") &
relativeCarbonErrorPerTimeStep
call mpas_log_write(m)
write(m,"('Relative carbon error per timestep bounds = ', es16.8)") &
relativeCarbonErrorStepBounds
call mpas_log_write(m)
call mpas_log_write(' ')

write(m,"('Accumulated absolute carbon error (kg) ', es16.8)") &
accumulatedAbsoluteCarbonError*mmol_to_kg_C
call mpas_log_write(m)
Expand All @@ -1796,7 +1805,6 @@ subroutine carbon_conservation(domain, err)
call mpas_log_write(m)
call mpas_log_write(' ')

relativeCarbonErrorPerTimeStep = relativeCarbonError/accumulatedFluxCounter
if (abs(relativeCarbonErrorPerTimeStep) > relativeCarbonErrorStepBounds) then
if (conservationCheck_carbon_failure_abort) then
call mpas_log_write( &
Expand Down

0 comments on commit 55764b7

Please sign in to comment.