      subroutine union(nca,nc1a,nc3a,ica,ic1a,ic3a)
      dimension ica(*),ic1a(*),ic3a(*)
      i1=1
      i3=1
      nca=0
 1    continue
      if(i1.gt.nc1a) then
         do i=i3,nc3a
            nca=nca+1
            ica(nca)=ic3a(i)
         enddo
         return
      endif
      if(i3.gt.nc3a) then
         do i=i1,nc1a
            nca=nca+1
            ica(nca)=ic1a(i)
         enddo
         return
      endif
      if(ic1a(i1).gt.ic3a(i3)) then
         nca=nca+1
         ica(nca)=ic3a(i3)
         i3=i3+1
      else
         nca=nca+1
         ica(nca)=ic1a(i1)
         i1=i1+1
      endif
      goto 1
      end
