Fortran Coder

标题: 关于F77老程序的编译 [打印本页]

作者: sunkingf    时间: 2020-2-24 16:51
标题: 关于F77老程序的编译
各位好:

F77老程序标准不严,随着发展,如果按VS2010+IVF2013的默认设置编译,会出现不少错误。如果目的是为了使得老程序运行,能否将该项目设置成完全的F77标准,按当时程序开发时的环境来运行,应该就没问题了。

但这怎么做呢?



作者: li913    时间: 2020-2-25 13:10
给错误提示和代码。
作者: sunkingf    时间: 2020-2-25 13:21
li913 发表于 2020-2-25 13:10
给错误提示和代码。

这是个比较大的程序,代码有50多M,见链接(windows 版本): https://www.wiley.com/legacy/wileychi/desouzaneto/files.html

编译采用VS2010+IVF2013,错误提示如下:

E:\work directory\HYPLAS_v2.0\src\MATERIALS\matior.f(30): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
        CALL ORVM(RALGVA  ,16      ,NTYPE   ,RSTAVA  ,STRES   )
------------------^

E:\work directory\HYPLAS_v2.0\src\MATERIALS\matict.f(114): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,DMATX      ,EPFLAG     ,IPROPS     ,NTYPE     ,
----------^
E:\work directory\HYPLAS_v2.0\src\MATERIALS\matict.f(140): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,DMATX      ,EPFLAG     ,IPROPS     ,NTYPE      ,
----------^
E:\work directory\HYPLAS_v2.0\src\MATERIALS\matict.f(213): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,DMATX      ,EPFLAG     ,IPROPS     ,NTYPE      ,
----------^

E:\work directory\HYPLAS_v2.0\src\TRESCA\sutr.f(60): error #7983: The storage extent of the dummy argument exceeds that of the actual argument.   [STREST]
      CALL SPDEC2(EIGPRJ,PSTRS,DUMMY,STREST)
-------------------------------------^

E:\work directory\HYPLAS_v2.0\src\GENERAL\initia.f(44): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   [LALGVL]
          CALL MATISW
---------------^
E:\work directory\HYPLAS_v2.0\src\GENERAL\initia.f(44): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   [RALGVL]
          CALL MATISW
---------------^
E:\work directory\HYPLAS_v2.0\src\GENERAL\initia.f(44): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   [RSTAVL]
          CALL MATISW
---------------^
E:\work directory\HYPLAS_v2.0\src\GENERAL\initia.f(44): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   [STRESL]
          CALL MATISW
---------------^

E:\work directory\HYPLAS_v2.0\src\DRUCKER_PRAGER\sudppn.f(69): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,DMATX      ,EPFLAG     ,IPROPS     ,LALGVA     ,
----------^

E:\work directory\HYPLAS_v2.0\src\MATERIALS\matisu.f(95): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,IPROPS     ,LALGVA     ,NTYPE      ,RPROPS     ,
----------^
E:\work directory\HYPLAS_v2.0\src\MATERIALS\matisu.f(99): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,IPROPS     ,LALGVA     ,NTYPE      ,RPROPS     ,
----------^
E:\work directory\HYPLAS_v2.0\src\MATERIALS\matisu.f(121): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,IPROPS     ,LALGVA     ,NTYPE      ,RPROPS     ,
----------^
E:\work directory\HYPLAS_v2.0\src\MATERIALS\matisu.f(213): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RALGVA]
     1(   RALGVA     ,IPROPS     ,LALGVA     ,NTYPE      ,RPROPS     ,
----------^
E:\work directory\HYPLAS_v2.0\src\MOHR_COULOMB\sumc.f(67): error #7983: The storage extent of the dummy argument exceeds that of the actual argument.   [STREST]
      CALL SPDEC2(EIGPRJ,PSTRS,DUMMY,STREST)
-------------------------------------^

Hytest1 - 22 error(s), 0 warning(s)
作者: 七星彩    时间: 2020-2-25 14:29
本帖最后由 七星彩 于 2020-2-25 14:34 编辑

现代编译器,也是完全的 F77 标准。并且比旧编译器拥有了更多的检查项目。
请理解:

如果你觉得这些新增加的检查没必要,可以放弃。比如,放弃接口检查。
项目,属性,Fortran,Diagnostics,Check Routine Interfaces /NO




作者: sunkingf    时间: 2020-2-25 15:19
七星彩 发表于 2020-2-25 14:29
现代编译器,也是完全的 F77 标准。并且比旧编译器拥有了更多的检查项目。
请理解:
  • 以前的代码能编译, ...

  • 谢谢,说的很好!

    我不专业,本来要表达的意思是:“能否将该项目设置成当时程序开发时的环境来运行,应该就没问题了。


    其实我就是要弱化一些条件,正如您指出的,“项目,属性,Fortran,Diagnostics,Check Routine Interfaces /NO”,这么操作后,程序通过了!

    谢谢!




    欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2