********************************************************************************
*                                                                              * 
*  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 ### rfunorb ###	
c
c     Reads orbitals only from a disk file in an unformatted form
      subroutine rfunorb (norbt,cw_orb)
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)	
      include 'commons8.inc'

      dimension cw_orb(*)
      dimension i1bt(60),i2bt(60),i3bt(1830),
     &     i1et(60),i2et(60),i3et(1830),
     &     i1sit(60),i2sit(60),i3sit(1830),
     &     i1ngt(60),i2ngt(60),i3ngt(1830),
     &     i1mut(60),i2mut(60),i3mut(1830)	
     
      read (iinp11,err=1000) i1bt,i2bt,i3bt,i1et,i2et,i3et,
     &     i1sit,i2sit,i3sit,i1ngt,i2ngt,i3ngt,
     &     i1mut,i2mut,i3mut	

      ioffset=norb-norbt
      do i=1,norbt
         call reada(iinp11,i1si(i+ioffset),cw_orb(i1b(i+ioffset)),ierr)
         if (ierr.ne.0) then
            write(iout6,*) 'error detected when reading orbital',i
            stop 'inifun'
         endif				   	
      enddo	   
      rewind iinp11	
 1000 continue
      write(iout6,*) 'error detected when reading file',iinp11
      return
      end
