FV3 Bundle
gsw_grav.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_grav (lat, p)
3 !==========================================================================
4 !
5 ! Calculates acceleration due to gravity as a function of latitude and as
6 ! a function of pressure in the ocean.
7 !
8 ! lat = latitude in decimal degress north [ -90 ... +90 ]
9 ! p = sea pressure [ dbar ]
10 !
11 ! gsw_grav : grav = gravitational acceleration [ m s^-2 ]
12 !--------------------------------------------------------------------------
13 
14 use gsw_mod_toolbox, only : gsw_z_from_p
15 
17 
18 use gsw_mod_kinds
19 
20 implicit none
21 
22 real (r8), intent(in) :: lat, p
23 
24 real (r8) :: gsw_grav
25 
26 real (r8) :: sin2, gs, z
27 
28 sin2 = sin(lat*deg2rad)**2
29 gs = 9.780327_r8*(1.0_r8 + (5.2792e-3_r8 + (2.32e-5_r8*sin2))*sin2)
30 
31 z = gsw_z_from_p(p,lat)
32 
33 gsw_grav = gs*(1.0_r8 - gamma*z) ! z is the height corresponding to p.
34  ! Note. In the ocean z is negative.
35 return
36 end function
37 
38 !--------------------------------------------------------------------------
elemental real(r8) function gsw_grav(lat, p)
Definition: gsw_grav.f90:3