In Fortran, by default the type of variables whose names start with I...N
is INTEGER
, and REAL
otherwise. It is a legacy of the past and it is know strongly advised to put an implicit none
statement in your program and in each module. That statement was added in the Fortran 90 standard.
Be conscious that if you put an implicit none
at the top of a module, it will apply to the procedures in the contains
section of the module, but not to the interface
section:
module example
implicit none
interface
integer function one(i)
! Here i will be implicitly an INTEGER, except if you add an implicit none here
end function
end interface
contains
integer function two(j)
! The compiler will detect an error because j is not declared
end function jfun
end module example
See also: