      subroutine msgener(sym,sym1,msym)
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      character(40)sym
      character(3) sym1(7)
      character(5) sym2
      !print*,'entree msgener ',sym
      if(msym==1) then
         sym1(1)=sym
         mm=1
      else
         l=len_trim(sym)
         mm=0
         ldeb=1
         do k=1,l+1
            if(sym(k:k)==' ') then
               lfin=k-1
               !print*,'ldeb,lfin',ldeb,lfin
               mm=mm+1
               sym1(mm)=sym(ldeb:lfin)
               ldeb=k+1
            endif
         enddo
      endif
      !print*,'msgener ',sym1
      if(msym==2) then
         call union(1,2,3,sym1)
         msym=3
      else if(msym==3) then
         !print*,'msgener ',sym1(1)
         !print*,'msgener ',sym1(2)
         !print*,'msgener ',sym1(3)
         call union(1,2,4,sym1)
         call union(1,3,5,sym1)
         call union(2,3,6,sym1)
         call union(4,3,7,sym1)
         msym=7
      endif
      return
      end
