主题:新手求助关于fortran调用C的头文件的问题
我有一个关于clsvof计算流体的fortran程序,里面涉及到调用c的头文件及.H的头文件
我用的是CVF
源程序是
#include "REAL.H"
#include "CONSTANTS.H"
#include "BC_TYPES.H"
#include "ArrayLim2d.H"
#define SDIM 2
#define VOFTOL (1.0E-14)
#define EBVOFTOL (1.0E-14)
#define SIMPLESLOPES 0
#define MAXSTACK (10000)
#define VOFTOL2 (1.0E-11)
subroutine tunnel_interpol(x,y,z,x_star,y_star,f_star,option)
implicit none
INTEGER_T k,l,i,j,option
REAL_T x(4,4),y(4,4),z(4,4),x_star,y_star,f_star
REAL_T zeross,den,slope,x_int,y_int,xlo,xhi,ylo,yhi
REAL_T f(4,4),k_lin(4),f_star_lin,fnu_lo,fnu_hi
............
其中一个头文件REAL.H是
#ifndef BL_REAL_H
#define BL_REAL_H
# define INTEGER_T integer*4
# define REAL_T real*8
# define BL_REAL(a) a/**/D0
# define BL_REAL_E(a,b) a/**/D/**/b
#endif /*BL_REAL_H
但是编译后出现这样的错误
Compiling Fortran...
E:\cls\clsvof.F
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
E:\cls\clsvof.F(29) : Error: Lead underscore not allowed
INTEGER_T k,l,i,j,option
-------------^
...........
头文件中定义的REAL_T未能调用到程序中,后面还有很多与头文件有关的错误, 都是因为头文件未调用成功。
请教下各位大神,该如何是好,已经纠结很久了。谢谢了啊。
我用的是CVF
源程序是
#include "REAL.H"
#include "CONSTANTS.H"
#include "BC_TYPES.H"
#include "ArrayLim2d.H"
#define SDIM 2
#define VOFTOL (1.0E-14)
#define EBVOFTOL (1.0E-14)
#define SIMPLESLOPES 0
#define MAXSTACK (10000)
#define VOFTOL2 (1.0E-11)
subroutine tunnel_interpol(x,y,z,x_star,y_star,f_star,option)
implicit none
INTEGER_T k,l,i,j,option
REAL_T x(4,4),y(4,4),z(4,4),x_star,y_star,f_star
REAL_T zeross,den,slope,x_int,y_int,xlo,xhi,ylo,yhi
REAL_T f(4,4),k_lin(4),f_star_lin,fnu_lo,fnu_hi
............
其中一个头文件REAL.H是
#ifndef BL_REAL_H
#define BL_REAL_H
# define INTEGER_T integer*4
# define REAL_T real*8
# define BL_REAL(a) a/**/D0
# define BL_REAL_E(a,b) a/**/D/**/b
#endif /*BL_REAL_H
但是编译后出现这样的错误
Compiling Fortran...
E:\cls\clsvof.F
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
f90: Warning: Bad # preprocessor line
E:\cls\clsvof.F(29) : Error: Lead underscore not allowed
INTEGER_T k,l,i,j,option
-------------^
...........
头文件中定义的REAL_T未能调用到程序中,后面还有很多与头文件有关的错误, 都是因为头文件未调用成功。
请教下各位大神,该如何是好,已经纠结很久了。谢谢了啊。