Skip to content

Commit c31ec7f

Browse files
committed
Fix v_sa_p bug in gsw_specvol_second_derivatives
Fixed a bug in the calculation of v_sa_p in gsw_specvol_second_derivatives, in which a division by the square root of offset-salinity was omitted. This bug was detected by the MOM6 self-consistency testing, but it turns out that it was previously corrected in the matlab version of the TEOS-10 code on Sept. 29, 2022, at github.com/TEOS-10/GSW-Matlab/commit/38c9635, and subsequently ported to the C version of the code via github.com/TEOS-10/GSW-C/pull/53, on Oct. 3, 2022, but the Fortran version was somehow omitted. This commit makes the analogous correction to the Fortran version of TEOS-10, and once this commit is fully merged into the master branch of TEOS-10/GSW-Fortran, I expect that github.com//issues/26 can be closed. At this point we are not detecting any other self-inconsistencies in the TEOS-10 Fortran code that we are using with MOM6. However, this bug might still raise the question of whether there are other corrections that have been made to the Matlab or C versions of TEOS-10 that have not propagated to the Fortran version.
1 parent 5d2271f commit c31ec7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

toolbox/gsw_specvol_second_derivatives.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ elemental subroutine gsw_specvol_second_derivatives (sa, ct, p, v_sa_sa, &
108108
+ b122*xs + b032*ys))) + z*(3.0_r8*(b003 + b103*xs + b013*ys) &
109109
+ 4.0_r8*b004*z))
110110

111-
v_sa_p = 1e-8_r8*0.5_r8*gsw_sfac*v_sa_p_part
111+
v_sa_p = 1e-8_r8*0.5_r8*gsw_sfac*v_sa_p_part/xs
112112

113113
end if
114114

0 commit comments

Comments
 (0)