18 real (r8),
intent(in) :: sa(:), ct(:), p(:), p_i(:)
19 real (r8),
intent(out) :: sa_i(:), ct_i(:)
29 if (p_i(i) .le. p(1))
then 34 else if (p_i(i) .ge. p(np))
then 42 if (p_i(i) .lt. p_i(i-1)) k = 1
46 r = (p_i(i)-p(k))/(p(k+1)-p(k))
47 sa_i(i) = sa(k) + r*(sa(k+1)-sa(k))
48 ct_i(i) = ct(k) + r*(ct(k+1)-ct(k))
pure subroutine gsw_linear_interp_sa_ct(sa, ct, p, p_i, sa_i, ct_i)