Please help me in understanding the below format

Please clarify the format 990 to me I will be very thankful

C Read event Date, Latitude, Longitude, Magnitude, Lineament angle
READ(5,990) IYR(I),IM(I),ID(I), QKE(I,1),QKE(I,2),QKE(I,3),TH(I)
990 FORMAT(3I4, 2F10.3, 2F12.1)

One way of understing it would be to use any online compiler

https://play.fortran-lang.org/

Online Fortran Compiler - online editor

And try out writing instead of reading:

program main

integer, parameter :: dim = 1
integer :: I
integer :: IYR(dim),IM(dim),ID(dim)
real :: QKE(dim,3) ,TH(dim)

IYR(:) = 1 ; IM(:) = 2 ; ID(:) = 3
QKE(:,:) = acos(-1.) ; TH(:) = 2*acos(-1.) 
I = 1
write(*,990) IYR(I),IM(I),ID(I), QKE(I,1),QKE(I,2),QKE(I,3),TH(I)
990 FORMAT(3I4, 2F10.3, 2F12.1)

end program

Output:

1   2   3     3.142     3.142         3.1         6.3

From the format you can already see that it expects:
3 integers, 2 reals , 2 reals
For more details on the formats:

Fortran Format

For the integers ‘I4’: it is expected that they contain less than 4 digits, anything > 9999 will cause problems

For the reals ‘F10.3’ : 10 characters are used for the formatted writting/reading and 3 decimal places are used

2 Likes

Beware of “-” sign, which is counted in the 4 characters… That means that anything <-999 will cause problems too.

2 Likes

Exactly! nice catch

1 Like