Fortran 77 question 
Author Message
 Fortran 77 question

Is it possible to prevent long lines, in output files produced using WRITE
statements, from being wrapped up?  I have some large matrices and I can't get
each row to be written in a single long line.  All my output files get wrapped
up around column 72.
Any help will be greatly appreciated.

Paulo Greco



Fri, 24 Jul 1998 03:00:00 GMT  
 Fortran 77 question


|>Is it possible to prevent long lines, in output files produced using WRITE
|>statements, from being wrapped up?  I have some large matrices and I can't get
|>each row to be written in a single long line.  All my output files get wrapped
|>up around column 72.

You don't say whose fortran you are using, what kind of system you have or
how you're doing the output.  I am going to guess you're using list-directed
output, since formatted output shouldn't wrap.

If you were using DEC Fortran, you could specify the RECL= keyword in the
OPEN statement for the output unit to specify the "line width", and
list-directed output would honor it.  You might want to try something like
that to see if the Fortran you are using is similar in this regard.
--


Fortran Development               WWW:  http://www.digital.com/info/slionel.html
Digital Equipment Corporation     CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on Digital Fortran 90, see http://www.digital.com/info/hpc/f90/



Fri, 24 Jul 1998 03:00:00 GMT  
 Fortran 77 question

Quote:

>Is it possible to prevent long lines, in output files produced using WRITE
>statements, from being wrapped up?

Yes. At a guess, you need to specify a larger maximum record length
when you open the output file, eg:

        OPEN ( ..., RECL=512)

although the default is usually larger than the 72 you mention. If
this doesn't solve it, perhaps you could give a sample of the
offending code?

                        Pete
--

WWW: http://sable.ox.ac.uk/~phouston/ | Opinions are mine.
Phone: +44-1865-792542                | Facts are everyone's.
Fax:   +44-1865-58817                 |



Sat, 25 Jul 1998 03:00:00 GMT  
 Fortran 77 question
: Is it possible to prevent long lines, in output files produced using WRITE
: statements, from being wrapped up?  I have some large matrices and I can't get
: each row to be written in a single long line.  All my output files get wrapped
: up around column 72.
: Any help will be greatly appreciated.

Fortran can easily write more than 72 characters to a file.  I suspect your
terminal or editor is wrapping the lines.  I use the "List" editor on my
PC to view lines as long as 256 characters.
--  Steve



Sun, 26 Jul 1998 03:00:00 GMT  
 Fortran 77 question
Quote:

>  Is it possible to prevent long lines, in output files produced using WRITE
>  statements, from being wrapped up?  I have some large matrices and I can't get
>  each row to be written in a single long line.  All my output files get wrapped
>  up around column 72.
>  Any help will be greatly appreciated.

>  Paulo Greco


        Your problem is not Fortran, but the interaction of your operating
system with the display device you are using.   Clearly, you cannot write more
than 72 characters to a device that's only 72 characters wide (though I'd expect
any terminal device to be 80 characters)  
        If you are writing the output directly to the terminal, then you may be
encountering situations such as on some HP systems which just won't write
over 80 characters to the screen, they will abort with an i/o error.  
        If you write to a file, then the longest record you can write is determined
by the OPEN statement and the operating system. (Usually has limits about 32000
or more characters/record)
        If you  truly want to see the output on the screen, and  then you could
use a FORMAT which indents line one and doesn't indent all following lines,
something like:

9000    FORMAT(1X, 7X,6F10.2/(1X,7F10.2))  

oops, don't remember if I need a trailing slash after the 7f10.2....
The 1X's are for carriagle control.  Depending on the system, they may or may not
be needed.  (There was a thread on this topic recently, either here or in the
mail-group, forget which)

_______________________
|Ralph Jay Frisbie      |                
|A flying saucer lover, |  
|but not the inventor.  |

|-----------------------



Sun, 26 Jul 1998 03:00:00 GMT  
 Fortran 77 question


Quote:
>Is it possible to prevent long lines, in output files produced using
>WRITE statements, from being wrapped up?  I have some large matrices
>and I can't get each row to be written in a single long line.  All my
>output files get wrapped up around column 72.
>Any help will be greatly appreciated.

F77 standard has no limit on record length but different compilers and
OS may have and a recordlength may be specified in an OPEN-statement.
In order to answer questions like this, you must inform about what
computer, OS and compiler you use and furthermore you should give the
OPEN- and WRITE-statements involved. If you give this information I'm
sure somebody can help you (It might be me).

Then there is another possibility. I got a similar problem once when the
editor I used to look at the file wraped the lines.

Hope this will give some help,
Kurt


Department of Building Science, LTH, Lund University, Sweden
<Speaking for myself, not the department, nor ...>



Sun, 26 Jul 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Fortran 77 question

2. Fortran 77 question

3. Fortran 77 question

4. Fortran-77 question -- is this legal?

5. A Very Simple Fortran 77 question

6. Fortran 77 simple code question

7. some fortran 77 language question

8. Fortran 77 File I/O Write and Format Question

9. question about negative indices in fortran 77

10. question about negative indices in fortran 77

11. A few basic questions about FORTRAN 77 program

12. Question on FORtran 77 standard

 

 
Powered by phpBB® Forum Software