********************************************************************************
*                                                                              *
*  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 ### prepwexch ###
c
c   Writes to disk exchange potentials involving orbital iorb.
c
      subroutine prepwexch
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)
      include 'commons8.inc'

      do iorb1=1,norb
         do iorb2=iorb1,norb
            k=i3xk(iorb2,iorb1)
            if (k.ne.0) iwexch(k)=k
         enddo
      enddo

      return
      end
