00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _FORT_PROTO_H_
00029 #define _FORT_PROTO_H_
00030
00031 #include "REAL.H"
00032 #include "SPACE.H"
00033
00034 #ifdef DOXYGEN
00035
00036
00039 #define FORTRAN_NAME( NAME ,name )
00040
00042
00076 #define CHF_MULTIDO(box, i, j, k)
00077
00079 #define CHF_ENDDO
00080
00081 #else
00082
00083 #ifdef CH_FORT_UPPERCASE
00084 #ifdef CH_FORT_UNDERSCORE
00085 #define FORTRAN_NAME( NAME ,name ) NAME ## _
00086 #else
00087 #define FORTRAN_NAME( NAME ,name ) NAME
00088 #endif
00089 #else
00090 #ifdef CH_FORT_UNDERSCORE
00091 #define FORTRAN_NAME( NAME ,name ) name ## _
00092 #else
00093 #define FORTRAN_NAME( NAME ,name ) name
00094 #endif
00095 #endif
00096
00097 class chfptr {
00098 public:
00099 int i ;
00100
00101
00102
00103 chfptr(int a):i(a){}
00104 operator const int*() const {return &i;}
00105 };
00106
00107 #endif
00108
00109
00110
00111
00112
00114 #define CHF_INT( i ) &i
00115
00116 #define CHF_CONST_INT( i ) &i
00117
00118 #define CHF_REAL( r ) &r
00119
00120 #define CHF_CONST_REAL( r ) &r
00121
00122 #define CHF_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
00123
00124 #define CHF_CONST_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
00125
00126 #define CHF_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00127
00128 #define CHF_CONST_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00129
00130
00131
00133 #define CHF_INTVECT( a ) a.dataPtr( )
00134
00135 #define CHF_CONST_INTVECT( a ) a.dataPtr( )
00136
00137 #define CHF_REALVECT( a ) a.dataPtr( )
00138
00139 #define CHF_CONST_REALVECT( a ) a.dataPtr( )
00140
00141 #define CHF_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
00142
00143 #define CHF_CONST_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
00144
00145 #define CHF_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
00146
00147 #define CHF_CONST_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
00148
00150 #define CHF_BOX( b ) D_DECL( &b.loVect()[0] \
00151 ,&b.loVect()[1] \
00152 ,&b.loVect()[2] ) \
00153 ,D_DECL( &b.hiVect()[0] \
00154 ,&b.hiVect()[1] \
00155 ,&b.hiVect()[2] )
00156
00158 #define CHF_FIA( a ) a.dataPtr( 0 ) \
00159 ,D_DECL( &a.loVect()[0] \
00160 ,&a.loVect()[1] \
00161 ,&a.loVect()[2] ) \
00162 ,D_DECL( &a.hiVect()[0] \
00163 ,&a.hiVect()[1] \
00164 ,&a.hiVect()[2] ) \
00165 ,a.nCompPtr()
00166
00168 #define CHF_FRA( a ) a.dataPtr( 0 ) \
00169 ,D_DECL( &a.loVect()[0] \
00170 ,&a.loVect()[1] \
00171 ,&a.loVect()[2] ) \
00172 ,D_DECL( &a.hiVect()[0] \
00173 ,&a.hiVect()[1] \
00174 ,&a.hiVect()[2] ) \
00175 ,a.nCompPtr()
00176
00178 #define CHF_CONST_FIA( a ) a.dataPtr( 0 ) \
00179 ,D_DECL( &a.loVect()[0] \
00180 ,&a.loVect()[1] \
00181 ,&a.loVect()[2] ) \
00182 ,D_DECL( &a.hiVect()[0] \
00183 ,&a.hiVect()[1] \
00184 ,&a.hiVect()[2] ) \
00185 ,a.nCompPtr()
00186
00188 #define CHF_CONST_FRA( a ) a.dataPtr( 0 ) \
00189 ,D_DECL( &a.loVect()[0] \
00190 ,&a.loVect()[1] \
00191 ,&a.loVect()[2] ) \
00192 ,D_DECL( &a.hiVect()[0] \
00193 ,&a.hiVect()[1] \
00194 ,&a.hiVect()[2] ) \
00195 ,a.nCompPtr()
00196
00198 #define CHF_FIA1( a,n ) a.dataPtr( n ) \
00199 ,D_DECL( &a.loVect()[0] \
00200 ,&a.loVect()[1] \
00201 ,&a.loVect()[2] ) \
00202 ,D_DECL( &a.hiVect()[0] \
00203 ,&a.hiVect()[1] \
00204 ,&a.hiVect()[2] )
00205
00207 #define CHF_FRA1( a,n ) a.dataPtr( n ) \
00208 ,D_DECL( &a.loVect()[0] \
00209 ,&a.loVect()[1] \
00210 ,&a.loVect()[2] ) \
00211 ,D_DECL( &a.hiVect()[0] \
00212 ,&a.hiVect()[1] \
00213 ,&a.hiVect()[2] )
00214
00216 #define CHF_CONST_FIA1( a,n ) a.dataPtr( n ) \
00217 ,D_DECL( &a.loVect()[0] \
00218 ,&a.loVect()[1] \
00219 ,&a.loVect()[2] ) \
00220 ,D_DECL( &a.hiVect()[0] \
00221 ,&a.hiVect()[1] \
00222 ,&a.hiVect()[2] )
00223
00225 #define CHF_CONST_FRA1( a,n ) a.dataPtr( n ) \
00226 ,D_DECL( &a.loVect()[0] \
00227 ,&a.loVect()[1] \
00228 ,&a.loVect()[2] ) \
00229 ,D_DECL( &a.hiVect()[0] \
00230 ,&a.hiVect()[1] \
00231 ,&a.hiVect()[2] )
00232
00233
00234
00235
00236
00237
00238 #define CHFp_INT( i ) int* const i
00239 #define CHFp_CONST_INT( i ) const int* const i
00240 #define CHFp_REAL( r ) Real* const r
00241 #define CHFp_CONST_REAL( r ) const Real* const r
00242
00243 #define CHFp_I1D( ia,dimen ) int* const ia, const int* const i ## ia ## hi0
00244 #define CHFp_CONST_I1D( ia,dimen ) const int* const ia, const int* const i ## ia ## hi0
00245 #define CHFp_R1D( ra,dimen ) Real* const ra, const int* const i ## ra ## hi0
00246 #define CHFp_CONST_R1D( ra,dimen ) const Real* const ra, const int* const i ## ra ## hi0
00247
00248
00249
00250 #define CHFp_INTVECT( r ) int* const r
00251 #define CHFp_CONST_INTVECT( r ) const int* const r
00252 #define CHFp_REALVECT( r ) Real* const r
00253 #define CHFp_CONST_REALVECT( r ) const Real* const r
00254 #define CHFp_VI( v ) int * const v, const int* const i ## v ## hi0
00255 #define CHFp_CONST_VI( v ) const int * const v, const int* const i ## v ## hi0
00256 #define CHFp_VR( v ) Real * const v, const int* const i ## v ## hi0
00257 #define CHFp_CONST_VR( v ) const Real * const v, const int* const i ## v ## hi0
00258
00259 #define CHFp_BOX( b ) D_DECL( const int* const i ## b ## lo0 \
00260 ,const int* const i ## b ## lo1 \
00261 ,const int* const i ## b ## lo2 ) \
00262 ,D_DECL( const int* const i ## b ## hi0 \
00263 ,const int* const i ## b ## hi1 \
00264 ,const int* const i ## b ## hi2 )
00265
00266 #define CHFp_FIA( a ) int *const a \
00267 ,D_DECL( const int* const i ## a ## lo0 \
00268 ,const int* const i ## a ## lo1 \
00269 ,const int* const i ## a ## lo2 ) \
00270 ,D_DECL( const int* const i ## a ## hi0 \
00271 ,const int* const i ## a ## hi1 \
00272 ,const int* const i ## a ## hi2 ) \
00273 ,const int* const n ## a ## comp
00274 #define CHFp_FRA( a ) Real *const a \
00275 ,D_DECL( const int* const i ## a ## lo0 \
00276 ,const int* const i ## a ## lo1 \
00277 ,const int* const i ## a ## lo2 ) \
00278 ,D_DECL( const int* const i ## a ## hi0 \
00279 ,const int* const i ## a ## hi1 \
00280 ,const int* const i ## a ## hi2 ) \
00281 ,const int* const n ## a ## comp
00282 #define CHFp_CONST_FIA( a ) const int *const a \
00283 ,D_DECL( const int* const i ## a ## lo0 \
00284 ,const int* const i ## a ## lo1 \
00285 ,const int* const i ## a ## lo2 ) \
00286 ,D_DECL( const int* const i ## a ## hi0 \
00287 ,const int* const i ## a ## hi1 \
00288 ,const int* const i ## a ## hi2 ) \
00289 ,const int* const n ## a ## comp
00290 #define CHFp_CONST_FRA( a ) const Real *const a \
00291 ,D_DECL( const int* const i ## a ## lo0 \
00292 ,const int* const i ## a ## lo1 \
00293 ,const int* const i ## a ## lo2 ) \
00294 ,D_DECL( const int* const i ## a ## hi0 \
00295 ,const int* const i ## a ## hi1 \
00296 ,const int* const i ## a ## hi2 ) \
00297 ,const int* const n ## a ## comp
00298 #define CHFp_FIA1( a ) int *const a \
00299 ,D_DECL( const int* const i ## a ## lo0 \
00300 ,const int* const i ## a ## lo1 \
00301 ,const int* const i ## a ## lo2 ) \
00302 ,D_DECL( const int* const i ## a ## hi0 \
00303 ,const int* const i ## a ## hi1 \
00304 ,const int* const i ## a ## hi2 )
00305 #define CHFp_FRA1( a ) Real *const a \
00306 ,D_DECL( const int* const i ## a ## lo0 \
00307 ,const int* const i ## a ## lo1 \
00308 ,const int* const i ## a ## lo2 ) \
00309 ,D_DECL( const int* const i ## a ## hi0 \
00310 ,const int* const i ## a ## hi1 \
00311 ,const int* const i ## a ## hi2 )
00312 #define CHFp_CONST_FIA1( a ) const int *const a \
00313 ,D_DECL( const int* const i ## a ## lo0 \
00314 ,const int* const i ## a ## lo1 \
00315 ,const int* const i ## a ## lo2 ) \
00316 ,D_DECL( const int* const i ## a ## hi0 \
00317 ,const int* const i ## a ## hi1 \
00318 ,const int* const i ## a ## hi2 )
00319 #define CHFp_CONST_FRA1( a ) const Real *const a \
00320 ,D_DECL( const int* const i ## a ## lo0 \
00321 ,const int* const i ## a ## lo1 \
00322 ,const int* const i ## a ## lo2 ) \
00323 ,D_DECL( const int* const i ## a ## hi0 \
00324 ,const int* const i ## a ## hi1 \
00325 ,const int* const i ## a ## hi2 )
00326
00327 #endif