I'm new to FORTRAN and need to work with a code to read and write Data. The Code is a bit older and I need to understand how things happen inside ;)
The code reads a Line of a .dat file with the
FORMAT(36A2):
READ(11,FORMAT(36A2)) ITEXT
The variable ITEXT is declared as an Integer array: INTEGER(KIND=2), DIMENSION(36) :: ITEXT
So if I read in the following line:
SREF = 0.031416,
ITEXT hast the following value:
2313 8224 21075 17989 8224 15648 12320 12334 12595 12596 11318 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224 8224
If I do WRITE(11,FORMAT(36A2))
it gives me back my Full Text.
SREF = 0.031416
,
So what is this Kind of "Integer Code"? How can I work with it and why should I use it?
It is completely new to me.
In the following part is an example Code. The integer "21075" represents "SR" of "SREF = 0.031416"
program example
integer :: ITEXT = 21075
WRITE (*,100), ITEXT
100 FORMAT(36A2)
end program example