PROGRAM g03zafe ! G03ZAF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : g03zaf, nag_wp, x04caf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: i, ifail, ldx, ldz, m, n, nvar ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: e(:), s(:), x(:,:), z(:,:) INTEGER, ALLOCATABLE :: isx(:) ! .. Intrinsic Functions .. INTRINSIC count ! .. Executable Statements .. WRITE (nout,*) 'G03ZAF Example Program Results' WRITE (nout,*) FLUSH (nout) ! Skip headings in data file READ (nin,*) ! Read in the problem size READ (nin,*) n, m ldx = n ALLOCATE (x(ldx,m),isx(m),e(m),s(m)) ! Read in data READ (nin,*) (x(i,1:m),i=1,n) ! Read in variable inclusion flags READ (nin,*) isx(1:m) ! Read in shift and scaling READ (nin,*) e(1:m) READ (nin,*) s(1:m) ! Calculate NVAR nvar = count(isx(1:m)/=0) ldz = n ALLOCATE (z(ldz,nvar)) ! Standardize data ifail = 0 CALL g03zaf(n,m,x,ldx,nvar,isx,s,e,z,ldz,ifail) ! Display results ifail = 0 CALL x04caf('General',' ',n,nvar,z,ldz,'Standardized Values',ifail) END PROGRAM g03zafe