Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29251 Discussions

Dummy argument names and interface bodies

IanH
Honored Contributor III
477 Views

Ifort complains that the name `node` inside the interface body for `two` isn't a type.  I think it is getting confused by the use of `node` as a dummy argument in the previous interface body.

MODULE m
  IMPLICIT NONE
  
  TYPE :: Node
  END TYPE Node
  
  INTERFACE
    MODULE SUBROUTINE one(node)
      INTEGER :: node
    END SUBROUTINE one
    
    MODULE SUBROUTINE two(arg)
      TYPE(Node) :: arg
    END SUBROUTINE two
  END INTERFACE
END MODULE m

 

>ifort /check:all /warn:all /standard-semantics "2016-01-25 node.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

2016-01-25 node.f90(13): error #6463: This is not a derived type name.   [NODE]
      TYPE(Node) :: arg
-----------^
2016-01-25 node.f90(12): warning #6717: This name has not been given an explicit type.   [ARG]
    MODULE SUBROUTINE two(arg)
--------------------------^
compilation aborted for 2016-01-25 node.f90 (code 1)

 

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
477 Views

What happens when type node is not a null type?

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
477 Views

That doesn't change things. You're right that making the dummy argument named node is the key. This is a bug and I will let the developers know - thanks. Issue ID is DPD200381101.

0 Kudos
Steven_L_Intel1
Employee
477 Views

I expect the fix for this to appear in Parallel Studio XE 2016 Update 3.

0 Kudos
Reply