Fortran Coder

查看: 5934|回复: 5
打印 上一主题 下一主题

[调试器] IVF 宏预处理嵌套错误

[复制链接]

10

帖子

2

主题

0

精华

入门

F 币
109 元
贡献
31 点
跳转到指定楼层
楼主
发表于 2015-8-10 10:23:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
      !DEC$ if (FLOAT==4)
       !DEC$ if defined(Spectral) || defined(FEM)
       SPECTRAL SOLVER AND OWN FEM DO NOT SUPPORT SINGLE PRECISION, STOPPING COMPILATION
       !DEC$ endif
        integer,     parameter, public :: pReal = 4                                                        !< floating point single precition (was selected_real_kind(6,37), number with 6 significant digits, up to 1e+-37)
       !DEC$ if defined (__INTEL_COMPILER)
       real(pReal), parameter, public :: DAMASK_NaN = Z'7F800001'                                         !< quiet NaN for single precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran)
       !DEC$ endif
       !DEC$ if defined (__GFORTRAN__)
       real(pReal), parameter, public :: DAMASK_NaN = real(Z'7F800001', pReal)                            !< quiet NaN for single precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran)
       !DEC$ endif
      !DEC$ elseif (FLOAT==8)
       integer,     parameter, public :: pReal = 8                                                        !< floating point double precision (was selected_real_kind(15,300), number with 15 significant digits, up to 1e+-300)
       !DEC$ if defined (__INTEL_COMPILER)
       real(pReal), parameter, public :: DAMASK_NaN = Z'7FF8000000000000'                                 !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran)
       !DEC$ endif
       !DEC$ if defined (__GFORTRAN__)
       real(pReal), parameter, public :: DAMASK_NaN = real(Z'7FF8000000000000', pReal)                    !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran)
       !DEC$ endif
      !DEC$ else
       NO SUITABLE PRECISION FOR REAL SELECTED, STOPPING COMPILATION
      !DEC$ endif

      !DEC$ if (INT==4)
       integer,     parameter, public :: pInt  = 4                                                        !< integer representation 32 bit (was selected_int_kind(9), number with at least up to +- 1e9)
      !DEC$ elseif (INT==8)
       integer,     parameter, public :: pInt  = 8                                                        !< integer representation 64 bit (was selected_int_kind(12), number with at least up to +- 1e12)
      !DEC$ else
       NO SUITABLE PRECISION FOR INTEGER SELECTED, STOPPING COMPILATION
      !DEC$ endif

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

10

帖子

2

主题

0

精华

入门

F 币
109 元
贡献
31 点
沙发
 楼主| 发表于 2015-8-10 10:27:08 | 只看该作者
1>F:\test\Console6\prec.f90(47): remark #5169: Misplaced conditional compilation directive or nesting too deep
1>F:\test\Console6\prec.f90(55): remark #5169: Misplaced conditional compilation directive or nesting too deep

712

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
607 元
贡献
311 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

板凳
发表于 2015-8-10 13:52:10 | 只看该作者
!DEC$ if defined(Spectral) || defined(FEM)
改为
!DEC$ if defined(Spectral) .OR. defined(FEM)

10

帖子

2

主题

0

精华

入门

F 币
109 元
贡献
31 点
地板
 楼主| 发表于 2015-8-10 15:23:59 | 只看该作者
楚香饭 发表于 2015-8-10 13:52
!DEC$ if defined(Spectral) || defined(FEM)
改为
!DEC$ if defined(Spectral) .OR. defined(FEM)


!DEC$ else
       NO SUITABLE PRECISION FOR INTEGER SELECTED, STOPPING COMPILATION
!DEC$ endif
中间这里显示Syntax error, found IDENTIFIER 'SUITABLE' when expecting one of: ( % [ : . = =>
怎么修改呢?

712

帖子

4

主题

0

精华

大师

农村外出务工人员

F 币
607 元
贡献
311 点

新人勋章爱心勋章水王勋章元老勋章热心勋章

5#
发表于 2015-8-10 15:37:51 | 只看该作者
这就是告诉你,你必须定义一个合法的 INT,如果你没有定义或者定义的不是 4 或 8,就会出错。

作者的初衷就是想让你出错,以便你知道,必须定义一个合法的 INT。

10

帖子

2

主题

0

精华

入门

F 币
109 元
贡献
31 点
6#
 楼主| 发表于 2015-8-10 15:54:56 | 只看该作者
楚香饭 发表于 2015-8-10 15:37
这就是告诉你,你必须定义一个合法的 INT,如果你没有定义或者定义的不是 4 或 8,就会出错。

作者的初衷 ...

嗯,谢谢你了
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-4-20 14:05

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表