Skip to content

Commit

Permalink
Merge branch 'beharrop/atm/fix-floating-invalid-co2-diags' into next …
Browse files Browse the repository at this point in the history
…(PR #6275)

Fixes floating invalid in co2_diagnostics module

Floating invalid error was occurring in co2_diagnostics module. This fix sets
global mean arrays to fill values.

Fixes #6185.

[BFB]

* origin/beharrop/atm/fix-floating-invalid-co2-diags:
  Fixes floating invalid in co2_diagnostics module from poorly initialized fields
  • Loading branch information
wlin7 committed May 3, 2024
2 parents 46f2245 + 4c099ee commit 866335c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/eam/src/physics/cam/co2_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -433,16 +433,24 @@ subroutine print_global_carbon_diags(state, dtime, nstep)
( co2_print_diags_monthly .and. is_end_curr_month() ) .or. &
( co2_print_diags_total .and. is_last_step() ) ) then
call gmean(tc, tc_glob, c_num_var)
else
tc_glob(:) = 1.e36
end if

if ( co2_print_diags_timestep) then
call gmean(flux_ts, flux_ts_glob, f_ts_num_var)
else
flux_ts_glob(:) = 0._r8
end if
if ( co2_print_diags_monthly .and. is_end_curr_month() ) then
call gmean(flux_mon, flux_mon_glob, f_mon_num_var)
else
flux_mon_glob(:) = 0._r8
end if
if ( co2_print_diags_total .and. is_last_step() ) then
call gmean(flux_run, flux_run_glob, f_run_num_var)
else
flux_run_glob(:) = 0._r8
end if

! assign global means to readable variables
Expand Down

0 comments on commit 866335c

Please sign in to comment.