cat > param.grid << '\eof' c +++param.grid+++ cc major dimensions parameter(nx=126,ny=126,nz=81) parameter(nxyz=nx*ny*nz) '\eof' cat > src.for << '\eof' program save_data cc include 'param.grid' cc grid (for regular dzeta isosurfaces) data dx,dy,dz,dt /400.,400.,300.,6./ common/grid/ time,dt,dx,dy,dz,dti,dxi,dyi,dzi cc thermodynamics real*4 theta(nx,ny,nz),qv(nx,ny,nz),qc(nx,ny,nz),qr(nx,ny,nz) real*4 qia(nx,ny,nz),qib(nx,ny,nz) cc dynamics real*4 ux(nx,ny,nz),uy(nx,ny,nz),uz(nx,ny,nz) ! current time level cc analysis of the tape: 12hrs, data every 6 min parameter(nt=1+10*12) do icas=1,2 print*,'+++ case: ',icas do itap=1,4 print*,'---+++ tape: ',itap if(icas.eq.1 .and. itap.eq.1) then open(17,file='../PRI/fort.17.1',form='unformatted', 1 status='old') endif if(icas.eq.1 .and. itap.eq.2) then open(17,file='../PRI/fort.17.2',form='unformatted', 1 status='old') endif if(icas.eq.1 .and. itap.eq.3) then open(17,file='../PRI/fort.17.3',form='unformatted', 1 status='old') endif if(icas.eq.1 .and. itap.eq.4) then open(17,file='../PRI/fort.17.4',form='unformatted', 1 status='old') endif if(icas.eq.2 .and. itap.eq.1) then open(17,file='../POL/fort.17.1',form='unformatted', 1 status='old') endif if(icas.eq.2 .and. itap.eq.2) then open(17,file='../POL/fort.17.2',form='unformatted', 1 status='old') endif if(icas.eq.2 .and. itap.eq.3) then open(17,file='../POL/fort.17.3',form='unformatted', 1 status='old') endif if(icas.eq.2 .and. itap.eq.4) then open(17,file='../POL/fort.17.4',form='unformatted', 1 status='old') endif ccc skip 6 hours... do it=1,10*6 read(17) read(17) read(17) enddo do it=1,1 read(17) time,nx1,ny1,nz1 read(17) ux,uy,uz read(17) theta,qv,qc,qr,qia,qib write(19) theta,qv,qc,qr,qia,qib,ux,uy,uz enddo ! time loop close(17) enddo ! tape loop enddo ! case loop stop end '\eof' ncargf77 src.for