我不熟悉导致以下警告的原因:
warning #5117: Bad # preprocessor line
#include "rtt_alloc_rad.interface"
我已经看过明显的问题,例如#include
被刷新了。我很想知道在哪里寻找可能的原因。
我正在使用英特尔编译器:ifort版本15.0.1
代码是一个与外部库相关联的大型气候模型。 很难知道要发布什么,但警告来自以下代码段:
MODULE rtt_interface
use rtt_types, only : rtt_options, rtt_coefs, profile_Type, &
transmission_Type, radiance_Type,rtt_coef_scatt_ir,rtt_optpar_ir, &
rtt_chanprof, rtt_emissivity, rtt_reflectance
use rtt_const, only : errorstatus_success, errorstatus_fatal, &
platform_name,inst_name
use rtt_unix_env, only : rtt_exit
use cosp_kinds, only : wp,wi,wl
IMPLICIT NONE
real(wp), parameter :: tmin_baran = 193.1571_wp
#include "rtt_alloc_rad.interface"
#include "rtt_alloc_transmission.interface"
#include "rtt_alloc_prof.interface"
#include "rtt_dealloc_coefs.interface"
#include "rtt_direct.interface"
#include "rtt_print_opts.interface"
! snip...
END MODULE rtt_interface
我使用标志编译:{{1}}
答案 0 :(得分:8)
消息
警告#5117:错误#预处理器行
可能有点误导。它表明代码已经通过预处理器,并且它是不满意的预处理器。情况并非总是如此:当源文件中出现预处理程序指令但未调用预处理程序时,ifort也会生成此警告消息。
为了确保运行预处理器,您有几个选择:
-fpp
(或-cpp
)添加到编译命令; .F90
命名自由格式的源文件(注意大写)。