The following program has format specifiers that are mismatched to the variables in the I/O list. FTN95 catches the errors, but the wording of the error message is a bit puzzling.
program mismatch
implicit none
integer i
real r
character(2) :: iline = '1.', jline='123'
read(iline,'(F2.1)')i !reading real number into integer variable using F format
print '(ES10.3,4x,I10)',i,i !printing integer using ES format
read(jline,'(I3)')r !reading integer data into real variable using I format
print '(ES10.3,4x,I10)',r,r !printing real using I format
end program
The error message is:
FORMAT mismatch: F-Format with UNKNOWN item (at data position 1). at address 1a0093c9
Surely, the compiler knows the type of the variable as well as its name (if /debug is specified)? Running the same program with Gfortran gives
At line 6 of file mm.f90
Fortran runtime error: Expected REAL for item 1 in formatted transfer, got INTEGER
(F2.1)
^