FV3 Bundle
gsw_sa_from_sp_baltic.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_sa_from_sp_baltic (sp, long, lat)
3 !==========================================================================
4 !
5 ! For the Baltic Sea, calculates Absolute Salinity with a value
6 ! computed analytically from Practical Salinity
7 !
8 ! sp : Practical Salinity [unitless]
9 ! long : longitude [deg E]
10 ! lat : latitude [deg N]
11 !
12 ! gsw_sa_from_sp_baltic : Absolute Salinity [g/kg]
13 !--------------------------------------------------------------------------
14 
16 
18 
20 
21 use gsw_mod_kinds
22 
23 implicit none
24 
25 real (r8), intent(in) :: sp, long, lat
26 
27 real (r8) :: gsw_sa_from_sp_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_sa_from_sp_baltic = ((gsw_sso - 0.087_r8)/35.0_r8)*sp + 0.087_r8
40  else
41  gsw_sa_from_sp_baltic = 9e15_r8
42  end if
43 
44 else
45  gsw_sa_from_sp_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_sa_from_sp_baltic(sp, long, lat)
real(r8), dimension(3) yb_left
real(r8), dimension(2) yb_right
real(r8), dimension(2) xb_right