I'm a bloody beginner to Fortran (f90) and some apparently easy problems turn out to cause severe headaches...Thanks for helping me with this one:
My code runs through a loop, processes data and writes them into a file. I'd like to have those data written in columns of the same file until the looping is finished.
OPEN (unit=11,file=filename // '.csv')
WRITE(11,'(i4,A1,f10.6)') NUM4 , tab, NUMfloat10_6
CLOSE(11)
This code works fine for the saving of a single dataset. "tab" is defined as char(9); filename is specified by the user at the beginning of the script.
When in loop-mode I'd like to add another tab as "A1" and another NUMfloar10_6 ("f10.6"). However, I can't so something like this:
OPEN (unit=11,file=filename // '.csv')
WRITE(11,'(Tk,i4,A1,f10.6)') NUM4 , tab, NUMfloat10_6
CLOSE(11)
with k defined as an integer, increasing with number of loop * 15.
How do you I solve that problem? How do I "add" columns to a file without knowing how many spaces to skip?