FV3 Bundle
gsw_util_xinterp1.f90
Go to the documentation of this file.
1
!==========================================================================
2
pure function
gsw_util_xinterp1
(x, y, x0)
3
!==========================================================================
4
!
5
! Linearly interpolate a real monotonic array.
6
!
7
! x : x array (must be monotonically increasing)
8
! y : y array
9
! x0 : x value to be interpolated
10
!
11
! xinterp1 : linearly interpolated y value
12
!--------------------------------------------------------------------------
13
14
use
gsw_mod_toolbox
,
only
:
gsw_util_indx
15
16
use
gsw_mod_kinds
17
18
implicit none
19
20
real (r8)
,
intent(in)
:: x0
21
real (r8)
,
intent(in)
:: x(:), y(:)
22
23
real (r8)
::
gsw_util_xinterp1
24
25
integer
:: k
26
real (r8)
:: r
27
28
k =
gsw_util_indx
(x,x0)
29
r = (x0-x(k))/(x(k+1)-x(k))
30
gsw_util_xinterp1
= y(k) + r*(y(k+1)-y(k))
31
32
return
33
end function
34
35
!--------------------------------------------------------------------------
gsw_mod_toolbox::gsw_util_indx
Definition:
gsw_mod_toolbox.f90:1510
gsw_mod_toolbox
Definition:
gsw_mod_toolbox.f90:1
gsw_mod_toolbox::gsw_util_xinterp1
Definition:
gsw_mod_toolbox.f90:1526
gsw_mod_kinds
Definition:
gsw_mod_kinds.f90:2
gsw_util_xinterp1
pure real(r8) function gsw_util_xinterp1(x, y, x0)
Definition:
gsw_util_xinterp1.f90:3
src
fv3-bundle
gsw
toolbox
gsw_util_xinterp1.f90
Generated on Tue Nov 6 2018 11:39:00 for FV3 Bundle by
1.8.14