anchor.diff:          close(kr)
           return
   c
  -c...  error opening output file
  -c
  - 40   continue
  -        ierr=2
  -        errstrng="read_connect"
  -        close(kw)
  -        close(kp)
  -        return
  -c
  -c...  error writing to output file
  -c
  - 50   continue
  -        ierr=4
  -        errstrng="read_connect"
  -        close(kw)
  -        close(kp)
  -        return
  -c
  -1000  format(30i7)
  -2000  format(1x,///,
  -     x          ' e l e m e n t  d a t a ',//,5x,
  -     x          ' element    material  element  number  ',20(a4,i2,4x))
  -2500  format(5x,'             number     type   gauss  ',/,
  -     x       5x,'                               points  ',/)
  -3000  format(6x,i7,25(5x,i7))
  -4000  format(//)
  -c
         end
   c
   c version
  -c $Id: read_connect.f,v 1.9 2005/04/05 22:39:56 willic3 Exp $
  +c $Id: read_connect.f,v 1.10 2005/04/12 23:17:42 willic3 Exp $
   c
   c Generated automatically by Fortran77Mill on Wed May 21 14:15:03 2003
   c
  
positive.code: c
  c...  check for illegal material type or material model
  c
          if(imat.le.izero.or.imat.gt.nvfamilies) then
            ierr=107
            errstrng="read_connect"
            return
          end if
          if(matmod.gt.nmatmodmax.or.infmatmod(1,matmod).eq.izero) then
            ierr=101
            errstrng="read_connect"
            return
          end if
  c
  c...  store element nodes in the proper family and update the pointer
  c     array for that family
  c
          iloc=ivftmp(imat)
          indxiel(i)=iloc
          call iquate(ien(1,iloc),itmp,nen)
          ivftmp(imat)=ivftmp(imat)+ione
        end do
        close(kr)
  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) 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) numelv,nen,ngauss
          write(kp,err=50) ivfamily
          write(kp,err=50) ien
          close(kp)
        end if
  c
  c...  output ascii info, if desired
  c
        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)
        end if
  c
  c......test for zero or out-of-bound entries in ien array
  c
  
negative.code: c
  c...  subroutine arguments
  c
        integer nen,numelv,numnp,nvfamilies,kr,ierr
        integer ien(nen,numelv),mat(numelv),infin(numelv)
        character ifile*(*),errstrng*(*)
  c
  c...  local variables
  c
  c
  c...  intrinsic functions
  c
  c
  c...  local variables
  c
        integer i,j,n,ietypev
  cdebug      integer idb,jdb
  c
  cdebug      write(6,*) "Hello from read_connect_f!"
  c
        call ifill(ien,izero,nen*numelv)
        ierr=izero
  c
  c...  read connectivity, material number, and infinite element info
  c
        open(kr,file=ifile,status="old",err=20)
        call pskip(kr)
        do i=1,numelv
          read(kr,*,end=30,err=30) n,ietypev,mat(i),infin(i),
       &   (ien(j,i),j=1,nen)
  c
  c...  check for illegal element type
  c
  