Re: Does F90 do type checking when calling module subroutines?



Neilen Marais wrote:
Hi

I was under the impression that if you call subroutines from modules, f90
would check the call paramter types?  I'm using Intel fortran under linux.
I have a subroutine defined in a module like this:

MODULE parseinput
.
.
.
  INTERFACE read_namelists
     MODULE PROCEDURE read_namelists
  END INTERFACE
.
.
.
CONTAINS

  SUBROUTINE read_namelists(infile)
    IMPLICIT NONE
    INTEGER(I4B), INTENT(in) :: infile


In another .f90 file, I included this subroutine with a USE parseinput statement. [...]

In addition to what Richard Maine said, I have some uneasiness about the last sentence quoted above. If you know all this, pardon my saying the obvious, but just to eliminate all sources of error...

    F90 does not have a concept of "source file" as does C/C++.
It is important that the "USE parseinput" statement be present in
*every* subroutine or function, or the main program, that calls
read_namelists.  Secondly, the USE statement does *not* include
the subroutine read_namelists.  What it does is make any module
parameters or variables visible to the compiler, and the _interfaces_
for any module procedures defined in the module.  That's a lot
different than, e.g., _including_ the source code for the subroutine.

	-Ken
--
I don't speak for Intel, Intel doesn't speak for me...

Ken Fairfield
D1C Automation VMS System Support
who:   kenneth dot h dot fairfield
where: intel dot com
.



Relevant Pages

  • Re: Q: Convert quadword time to Ascii time in DCL?
    ... Ken Fairfield wrote: ... posted to c.o.v back in May 1992 by Wolfgang Moeller to be the ... I don't speak for Intel, ... kenneth dot h dot fairfield ...
    (comp.os.vms)
  • Re: removing blanks from a file
    ... offer a small explanation of the "SS" format specifier (which ... I don't speak for Intel, ... Ken Fairfield ... kenneth dot h dot fairfield ...
    (comp.lang.fortran)
  • Re: Challenge: Workaround a CVF bug
    ... Seems to me that the question at hand was just to then copy data from a C string to such a character variable, truncating or blank padding as needed. ... I don't speak for Intel, ... Ken Fairfield ... kenneth dot h dot fairfield ...
    (comp.lang.fortran)
  • Re: cURL 7.11.0 available for VMS
    ... Ken Fairfield wrote: ... > OpenSSL requirement would be a significant barrier... ... I don't speak for Intel, ... kenneth dot h dot fairfield ...
    (comp.os.vms)
  • Re: Logfile name
    ... > Ken Fairfield wrote: ... I don't speak for Intel, ... kenneth dot h dot fairfield ...
    (comp.os.vms)