开发者

Implicit none - Explicit type - Abstract interface - Error

开发者 https://www.devze.com 2023-03-02 23:51 出处:网络
The following Fortran Code: module Mod implicit none TYPE derivedtype procedure(procInterface),POINTER,PASS::f

The following Fortran Code:

module Mod
    implicit none

    TYPE derivedtype
        procedure(procInterface),POINTER,PASS::f
    END TYPE derivedtype

    ABSTRACT INTERFACE        
        subroutine 开发者_StackOverflow中文版procInterface(A)
            import derivedtype            
            implicit none
            class(derivedtype),intent(inout)::A
        end subroutine
    END INTERFACE

end module Mod

produces an error if compiled with ifort:

error #6404: This name does not have a type, and must have an explicit type. [F]

Why? Is this a bug?


This is propably a compiler short-coming. The Cray and IBM compilers can compile this specific module as well, as gfortran 4.6.1. Depending on what you want to achieve, you maybe could use generic type-bound procedures instead, however I am unsure, if this would be better supported by the Intel compiler.

0

精彩评论

暂无评论...
验证码 换一张
取 消