indoze
January 28th, 2011, 06:06 PM
Hello,
I've searched all over the internet for potential solutions to this problem, and while some explanations come close I haven't managed to fully solve my problem.
I have a fortran program, and one subroutine is called at the start to generate an input file using a series of write statements. Part of this subroutine entails reading a comma-separated file to pull variables and write them in the list (3 variables total; 1 integer, 2 real). The write statements I use are similar to this:
WRITE (33,*)'Calculated Flux photo.FLUX'
WRITE (33,*)'Calculated A 'A'
WRITE (33,*)'Calculated B 'B'
Where 33 is the unit being called (the input file), and A and B are variables. Since I'm using list-directed output, fortran is inserting a single space at the start of each line, which really screws with the rest of the program this file is generated for. I've tried using different formatting codes (such as '(A)' or '(A$)'), but since these either do not work with my variables or do not form a list, the input still doesn't work.
My question is, is there a way to write to a file in a list format without that starting blank space? Even if it's more complicated (by using explicit formatting), if someone could help me with this I'd be greatly appreciated.
Thank you!
I've searched all over the internet for potential solutions to this problem, and while some explanations come close I haven't managed to fully solve my problem.
I have a fortran program, and one subroutine is called at the start to generate an input file using a series of write statements. Part of this subroutine entails reading a comma-separated file to pull variables and write them in the list (3 variables total; 1 integer, 2 real). The write statements I use are similar to this:
WRITE (33,*)'Calculated Flux photo.FLUX'
WRITE (33,*)'Calculated A 'A'
WRITE (33,*)'Calculated B 'B'
Where 33 is the unit being called (the input file), and A and B are variables. Since I'm using list-directed output, fortran is inserting a single space at the start of each line, which really screws with the rest of the program this file is generated for. I've tried using different formatting codes (such as '(A)' or '(A$)'), but since these either do not work with my variables or do not form a list, the input still doesn't work.
My question is, is there a way to write to a file in a list format without that starting blank space? Even if it's more complicated (by using explicit formatting), if someone could help me with this I'd be greatly appreciated.
Thank you!