FV3 Bundle
gsw_adiabatic_lapse_rate_from_ct.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_adiabatic_lapse_rate_from_ct (sa, ct, p)
3 !==========================================================================
4 
5 ! Calculates the adiabatic lapse rate from Conservative Temperature
6 !
7 ! sa : Absolute Salinity [g/kg]
8 ! ct : Conservative Temperature [deg C]
9 ! p : sea pressure [dbar]
10 !
11 ! gsw_adiabatic_lapse_rate_from_ct : adiabatic lapse rate [K/Pa]
12 !--------------------------------------------------------------------------
13 
15 
16 use gsw_mod_kinds
17 
18 implicit none
19 
20 real (r8), intent(in) :: sa, ct, p
21 
23 
24 real (r8) :: pt0, t
25 
26 integer, parameter :: n0=0, n1=1, n2=2
27 real (r8), parameter :: pr0 = 0.0_r8
28 
29 pt0 = gsw_pt_from_ct(sa,ct)
30 t = gsw_pt_from_t(sa,pt0,pr0,p)
31 
32 gsw_adiabatic_lapse_rate_from_ct = -gsw_gibbs(n0,n1,n1,sa,t,p) / &
33  gsw_gibbs(n0,n2,n0,sa,t,p)
34 
35 return
36 end function
37 
38 !--------------------------------------------------------------------------
elemental real(r8) function gsw_adiabatic_lapse_rate_from_ct(sa, ct, p)