Topic: carriage control

As an 'old' fortran user, I would like to make my output prettier.  However, when I use the carriage control that I remember, nothing happens.  I tried using the option 'carriagecontrol='fortran' in the file open statement.  However that does not work.  I think that I tried using the -fdec option on the makefile option menu.  That did not work.  Has anybody tried using carriage control, and if so I would like some help.  Thank you, jstephen.tennis

Re: carriage control

The carriagecontrol option for the open statement is a weird, Intel-only option, and our compiler certainly does not support it.  A lot of the functionality of early format extensions in other compilers has been supplanted by using the advance option in read and write statements and the new_line function (which returns the platform's new line sequence). 

What exactly are you trying to do that we might be able to suggest an alternative?

Jeff Armstrong
Approximatrix, LLC

3 (edited by Lynn McGuire 2021-10-13 22:34:37)

Re: carriage control

We use carriage control in every single write to our output file.  The first character of each line is a
1 - page feed (form feed)
+ - over write the previous line
0 - skip to the next line the write
' ' - blank, default, dont do anything

I would guess that we have 10,000 formatted writes to our output file.  Changing this is going to be expensive for us.  I have been thinking about it for quite a while though.

C        open the output file           
      OPEN (UNIT    = oufile,
     *      FILE    = OUPATH,
     *      ACTION  = 'WRITE',
     *      ACCESS  = 'SEQUENTIAL',
     *      STATUS  = 'UNKNOWN',
     *      CARRIAGECONTROL = 'YES',
     *      BLOCKSIZE = 80,
     *      FORM    = 'FORMATTED',
     *      IOSTAT  = OPERR,
     *      ERR     = 400)

   IF (KTRACE.EQ.28) WRITE (OUFILE,555)
  555    FORMAT('0 JUST RETURNED FROM EQCALL, GETTING TO SUBST1----')

      WRITE (OUFILE,133)
133   FORMAT ('0++++++++NEW CASE STUDY++++++++')

            WRITE(OUFILE,9764) (IVDY(VTAB+IK).I ,IK=1,KEND)
9764       FORMAT(/' TRANSPORT OPTIONS',12I4)

         CALL PTITLE
         WRITE(OUFILE,910)
  910    FORMAT ('0',5X,'STREAM THERMODYNAMIC INITIALIZATION',//
     *           2X,'STREAM NUMBER',3X,'KVALUES',3X,'ENTHALPIES',3X,
     *           'VAPOR DENSITY',3x,'LIQUID DENSITY',3x,'IMM COMP'/
     *           2X,13('-'),3X,7('-'),3X,10('-'),3X,13('-'),3X,14('-'),
     *           3x,'--------')

Our software dates back to the Univac 1108 (36 bit words) in the middle 1960s.  My first port was to the CDC 7600 (60 bit words) in 1977.

4 (edited by Lynn McGuire 2021-10-14 01:03:27)

Re: carriage control

I got the carriage control to compile changing the
     *      CARRIAGECONTROL = 'YES',
to
     *      CARRIAGECONTROL = 'FORTRAN',

and removing the BLOCKSIZE command.

Amazing.

Now I have to figure out how to conditionally compile some of my code for the different options for carriage control between Watcom and gFortran.