Skip to content

Commit

Permalink
*Fix two bugs in convert_temp_salt_for_TEOS10
Browse files Browse the repository at this point in the history
  Fixed two bugs on a single line of convert_temp_salt_for_TEOS10.  The first
bug was a reversal in the order of the temperature and salinity arguments to
poTemp_to_consTemp, resulting in temperatures that closely approximate the
salinities.  The second bug that was fixed on this line was temperatures being
rescaled with a factor that is appropriate for salinities. This bug-fix will
change answers dramatically for any cases that use the ROQUET_RHO, ROQUET_SPV
and TEOS10 equations of state and initialize the model with
INIT_LAYERS_FROM_Z_FILE = True.
  • Loading branch information
Hallberg-NOAA authored and marshallward committed Feb 7, 2024
1 parent 671c85d commit 07bace6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/equation_of_state/MOM_EOS.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ subroutine convert_temp_salt_for_TEOS10(T, S, HI, kd, mask_z, EOS)
do k=1,kd ; do j=HI%jsc,HI%jec ; do i=HI%isc,HI%iec
if (mask_z(i,j,k) >= 1.0) then
S(i,j,k) = Sref_Sprac * S(i,j,k)
T(i,j,k) = EOS%degC_to_C*poTemp_to_consTemp(EOS%S_to_ppt*S(i,j,k), EOS%S_to_ppt*T(i,j,k))
T(i,j,k) = EOS%degC_to_C*poTemp_to_consTemp(EOS%C_to_degC*T(i,j,k), EOS%S_to_ppt*S(i,j,k))
endif
enddo ; enddo ; enddo
end subroutine convert_temp_salt_for_TEOS10
Expand Down

0 comments on commit 07bace6

Please sign in to comment.