anchor.diff:           deallocate( iBCtmpread)
            iBCtmp=0
         endif
  -!MR CHANGE END
  -
   c
   c.... read boundary condition data
   c
  -
         ione=1
  -
  -c      ione=1
  -c      fname1='boundary condition array?'
  -c      call readheader(igeomBAK,fname1,intfromfile,
  -c     &     ione, 'double', iotype)
         call phio_readheader(fhandle,
        & c_char_'boundary condition array' // char(0),
        & c_loc(intfromfile),ione, dataDbl, iotype)
  -c here intfromfile(1) contains (ndof+7)*numpbc
  -!MR CHANGE
  -!       if ( numpbc > 0 ) then
  -!          if(intfromfile(1).ne.(ndof+7)*numpbc) then
  -!            warning='WARNING more data in BCinp than needed: keeping 1st'
  -!            write(*,*) warning, ndof+7
  -!          endif
  -!          allocate( BCinp(numpbc,ndof+7) )
  -!          nsecondrank=intfromfile(1)/numpbc
  -!          allocate( BCinpread(numpbc,nsecondrank) )
  -!          iBCinpsiz=intfromfile(1)
  -! c         call readdatablock(igeomBAK,fname1,BCinpread,iBCinpsiz,
  -! c     &                      'double',iotype)
  -!          call readdatablock(igeom,fname2,BCinpread,iBCinpsiz,
  -!      &                      'double',iotype)
  -!          BCinp(:,1:(ndof+7))=BCinpread(:,1:(ndof+7))
  -!       else  ! sometimes a partition has no BC's
  -!          allocate( BCinp(1,ndof+7) )
  -!          BCinp=0
  -!       endif
   
         if ( numpbc > 0 ) then
  -!         if(intfromfile(1).ne.(ndof+7)*numpbc) then
  -!           warning='WARNING more data in BCinp than needed: keeping 1st'
  -!           write(*,*) warning, ndof+7
  -!         endif
            allocate( BCinp(numpbc,ndof+7) )
            nsecondrank=intfromfile(1)/numpbc
            allocate( BCinpread(numpbc,nsecondrank) )
  
positive.code: c
        pzero=1
        if (any(btest(iBC,2))) pzero=0  
  c
        do iblk = 1, nelblb
           npro = lcblkb(1,iblk+1)-lcblkb(1,iblk)
           do i=1, npro
  
negative.code:          endif
           acold=zero
        endif
  cc
  cc.... read the header and check it against the run data
  cc
        if (ideformwall.eq.1) then
  
            intfromfile=0
            call phio_readheader(fhandle,
  