44 real(
double),
intent(in) :: x1,x2, y1,y2, x
72 real,
intent(in) :: x1,x2, y1,y2, x
95 real(
double),
intent(in) :: xarr(:), yarr(:), xval
99 if(
size(xarr)*
size(yarr).eq.0)
then
100 call warn(
'linear_interpolate_array(): at least one of the arrays has no elements.')
130 real(
double),
intent(in) :: x1,x2,x3, y1,y2,y3
131 real(
double),
intent(out) :: a,b,c
132 real(
double) :: x12,x22,x32, d
140 a = ((y3-y1) - (y2-y1)*d) / ((x32-x12) - (x22-x12)*d)
141 b = ((y2-y1) - a*(x22-x12)) / (x2-x1)
142 c = y1 - a*x12 - b*x1
161 real(
double),
intent(in) :: x,a,b,c
186 real(
double),
intent(in) :: xval, xarray(:)
191 ascending = (xarray(narr).ge.xarray(1))
196 if(iup-ilow.le.1)
exit
199 if(ascending .eqv. (xval.ge.xarray(imid)))
then
207 if(
deq(xval, xarray(1)))
then
209 else if(
deq(xval, xarray(narr)))
then
Procedures to do interpolation (and fitting?)
real(double) function linear_interpolate_array(xarr, yarr, xval)
Do linear interpolation using the data arrays xArr,yArr to find the value y corresponding to x.
pure real(double) function linear_interpolation(x1, x2, y1, y2, x)
Do linear interpolation using the data points x1,x2, and y1,y2 to find the value y corresponding to x...
pure real(double) function parabola(x, a, b, c)
Compute a parabola a*x^2 + b*x + c.
pure integer function locate_value_in_array(xval, xarray)
Locate the index in a monotonic array, such that a given value lies between array(index) and array(in...
pure real function linear_interpolation_sp(x1, x2, y1, y2, x)
Do linear interpolation using the data points x1,x2, and y1,y2 to find the value y corresponding to x...
pure subroutine perfect_parabolic_fit(x1, x2, x3, y1, y2, y3, a, b, c)
Fit a parabola perfectly to three sets of data points x1,y1, x2,y2 and x3,y3.
Provides kinds and related constants/routines.
integer, parameter double
Double-precision float. Precision = 15, range = 307.
Procedures for numerical operations.
elemental logical function deq(x1, x2, eps)
Test whether two double-precision variables are equal to better than a given value (default: 2x machi...
System-related procedures.
subroutine warn(message, unit)
Print a warning to StdOut or StErr.