    PROGRAM nag_ip_ex01

      ! Example Program Text for nag_ip
      ! NAG fl90, Release 4. NAG Copyright 2000.

      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_in, nag_std_out
      USE nag_ip, ONLY : nag_ip_sol
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND
      ! .. Parameters ..
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      ! .. Local Scalars ..
      INTEGER :: i, m, n
      REAL (wp) :: obj_f
      ! .. Local Arrays ..
      REAL (wp), ALLOCATABLE :: a(:,:), ax_lower(:), ax_upper(:), c(:), x(:)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_ip_ex01'

      READ (nag_std_in,*)          ! Skip heading in data file

      ! Read number of linear constraints (m) and variables (n)
      READ (nag_std_in,*) m, n

      ALLOCATE (x(n),c(n),a(m,n),ax_lower(m),ax_upper(m)) ! Allocate storage

      ! Read in problem data
      READ (nag_std_in,*) (a(i,:),i=1,m)
      READ (nag_std_in,*) ax_lower
      READ (nag_std_in,*) ax_upper
      READ (nag_std_in,*) x
      READ (nag_std_in,*) c

      ! Solve the problem

      CALL nag_ip_sol(x,c,obj_f,a=a,ax_lower=ax_lower,ax_upper=ax_upper)

      DEALLOCATE (x,c,a,ax_lower,ax_upper) ! Deallocate storage

    END PROGRAM nag_ip_ex01
