- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
E:\Projects>ifort /c /warn:interface boris.f90 main.f90
Intel Visual Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.1.127 Build 20101116
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
main.f90(1): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [ARG1]
call boris
-----^
This option is enabled by default in the Debug configuration of new Visual Studio projects (Diagnostics > Check routine interfaces.) You may have turned it off, or you may have converted an old project where this was off.
Sometimes you will not see this on an initial build if the caller is compiled before the called routine, but if you recompile the caller you'll see the error.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The behavior is expected!
In Fortran, program units (e.g., functions, subroutines, modules, etc.) are independent, even if they are on the same file ---i.e., in Fortran a file is NOT a boundary.
That means the units will be compiled independently and only rely upon the interfaces provided (or the ones assumed). You can provide explicit interfaces either by placing your functions/subroutines after the CONTAINS statement in a MODULE or PROGRAM unit, or by creating INTERFACE blocks for them.
Besides guaranteeing that the compiler will check the invoked procedures for type, rank, number of arguments, etc., the concept of explicit interface is required in some F90+ constructs, so it's a good idea to get used to it ---which, in its easiest form, means to get used to working with modules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CVF performed checking for multiple subroutines in the same source file, but ifort does not, unless one of the precautions mentioned above is taken.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
E:\Projects>ifort /c /warn:interface boris.f90 main.f90
Intel Visual Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.1.127 Build 20101116
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
main.f90(1): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. [ARG1]
call boris
-----^
This option is enabled by default in the Debug configuration of new Visual Studio projects (Diagnostics > Check routine interfaces.) You may have turned it off, or you may have converted an old project where this was off.
Sometimes you will not see this on an initial build if the caller is compiled before the called routine, but if you recompile the caller you'll see the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page