anchor.diff:      else
         write(id,*),0
       end if
  -    write(id,'(i1)'),1 ! 1-component scalar
  -    write(id,*),size(v)
  -    do i=1,size(v)
  +    select case(rank)
  +    case(RANK_SCAL)
  +      nEntry=1
  +    case(RANK_VECT)
  +      nEntry=3
  +    case(RANK_TENS)
  +      nEntry=9
  +    case default
  +      nEntry=0
  +    end select
  +    write(id,'(i1)'),nEntry
  +    select case(bind)
  +    case(BIND_NODE)
  +      nItem=grid%nNode
  +    case(BIND_FACET)
  +      nItem=grid%nFacet
  +    case(BIND_BLOCK)
  +      nItem=grid%nBlock
  +    case default
  +      nItem=0
  +    end select
  +    write(id,*),nItem
  +    do i=1,nItem
         select case(bind)
         case(BIND_NODE,BIND_BLOCK)
  -        write(tempStr,*),i,v(i)
  +        write(tempStr,*),i,v((i-1)*nEntry+1:(i-1)*nEntry+nEntry)
         case(BIND_FACET)
  -        write(tempStr,*),i+grid%nBlock,v(i)
  +        write(tempStr,*),i+grid%nBlock,v((i-1)*nEntry+1:(i-1)*nEntry+nEntry)
         case default
         end select
         write(id,'(a)'),trim(adjustl(tempStr))
  
positive.code: !> file input/output
  module moduleFileIO
    private
    
    !> read GMSH file
    interface readGMSH
  
negative.code:     character(*),intent(in)::vName !< name of v
      integer,intent(in),optional::n !< time step index
      double precision,intent(in),optional::t !< time
      
      if(present(n).and.present(t))then
        call writeGMSHScalVectTens(id,RANK_TENS,v,grid,bind,vName,n,t)
      else
        call writeGMSHScalVectTens(id,RANK_TENS,v,grid,bind,vName)
      end if
    end subroutine
    
  end module
  