I've written a 3D finite difference diffusion code in Microsoft Visual studio and I need to output the concentrations are certain time step values. I need multiple output files that include the concentration array in the domain for specific time steps throughout the program. The format I have right now is listed below.
open(71,file='Conc.out',status='unknown')
if(NumTS.eq.TS)then
do k=1,NZ
do j=1,NY
do i=1,NX
m=i+(j-1)*NX+(k-1)*NX*NY
write (71,'(TS)',ADVANCE = "NO")TS
write (71,'(TS)',ADVANCE = "NO")Cold(m)
end do
end do
end do
end if
close(unit=71)
NumTS is the time step value I wish to output i.e NumTS=100,150,200 etc. TS is the updated time step value that has an increase in time step size added to the previous time step value that is included in the main loop i.e 50 is added each time. So my desired output files would be Conc100.out, Conc150.out and so on. OR how can I output the concentrations for each time step in one file that is column listed. Any help would be awesome! Thanks.
Note: This output command is within a subroutine and Cold(m) is the concentration array