NAG Library Manual, Mark 27.3
```    Program g10acfe

!     G10ACF Example Program Text

!     Mark 27.3 Release. NAG Copyright 2021.

!     .. Use Statements ..
Use nag_library, Only: g10acf, g10zaf, nag_wp
!     .. Implicit None Statement ..
Implicit None
!     .. Parameters ..
Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
Real (Kind=nag_wp)               :: crit, df, rho, rss, tol, u
Integer                          :: i, ifail, ldc, lwk, lwt, maxcal, n,  &
nord
Character (1)                    :: method, weight
!     .. Local Arrays ..
Real (Kind=nag_wp), Allocatable  :: c(:,:), h(:), res(:), wk(:), wt(:),  &
wwt(:), x(:), xord(:), y(:),         &
yhat(:), yord(:)
Integer, Allocatable             :: iwrk(:)
!     .. Executable Statements ..
Write (nout,*) 'G10ACF Example Program Results'
Write (nout,*)

!     Skip heading in data file

If (weight=='W' .Or. weight=='w') Then
lwt = n
Else
lwt = 0
End If
ldc = n - 1
lwk = 7*(n+2)
Allocate (x(n),y(n),wt(lwt),xord(n),yord(n),wwt(n),yhat(n),c(ldc,3),     &
res(n),h(n),wk(lwk),iwrk(n))

If (lwt>0) Then
Else
End If

Read (nin,*) u, tol, maxcal, crit

!     Sort data, removing ties and weighting accordingly
ifail = 0

!     Fit cubic spline
ifail = 0
rho,u,tol,maxcal,wk,ifail)

!     Display results
Write (nout,99999) 'Residual sum of squares = ', rss
Write (nout,99999) 'Degrees of freedom = ', df
Write (nout,99999) 'RHO = ', rho
Write (nout,*)
Write (nout,*) '     Input data                Output results'
Write (nout,*) '   I    X       Y            YHAT      H'
Write (nout,99998)(i,xord(i),yord(i),yhat(i),h(i),i=1,nord)

99999 Format (1X,A,F10.2)
99998 Format (I4,2F8.3,6X,2F8.3)
End Program g10acfe
```