subroutine cdump( ddd, myndump, itx1, ity1, itz1 ) implicit none integer myndump, itx1,ity1,itz1 c // The 2-D decomposition is a tiling, based from 1.. c c // The towers are further cut into blocks for computation, which c gives the z block number include 'iq.h' include 'globals.h' include 'context.h' real ddd(nvar,1-nbdyf:npx+nbdyf, 1-nbdyf:npy+nbdyf, 1-nbdyf:npz+nbdyf) integer i, n integer itx,ity,itz, ix0,iy0,iz0 integer ntx,nty,ntz real xxl4(1-nbdyf:MX_AXIS+nbdyf),yyl4(1-nbdyf:MX_AXIS+nbdyf), & zzl4(1-nbdyf:MX_AXIS+nbdyf) character*256 filename, filenamex integer iunit, binopen c real v c integer ix,iy,iz c character*1 bob(npx,npy,npz) c character*32 prefix c common // bob c ----- ndump= myndump c Number of tiles globally: ntx= (nx+npx-1)/npx nty= (ny+npy-1)/npy ntz= (nz+npz-1)/npz c Base tile numbers at 0 for cdump routines itx= itx1-1 ity= ity1-1 itz= itz1-1 c Compose output filename: homeDir/####/x10a####aaa c n= 0 do i= 1, len(homeDir) if ( homeDir(i:i) .eq. ' ' .or. homeDir(i:i).eq. char(0) ) goto 10 filename(i:i)= homeDir(i:i) n= i enddo 10 continue if (n.gt.len(homeDir)-15 ) then write(0,*) "Warning: home directory name too long", n, homeDir n= len(homeDir)-15 endif write(filename(n+1:len(filename)),"(i4.4,'/',a4,i4.4)" ) & ndump, runname, ndump c write(0,*) "making directory ",filename(1:n+5) call mkdir(filename(1:n+5)) call ppm98_cdnametime(itx,ity,itz, filename, filenamex) n= n+11 + 5 c write(0,*) "=====================================================" c write(0,*) "Writing cdump: ",filenamex(1:n), " time=", c & time, ", tdump=",tdump, ' nstep=',nstep iunit= 66 c write(0,*) "before binpoopoo iunit=", iunit i= binopen( filenamex, n, iunit) c write(0,*) "*****after binpopopo iunit=", iunit, i iunit= i call ppm98_timestamp(iunit) call ppm98_var0d("nstep","NSTEP", float(nstep), iunit ) call PPM98_var0d("time", "T", time, iunit ) call ppm98_var0d("dtime", "dt", dtime, iunit ) c Now record domain decomposition information call ppm98_tileo3( itx,ity,itz, ntx,nty,ntz, iunit ) c Now write mesh ix0= (itx)*npx +1 iy0= (ity)*npy +1 iz0= (itz)*npz +1 c write(0,*) "ix0,y0,z0=", ix0,iy0,iz0 c write(0,*) "itx,ity,itz=",itx,ity,itz c c do i= 1+ix0, nxyz+ix0 c write(0,*) i,xxl(i), yyl(i) c enddo c do i= 1+iz0, npz+iz0 c write(0,*) i, zzl(i) c enddo do i= 1-nbdyf, nx+nbdyf xxl4(i) = xxl(i) enddo do i= 1-nbdyf, ny+nbdyf yyl4(i) = yyl(i) enddo do i= 1-nbdyf, nz+nbdyf zzl4(i) = zzl(i) enddo call ppm98_mesho3('X','Y','Z', 0,npx,0, 0,npy,0, 0,npz,0, & xxl4(ix0),yyl4(iy0),zzl4(iz0), iunit ) call ppm98_endian( iunit ) c Now the zone average quantities call ppm98_var3d("lnDensity", 'RHO', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 1, ddd, 1, iunit) call ppm98_var3d("lnPressure", 'P', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 2, ddd, 1, iunit) call ppm98_var3d("X velocity", 'Vx', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 3, ddd, 0, iunit) call ppm98_var3d("Y velocity", 'Vy', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 4, ddd, 0, iunit) call ppm98_var3d("Z velocity", 'Vz', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 5, ddd, 0, iunit) call ppm98_var3d("Diagnostic", 'DIAG', nbdyf, npx, nbdyf, & nbdyf, npy, nbdyf, & nbdyf, npz, nbdyf, & nvar, 6, ddd, 0, iunit) call ppm98_binclose(iunit) c write(0,*) "*** cdump complete" c =================== c do iz= 1, npz c do iy= 1, npy c do ix= 1, npx c v= ddd(3,ix,iy,iz) c bob(ix,iy,iz)= char( int(128 * ( 1 + v/(abs(v)+1) )) ) c enddo c enddo c enddo c prefix= "vx"//char(0) c call writebob( prefix,ndump, npx,npy,npz, bob ) c return end