anchor.diff:       READ(20,*) ngrid2
        READ(20,*) level2
        READ(20,*) blockno2
  +     READ(20,*) mpirank2
        READ(20,*) mx2
        READ(20,*) my2
        READ(20,*) xlow2
  
positive.code:   dir3_fname1 = TRIM(dir3)//'/'//trim(fname1)
    OPEN(fid_com,file=dir3_fname1,position='append');
  
    WRITE(fid_com,1001) patch_num, level, blockno, mx, my
  1001 FORMAT(i5,'                 grid_number',/, &
            i5,'                 AMR_level',/, &
            i5,'                 block_number',/, &
            i5,'                 mx',/, &
            i5,'                 my')
  
  
    WRITE(fid_com,1002) xlower,ylower,dx,dy
  
negative.code:   CLOSE(20)
  
    WRITE(6,*) ' '
    DO m = 1,meqn
       WRITE(6,150) global_max(m), m, grid_max(m)
    ENDDO
  
    WRITE(6,*) ' '
    OPEN(30,file=dir3_fname3)
    DO m = 1,meqn
       WRITE(30,150) global_max(m), m, grid_max(m)
    ENDDO
    WRITE(30,*) ' '
  
    DO n = 0,ngrids-1
       WRITE(30,'(I5,10E16.4)') n, (max_grids(n,m),m=1,meqn)
    ENDDO
    CLOSE(30)
  130 FORMAT(E30.16,'     ',A)
  140 FORMAT(I30,   '     ',A)
  150 FORMAT(E30.16, '     occurs in field',I5,' on grid ',I5)
  
    RETURN
  100 WRITE(6,*) 'Could not open file ', dir1_fname1
  200 WRITE(6,*) 'Could not open file ', dir2_fname1
  
  END PROGRAM compare_files
  
  
  SUBROUTINE write_tfile(iframe,time,meqn,ngrids,dir3)
    IMPLICIT NONE
  
    INTEGER :: iframe,meqn,ngrids,maux
    CHARACTER(100) :: dir3, dir3_fname1, dir3_fname2
    CHARACTER(10) :: fname1
    CHARACTER(10) :: fname2
  