24 real (r8),
intent(in) :: p,
long, lat
28 integer :: indx0, indy0, indz0, k, ndepth_max
30 real (r8),
dimension(4) :: dsar, dsar_old
31 real (r8) :: dlong, dlat
32 real (r8) :: p0_original, sa_upper, sa_lower
33 real (r8) :: r1, s1, t1, p_tmp, long360
35 character (*),
parameter :: func_name =
"gsw_deltasa_atlas" 38 if (long360.lt.0.0_r8) long360 = long360 + 360.0_r8
40 indx0 = floor(1.0_r8 + (
nx-1)*(long360-
longs_ref(1)) / &
45 if ((indx0.ge.1 .and. indx0.le.
nx) .and. (indy0.ge.1 .and. indy0.le.
ny))
then 46 if (indx0.eq.
nx) indx0 =
nx-1
47 if (indy0.eq.
ny) indy0 =
ny-1
70 if (ndepth_max.eq.-1)
then 77 if (p_tmp.gt.
p_ref(ndepth_max)) p_tmp =
p_ref(ndepth_max)
96 else if (abs(sum(dsar)).ge.1e10_r8)
then 101 sa_upper = (1.0_r8-s1)*(dsar(1) + r1*(dsar(2)-dsar(1))) + s1*(dsar(4) + &
102 r1*(dsar(3)-dsar(4)))
113 else if (abs(sum(dsar)).ge.1e10_r8)
then 118 sa_lower = (1.0_r8-s1)*(dsar(1) + r1*(dsar(2)-dsar(1))) + s1*(dsar(4) + &
119 r1*(dsar(3)-dsar(4)))
120 if (abs(sa_lower).ge.1e10_r8) sa_lower = sa_upper
integer, parameter, public long
elemental real(r8) function gsw_deltasa_atlas(p, long, lat)
real(r8), dimension(npan) longs_pan
real(r8), dimension(npan) lats_pan
real(r8), parameter, public gsw_error_limit
integer, dimension(4) delj
real(r8), dimension(nz) p_ref
real(r8), dimension(nx) longs_ref
real(r8), dimension(nz, ny, nx) delta_sa_ref
integer, dimension(4) deli
integer, dimension(ny, nx) ndepth_ref
real(r8), dimension(ny) lats_ref
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)