FORTRAN WRITE ()

Before I begin, I must preface, stating that I am a newbie when it comes to Fortran. I keep the inherited piece of code since 1978. Its purpose is to read some data values ​​from a file, process the values, and then output the processed values ​​to another text file.

Given the following FORTRAN code:

      INTEGER NM,STUBS,I,J,K
      PARAMETER (NM=67,STUBS=43)
      INTEGER*4 MDS(STUBS,NM)

      CALL OPEN$A(A$RDWR,'/home/test/data.txt', MAXPATHLEN,1)
      CALL OPEN$A(A$WRIT,'out',11,2)

      DO 90 I=1,2
          READ(1,82) STUB     
          !-- data processing --!     
          WRITE(2,80) STUB,(MDS(I,J),J=1,24)
90    CONTINUE

80    FORMAT(/1X,A24,25I5)
82    FORMAT(1X,A24,25F5,1)

My question is about instructions WRITE().

I understand that it (2,80)refers to an open file output stream and points to a file 'out'and refers to the number 2. I understand that 80 refers to the format operator referenced by label 80.

STUBused to store the values ​​read from the input of file 1. These values ​​are what is processed and stored in MDS(I,J)the section !-- data processing --!that I skipped.

, (MDS(I,J),J=1,24) 24 ? , 1 24?

+5
1

, . (MDS(I,J), J=1,24) - DO-loop" .

+10

All Articles