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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef _FORT_PROTO_H_
00053 #define _FORT_PROTO_H_
00054
00055 #include "REAL.H"
00056 #include "SPACE.H"
00057
00058 #ifdef DOXYGEN
00059
00060
00063 #define FORTRAN_NAME( NAME ,name )
00064
00066
00100 #define CHF_MULTIDO(box, i, j, k)
00101
00103 #define CHF_ENDDO
00104
00105 #else
00106
00107 #ifdef CH_FORT_UPPERCASE
00108 #ifdef CH_FORT_UNDERSCORE
00109 #define FORTRAN_NAME( NAME ,name ) NAME ## _
00110 #else
00111 #define FORTRAN_NAME( NAME ,name ) NAME
00112 #endif
00113 #else
00114 #ifdef CH_FORT_UNDERSCORE
00115 #define FORTRAN_NAME( NAME ,name ) name ## _
00116 #else
00117 #define FORTRAN_NAME( NAME ,name ) name
00118 #endif
00119 #endif
00120
00121 class chfptr {
00122 public:
00123 int i ;
00124
00125
00126
00127 chfptr(int a):i(a){}
00128 operator const int*() const {return &i;}
00129 };
00130
00131 #endif
00132
00133
00134
00135
00136
00138 #define CHF_INT( i ) &i
00139
00140 #define CHF_CONST_INT( i ) &i
00141
00142 #define CHF_REAL( r ) &r
00143
00144 #define CHF_CONST_REAL( r ) &r
00145
00146 #define CHF_COMPLEX( c ) &c
00147
00148 #define CHF_CONST_COMPLEX( c ) &c
00149
00150 #define CHF_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
00151
00152 #define CHF_CONST_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
00153
00154 #define CHF_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00155
00156 #define CHF_CONST_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00157
00158 #define CHF_C1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00159
00160 #define CHF_CONST_C1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
00161
00162
00163
00165 #define CHF_INTVECT( a ) a.dataPtr( )
00166
00167 #define CHF_CONST_INTVECT( a ) a.dataPtr( )
00168
00169 #define CHF_REALVECT( a ) a.dataPtr( )
00170
00171 #define CHF_CONST_REALVECT( a ) a.dataPtr( )
00172
00173 #define CHF_COMPLEXVECT( a ) a.dataPtr( )
00174
00175 #define CHF_CONST_COMPLEXVECT( a ) a.dataPtr( )
00176
00177 #define CHF_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
00178
00179 #define CHF_CONST_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
00180
00181 #define CHF_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
00182
00183 #define CHF_CONST_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
00184
00185 #define CHF_VC( v ) &v[0],(const int*)chfptr(v.size()-1)
00186
00187 #define CHF_CONST_VC( v ) &v[0],(const int*)chfptr(v.size()-1)
00188
00190 #define CHF_BOX( b ) D_DECL( &b.loVect()[0] \
00191 ,&b.loVect()[1] \
00192 ,&b.loVect()[2] ) \
00193 ,D_DECL( &b.hiVect()[0] \
00194 ,&b.hiVect()[1] \
00195 ,&b.hiVect()[2] )
00196
00198 #define CHF_FIA( a ) a.dataPtr( 0 ) \
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 ,a.nCompPtr()
00206
00208 #define CHF_FRA( a ) a.dataPtr( 0 ) \
00209 ,D_DECL( &a.loVect()[0] \
00210 ,&a.loVect()[1] \
00211 ,&a.loVect()[2] ) \
00212 ,D_DECL( &a.hiVect()[0] \
00213 ,&a.hiVect()[1] \
00214 ,&a.hiVect()[2] ) \
00215 ,a.nCompPtr()
00216
00218 #define CHF_FCA( a ) a.dataPtr( 0 ) \
00219 ,D_DECL( &a.loVect()[0] \
00220 ,&a.loVect()[1] \
00221 ,&a.loVect()[2] ) \
00222 ,D_DECL( &a.hiVect()[0] \
00223 ,&a.hiVect()[1] \
00224 ,&a.hiVect()[2] ) \
00225 ,a.nCompPtr()
00226
00228 #define CHF_CONST_FIA( a ) a.dataPtr( 0 ) \
00229 ,D_DECL( &a.loVect()[0] \
00230 ,&a.loVect()[1] \
00231 ,&a.loVect()[2] ) \
00232 ,D_DECL( &a.hiVect()[0] \
00233 ,&a.hiVect()[1] \
00234 ,&a.hiVect()[2] ) \
00235 ,a.nCompPtr()
00236
00238 #define CHF_CONST_FRA( a ) a.dataPtr( 0 ) \
00239 ,D_DECL( &a.loVect()[0] \
00240 ,&a.loVect()[1] \
00241 ,&a.loVect()[2] ) \
00242 ,D_DECL( &a.hiVect()[0] \
00243 ,&a.hiVect()[1] \
00244 ,&a.hiVect()[2] ) \
00245 ,a.nCompPtr()
00246
00248 #define CHF_CONST_FCA( a ) a.dataPtr( 0 ) \
00249 ,D_DECL( &a.loVect()[0] \
00250 ,&a.loVect()[1] \
00251 ,&a.loVect()[2] ) \
00252 ,D_DECL( &a.hiVect()[0] \
00253 ,&a.hiVect()[1] \
00254 ,&a.hiVect()[2] ) \
00255 ,a.nCompPtr()
00256
00258 #define CHF_FIA1( a,n ) a.dataPtr( n ) \
00259 ,D_DECL( &a.loVect()[0] \
00260 ,&a.loVect()[1] \
00261 ,&a.loVect()[2] ) \
00262 ,D_DECL( &a.hiVect()[0] \
00263 ,&a.hiVect()[1] \
00264 ,&a.hiVect()[2] )
00265
00267 #define CHF_FRA1( a,n ) a.dataPtr( n ) \
00268 ,D_DECL( &a.loVect()[0] \
00269 ,&a.loVect()[1] \
00270 ,&a.loVect()[2] ) \
00271 ,D_DECL( &a.hiVect()[0] \
00272 ,&a.hiVect()[1] \
00273 ,&a.hiVect()[2] )
00274
00276 #define CHF_FCA1( a,n ) a.dataPtr( n ) \
00277 ,D_DECL( &a.loVect()[0] \
00278 ,&a.loVect()[1] \
00279 ,&a.loVect()[2] ) \
00280 ,D_DECL( &a.hiVect()[0] \
00281 ,&a.hiVect()[1] \
00282 ,&a.hiVect()[2] )
00283
00285 #define CHF_CONST_FIA1( a,n ) a.dataPtr( n ) \
00286 ,D_DECL( &a.loVect()[0] \
00287 ,&a.loVect()[1] \
00288 ,&a.loVect()[2] ) \
00289 ,D_DECL( &a.hiVect()[0] \
00290 ,&a.hiVect()[1] \
00291 ,&a.hiVect()[2] )
00292
00294 #define CHF_CONST_FRA1( a,n ) a.dataPtr( n ) \
00295 ,D_DECL( &a.loVect()[0] \
00296 ,&a.loVect()[1] \
00297 ,&a.loVect()[2] ) \
00298 ,D_DECL( &a.hiVect()[0] \
00299 ,&a.hiVect()[1] \
00300 ,&a.hiVect()[2] )
00301
00303 #define CHF_CONST_FCA1( a,n ) a.dataPtr( n ) \
00304 ,D_DECL( &a.loVect()[0] \
00305 ,&a.loVect()[1] \
00306 ,&a.loVect()[2] ) \
00307 ,D_DECL( &a.hiVect()[0] \
00308 ,&a.hiVect()[1] \
00309 ,&a.hiVect()[2] )
00310
00311
00312
00313
00314
00315 #define CHFp_INT( i ) int* const i
00316 #define CHFp_CONST_INT( i ) const int* const i
00317 #define CHFp_REAL( r ) Real* const r
00318 #define CHFp_CONST_REAL( r ) const Real* const r
00319 #define CHFp_COMPLEX( c ) Complex* const c
00320 #define CHFp_CONST_COMPLEX( c ) const Complex* const c
00321
00322 #define CHFp_I1D( ia,dimen ) int* const ia, const int* const i ## ia ## hi0
00323 #define CHFp_CONST_I1D( ia,dimen ) const int* const ia, const int* const i ## ia ## hi0
00324 #define CHFp_R1D( ra,dimen ) Real* const ra, const int* const i ## ra ## hi0
00325 #define CHFp_CONST_R1D( ra,dimen ) const Real* const ra, const int* const i ## ra ## hi0
00326 #define CHFp_C1D( ra,dimen ) Complex* const ra, const int* const i ## ra ## hi0
00327 #define CHFp_CONST_C1D( ra,dimen ) const Complex* const ra, const int* const i ## ra ## hi0
00328
00329
00330
00331 #define CHFp_INTVECT( r ) int* const r
00332 #define CHFp_CONST_INTVECT( r ) const int* const r
00333 #define CHFp_REALVECT( r ) Real* const r
00334 #define CHFp_CONST_REALVECT( r ) const Real* const r
00335 #define CHFp_COMPLEXVECT( r ) Complex* const r
00336 #define CHFp_CONST_COMPLEXVECT( r ) const Complex* const r
00337 #define CHFp_VI( v ) int * const v, const int* const i ## v ## hi0
00338 #define CHFp_CONST_VI( v ) const int * const v, const int* const i ## v ## hi0
00339 #define CHFp_VR( v ) Real * const v, const int* const i ## v ## hi0
00340 #define CHFp_CONST_VR( v ) const Real * const v, const int* const i ## v ## hi0
00341 #define CHFp_VC( v ) Complex * const v, const int* const i ## v ## hi0
00342 #define CHFp_CONST_VC( v ) const Complex * const v, const int* const i ## v ## hi0
00343
00344 #define CHFp_BOX( b ) D_DECL( const int* const i ## b ## lo0 \
00345 ,const int* const i ## b ## lo1 \
00346 ,const int* const i ## b ## lo2 ) \
00347 ,D_DECL( const int* const i ## b ## hi0 \
00348 ,const int* const i ## b ## hi1 \
00349 ,const int* const i ## b ## hi2 )
00350
00351 #define CHFp_FIA( a ) int *const a \
00352 ,D_DECL( const int* const i ## a ## lo0 \
00353 ,const int* const i ## a ## lo1 \
00354 ,const int* const i ## a ## lo2 ) \
00355 ,D_DECL( const int* const i ## a ## hi0 \
00356 ,const int* const i ## a ## hi1 \
00357 ,const int* const i ## a ## hi2 ) \
00358 ,const int* const n ## a ## comp
00359 #define CHFp_FRA( a ) Real *const a \
00360 ,D_DECL( const int* const i ## a ## lo0 \
00361 ,const int* const i ## a ## lo1 \
00362 ,const int* const i ## a ## lo2 ) \
00363 ,D_DECL( const int* const i ## a ## hi0 \
00364 ,const int* const i ## a ## hi1 \
00365 ,const int* const i ## a ## hi2 ) \
00366 ,const int* const n ## a ## comp
00367 #define CHFp_FCA( a ) Complex *const a \
00368 ,D_DECL( const int* const i ## a ## lo0 \
00369 ,const int* const i ## a ## lo1 \
00370 ,const int* const i ## a ## lo2 ) \
00371 ,D_DECL( const int* const i ## a ## hi0 \
00372 ,const int* const i ## a ## hi1 \
00373 ,const int* const i ## a ## hi2 ) \
00374 ,const int* const n ## a ## comp
00375 #define CHFp_CONST_FIA( a ) const int *const a \
00376 ,D_DECL( const int* const i ## a ## lo0 \
00377 ,const int* const i ## a ## lo1 \
00378 ,const int* const i ## a ## lo2 ) \
00379 ,D_DECL( const int* const i ## a ## hi0 \
00380 ,const int* const i ## a ## hi1 \
00381 ,const int* const i ## a ## hi2 ) \
00382 ,const int* const n ## a ## comp
00383 #define CHFp_CONST_FRA( a ) const Real *const a \
00384 ,D_DECL( const int* const i ## a ## lo0 \
00385 ,const int* const i ## a ## lo1 \
00386 ,const int* const i ## a ## lo2 ) \
00387 ,D_DECL( const int* const i ## a ## hi0 \
00388 ,const int* const i ## a ## hi1 \
00389 ,const int* const i ## a ## hi2 ) \
00390 ,const int* const n ## a ## comp
00391 #define CHFp_CONST_FCA( a ) const Complex *const a \
00392 ,D_DECL( const int* const i ## a ## lo0 \
00393 ,const int* const i ## a ## lo1 \
00394 ,const int* const i ## a ## lo2 ) \
00395 ,D_DECL( const int* const i ## a ## hi0 \
00396 ,const int* const i ## a ## hi1 \
00397 ,const int* const i ## a ## hi2 ) \
00398 ,const int* const n ## a ## comp
00399 #define CHFp_FIA1( a ) int *const a \
00400 ,D_DECL( const int* const i ## a ## lo0 \
00401 ,const int* const i ## a ## lo1 \
00402 ,const int* const i ## a ## lo2 ) \
00403 ,D_DECL( const int* const i ## a ## hi0 \
00404 ,const int* const i ## a ## hi1 \
00405 ,const int* const i ## a ## hi2 )
00406 #define CHFp_FRA1( a ) Real *const a \
00407 ,D_DECL( const int* const i ## a ## lo0 \
00408 ,const int* const i ## a ## lo1 \
00409 ,const int* const i ## a ## lo2 ) \
00410 ,D_DECL( const int* const i ## a ## hi0 \
00411 ,const int* const i ## a ## hi1 \
00412 ,const int* const i ## a ## hi2 )
00413 #define CHFp_FCA1( a ) Complex *const a \
00414 ,D_DECL( const int* const i ## a ## lo0 \
00415 ,const int* const i ## a ## lo1 \
00416 ,const int* const i ## a ## lo2 ) \
00417 ,D_DECL( const int* const i ## a ## hi0 \
00418 ,const int* const i ## a ## hi1 \
00419 ,const int* const i ## a ## hi2 )
00420 #define CHFp_CONST_FIA1( a ) const int *const a \
00421 ,D_DECL( const int* const i ## a ## lo0 \
00422 ,const int* const i ## a ## lo1 \
00423 ,const int* const i ## a ## lo2 ) \
00424 ,D_DECL( const int* const i ## a ## hi0 \
00425 ,const int* const i ## a ## hi1 \
00426 ,const int* const i ## a ## hi2 )
00427 #define CHFp_CONST_FRA1( a ) const Real *const a \
00428 ,D_DECL( const int* const i ## a ## lo0 \
00429 ,const int* const i ## a ## lo1 \
00430 ,const int* const i ## a ## lo2 ) \
00431 ,D_DECL( const int* const i ## a ## hi0 \
00432 ,const int* const i ## a ## hi1 \
00433 ,const int* const i ## a ## hi2 )
00434 #define CHFp_CONST_FCA1( a ) const Complex *const a \
00435 ,D_DECL( const int* const i ## a ## lo0 \
00436 ,const int* const i ## a ## lo1 \
00437 ,const int* const i ## a ## lo2 ) \
00438 ,D_DECL( const int* const i ## a ## hi0 \
00439 ,const int* const i ## a ## hi1 \
00440 ,const int* const i ## a ## hi2 )
00441
00442 #endif