********************************************************************************
*                                                                              *
*  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 ### asymorb ###
c
c     Calculates asymptotic values of a given orbital at the practical infinity.
c
      subroutine asymorb (nmi,psi,aorb)
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)
      include 'commons8.inc'
      dimension psi(*),aorb(nni,4)

      jj=0
      do j=nmi-3,nmi
         itt=(j-1)*nni
         jj=jj+1
         do i=1,nni
	    kk=i+itt
	    ps1=psi(kk)
	    psi(kk)=psi(kk-nni)*aorb(i,jj)
	    psi(kk)=ps1+omega*(psi(kk)-ps1)
         enddo
      enddo
      return
      end
