anchor.diff:            errstrng="read_connect"
             return
           end if
  -cdebug        write(6,*) "i,imat,indmat(imat):",i,imat,indmat(imat)
  -        infiel(4,indmat(imat))=i
  -        indmat(imat)=indmat(imat)+ione
  -c
  -c...  set state variable and material matrix indices, and increment the
  -c     total size of the state variable and material matrices.
  -c
  -        ngauss=infetype(1,infiel(3,i))
  -        infiel(5,i)=nstatesz+ione
  -        infiel(7,i)=nstatesz0+ione
  -        ngausstot=ngausstot+ngauss
  -        nstate=infmatmod(2,matmod)
  -        imatvar=infmatmod(4,matmod)
  -        nstatesz=nstatesz+nstate*ngauss
  -        nstatesz0=nstatesz0+incstate0*ngauss
  -        if(imatvar.eq.izero) then
  -          if(imgrp(imat).eq.izero) then
  -            infiel(6,i)=ndmatsz+ione
  -            ndmatsz=ndmatsz+ngaussmax
  -            imgrp(imat)=infiel(6,i)
  -          else
  -            infiel(6,i)=imgrp(imat)
  -cdebug            infiel(6,i)=infiel(6,infiel(4,i-1))
  -          end if
  -        else
  -          infiel(6,i)=ndmatsz+ione
  -          ndmatsz=ndmatsz+ngauss
  -        end if
  -cdebug        write(6,*) "i,infiel:",i,(infiel(jdb,i),jdb=1,7)
  +c
  +c...  store element nodes in the proper family and update the pointer
  +c     array for that family
  +c
  +        iloc=ivftmp(imat)
  +        call iquate(ien(1,iloc),itmp,nen)
  +        ivftmp(imat)=ivftmp(imat)+ione
         end do
  -      if(nprestrflag.eq.izero) nstatesz0=ngaussmax
         close(kr)
  -cdebug      write(6,*) "infiel:"
  -cdebug      do idb=1,numelt
  -cdebug        write(6,*) idb,(infiel(jdb,idb),jdb=1,6)
  -cdebug      end do
   c
   c...  output plot info, if desired
   c
         if(idsk.eq.ione) then
           open(kp,file=pfile,err=40,status="old",access="append")
  -        write(kp,1000,err=50) numelt
  -        do i=1,numelt
  -          imat=infiel(2,i)
  -          ietype=infiel(3,i)
  -          ngauss=infetype(1,ietype)
  -          nen=infetype(2,ietype)
  -          i1=infiel(1,i)
  -          i2=infiel(1,i)+nen-1
  -          write(kp,1000) i,imat,ietype,ngauss,(ien(j),j=i1,i2)
  +        write(kp,1000,err=50) numelv
  +        ielg=izero
  +        do ifam=1,nvfamilies
  +          nelfamily=ivfamily(1,ifam)
  +          matmod=ivfamily(2,ifam)
  +          do ielf=1,nelfamily
  +            ielg=ielg+ione
  +            write(kp,1000) ielg,matmod,ietypev,ngauss,
  +     &       (ien(j,ielg),j=1,nen)
  +          end do
           end do
           close(kp)
         else if(idsk.eq.itwo) then
           open(kp,file=pfile,err=40,status="old",access="append",
        &   form="unformatted")
  -        write(kp,err=50) numelt,nconsz
  -        write(kp,err=50) infetype
  -        write(kp,err=50) infiel
  +        write(kp,err=50) numelv,nen,ngauss
  +        write(kp,err=50) ivfamily
           write(kp,err=50) ien
           close(kp)
         end if
  
positive.code: c
  c...  subroutine arguments
  c
        integer nconsz,nprestrflag,numelt,ngausstot,numnp,numat
        integer nstatesz,ndmatsz,kr,kw,kp,idout,idsk,ierr
        integer neni(netypesi),infetype(4,netypes),infmat(3,numat)
        integer infmatmod(5,nmatmodmax),ien(nconsz),infiel(7,numelt)
        integer indmat(numat),imgrp(numat)
        character ifile*(*),ofile*(*),pfile*(*),errstrng*(*)
  c
  c...  local variables
  
negative.code:       if(idout.gt.izero) then
          open(kw,file=ofile,status="old",access="append")
          npage=50
          ielg=izero
          do ifam=1,nvfamilies
            nelfamily=ivfamily(1,ifam)
            matmod=ivfamily(2,ifam)
            do ielf=1,nelfamily
              ielg=ielg+ione
              if(ielg.eq.ione.or.mod(ielg,npage).eq.izero) then
                write(kw,2000)(head(j),j,j=1,nen)
                write(kw,2500)
              end if
              write(kw,3000) ielg,matmod,ietypev,ngauss,
       &       (ien(j,ielg),j=1,nen)
            end do
          end do
          write(kw,4000)
          close(kw)
  