c
       character*80 ifile
       dimension id(14),pgm(2)
c
c       print*,'first grid'
       read(5,100) ifile
100    format(a)
       open(10,file=ifile,form='unformatted',status='old')
       read(10) id,pgm,nc1,nr1,nz,xo1,dx1,yo1,dy1
c       print*,'second grid'
       read(5,100) ifile
       open(11,file=ifile,form='unformatted',status='old')
       read(11) id,pgm,nc2,nr2,nz,xo2,dx2,yo2,dy2
       if(dx1.ne.dx2) stop
       if(dy1.ne.dy2) stop
       dx=dx1
       dy=dy1
       xo=min(xo1,xo2)
       yo=min(yo1,yo2)
       xm1=xo1+(nc1-1)*dx
       xm2=xo2+(nc2-1)*dx
       xm=max(xm1,xm2)
       nc=((xm-xo)/dx+1.5)
       ym1=yo1+(nr1-1)*dy
       ym2=yo2+(nr2-1)*dy
       ym=max(ym1,ym2)
       nr=((ym-yo)/dy+1.5)
       print*,'empty.big'
       print*,nc,nr
       print*
       print*,xo,yo,dx,dy
       end
