I've written a 3D finite difference diffusion code in Microsoft Visual studio Intel Fortran Compiler and I need to output the concentrations at certain time step values. I need an output file that includes the concentration array in the domain for specific time steps throughout the program. The format I have right now is listed below. m is the global indexing scheme.
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
write (71,*)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. How can I output the concentrations for each time step in one file that is column listed. I need the output file to be as seen below. Any help would be awesome! Thanks.
Note: This output command is within a subroutine and Cold(m) is the concentration array
100 150 200 250 etc..
1495.222 12453 16463 13564
1494.811 134546 13658 13565
1494.206 136563 13564 13567
1493.420 114543 16743 13569
******** ******** ******* *******
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
write (71,*)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. How can I output the concentrations for each time step in one file that is column listed. I need the output file to be as seen below. Any help would be awesome! Thanks.
Note: This output command is within a subroutine and Cold(m) is the concentration array
100 150 200 250 etc..
1495.222 12453 16463 13564
1494.811 134546 13658 13565
1494.206 136563 13564 13567
1493.420 114543 16743 13569
******** ******** ******* *******