Skip to content

Commit

Permalink
Fix the saltFluxAdded diagnoistic, broken in NOAA-GFDL#401
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Nov 21, 2023
1 parent f4c95ec commit 7ef6a57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ module MOM_forcing_type
integer :: id_saltflux = -1
integer :: id_saltFluxIn = -1
integer :: id_saltFluxAdded = -1
integer :: id_saltFluxBehind = -1

integer :: id_total_saltflux = -1
integer :: id_total_saltFluxIn = -1
Expand Down Expand Up @@ -2099,7 +2100,7 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles,
diag%axesT1,Time,'Salt flux into ocean at surface due to restoring or flux adjustment', &
units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s)

handles%id_saltFluxAdded = register_diag_field('ocean_model', 'salt_left_behind', &
handles%id_saltFluxBehind = register_diag_field('ocean_model', 'salt_left_behind', &
diag%axesT1,Time,'Salt left in ocean at surface due to ice formation', &
units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s)

Expand Down Expand Up @@ -3130,6 +3131,9 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h
call post_data(handles%id_total_saltFluxIn, total_transport, diag)
endif

if (handles%id_saltFluxBehind > 0 .and. associated(fluxes%salt_left_behind)) &
call post_data(handles%id_saltFluxBehind, fluxes%salt_left_behind, diag)

if (handles%id_saltFluxGlobalAdj > 0) &
call post_data(handles%id_saltFluxGlobalAdj, fluxes%saltFluxGlobalAdj, diag)
if (handles%id_vPrecGlobalAdj > 0) &
Expand Down

0 comments on commit 7ef6a57

Please sign in to comment.