Program g08ebfe ! G08EBF Example Program Text ! Mark 24 Release. NAG Copyright 2012. ! .. Use Statements .. Use nag_library, Only: g08ebf, nag_wp, x04eaf ! .. Implicit None Statement .. Implicit None ! .. Parameters .. Integer, Parameter :: nin = 5, nout = 6 ! .. Local Scalars .. Real (Kind=nag_wp) :: chi, df, ex, prob Integer :: i, ifail, lag, ldc, lwrk, msize, n, & nsamp, pn Logical :: bapp Character (1) :: cl ! .. Local Arrays .. Real (Kind=nag_wp), Allocatable :: wrk(:), x(:) Integer, Allocatable :: ncount(:,:) ! .. Executable Statements .. Write (nout,*) 'G08EBF Example Program Results' Write (nout,*) Flush (nout) ! Skip main heading in data file Read (nin,*) ! Read in number of samples Read (nin,*) nsamp, msize, lag ldc = msize lwrk = 2*lag Allocate (ncount(ldc,msize),wrk(lwrk),x(1)) If (nsamp==1) Then cl = 'S' Else cl = 'F' End If pn = 0 bapp = .False. Do i = 1, nsamp ! Skip run heading in data file Read (nin,*) ! Read in sample size Read (nin,*) n If (n>pn) Then ! Reallocate X if required Deallocate (x) Allocate (x(n)) pn = n End If ! Read in the sample Read (nin,*) x(1:n) ! Process the sample ifail = -1 Call g08ebf(cl,n,x,msize,lag,ncount,ldc,ex,chi,df,prob,wrk,ifail) If (ifail==8) Then bapp = .True. Else If (ifail/=0) Then Go To 100 End If ! Adjust CL for intermediate calls If (i