[Fortran] 纯文本查看 复制代码
!< write data to TECPLOT file
program printDat
implicit none
integer :: i,j,k
integer :: ni
integer :: nj
integer :: nk
real(kind=8) :: xp(5,5,5)
character :: text
ni = 5
nj = 5
nk = 5
open(unit=15,file='tecplot.dat',form='formatted',status='unknown')
!< three-dimensional
text='VARIABLES = X Y Z U V W P K E VIS'
write(15,90) text
90 format(1x,70a)
write(15,92) ni,nj,nk
92 format(1x,'ZONE T="Zone-One", I= ',i3,' ,J= ',i3,' ,K= ',i3,' ,F=POINT')
do k=1,nk
do j=1,nj
do i=1,ni
! write(15,98)xp(i,j,k),yp(i,j,k),zp(i,j,k),phi(i,j,k,u),
! &phi(i,j,k,v),phi(i,j,k,w),phi(i,j,k,p),phi(i,j,k,te),
! &phi(i,j,k,ed),vis(i,j,k)
write(15,108) xp(i,j,k)
enddo
enddo
enddo
98 format(1x,10(1pe13.6,2x))
108 format(1x,1(1pe13.6,2x))
close(15)
endprogram