********************************************************************************
*                                                                              *
*  2DHF version 1-2003                                                         *
*  Copyright (C) 1996  Jacek Kobus, Leif Laaksonen, Dage Sundholm              *
*                                                                              *
*  This software may be used and distributed according to the terms            *
*  of the GNU General Public License, see README and COPYING.                  *
*                                                                              *
********************************************************************************
c ### inaorb ###
c
c     Initializes array aorb which is used by asyorb to calculate
c     boundary values of a given orbital at the practical infinity.
c
      subroutine inaorb (nmi,aorb,aorb1)
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)
      include 'commons8.inc'
      dimension aorb(nni,4),aorb1(*)

      jj=0
      do j=nmi-3,nmi
         jj=jj+1
         itt=(j-1)*nni
         do i=1,nni
            kk=i+itt
c           see mulex	    
            raiq1=sqrt(vxisq(j-1)+vetasq(i)-1.d0)
            raiq =sqrt(vxisq(j)+vetasq(i)-1.d0)

            if (idbg(101).ne.0) then 
               raiq1=sqrt(vxi1(j-1)*vxi1(j-1)-veta1(i)*veta1(i)+1.d0)
               raiq =sqrt(vxi1(j)*vxi1(j)-veta1(i)*veta1(i)+1.d0)
            endif
	    aorb(i,jj)=(abs(aorb1(kk-nni)/aorb1(kk)))**0.25d0
     &           *exp(sqrt(abs(aorb1(kk-nni)))*(raiq1-raiq))
         enddo
      enddo
      return
      end
