phcs 发表于 2015-8-10 10:23:56

IVF 宏预处理嵌套错误

      !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

phcs 发表于 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

楚香饭 发表于 2015-8-10 13:52:10

!DEC$ if defined(Spectral) || defined(FEM)
改为
!DEC$ if defined(Spectral) .OR. defined(FEM)

phcs 发表于 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: ( % [ : . = =>
怎么修改呢?

楚香饭 发表于 2015-8-10 15:37:51

这就是告诉你,你必须定义一个合法的 INT,如果你没有定义或者定义的不是 4 或 8,就会出错。

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

phcs 发表于 2015-8-10 15:54:56

楚香饭 发表于 2015-8-10 15:37
这就是告诉你,你必须定义一个合法的 INT,如果你没有定义或者定义的不是 4 或 8,就会出错。

作者的初衷 ...

嗯,谢谢你了
页: [1]
查看完整版本: IVF 宏预处理嵌套错误