V3FIT
r8mkherm1.f
1  subroutine r8mkherm1(fun,x,nx,fherm)
2 C
3 C create a data set for Hermite interpolation, from evaluation of
4 C function and derivatives. function of 1 indep. coordinate.
5 C
6 C input:
7 C
8 !============
9 ! idecl: explicitize implicit INTEGER declarations:
10  IMPLICIT NONE
11  INTEGER, PARAMETER :: R8=selected_real_kind(12,100)
12  INTEGER nx,ix
13 !============
14 ! idecl: explicitize implicit REAL declarations:
15  real*8 fun,dfdx
16 !============
17  external fun ! passed real function(x,dfdx)
18  real*8 x(nx) ! x coordinate array
19 C
20 C the passed function fun must have the interface:
21 C
22 C real function <name>(x,dfdx)
23 C where x is input, the function returns the function value and the
24 C argument dfdx returns as output the function derivative at x.
25 C
26 C output:
27 C
28  real*8 fherm(0:1,nx) ! function data & derivative
29 C
30 C fherm(0,j) = function value f at x(j)
31 C fherm(1,j) = derivative df/dx at x(j)
32 C
33 C----------------------------
34 C
35  do ix=1,nx
36  fherm(0,ix)=fun(x(ix),dfdx)
37  fherm(1,ix)=dfdx
38  enddo
39 C
40  return
41  end