【问题标题】:Fortran preprocessing with Portland compiler使用 Portland 编译器进行 Fortran 预处理
【发布时间】:2011-08-29 02:26:35
【问题描述】:

我正在尝试使用 pgf90 预处理 Fortran 模块 (pmu.F90)。模块如下:

module pmu

   module variables

contains

   include 'file.F90'

end module 

file.F90 是一个包含以下行的子程序:

 #ifdef PART  

    startm1 = xstart - 1

    startm2 = xstart - 2

    endp1   = xend + 1

    endp2   = xend + 2 

 #else    

    startm1 = xstart - 1

    startm2 = xstart - 1

    endp1   = xend + 1

    endp2   = xend + 1 

 #endif 

如果我编译:

pgf90  -DPART    -Mfree -Mbounds -Msave -Mdclchk -r8 -Mpreprocess  -I/data/users/mrosso/fftw3/include    -c pmu.F90

我明白了

PGF90-S-0021-Label field of continuation line is not blank.

【问题讨论】:

    标签: preprocessor fortran


    【解决方案1】:

    好吧,包含的文件不包含任何过程,这是您在模块 pmu 文件中的“包含”和“结束模块”语句之间需要的。

    在 Fortran 中使用 CPP 的另一个问题是 Fortran 包含语句与 CPP #include 不同。特别是,没有具体说明它们的相互作用。也就是说,如果您要包含一个本身包含 CPP 指令的文件,那么如果您使用 #include 代替,这可能会出错。

    【讨论】:

    • OP 声明“file.F90”包含一个子程序。如果我理解正确的话,他展示的那段代码只是其中的一部分,而不是全部。我同意你关于 CPP 和 Fortran 包含语句之间交互的观点。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多