anchor.diff:  c...  subroutine arguments
   c
         integer kr,kw,kp,idout,idsk,ierr
  -      integer istatout(2,nstatesmax)
  +      integer istatout(3,nstatesmax)
         character stfile*(*),ofile*(*),pfile*(*),errstrng*(*)
   c
  +c...  included dimension and type statements
  +c
  +      include "labels_dim.inc"
  +c
   c...  local variables
   c
  -      integer i,j
  +      integer i,j,nstatestot,nstatesinc,nstatesrate
  +      integer itmp(3,nstatesmax)
  +c
  +c...  included variable definitions
  +c
  +      include "labels_def.inc"
   c
         ierr=izero
  +      call ifill(itmp,izero,3*nstatesmax)
  +      nstatestot=izero
  +      nstatesinc=izero
  +      nstatesrate=izero
   c
   c...  open input file and read information on state variable output.
   c     The same variables will be output for both the elastic and
   c     time-dependent solutions.
   c
         open(kr,file=stfile,status="old",err=20)
  -      call pskip(kr)
  -      read(kr,*,err=30,end=30) ((istatout(j,i),j=1,2),i=1,nstatesmax)
  +      do i=1,nstatesmax
  +        call pskip(kr)
  +        read(kr,*,err=30,end=30) (istatout(j,i),j=1,3)
  +      end do
         close(kr)
  +c
  +c...  dump istatout array into index array
  +c
  +      do i=1,nstatesmax
  +        if(istatout(1,i).ne.izero) then
  +          nstatestot=nstatestot+ione
  +          itmp(1,nstatestot)=i
  +        end if
  +        if(istatout(2,i).ne.izero) then
  +          nstatesinc=nstatesinc+ione
  +          itmp(2,nstatesinc)=i
  +        end if
  +        if(istatout(3,i).ne.izero) then
  +          nstatesrate=nstatesrate+ione
  +          itmp(3,nstatesrate)=i
  +        end if
  +      end do
   c
   c...  output results, if desired
   c
         if(idout.gt.izero) then
           open(kw,file=ofile,err=40,status="old",access="append")
  -        write(kw,800,err=50) ((istatout(j,i),j=1,2),i=1,nstatesmax)
  +        if(nstatestot.ne.izero) then
  +          write(kw,700,err=50)
  +          write(kw,730,err=50) (labels(itmp(1,i)),i=1,nstatestot)
  +        end if
  +        if(nstatesinc.ne.izero) then
  +          write(kw,710,err=50)
  +          write(kw,730,err=50) (labels(itmp(2,i)),i=1,nstatesinc)
  +        end if
  +        if(nstatesrate.ne.izero) then
  +          write(kw,720,err=50)
  +          write(kw,730,err=50) (labels(itmp(3,i)),i=1,nstatesrate)
  +        end if
           close(kw)
         end if
         if(idsk.eq.ione) then
           open(kp,file=pfile,err=40,status="old",access="append")
  -        write(kp,810,err=50) ((istatout(j,i),j=1,2),i=1,nstatesmax)
  +        write(kp,810,err=50) ((istatout(j,i),j=1,3),i=1,nstatesmax)
         end if
         if(idsk.eq.itwo) then
           open(kp,file=pfile,err=40,status="old",access="append",
  
positive.code: c        to output.  It is assumed that the same set of variables are
  c        desired for both the elastic and time-dependent solutions.
  c
  c     Error codes:
  c         0:  No error
  c         1:  Error opening input file
  
negative.code:         close(kp)
          return
  c
   700  format(//,
       & " State variable total values to be output:",/)
   710  format(//,
       & " State variable incremental values to be output:",/)
   720  format(//,
       & " State variable rate values to be output:",/)
   730  format(4x,6(:2x,a6))
  c
   810  format(16i5)
  c
        end
  c
  c version
  c $Id: read_stateout.f,v 1.4 2005/03/22 23:52:43 willic3 Exp $
  c
  c Generated automatically by Fortran77Mill on Wed May 21 14:15:03 2003
  c
  