From 86c5ed989cb2e7b2719cf6aaaf1a562a28f89e74 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Tue, 27 Feb 2024 04:22:17 -0500 Subject: [PATCH] (*)Fix bug in h_neglect used to remap diags to rho Added explicit names to the h_neglect and h_neglect_edge arguments in a call to build_rho_column in diag_remap_update. These were problematic because these arguments were previously in the wrong positions and hence were being used for the wrong variables inside of build_rho_column. In Boussinesq mode, the results will be the same as long as there is no dimensional rescaling being applied to thicknesses, and it this were being tested it would have resulted in a dimensional consistency test failure. In non-Boussinesq mode, the values of H_subroundoff as used for this coordinate will be off by a factor of RHO_KV_CONVERT (usually 1035), but these thicknesses are so small that they do not matter unless ANGSTROM is explicitly set to zero (when no dimensional rescaling is being used). To summarize, this fixes a bug that has been around since 2017, and while this fix could slightly change some diagnostics that are remapped to density, it only does so in circumstances that are unlikely to have been realized. No answer changes were detected in the MOM6-examples regression suite, and almost certainly none ever would be in any existing use of MOM6. --- src/framework/MOM_diag_remap.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/framework/MOM_diag_remap.F90 b/src/framework/MOM_diag_remap.F90 index a2ecc197bc..0e2e594403 100644 --- a/src/framework/MOM_diag_remap.F90 +++ b/src/framework/MOM_diag_remap.F90 @@ -326,7 +326,7 @@ subroutine diag_remap_update(remap_cs, G, GV, US, h, T, S, eqn_of_state, h_targe elseif (remap_cs%vertical_coord == coordinateMode('RHO')) then call build_rho_column(get_rho_CS(remap_cs%regrid_cs), GV%ke, & GV%Z_to_H*(G%bathyT(i,j)+G%Z_ref), h(i,j,:), T(i,j,:), S(i,j,:), & - eqn_of_state, zInterfaces, h_neglect, h_neglect_edge) + eqn_of_state, zInterfaces, h_neglect=h_neglect, h_neglect_edge=h_neglect_edge) elseif (remap_cs%vertical_coord == coordinateMode('HYCOM1')) then ! call build_hycom1_column(remap_cs%regrid_cs, nz, & ! GV%Z_to_H*(G%bathyT(i,j)+G%Z_ref), sum(h(i,j,:)), zInterfaces)