FV3 Bundle
gsw_sp_from_sa_baltic.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_sp_from_sa_baltic (sa, long, lat)
3 !==========================================================================
4 !
5 ! For the Baltic Sea, calculates Practical Salinity with a value
6 ! computed analytically from Absolute Salinity
7 !
8 ! sa : Absolute Salinity [g/kg]
9 ! long : longitude [deg E]
10 ! lat : latitude [deg N]
11 !
12 ! gsw_sp_from_sa_baltic : Practical Salinity [unitless]
13 !--------------------------------------------------------------------------
14 
16 
18 
20 
21 use gsw_mod_kinds
22 
23 implicit none
24 
25 real (r8), intent(in) :: sa, long, lat
26 
27 real (r8) :: gsw_sp_from_sa_baltic
28 
29 real (r8) :: xx_left, xx_right
30 
31 if (xb_left(2).lt.long .and. long.lt.xb_right(1) .and. &
32  yb_left(1).lt.lat .and. lat.lt.yb_left(3)) then
33 
34  xx_left = gsw_util_xinterp1(yb_left, xb_left, lat)
35 
36  xx_right = gsw_util_xinterp1(yb_right, xb_right, lat)
37 
38  if(xx_left.le.long .and. long.le.xx_right) then
39  gsw_sp_from_sa_baltic = (35.0_r8/(gsw_sso - 0.087_r8))*(sa - 0.087_r8)
40  else
41  gsw_sp_from_sa_baltic = 9e15_r8
42  end if
43 
44 else
45  gsw_sp_from_sa_baltic = 9e15_r8
46 end if
47 
48 return
49 end function
50 
51 !--------------------------------------------------------------------------
real(r8), dimension(3) xb_left
integer, parameter, public long
Definition: Type_Kinds.f90:76
elemental real(r8) function gsw_sp_from_sa_baltic(sa, long, lat)
real(r8), dimension(3) yb_left
real(r8), dimension(2) yb_right
real(r8), dimension(2) xb_right