errclb Subroutine

private subroutine errclb(n, m, Factr, l, u, Nbd, Task, Info, k)

This subroutine checks the validity of the input data.

Credits

  • NEOS, November 1994. (Latest revision June 1996.) Optimization Technology Center. Argonne National Laboratory and Northwestern University. Written by Ciyou Zhu in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(in) :: m
real(kind=wp), intent(in) :: Factr
real(kind=wp), intent(in) :: l(n)

the lower bound on x.

real(kind=wp), intent(in) :: u(n)

the upper bound on x.

integer, intent(in) :: Nbd(n)
character(len=60) :: Task
integer, intent(inout) :: Info
integer, intent(out) :: k

Called by

proc~~errclb~~CalledByGraph proc~errclb lbfgsb_module::errclb proc~mainlb lbfgsb_module::mainlb proc~mainlb->proc~errclb proc~setulb lbfgsb_module::setulb proc~setulb->proc~mainlb

Source Code

      subroutine errclb(n,m,Factr,l,u,Nbd,Task,Info,k)
      implicit none

      character(len=60) :: Task
      integer,intent(in) :: n
      integer,intent(in) :: m
      integer,intent(inout) :: Info
      integer,intent(out) :: k
      integer,intent(in) :: Nbd(n)
      real(wp),intent(in) :: Factr
      real(wp),intent(in) :: l(n) !! the lower bound on `x`.
      real(wp),intent(in) :: u(n) !! the upper bound on `x`.

      integer :: i

      ! Check the input arguments for errors.

      if ( n<=0 )       Task = 'ERROR: N <= 0'
      if ( m<=0 )       Task = 'ERROR: M <= 0'
      if ( Factr<zero ) Task = 'ERROR: FACTR < 0'

      ! Check the validity of the arrays nbd(i), u(i), and l(i).

      k = 0 ! JW : added this so it will always be defined

      do i = 1 , n
         if ( Nbd(i)<0 .or. Nbd(i)>3 ) then
            ! return
            Task = 'ERROR: INVALID NBD'
            Info = -6
            k = i
         endif
         if ( Nbd(i)==2 ) then
            if ( l(i)>u(i) ) then
               ! return
               Task = 'ERROR: NO FEASIBLE SOLUTION'
               Info = -7
               k = i
            endif
         endif
      enddo

      end subroutine errclb