Fixing FORTRAN IV warning: “The number of arguments is incompatible with intrinsinc procedure, assume 'external' ”

泄露秘密 提交于 2019-12-02 13:24:54

KNOT() is a non-standard specific intrinsic function for the NOT function which accepts 8 byte integers (see https://docs.oracle.com/cd/E19422-01/819-3684/3_F77_Intrins.html ).

You can indeed ignore the warning in this case. Because the numbers and types of the arguments differ, the compiler will not call the intrinsic inadvertently, so it is safe. The problem would be if the compiler had a function which looks exactly the same but does something different. The external statement serves the purpose to prevent such collisions.

The thing you can do to suppress the warning is to tell the compiler you have your own external function KNOT() by placing

EXTERNAL *KNOT

in the declaration section of each compilation unit which calls KNOT, so for example,

SUBROUTINE ABEL1(N,IN,X,XN,A,B,C,D,YCALC)
      IMPLICIT REAL*8 (A-H,O-Z)
      EXTERNAL *KNOT

The type should be all-right given your implicit typing rules, but you can specify it explicitly by

      INTEGER KNOT

Note: the * in EXTERNAL *KNOT means that not an intrinsic, but a user-supplied function should be used. This behaviour differs from modern Fortran! See http://h21007.www2.hp.com/portal/download/files/unprot/fortran/docs/lrm/lrm0633a.htm In FORTRAN 77 and later use just EXTERNAL KNOT.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!