- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I try to write numerical values in an output file (from a former post of July). but I have compilation error.
The difficulty is that I have all my Fortran source code with extension .for and not .f90, so the simple synthax of f90 cannot be re-used here (and I cannot convert my .for code in .f90).
Since the previous post, I progressed on this: I succeeded to write headers (for each numerical values I want to store) in the output file (see file attached), it compiles correctly with that synthax.
But when I want to write the numerical values using similar synthax, the compilation fails.
Any help ?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot, it works !
There was still a small parenthesis error in your code but I corrected it and now it compiles (below the corrected source code).
! WRITE IN FILE THE STRIP MODEL COEFF.
OPEN(987, file = 'OutputFile.txt', status = 'unknown')
! WRITE HEADERS
WRITE(987, '(37(A,$))') 'GammaB_CB[1,1,1]', CHAR(9),
> 'GammaP_CB[1,1,1]', CHAR(9),
> 'Rb_CB[1,1,1]', CHAR(9),
> 'Rp_CB[1,1,1]', CHAR(9),
> 'def0', CHAR(9)
! WRITE VALUES
WRITE(987, '(/, 4(F5.2, A), $)')
> GammaB_CB(1,1,1), CHAR(9),
> GammaP_CB(1,1,1), CHAR(9),
> Rb_CB(1,1,1), CHAR(9),
> Rp_CB(1,1,1)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see three errors in the first multiline statement that produced a syntax error (line 710 et seq):
c
write(987,'(/, F5.2, A, $, F5.2, A, $, F5.2, A, $, F5.2, A, $)
> GammB_CB[1,1,1], CHAR(9),
Of the four '$' format specifiers, only the last one makes sense. Nevertheless, it would be better to use the standard method, which does away with the '$' specifier, instead using the clause ADVANCE = 'NO' in the WRITE statement.
The next error is that the first line is missing two characters at the end: a single quote and right-parenthesis. The third error is your using brackets instead of parentheses for containing subscripts. The lines above should be
c
write(987,'(/, 4(F5.2, A), $)')
> GammB_CB(1,1,1), CHAR(9),
It would make it easier for people to respond if you posted program text using the </> tool icon instead of attaching Powerpoint files or screenshots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot, it works !
There was still a small parenthesis error in your code but I corrected it and now it compiles (below the corrected source code).
! WRITE IN FILE THE STRIP MODEL COEFF.
OPEN(987, file = 'OutputFile.txt', status = 'unknown')
! WRITE HEADERS
WRITE(987, '(37(A,$))') 'GammaB_CB[1,1,1]', CHAR(9),
> 'GammaP_CB[1,1,1]', CHAR(9),
> 'Rb_CB[1,1,1]', CHAR(9),
> 'Rp_CB[1,1,1]', CHAR(9),
> 'def0', CHAR(9)
! WRITE VALUES
WRITE(987, '(/, 4(F5.2, A), $)')
> GammaB_CB(1,1,1), CHAR(9),
> GammaP_CB(1,1,1), CHAR(9),
> Rb_CB(1,1,1), CHAR(9),
> Rp_CB(1,1,1)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page