subroutine printresult(x,y,u,nx,ny,nmax,time,nfile, * bDoXBoundaries, bDoYBoundaries) implicit none real*8 x,y,u,time integer nx,ny,nmax,nfile,i,j character hundred,ten,unit logical bDoXBoundaries, bDoYBoundaries integer xMin, xMax, yMin, yMax dimension x(0:nx+1),y(0:ny+1),u(0:nmax+1,0:nmax+1) hundred = char(nfile/100+48) ten=char(mod(nfile,100)/10+48) unit=char(mod(nfile,10) + 48) open(10,file='u.'//hundred//ten//unit,status='unknown') open(11,file='x.'//hundred//ten//unit,status='unknown') open(12,file='y.'//hundred//ten//unit,status='unknown') open(13,file='time.'//hundred//ten//unit,status='unknown') xMin = 1 xMax = nx yMin = 1 yMax = ny if(bDoXBoundaries .EQV. .TRUE.) then xMin = 0 xMax = nx+1 endif if(bDoYBoundaries .EQV. .TRUE.) then yMin = 0 yMax = ny+1 endif do j=yMin,yMax do i=xMin,xMax write(10,*) u(i,j) enddo enddo do i=xMin,xMax write(11,*) x(i) enddo do j=yMin,yMax write(12,*) y(j) enddo write(13,*) time close(10) close(11) close(12) close(13) return end subroutine printPsi(x,y,u,nx,ny,nmax,time,nfile, * bDoXBoundaries, bDoYBoundaries) implicit none real*8 x,y,u,time integer nx,ny,nmax,nfile,i,j character hundred,ten,unit logical bDoXBoundaries, bDoYBoundaries integer xMin, xMax, yMin, yMax dimension x(0:nx+1),y(0:ny+1),u(0:nmax+1,0:nmax+1) hundred = char(nfile/100+48) ten=char(mod(nfile,100)/10+48) unit=char(mod(nfile,10) + 48) open(10,file='psi.'//hundred//ten//unit,status='unknown') open(11,file='x.'//hundred//ten//unit,status='unknown') open(12,file='y.'//hundred//ten//unit,status='unknown') open(13,file='time.'//hundred//ten//unit,status='unknown') xMin = 1 xMax = nx yMin = 1 yMax = ny if(bDoXBoundaries .EQV. .TRUE.) then xMin = 0 xMax = nx+1 endif if(bDoYBoundaries .EQV. .TRUE.) then yMin = 0 yMax = ny+1 endif do j=yMin,yMax do i=xMin,xMax write(10,*) u(i,j) enddo enddo do i=xMin,xMax write(11,*) x(i) enddo do j=yMin,yMax write(12,*) y(j) enddo write(13,*) time close(10) close(11) close(12) close(13) return end subroutine printUVresult(x,y,u,nx,ny,nmax,time,nfile, * bDoXBoundaries, bDoYBoundaries) implicit none real*8 x,y,u,time integer nx,ny,nmax,nfile,i,j character hundred,ten,unit logical bDoXBoundaries, bDoYBoundaries integer xMin, xMax, yMin, yMax dimension x(0:nx+1),y(0:ny+1),u(2,0:nmax+1,0:nmax+1) hundred = char(nfile/100+48) ten=char(mod(nfile,100)/10+48) unit=char(mod(nfile,10) + 48) open(9,file='u.'//hundred//ten//unit,status='unknown') open(10,file='v.'//hundred//ten//unit,status='unknown') open(11,file='x.'//hundred//ten//unit,status='unknown') open(12,file='y.'//hundred//ten//unit,status='unknown') open(13,file='time.'//hundred//ten//unit,status='unknown') xMin = 1 xMax = nx yMin = 1 yMax = ny if(bDoXBoundaries .EQV. .TRUE.) then xMin = 0 xMax = nx+1 endif if(bDoYBoundaries .EQV. .TRUE.) then yMin = 0 yMax = ny+1 endif do j=yMin,yMax do i=xMin,xMax write(9,*) u(1,i,j) enddo enddo do j=yMin,yMax do i=xMin,xMax write(10,*) u(2,i,j) enddo enddo do i=xMin,xMax write(11,*) x(i) enddo do j=yMin,yMax write(12,*) y(j) enddo write(13,*) time close(9) close(10) close(11) close(12) close(13) return end