2 elemental function gsw_saar (p, long, lat)
24 real (r8),
intent(in) :: p,
long, lat
28 integer :: indx0, indy0, indz0, k, ndepth_max
30 real (r8),
dimension(4) :: saar, saar_old
31 real (r8) :: p0_original, sa_upper, sa_lower, dlong, dlat
32 real (r8) :: r1, s1, t1, p_tmp, long360
34 character (*),
parameter :: func_name =
"gsw_saar" 37 if (long360.lt.0.0_r8) long360 = long360 + 360.0_r8
39 indx0 = floor(1.0_r8 + (
nx-1)*(long360-
longs_ref(1)) / &
44 if ((indx0.ge.1 .and. indx0.le.
nx) .and. (indy0.ge.1 .and. indy0.le.
ny))
then 45 if (indx0.eq.
nx) indx0 =
nx-1
46 if (indy0.eq.
ny) indy0 =
ny-1
69 if (ndepth_max.eq.-1)
then 76 if (p_tmp.gt.
p_ref(ndepth_max)) p_tmp =
p_ref(ndepth_max)
95 else if (abs(sum(saar)).ge.1e10_r8)
then 100 sa_upper = (1.0_r8-s1)*(saar(1) + r1*(saar(2)-saar(1))) + s1*(saar(4) + &
101 r1*(saar(3)-saar(4)))
112 else if (abs(sum(saar)).ge.1e10_r8)
then 117 sa_lower = (1.0_r8-s1)*(saar(1) + r1*(saar(2)-saar(1))) + s1*(saar(4) + &
118 r1*(saar(3)-saar(4)))
119 if (abs(sa_lower).ge.1e10_r8) sa_lower = sa_upper
120 gsw_saar = sa_upper + t1*(sa_lower-sa_upper)
integer, parameter, public long
real(r8), dimension(npan) longs_pan
real(r8), dimension(npan) lats_pan
elemental real(r8) function gsw_saar(p, long, lat)
integer, dimension(4) delj
real(r8), dimension(nz) p_ref
real(r8), dimension(nx) longs_ref
integer, dimension(4) deli
integer, dimension(ny, nx) ndepth_ref
real(r8), dimension(nz, ny, nx) saar_ref
real(r8), dimension(ny) lats_ref
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)