c****************************************************************
c      mbikxyz.f                                                *
c      data no nukidasi                                         *
c            ( x-direction,y-direction z-direction  mabiki )    *
c****************************************************************
c
       PARAMETER (NX= 268,NY= 134,NZ= 134)
       parameter (nx2=nx+2,ny2=ny+2,nz2=nz+2)
       PARAMETER (nx0=1,ny0=1,nz0=1)
       parameter (last=1,mb=2,nb=8)
c             ***  mb: mabikisu
       parameter (mxl=nx/mb+1,myl=ny/mb+1,mzl=nz/mb+1)
       dimension fa(nx2,ny2,nz2),fb(mxl,myl,mzl)
       dimension gf(nx2,ny2)
c
       open(11,file='idd1e360.data',
     1         access='sequential',form='unformatted')
c
       open(31,file='mdd1e360.data',
     1         access='sequential',form='unformatted')
c
       do 100 ii=1,LAST
       itapi=ii+10
       itapo=ii+30
c
c *** input data wo mabiki ***
       do 30 m=1,nb
       do 20 k=1,nz2
        read(itapi,end=100) gf
        do j=1,ny2
         do i=1,nx2
          fa(i,j,k)=gf(i,j)
         end do
        end do
   20  continue
c
cc      if (m.ne.1 .and. m.ne.8 .and. m.ne.7) go to 30
cc      if (m.ne.1 .and. m.ne.8) go to 30
c
       do mz=1,mzl
       do my=1,myl
       do mx=1,mxl
c
       ix=nx0+mb*(mx-1)
       iy=ny0+mb*(my-1)
       iz=nz0+mb*(mz-1)
       fb(mx,my,mz)=fa(ix,iy,iz)
c
       end do
       end do
       end do
c
       write(itapo) fb
c
   30  continue
c
  100  CONTINUE
       STOP
       END
