Chombo + EB  3.2
FORT_PROTO.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #include "FortranNameMacro.H"
12  // Generated by lib/util/multidim/make_FortranNameMacro_H.sh, which is called
13  // in turn by the bootstrap script.
14 
15 //
16 // Yes, the include guards are here and not at the top of the file. That's because
17 // the multidim stuff needs special handling.
18 //
19 #ifndef _FORT_PROTO_H_
20 #define _FORT_PROTO_H_
21 
22 #include "REAL.H"
23 #include "SPACE.H"
24 #include "BaseNamespaceHeader.H"
25 
26 #ifdef DOXYGEN
27 /// Used to declare a fortran routine in a portable way
28 /** @ingroup macros
29 
30  */
31 #define FORTRAN_NAME( NAME ,name )
32 
33 /// Used in ChomboFortran to write dimension-independent loops
34 /** @ingroup macros
35 CHF_MULTIDO is used to iterate over a box in a dimension independent
36 fashion by setting up nested Fortran do loops and CHF_ENDDO is used to
37 terminate those do loops correctly. Specifically,
38 CHF_MULTIDO[box;i;j;k] will generate a do loop for i
39 nested inside a do loop for j and, in 3D, this will be nested inside
40 a do loop for k. The i loop will go from first element of the
41 low corner of box to the first element of the high corner of box.
42 Similarly, the {\tt j} loop will use the second element and, in 3D, the
43  k loop will use the third element. CHF_ENDDO will end all the do
44 loops set up by CHF_MULTIDO.
45 
46 Here is an example using these macros:
47 
48 \code
49  subroutine LOOP(CHF_FRA1[array],CHF_BOX[box])
50 
51  integer CHF_DDECL[i;j;k]
52  integer productsum
53 
54  productsum = 0
55  CHF_MULTIDO[box;i;j;k]
56  productsum = productsum + i*j*k
57  array(CHF_IX[i;j;k]) = productsum
58  CHF_ENDDO
59 
60  return
61  end
62 \endcode
63 
64 see the section of the Chombo Design document about Chombo Fortran for
65 a more detailed use of macros in Fortran
66 
67 */
68 #define CHF_MULTIDO(box, i, j, k)
69 
70 /** @ingroup macros */
71 #define CHF_ENDDO
72 
73 #else
74 
75 class chfptr
76 {
77 public:
78  int i ;
79  //XXX for debugging
80  //XXXchfptr(int a):i(a){std::cout << "constructing chfptr " << &i << std::endl;}
81  //XXX~chfptr() {std::cout << "destructing chfptr " << &i << std::endl;}
82  chfptr(int a):i(a)
83  {
84  }
85 
86  operator const int*() const
87  {
88  return &i;
89  }
90 };
91 
92 #define CHFPTR(a) (const int*)chfptr(a)
93 #define CHFPTR1(alo,ahi) \
94  (const int*)chfptr(alo),(const int*)chfptr(ahi)
95 #define CHFPTR2(alo,blo,ahi,bhi) \
96  (const int*)chfptr(alo),(const int*)chfptr(blo), \
97  (const int*)chfptr(ahi),(const int*)chfptr(bhi)
98 #define CHFPTR3(alo,blo,clo,ahi,bhi,chi) \
99  (const int*)chfptr(alo),(const int*)chfptr(blo),(const int*)chfptr(clo), \
100  (const int*)chfptr(ahi),(const int*)chfptr(bhi),(const int*)chfptr(chi)
101 #define CHFPTR4(alo,blo,clo,dlo,ahi,bhi,chi,dhi) \
102  (const int*)chfptr(alo),(const int*)chfptr(blo),(const int*)chfptr(clo),(const int*)chfptr(dlo), \
103  (const int*)chfptr(ahi),(const int*)chfptr(bhi),(const int*)chfptr(chi),(const int*)chfptr(dhi)
104 #define CHFPTR5(alo,blo,clo,dlo,elo,ahi,bhi,chi,dhi,ehi) \
105  (const int*)chfptr(alo),(const int*)chfptr(blo),(const int*)chfptr(clo),(const int*)chfptr(dlo),(const int*)chfptr(elo), \
106  (const int*)chfptr(ahi),(const int*)chfptr(bhi),(const int*)chfptr(chi),(const int*)chfptr(dhi),(const int*)chfptr(ehi)
107 #define CHFPTR6(alo,blo,clo,dlo,elo,flo,ahi,bhi,chi,dhi,ehi,fhi) \
108  (const int*)chfptr(alo),(const int*)chfptr(blo),(const int*)chfptr(clo),(const int*)chfptr(dlo),(const int*)chfptr(elo),(const int*)chfptr(flo), \
109  (const int*)chfptr(ahi),(const int*)chfptr(bhi),(const int*)chfptr(chi),(const int*)chfptr(dhi),(const int*)chfptr(ehi),(const int*)chfptr(fhi)
110 #define CHFPTR7(alo,blo,clo,dlo,elo,flo,glo,ahi,bhi,chi,dhi,ehi,fhi,ghi) \
111  (const int*)chfptr(alo),(const int*)chfptr(blo),(const int*)chfptr(clo),(const int*)chfptr(dlo),(const int*)chfptr(elo),(const int*)chfptr(flo),(const int*)chfptr(glo), \
112  (const int*)chfptr(ahi),(const int*)chfptr(bhi),(const int*)chfptr(chi),(const int*)chfptr(dhi),(const int*)chfptr(ehi),(const int*)chfptr(fhi),(const int*)chfptr(ghi)
113 
114 #define ARCHFPTR1(anm) CHFPTR1(anm.lowerBound(0), \
115  anm.upperBound(0))
116 #define ARCHFPTR2(anm) CHFPTR2(anm.lowerBound(0),anm.lowerBound(1), \
117  anm.upperBound(0),anm.upperBound(1))
118 #define ARCHFPTR3(anm) CHFPTR3(anm.lowerBound(0),anm.lowerBound(1),anm.lowerBound(2), \
119  anm.upperBound(0),anm.upperBound(1),anm.upperBound(2))
120 #define ARCHFPTR4(anm) CHFPTR4(anm.lowerBound(0),anm.lowerBound(1),anm.lowerBound(2),anm.lowerBound(3), \
121  anm.upperBound(0),anm.upperBound(1),anm.upperBound(2),anm.upperBound(3))
122 #define ARCHFPTR5(anm) CHFPTR5(anm.lowerBound(0),anm.lowerBound(1),anm.lowerBound(2),anm.lowerBound(3),anm.lowerBound(4), \
123  anm.upperBound(0),anm.upperBound(1),anm.upperBound(2),anm.upperBound(3),anm.upperBound(4))
124 #define ARCHFPTR6(anm) CHFPTR6(anm.lowerBound(0),anm.lowerBound(1),anm.lowerBound(2),anm.lowerBound(3),anm.lowerBound(4),anm.lowerBound(5), \
125  anm.upperBound(0),anm.upperBound(1),anm.upperBound(2),anm.upperBound(3),anm.upperBound(4),anm.upperBound(5))
126 #define ARCHFPTR7(anm) CHFPTR7(anm.lowerBound(0),anm.lowerBound(1),anm.lowerBound(2),anm.lowerBound(3),anm.lowerBound(4),anm.lowerBound(5),anm.lowerBound(6), \
127  anm.upperBound(0),anm.upperBound(1),anm.upperBound(2),anm.upperBound(3),anm.upperBound(4),anm.upperBound(5),anm.upperBound(6))
128 
129 //[Note: macros appended with "_X" are required just to expand an argument]
130 #define DIMARGp_X(rank, anm) DIMARG ## rank ## p(anm)
131 #define DIMARG1p( anm ) const int* const i ## anm ## lo0, \
132  const int* const i ## anm ## hi0
133 #define DIMARG2p( anm ) const int* const i ## anm ## lo0, \
134  const int* const i ## anm ## lo1, \
135  const int* const i ## anm ## hi0, \
136  const int* const i ## anm ## hi1
137 #define DIMARG3p( anm ) const int* const i ## anm ## lo0, \
138  const int* const i ## anm ## lo1, \
139  const int* const i ## anm ## lo2, \
140  const int* const i ## anm ## hi0, \
141  const int* const i ## anm ## hi1, \
142  const int* const i ## anm ## hi2
143 #define DIMARG4p( anm ) const int* const i ## anm ## lo0, \
144  const int* const i ## anm ## lo1, \
145  const int* const i ## anm ## lo2, \
146  const int* const i ## anm ## lo3, \
147  const int* const i ## anm ## hi0, \
148  const int* const i ## anm ## hi1, \
149  const int* const i ## anm ## hi2, \
150  const int* const i ## anm ## hi3
151 #define DIMARG5p( anm ) const int* const i ## anm ## lo0, \
152  const int* const i ## anm ## lo1, \
153  const int* const i ## anm ## lo2, \
154  const int* const i ## anm ## lo3, \
155  const int* const i ## anm ## lo4, \
156  const int* const i ## anm ## hi0, \
157  const int* const i ## anm ## hi1, \
158  const int* const i ## anm ## hi2, \
159  const int* const i ## anm ## hi3, \
160  const int* const i ## anm ## hi4
161 #define DIMARG6p( anm ) const int* const i ## anm ## lo0, \
162  const int* const i ## anm ## lo1, \
163  const int* const i ## anm ## lo2, \
164  const int* const i ## anm ## lo3, \
165  const int* const i ## anm ## lo4, \
166  const int* const i ## anm ## lo5, \
167  const int* const i ## anm ## hi0, \
168  const int* const i ## anm ## hi1, \
169  const int* const i ## anm ## hi2, \
170  const int* const i ## anm ## hi3, \
171  const int* const i ## anm ## hi4, \
172  const int* const i ## anm ## hi5
173 #define DIMARG7p( anm ) const int* const i ## anm ## lo0, \
174  const int* const i ## anm ## lo1, \
175  const int* const i ## anm ## lo2, \
176  const int* const i ## anm ## lo3, \
177  const int* const i ## anm ## lo4, \
178  const int* const i ## anm ## lo5, \
179  const int* const i ## anm ## lo6, \
180  const int* const i ## anm ## hi0, \
181  const int* const i ## anm ## hi1, \
182  const int* const i ## anm ## hi2, \
183  const int* const i ## anm ## hi3, \
184  const int* const i ## anm ## hi4, \
185  const int* const i ## anm ## hi5, \
186  const int* const i ## anm ## hi6
187 
188 #define DIMARGt_X(rank, anm) DIMARG ## rank ## t(anm)
189 #define DIMARG1t( anm ) i ## anm ## lo0, \
190  i ## anm ## hi0
191 #define DIMARG2t( anm ) i ## anm ## lo0, \
192  i ## anm ## lo1, \
193  i ## anm ## hi0, \
194  i ## anm ## hi1
195 #define DIMARG3t( anm ) i ## anm ## lo0, \
196  i ## anm ## lo1, \
197  i ## anm ## lo2, \
198  i ## anm ## hi0, \
199  i ## anm ## hi1, \
200  i ## anm ## hi2
201 #define DIMARG4t( anm ) i ## anm ## lo0, \
202  i ## anm ## lo1, \
203  i ## anm ## lo2, \
204  i ## anm ## lo3, \
205  i ## anm ## hi0, \
206  i ## anm ## hi1, \
207  i ## anm ## hi2, \
208  i ## anm ## hi3
209 #define DIMARG5t( anm ) i ## anm ## lo0, \
210  i ## anm ## lo1, \
211  i ## anm ## lo2, \
212  i ## anm ## lo3, \
213  i ## anm ## lo4, \
214  i ## anm ## hi0, \
215  i ## anm ## hi1, \
216  i ## anm ## hi2, \
217  i ## anm ## hi3, \
218  i ## anm ## hi4
219 #define DIMARG6t( anm ) i ## anm ## lo0, \
220  i ## anm ## lo1, \
221  i ## anm ## lo2, \
222  i ## anm ## lo3, \
223  i ## anm ## lo4, \
224  i ## anm ## lo5, \
225  i ## anm ## hi0, \
226  i ## anm ## hi1, \
227  i ## anm ## hi2, \
228  i ## anm ## hi3, \
229  i ## anm ## hi4, \
230  i ## anm ## hi5
231 #define DIMARG7t( anm ) i ## anm ## lo0, \
232  i ## anm ## lo1, \
233  i ## anm ## lo2, \
234  i ## anm ## lo3, \
235  i ## anm ## lo4, \
236  i ## anm ## lo5, \
237  i ## anm ## lo6, \
238  i ## anm ## hi0, \
239  i ## anm ## hi1, \
240  i ## anm ## hi2, \
241  i ## anm ## hi3, \
242  i ## anm ## hi4, \
243  i ## anm ## hi5, \
244  i ## anm ## hi6
245 
246 // Application array dimensions
247 #define CHF_ARRAY_X(rank, ...) CHFPTR ## rank(__VA_ARGS__)
248 #define CHF_CHARRAY_X(rank, name) ARCHFPTR ## rank(name)
249 
250 // To specify the array rank as a function of SpaceDim
251 #if CH_SPACEDIM==1
252 # define RANK_SPACEDIM_PLUS_0 1
253 # define RANK_SPACEDIM_PLUS_1 2
254 # define RANK_SPACEDIM_PLUS_2 3
255 # define RANK_SPACEDIM_PLUS_3 4
256 # define RANK_SPACEDIM_PLUS_4 5
257 # define RANK_SPACEDIM_PLUS_5 6
258 # define RANK_SPACEDIM_PLUS_6 7
259 #elif CH_SPACEDIM==2
260 # define RANK_SPACEDIM_PLUS_0 2
261 # define RANK_SPACEDIM_PLUS_1 3
262 # define RANK_SPACEDIM_PLUS_2 4
263 # define RANK_SPACEDIM_PLUS_3 5
264 # define RANK_SPACEDIM_PLUS_4 6
265 # define RANK_SPACEDIM_PLUS_5 7
266 #elif CH_SPACEDIM==3
267 # define RANK_SPACEDIM_PLUS_0 3
268 # define RANK_SPACEDIM_PLUS_1 4
269 # define RANK_SPACEDIM_PLUS_2 5
270 # define RANK_SPACEDIM_PLUS_3 6
271 # define RANK_SPACEDIM_PLUS_4 7
272 #elif CH_SPACEDIM==4
273 # define RANK_SPACEDIM_PLUS_0 4
274 # define RANK_SPACEDIM_PLUS_1 5
275 # define RANK_SPACEDIM_PLUS_2 6
276 # define RANK_SPACEDIM_PLUS_3 7
277 #elif CH_SPACEDIM==5
278 # define RANK_SPACEDIM_PLUS_0 5
279 # define RANK_SPACEDIM_PLUS_1 6
280 # define RANK_SPACEDIM_PLUS_2 7
281 #elif CH_SPACEDIM==6
282 # define RANK_SPACEDIM_PLUS_0 6
283 # define RANK_SPACEDIM_PLUS_1 7
284 #endif
285 
286 #endif
287 
288 // ChomboFortran declaration macros for Application code
289 
290 // primitive data types
291 
292 /** @ingroup macros */
293 #define CHF_INT( i ) &i
294 /** @ingroup macros */
295 #define CHF_CONST_INT( i ) &i
296 /** @ingroup macros */
297 #define CHF_REAL( r ) &r
298 /** @ingroup macros */
299 #define CHF_CONST_REAL( r ) &r
300 /** @ingroup macros */
301 #define CHF_COMPLEX( c ) &c
302 /** @ingroup macros */
303 #define CHF_CONST_COMPLEX( c ) &c
304 /** @ingroup macros */
305 #define CHF_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
306 /** @ingroup macros */
307 #define CHF_CONST_I1D( ia,dimen ) ia,(const int*)chfptr(dimen-1)
308 /** @ingroup macros */
309 #define CHF_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
310 /** @ingroup macros */
311 #define CHF_CONST_R1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
312 /** @ingroup macros */
313 #define CHF_C1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
314 /** @ingroup macros */
315 #define CHF_CONST_C1D( ra,dimen ) ra,(const int*)chfptr(dimen-1)
316 
317 /** @ingroup macros */
318 #define CHF_IARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
319 /** @ingroup macros */
320 #define CHF_CONST_IARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
321 /** @ingroup macros */
322 #define CHF_RARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
323 /** @ingroup macros */
324 #define CHF_CONST_RARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
325 /** @ingroup macros */
326 #define CHF_CARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
327 /** @ingroup macros */
328 #define CHF_CONST_CARRAY(rank, ia, ...) ia,CHF_ARRAY_X(rank, __VA_ARGS__)
329 
330 // Chombo data types
331 
332 /** @ingroup macros */
333 #define CHF_INTVECT( a ) a.dataPtr( )
334 /** @ingroup macros */
335 #define CHF_CONST_INTVECT( a ) a.dataPtr( )
336 /** @ingroup macros */
337 #define CHF_REALVECT( a ) a.dataPtr( )
338 /** @ingroup macros */
339 #define CHF_CONST_REALVECT( a ) a.dataPtr( )
340 /** @ingroup macros */
341 #define CHF_COMPLEXVECT( a ) a.dataPtr( )
342 /** @ingroup macros */
343 #define CHF_CONST_COMPLEXVECT( a ) a.dataPtr( )
344 /** @ingroup macros */
345 #define CHF_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
346 /** @ingroup macros */
347 #define CHF_CONST_VI( v ) &v[0],(const int*)chfptr(v.size()-1)
348 /** @ingroup macros */
349 #define CHF_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
350 /** @ingroup macros */
351 #define CHF_CONST_VR( v ) &v[0],(const int*)chfptr(v.size()-1)
352 /** @ingroup macros */
353 #define CHF_VC( v ) &v[0],(const int*)chfptr(v.size()-1)
354 /** @ingroup macros */
355 #define CHF_CONST_VC( v ) &v[0],(const int*)chfptr(v.size()-1)
356 
357 /** @ingroup macros */
358 #define CHF_BOX( b ) D_DECL6( &b.loVect()[0] \
359  ,&b.loVect()[1] \
360  ,&b.loVect()[2] \
361  ,&b.loVect()[3] \
362  ,&b.loVect()[4] \
363  ,&b.loVect()[5] ) \
364  ,D_DECL6( &b.hiVect()[0] \
365  ,&b.hiVect()[1] \
366  ,&b.hiVect()[2] \
367  ,&b.hiVect()[3] \
368  ,&b.hiVect()[4] \
369  ,&b.hiVect()[5] )
370 
371 #define CHF_BOX_SHIFT( b , iv) D_DECL6( CHFPTR(b.loVect()[0] - iv[0]), \
372  CHFPTR(b.loVect()[1] - iv[1]), \
373  CHFPTR(b.loVect()[2] - iv[2]), \
374  CHFPTR(b.loVect()[3] - iv[3]), \
375  CHFPTR(b.loVect()[4] - iv[4]), \
376  CHFPTR(b.loVect()[5] - iv[5])) \
377  ,D_DECL6( CHFPTR(b.hiVect()[0] - iv[0]), \
378  CHFPTR(b.hiVect()[1] - iv[1]), \
379  CHFPTR(b.hiVect()[2] - iv[2]), \
380  CHFPTR(b.hiVect()[3] - iv[3]), \
381  CHFPTR(b.hiVect()[4] - iv[4]), \
382  CHFPTR(b.hiVect()[5] - iv[5]))
383 
384 /** @ingroup macros */
385 #define CHF_FIA( a ) a.dataPtr( 0 ) \
386  ,D_DECL6( &a.loVect()[0] \
387  ,&a.loVect()[1] \
388  ,&a.loVect()[2] \
389  ,&a.loVect()[3] \
390  ,&a.loVect()[4] \
391  ,&a.loVect()[5] ) \
392  ,D_DECL6( &a.hiVect()[0] \
393  ,&a.hiVect()[1] \
394  ,&a.hiVect()[2] \
395  ,&a.hiVect()[3] \
396  ,&a.hiVect()[4] \
397  ,&a.hiVect()[5] ) \
398  ,a.nCompPtr()
399 
400 /** @ingroup macros */
401 #define CHF_FIA_SHIFT( a, iv ) \
402  a.dataPtr(0), \
403  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
404  CHFPTR(a.loVect()[1] - iv[1]), \
405  CHFPTR(a.loVect()[2] - iv[2]), \
406  CHFPTR(a.loVect()[3] - iv[3]), \
407  CHFPTR(a.loVect()[4] - iv[4]), \
408  CHFPTR(a.loVect()[5] - iv[5]) ), \
409  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
410  CHFPTR(a.hiVect()[1] - iv[1]), \
411  CHFPTR(a.hiVect()[2] - iv[2]), \
412  CHFPTR(a.hiVect()[3] - iv[3]), \
413  CHFPTR(a.hiVect()[4] - iv[4]), \
414  CHFPTR(a.hiVect()[5] - iv[5]) ), \
415  a.nCompPtr()
416 
417 /** @ingroup macros */
418 #define CHF_FRA( a ) a.dataPtr( 0 ) \
419  ,D_DECL6( &a.loVect()[0] \
420  ,&a.loVect()[1] \
421  ,&a.loVect()[2] \
422  ,&a.loVect()[3] \
423  ,&a.loVect()[4] \
424  ,&a.loVect()[5] ) \
425  ,D_DECL6( &a.hiVect()[0] \
426  ,&a.hiVect()[1] \
427  ,&a.hiVect()[2] \
428  ,&a.hiVect()[3] \
429  ,&a.hiVect()[4] \
430  ,&a.hiVect()[5] ) \
431  ,a.nCompPtr()
432 
433 /** @ingroup macros */
434 #define CHF_FRA_SHIFT( a , iv) a.dataPtr( 0 ), \
435  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
436  CHFPTR(a.loVect()[1] - iv[1]), \
437  CHFPTR(a.loVect()[2] - iv[2]), \
438  CHFPTR(a.loVect()[3] - iv[3]), \
439  CHFPTR(a.loVect()[4] - iv[4]), \
440  CHFPTR(a.loVect()[5] - iv[5])) \
441  ,D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
442  CHFPTR(a.hiVect()[1] - iv[1]), \
443  CHFPTR(a.hiVect()[2] - iv[2]), \
444  CHFPTR(a.hiVect()[3] - iv[3]), \
445  CHFPTR(a.hiVect()[4] - iv[4]), \
446  CHFPTR(a.hiVect()[5] - iv[5])) \
447  ,a.nCompPtr()
448 
449 /** @ingroup macros */
450 #define CHF_FCA( a ) a.dataPtr( 0 ) \
451  ,D_DECL6( &a.loVect()[0] \
452  ,&a.loVect()[1] \
453  ,&a.loVect()[2] \
454  ,&a.loVect()[3] \
455  ,&a.loVect()[4] \
456  ,&a.loVect()[5] ) \
457  ,D_DECL6( &a.hiVect()[0] \
458  ,&a.hiVect()[1] \
459  ,&a.hiVect()[2] \
460  ,&a.hiVect()[3] \
461  ,&a.hiVect()[4] \
462  ,&a.hiVect()[5] ) \
463  ,a.nCompPtr()
464 
465 /** @ingroup macros */
466 #define CHF_CONST_FIA( a ) a.dataPtr( 0 ) \
467  ,D_DECL6( &a.loVect()[0] \
468  ,&a.loVect()[1] \
469  ,&a.loVect()[2] \
470  ,&a.loVect()[3] \
471  ,&a.loVect()[4] \
472  ,&a.loVect()[5] ) \
473  ,D_DECL6( &a.hiVect()[0] \
474  ,&a.hiVect()[1] \
475  ,&a.hiVect()[2] \
476  ,&a.hiVect()[3] \
477  ,&a.hiVect()[4] \
478  ,&a.hiVect()[5] ) \
479  ,a.nCompPtr()
480 
481 /** @ingroup macros */
482 #define CHF_CONST_FIA_SHIFT( a, iv ) \
483  a.dataPtr(0), \
484  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
485  CHFPTR(a.loVect()[1] - iv[1]), \
486  CHFPTR(a.loVect()[2] - iv[2]), \
487  CHFPTR(a.loVect()[3] - iv[3]), \
488  CHFPTR(a.loVect()[4] - iv[4]), \
489  CHFPTR(a.loVect()[5] - iv[5]) ), \
490  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
491  CHFPTR(a.hiVect()[1] - iv[1]), \
492  CHFPTR(a.hiVect()[2] - iv[2]), \
493  CHFPTR(a.hiVect()[3] - iv[3]), \
494  CHFPTR(a.hiVect()[4] - iv[4]), \
495  CHFPTR(a.hiVect()[5] - iv[5]) ), \
496  a.nCompPtr()
497 
498 /** @ingroup macros */
499 #define CHF_CONST_FRA( a ) a.dataPtr( 0 ) \
500  ,D_DECL6( &a.loVect()[0] \
501  ,&a.loVect()[1] \
502  ,&a.loVect()[2] \
503  ,&a.loVect()[3] \
504  ,&a.loVect()[4] \
505  ,&a.loVect()[5] ) \
506  ,D_DECL6( &a.hiVect()[0] \
507  ,&a.hiVect()[1] \
508  ,&a.hiVect()[2] \
509  ,&a.hiVect()[3] \
510  ,&a.hiVect()[4] \
511  ,&a.hiVect()[5] ) \
512  ,a.nCompPtr()
513 
514 /** @ingroup macros */
515 #define CHF_CONST_FRA_SHIFT( a , iv) a.dataPtr( 0 ), \
516  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
517  CHFPTR(a.loVect()[1] - iv[1]), \
518  CHFPTR(a.loVect()[2] - iv[2]), \
519  CHFPTR(a.loVect()[3] - iv[3]), \
520  CHFPTR(a.loVect()[4] - iv[4]), \
521  CHFPTR(a.loVect()[5] - iv[5])) \
522  ,D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
523  CHFPTR(a.hiVect()[1] - iv[1]), \
524  CHFPTR(a.hiVect()[2] - iv[2]), \
525  CHFPTR(a.hiVect()[3] - iv[3]), \
526  CHFPTR(a.hiVect()[4] - iv[4]), \
527  CHFPTR(a.hiVect()[5] - iv[5])) \
528  ,a.nCompPtr()
529 
530 /** @ingroup macros */
531 #define CHF_CONST_FCA( a ) a.dataPtr( 0 ) \
532  ,D_DECL6( &a.loVect()[0] \
533  ,&a.loVect()[1] \
534  ,&a.loVect()[2] \
535  ,&a.loVect()[3] \
536  ,&a.loVect()[4] \
537  ,&a.loVect()[5] ) \
538  ,D_DECL6( &a.hiVect()[0] \
539  ,&a.hiVect()[1] \
540  ,&a.hiVect()[2] \
541  ,&a.hiVect()[3] \
542  ,&a.hiVect()[4] \
543  ,&a.hiVect()[5] ) \
544  ,a.nCompPtr()
545 
546 /** @ingroup macros */
547 #define CHF_FIA1( a,n ) a.dataPtr( n ) \
548  ,D_DECL6( &a.loVect()[0] \
549  ,&a.loVect()[1] \
550  ,&a.loVect()[2] \
551  ,&a.loVect()[3] \
552  ,&a.loVect()[4] \
553  ,&a.loVect()[5] ) \
554  ,D_DECL6( &a.hiVect()[0] \
555  ,&a.hiVect()[1] \
556  ,&a.hiVect()[2] \
557  ,&a.hiVect()[3] \
558  ,&a.hiVect()[4] \
559  ,&a.hiVect()[5] )
560 
561 /** @ingroup macros */
562 #define CHF_FIA1_SHIFT( a, n, iv ) \
563  a.dataPtr(n), \
564  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
565  CHFPTR(a.loVect()[1] - iv[1]), \
566  CHFPTR(a.loVect()[2] - iv[2]), \
567  CHFPTR(a.loVect()[3] - iv[3]), \
568  CHFPTR(a.loVect()[4] - iv[4]), \
569  CHFPTR(a.loVect()[5] - iv[5]) ), \
570  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
571  CHFPTR(a.hiVect()[1] - iv[1]), \
572  CHFPTR(a.hiVect()[2] - iv[2]), \
573  CHFPTR(a.hiVect()[3] - iv[3]), \
574  CHFPTR(a.hiVect()[4] - iv[4]), \
575  CHFPTR(a.hiVect()[5] - iv[5]) )
576 
577 /** @ingroup macros */
578 #define CHF_FRA1( a,n ) a.dataPtr( n ) \
579  ,D_DECL6( &a.loVect()[0] \
580  ,&a.loVect()[1] \
581  ,&a.loVect()[2] \
582  ,&a.loVect()[3] \
583  ,&a.loVect()[4] \
584  ,&a.loVect()[5] ) \
585  ,D_DECL6( &a.hiVect()[0] \
586  ,&a.hiVect()[1] \
587  ,&a.hiVect()[2] \
588  ,&a.hiVect()[3] \
589  ,&a.hiVect()[4] \
590  ,&a.hiVect()[5] )
591 
592 /** @ingroup macros */
593 #define CHF_FRA1_SHIFT( a, n, iv) \
594  a.dataPtr( 0 ), \
595  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
596  CHFPTR(a.loVect()[1] - iv[1]), \
597  CHFPTR(a.loVect()[2] - iv[2]), \
598  CHFPTR(a.loVect()[3] - iv[3]), \
599  CHFPTR(a.loVect()[4] - iv[4]), \
600  CHFPTR(a.loVect()[5] - iv[5]) ), \
601  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
602  CHFPTR(a.hiVect()[1] - iv[1]), \
603  CHFPTR(a.hiVect()[2] - iv[2]), \
604  CHFPTR(a.hiVect()[3] - iv[3]), \
605  CHFPTR(a.hiVect()[4] - iv[4]), \
606  CHFPTR(a.hiVect()[5] - iv[5]) )
607 
608 /** @ingroup macros */
609 #define CHF_FCA1( a,n ) a.dataPtr( n ) \
610  ,D_DECL6( &a.loVect()[0] \
611  ,&a.loVect()[1] \
612  ,&a.loVect()[2] \
613  ,&a.loVect()[3] \
614  ,&a.loVect()[4] \
615  ,&a.loVect()[5] ) \
616  ,D_DECL6( &a.hiVect()[0] \
617  ,&a.hiVect()[1] \
618  ,&a.hiVect()[2] \
619  ,&a.hiVect()[3] \
620  ,&a.hiVect()[4] \
621  ,&a.hiVect()[5] )
622 
623 /** @ingroup macros */
624 #define CHF_CONST_FIA1( a,n ) a.dataPtr( n ) \
625  ,D_DECL6( &a.loVect()[0] \
626  ,&a.loVect()[1] \
627  ,&a.loVect()[2] \
628  ,&a.loVect()[3] \
629  ,&a.loVect()[4] \
630  ,&a.loVect()[5] ) \
631  ,D_DECL6( &a.hiVect()[0] \
632  ,&a.hiVect()[1] \
633  ,&a.hiVect()[2] \
634  ,&a.hiVect()[3] \
635  ,&a.hiVect()[4] \
636  ,&a.hiVect()[5] )
637 
638 #define CHF_CONST_FBA1( a,n ) a.dataPtr( n ) \
639  ,D_DECL6( &a.loVect()[0] \
640  ,&a.loVect()[1] \
641  ,&a.loVect()[2] \
642  ,&a.loVect()[3] \
643  ,&a.loVect()[4] \
644  ,&a.loVect()[5] ) \
645  ,D_DECL6( &a.hiVect()[0] \
646  ,&a.hiVect()[1] \
647  ,&a.hiVect()[2] \
648  ,&a.hiVect()[3] \
649  ,&a.hiVect()[4] \
650  ,&a.hiVect()[5] )
651 
652 /** @ingroup macros */
653 #define CHF_CONST_FIA1_SHIFT( a, n, iv ) \
654  a.dataPtr(n), \
655  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
656  CHFPTR(a.loVect()[1] - iv[1]), \
657  CHFPTR(a.loVect()[2] - iv[2]), \
658  CHFPTR(a.loVect()[3] - iv[3]), \
659  CHFPTR(a.loVect()[4] - iv[4]), \
660  CHFPTR(a.loVect()[5] - iv[5]) ), \
661  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
662  CHFPTR(a.hiVect()[1] - iv[1]), \
663  CHFPTR(a.hiVect()[2] - iv[2]), \
664  CHFPTR(a.hiVect()[3] - iv[3]), \
665  CHFPTR(a.hiVect()[4] - iv[4]), \
666  CHFPTR(a.hiVect()[5] - iv[5]) )
667 
668 /** @ingroup macros */
669 #define CHF_CONST_FRA1( a,n ) a.dataPtr( n ) \
670  ,D_DECL6( &a.loVect()[0] \
671  ,&a.loVect()[1] \
672  ,&a.loVect()[2] \
673  ,&a.loVect()[3] \
674  ,&a.loVect()[4] \
675  ,&a.loVect()[5] ) \
676  ,D_DECL6( &a.hiVect()[0] \
677  ,&a.hiVect()[1] \
678  ,&a.hiVect()[2] \
679  ,&a.hiVect()[3] \
680  ,&a.hiVect()[4] \
681  ,&a.hiVect()[5] )
682 
683 
684 /** @ingroup macros */
685 #define CHF_CONST_FRA1_SHIFT( a, n, iv) \
686  a.dataPtr( 0 ), \
687  D_DECL6( CHFPTR(a.loVect()[0] - iv[0]), \
688  CHFPTR(a.loVect()[1] - iv[1]), \
689  CHFPTR(a.loVect()[2] - iv[2]), \
690  CHFPTR(a.loVect()[3] - iv[3]), \
691  CHFPTR(a.loVect()[4] - iv[4]), \
692  CHFPTR(a.loVect()[5] - iv[5]) ), \
693  D_DECL6( CHFPTR(a.hiVect()[0] - iv[0]), \
694  CHFPTR(a.hiVect()[1] - iv[1]), \
695  CHFPTR(a.hiVect()[2] - iv[2]), \
696  CHFPTR(a.hiVect()[3] - iv[3]), \
697  CHFPTR(a.hiVect()[4] - iv[4]), \
698  CHFPTR(a.hiVect()[5] - iv[5]) )
699 
700 /** @ingroup macros */
701 #define CHF_CONST_FCA1( a,n ) a.dataPtr( n ) \
702  ,D_DECL6( &a.loVect()[0] \
703  ,&a.loVect()[1] \
704  ,&a.loVect()[2] \
705  ,&a.loVect()[0] \
706  ,&a.loVect()[1] \
707  ,&a.loVect()[2] ) \
708  ,D_DECL6( &a.hiVect()[0] \
709  ,&a.hiVect()[1] \
710  ,&a.hiVect()[2] \
711  ,&a.hiVect()[3] \
712  ,&a.hiVect()[4] \
713  ,&a.hiVect()[5] )
714 
715 /** @ingroup macros */
716 #define CHF_ICHARRAY(rank, ia) ia.begin(),CHF_CHARRAY_X(rank, ia)
717 /** @ingroup macros */
718 #define CHF_CONST_ICHARRAY(rank, ia) ia.begin(),CHF_CHARRAY_X(rank, ia)
719 /** @ingroup macros */
720 #define CHF_RCHARRAY(rank, ra) ra.begin(),CHF_CHARRAY_X(rank, ra)
721 /** @ingroup macros */
722 #define CHF_CONST_RCHARRAY(rank, ra) ra.begin(),CHF_CHARRAY_X(rank, ra)
723 /** @ingroup macros */
724 #define CHF_CCHARRAY(rank, ra) ra.begin(),CHF_CHARRAY_X(rank, ra)
725 /** @ingroup macros */
726 #define CHF_CONST_CCHARRAY(rank, ra) ra.begin(),CHF_CHARRAY_X(rank, ra)
727 /** @ingroup macros */
728 #define CHF_VECTOR(ra) ra.begin(),CHF_CHARRAY_X(1, ra)
729 /** @ingroup macros */
730 #define CHF_CONST_VECTOR(ra) ra.begin(),CHF_CHARRAY_X(1, ra)
731 /** @ingroup macros */
732 #define CHF_MATRIX(ra) ra.begin(),CHF_CHARRAY_X(2, ra)
733 /** @ingroup macros */
734 #define CHF_CONST_MATRIX(ra) ra.begin(),CHF_CHARRAY_X(2, ra)
735 
736 // Macros used in automatically-generated Chombo Fortran prototypes
737 
738 // primitive data types
739 
740 #define CHFp_INT( i ) int* const i
741 #define CHFp_CONST_INT( i ) const int* const i
742 #define CHFp_REAL( r ) Real* const r
743 #define CHFp_CONST_REAL( r ) const Real* const r
744 #define CHFp_COMPLEX( c ) Complex* const c
745 #define CHFp_CONST_COMPLEX( c ) const Complex* const c
746 //[NOTE: the *1D macros has 2 args in C++, but just 1 in Fortran]
747 #define CHFp_I1D( ia,dimen ) int* const ia, const int* const i ## ia ## hi0
748 #define CHFp_CONST_I1D( ia,dimen ) const int* const ia, const int* const i ## ia ## hi0
749 #define CHFp_R1D( ra,dimen ) Real* const ra, const int* const i ## ra ## hi0
750 #define CHFp_CONST_R1D( ra,dimen ) const Real* const ra, const int* const i ## ra ## hi0
751 #define CHFp_C1D( ra,dimen ) Complex* const ra, const int* const i ## ra ## hi0
752 #define CHFp_CONST_C1D( ra,dimen ) const Complex* const ra, const int* const i ## ra ## hi0
753 //[NOTE: primitive multidimensional arrays cannot depend on SpaceDim]
754 #define CHFp_IARRAY( rank, ia, ...) int* const ia, DIMARG ## rank ## p(ia)
755 #define CHFp_CONST_IARRAY(rank, ia, ...) const int* const ia, DIMARG ## rank ## p(ia)
756 #define CHFp_RARRAY( rank, ra, ...) Real* const ra, DIMARG ## rank ## p(ra)
757 #define CHFp_CONST_RARRAY(rank, ra, ...) const Real* const ra, DIMARG ## rank ## p(ra)
758 #define CHFp_CARRAY( rank, ra, ...) Complex* const ra, DIMARG ## rank ## p(ra)
759 #define CHFp_CONST_CARRAY(rank, ra, ...) const Complex* const ra, DIMARG ## rank ## p(ra)
760 
761 // Chombo data types
762 
763 #define CHFp_INTVECT( r ) int* const r
764 #define CHFp_CONST_INTVECT( r ) const int* const r
765 #define CHFp_REALVECT( r ) Real* const r
766 #define CHFp_CONST_REALVECT( r ) const Real* const r
767 #define CHFp_COMPLEXVECT( r ) Complex* const r
768 #define CHFp_CONST_COMPLEXVECT( r ) const Complex* const r
769 #define CHFp_VI( v ) int * const v, const int* const i ## v ## hi0
770 #define CHFp_CONST_VI( v ) const int * const v, const int* const i ## v ## hi0
771 #define CHFp_VR( v ) Real * const v, const int* const i ## v ## hi0
772 #define CHFp_CONST_VR( v ) const Real * const v, const int* const i ## v ## hi0
773 #define CHFp_VC( v ) Complex * const v, const int* const i ## v ## hi0
774 #define CHFp_CONST_VC( v ) const Complex * const v, const int* const i ## v ## hi0
775 
776 #define CHFp_BOX( b ) D_DECL6( const int* const i ## b ## lo0 \
777  ,const int* const i ## b ## lo1 \
778  ,const int* const i ## b ## lo2 \
779  ,const int* const i ## b ## lo3 \
780  ,const int* const i ## b ## lo4 \
781  ,const int* const i ## b ## lo5 ) \
782  ,D_DECL6( const int* const i ## b ## hi0 \
783  ,const int* const i ## b ## hi1 \
784  ,const int* const i ## b ## hi2 \
785  ,const int* const i ## b ## hi3 \
786  ,const int* const i ## b ## hi4 \
787  ,const int* const i ## b ## hi5 )
788 
789 #define CHFp_FIA( a ) int *const a \
790  ,D_DECL6( const int* const i ## a ## lo0 \
791  ,const int* const i ## a ## lo1 \
792  ,const int* const i ## a ## lo2 \
793  ,const int* const i ## a ## lo3 \
794  ,const int* const i ## a ## lo4 \
795  ,const int* const i ## a ## lo5 ) \
796  ,D_DECL6( const int* const i ## a ## hi0 \
797  ,const int* const i ## a ## hi1 \
798  ,const int* const i ## a ## hi2 \
799  ,const int* const i ## a ## hi3 \
800  ,const int* const i ## a ## hi4 \
801  ,const int* const i ## a ## hi5 ) \
802  ,const int* const n ## a ## comp
803 #define CHFp_FRA( a ) Real *const a \
804  ,D_DECL6( const int* const i ## a ## lo0 \
805  ,const int* const i ## a ## lo1 \
806  ,const int* const i ## a ## lo2 \
807  ,const int* const i ## a ## lo3 \
808  ,const int* const i ## a ## lo4 \
809  ,const int* const i ## a ## lo5 ) \
810  ,D_DECL6( const int* const i ## a ## hi0 \
811  ,const int* const i ## a ## hi1 \
812  ,const int* const i ## a ## hi2 \
813  ,const int* const i ## a ## hi3 \
814  ,const int* const i ## a ## hi4 \
815  ,const int* const i ## a ## hi5 ) \
816  ,const int* const n ## a ## comp
817 #define CHFp_FCA( a ) Complex *const a \
818  ,D_DECL6( const int* const i ## a ## lo0 \
819  ,const int* const i ## a ## lo1 \
820  ,const int* const i ## a ## lo2 \
821  ,const int* const i ## a ## lo3 \
822  ,const int* const i ## a ## lo4 \
823  ,const int* const i ## a ## lo5 ) \
824  ,D_DECL6( const int* const i ## a ## hi0 \
825  ,const int* const i ## a ## hi1 \
826  ,const int* const i ## a ## hi2 \
827  ,const int* const i ## a ## hi0 \
828  ,const int* const i ## a ## hi1 \
829  ,const int* const i ## a ## hi2 ) \
830  ,const int* const n ## a ## comp
831 #define CHFp_CONST_FIA( a ) const int *const a \
832  ,D_DECL6( const int* const i ## a ## lo0 \
833  ,const int* const i ## a ## lo1 \
834  ,const int* const i ## a ## lo2 \
835  , const int* const i ## a ## lo3 \
836  ,const int* const i ## a ## lo4 \
837  ,const int* const i ## a ## lo5 ) \
838  ,D_DECL6( const int* const i ## a ## hi0 \
839  ,const int* const i ## a ## hi1 \
840  ,const int* const i ## a ## hi2 \
841  ,const int* const i ## a ## hi3 \
842  ,const int* const i ## a ## hi4 \
843  ,const int* const i ## a ## hi5 ) \
844  ,const int* const n ## a ## comp
845 #define CHFp_CONST_FBA1( a ) const char *const a \
846  ,D_DECL6( const int* const i ## a ## lo0 \
847  ,const int* const i ## a ## lo1 \
848  ,const int* const i ## a ## lo2 \
849  , const int* const i ## a ## lo3 \
850  ,const int* const i ## a ## lo4 \
851  ,const int* const i ## a ## lo5 ) \
852  ,D_DECL6( const int* const i ## a ## hi0 \
853  ,const int* const i ## a ## hi1 \
854  ,const int* const i ## a ## hi2 \
855  ,const int* const i ## a ## hi3 \
856  ,const int* const i ## a ## hi4 \
857  ,const int* const i ## a ## hi5 )
858 #define CHFp_CONST_FRA( a ) const Real *const a \
859  ,D_DECL6( const int* const i ## a ## lo0 \
860  ,const int* const i ## a ## lo1 \
861  ,const int* const i ## a ## lo2 \
862  ,const int* const i ## a ## lo3 \
863  ,const int* const i ## a ## lo4 \
864  ,const int* const i ## a ## lo5 ) \
865  ,D_DECL6( const int* const i ## a ## hi0 \
866  ,const int* const i ## a ## hi1 \
867  ,const int* const i ## a ## hi2 \
868  ,const int* const i ## a ## hi3 \
869  ,const int* const i ## a ## hi4 \
870  ,const int* const i ## a ## hi5 ) \
871  ,const int* const n ## a ## comp
872 #define CHFp_CONST_FCA( a ) const Complex *const a \
873  ,D_DECL6( const int* const i ## a ## lo0 \
874  ,const int* const i ## a ## lo1 \
875  ,const int* const i ## a ## lo2 \
876  ,const int* const i ## a ## lo3 \
877  ,const int* const i ## a ## lo4 \
878  ,const int* const i ## a ## lo5 ) \
879  ,D_DECL6( const int* const i ## a ## hi0 \
880  ,const int* const i ## a ## hi1 \
881  ,const int* const i ## a ## hi2 \
882  ,const int* const i ## a ## hi3 \
883  ,const int* const i ## a ## hi4 \
884  ,const int* const i ## a ## hi5 ) \
885  ,const int* const n ## a ## comp
886 #define CHFp_FIA1( a ) int *const a \
887  ,D_DECL6( const int* const i ## a ## lo0 \
888  ,const int* const i ## a ## lo1 \
889  ,const int* const i ## a ## lo2 \
890  ,const int* const i ## a ## lo3 \
891  ,const int* const i ## a ## lo4 \
892  ,const int* const i ## a ## lo5 ) \
893  ,D_DECL6( const int* const i ## a ## hi0 \
894  ,const int* const i ## a ## hi1 \
895  ,const int* const i ## a ## hi2 \
896  ,const int* const i ## a ## hi3 \
897  ,const int* const i ## a ## hi4 \
898  ,const int* const i ## a ## hi5 )
899 #define CHFp_FBA1( a ) char *const a \
900  ,D_DECL6( const int* const i ## a ## lo0 \
901  ,const int* const i ## a ## lo1 \
902  ,const int* const i ## a ## lo2 \
903  ,const int* const i ## a ## lo3 \
904  ,const int* const i ## a ## lo4 \
905  ,const int* const i ## a ## lo5 ) \
906  ,D_DECL6( const int* const i ## a ## hi0 \
907  ,const int* const i ## a ## hi1 \
908  ,const int* const i ## a ## hi2 \
909  ,const int* const i ## a ## hi3 \
910  ,const int* const i ## a ## hi4 \
911  ,const int* const i ## a ## hi5 )
912 
913 #define CHFp_FRA1( a ) Real *const a \
914  ,D_DECL6( const int* const i ## a ## lo0 \
915  ,const int* const i ## a ## lo1 \
916  ,const int* const i ## a ## lo2 \
917  ,const int* const i ## a ## lo3 \
918  ,const int* const i ## a ## lo4 \
919  ,const int* const i ## a ## lo5 ) \
920  ,D_DECL6( const int* const i ## a ## hi0 \
921  ,const int* const i ## a ## hi1 \
922  ,const int* const i ## a ## hi2 \
923  ,const int* const i ## a ## hi3 \
924  ,const int* const i ## a ## hi4 \
925  ,const int* const i ## a ## hi5 )
926 #define CHFp_FCA1( a ) Complex *const a \
927  ,D_DECL6( const int* const i ## a ## lo0 \
928  ,const int* const i ## a ## lo1 \
929  ,const int* const i ## a ## lo2 \
930  ,const int* const i ## a ## lo3 \
931  ,const int* const i ## a ## lo4 \
932  ,const int* const i ## a ## lo5 ) \
933  ,D_DECL6( const int* const i ## a ## hi0 \
934  ,const int* const i ## a ## hi1 \
935  ,const int* const i ## a ## hi2 \
936  ,const int* const i ## a ## hi3 \
937  ,const int* const i ## a ## hi4 \
938  ,const int* const i ## a ## hi5 )
939 #define CHFp_CONST_FIA1( a ) const int *const a \
940  ,D_DECL6( const int* const i ## a ## lo0 \
941  ,const int* const i ## a ## lo1 \
942  ,const int* const i ## a ## lo2 \
943  ,const int* const i ## a ## lo3 \
944  ,const int* const i ## a ## lo4 \
945  ,const int* const i ## a ## lo5 ) \
946  ,D_DECL6( const int* const i ## a ## hi0 \
947  ,const int* const i ## a ## hi1 \
948  ,const int* const i ## a ## hi2 \
949  ,const int* const i ## a ## hi3 \
950  ,const int* const i ## a ## hi4 \
951  ,const int* const i ## a ## hi5 )
952 #define CHFp_CONST_FRA1( a ) const Real *const a \
953  ,D_DECL6( const int* const i ## a ## lo0 \
954  ,const int* const i ## a ## lo1 \
955  ,const int* const i ## a ## lo2 \
956  ,const int* const i ## a ## lo3 \
957  ,const int* const i ## a ## lo4 \
958  ,const int* const i ## a ## lo5 ) \
959  ,D_DECL6( const int* const i ## a ## hi0 \
960  ,const int* const i ## a ## hi1 \
961  ,const int* const i ## a ## hi2 \
962  ,const int* const i ## a ## hi3 \
963  ,const int* const i ## a ## hi4 \
964  ,const int* const i ## a ## hi5 )
965 #define CHFp_CONST_FCA1( a ) const Complex *const a \
966  ,D_DECL6( const int* const i ## a ## lo0 \
967  ,const int* const i ## a ## lo1 \
968  ,const int* const i ## a ## lo2 \
969  ,const int* const i ## a ## lo3 \
970  ,const int* const i ## a ## lo4 \
971  ,const int* const i ## a ## lo5 ) \
972  ,D_DECL6( const int* const i ## a ## hi0 \
973  ,const int* const i ## a ## hi1 \
974  ,const int* const i ## a ## hi2 \
975  ,const int* const i ## a ## hi3 \
976  ,const int* const i ## a ## hi4 \
977  ,const int* const i ## a ## hi5 )
978 
979 //[NOTE: Chombo multidimensional arrays can depend on SpaceDim]
980 //[NOTE: CHVector and CHMatrix are converted to CHFp_RCHARRAY
981 #define CHFp_ICHARRAY( rank, ia) int* const ia, DIMARGp_X(rank, ia)
982 #define CHFp_CONST_ICHARRAY(rank, ia) const int* const ia, DIMARGp_X(rank, ia)
983 #define CHFp_RCHARRAY( rank, ra) Real* const ra, DIMARGp_X(rank, ra)
984 #define CHFp_CONST_RCHARRAY(rank, ra) const Real* const ra, DIMARGp_X(rank, ra)
985 #define CHFp_CCHARRAY( rank, ra) Complex* const ra, DIMARGp_X(rank, ra)
986 #define CHFp_CONST_CCHARRAY(rank, ra) const Complex* const ra, DIMARGp_X(rank, ra)
987 
988 #define CHFt_INT( i ) i
989 #define CHFt_CONST_INT( i ) i
990 #define CHFt_REAL( r ) r
991 #define CHFt_CONST_REAL( r ) r
992 #define CHFt_COMPLEX( c ) c
993 #define CHFt_CONST_COMPLEX( c ) c
994 //[NOTE: the *1D macros has 2 args in C++, but just 1 in Fortran]
995 #define CHFt_I1D( ia,dimen ) ia, i ## ia ## hi0
996 #define CHFt_CONST_I1D( ia,dimen ) ia, i ## ia ## hi0
997 #define CHFt_R1D( ra,dimen ) ra, i ## ra ## hi0
998 #define CHFt_CONST_R1D( ra,dimen ) ra, i ## ra ## hi0
999 #define CHFt_C1D( ra,dimen ) ra, i ## ra ## hi0
1000 #define CHFt_CONST_C1D( ra,dimen ) ra, i ## ra ## hi0
1001 //[NOTE: primitive multidimensional arrays cannot depend on SpaceDim]
1002 #define CHFt_CONST_IARRAY(rank, ia, ...) ia, DIMARG ## rank ## t(ia)
1003 #define CHFt_IARRAY( rank, ia, ...) ia, DIMARG ## rank ## t(ia)
1004 #define CHFt_CONST_BARRAY(rank, ia, ...) ia, DIMARG ## rank ## t(ia)
1005 #define CHFt_BARRAY( rank, ia, ...) ia, DIMARG ## rank ## t(ia)
1006 #define CHFt_CONST_RARRAY(rank, ra, ...) ra, DIMARG ## rank ## t(ra)
1007 #define CHFt_RARRAY( rank, ra, ...) ra, DIMARG ## rank ## t(ra)
1008 #define CHFt_CONST_CARRAY(rank, ra, ...) ra, DIMARG ## rank ## t(ra)
1009 #define CHFt_CARRAY( rank, ra, ...) ra, DIMARG ## rank ## t(ra)
1010 
1011 // Chombo data types
1012 
1013 #define CHFt_INTVECT( r ) r
1014 #define CHFt_CONST_INTVECT( r ) r
1015 #define CHFt_REALVECT( r ) r
1016 #define CHFt_CONST_REALVECT( r ) r
1017 #define CHFt_COMPLEXVECT( r ) r
1018 #define CHFt_CONST_COMPLEXVECT( r ) r
1019 #define CHFt_VI( v ) v, i ## v ## hi0
1020 #define CHFt_CONST_VI( v ) v, i ## v ## hi0
1021 #define CHFt_VR( v ) v, i ## v ## hi0
1022 #define CHFt_CONST_VR( v ) v, i ## v ## hi0
1023 #define CHFt_VC( v ) v, i ## v ## hi0
1024 #define CHFt_CONST_VC( v ) v, i ## v ## hi0
1025 
1026 #define CHFt_BOX( b ) D_DECL6( i ## b ## lo0 \
1027  , i ## b ## lo1 \
1028  , i ## b ## lo2 \
1029  , i ## b ## lo3 \
1030  , i ## b ## lo4 \
1031  , i ## b ## lo5 ) \
1032  ,D_DECL6( i ## b ## hi0 \
1033  , i ## b ## hi1 \
1034  , i ## b ## hi2 \
1035  , i ## b ## hi3 \
1036  , i ## b ## hi4 \
1037  , i ## b ## hi5 )
1038 
1039 #define CHFt_FIA( a ) a \
1040  ,D_DECL6( i ## a ## lo0 \
1041  , i ## a ## lo1 \
1042  , i ## a ## lo2 \
1043  , i ## a ## lo3 \
1044  , i ## a ## lo4 \
1045  , i ## a ## lo5 ) \
1046  ,D_DECL6( i ## a ## hi0 \
1047  , i ## a ## hi1 \
1048  , i ## a ## hi2 \
1049  , i ## a ## hi3 \
1050  , i ## a ## hi4 \
1051  , i ## a ## hi5 ) \
1052  , n ## a ## comp
1053 #define CHFt_FRA( a ) a \
1054  ,D_DECL6( i ## a ## lo0 \
1055  , i ## a ## lo1 \
1056  , i ## a ## lo2 \
1057  , i ## a ## lo3 \
1058  , i ## a ## lo4 \
1059  , i ## a ## lo5 ) \
1060  ,D_DECL6( i ## a ## hi0 \
1061  , i ## a ## hi1 \
1062  , i ## a ## hi2 \
1063  , i ## a ## hi3 \
1064  , i ## a ## hi4 \
1065  , i ## a ## hi5 ) \
1066  , n ## a ## comp
1067 #define CHFt_FCA( a ) a \
1068  ,D_DECL6( i ## a ## lo0 \
1069  , i ## a ## lo1 \
1070  , i ## a ## lo2 \
1071  , i ## a ## lo3 \
1072  , i ## a ## lo4 \
1073  , i ## a ## lo5 ) \
1074  ,D_DECL6( i ## a ## hi0 \
1075  , i ## a ## hi1 \
1076  , i ## a ## hi2 \
1077  , i ## a ## hi3 \
1078  , i ## a ## hi4 \
1079  , i ## a ## hi5 ) \
1080  , n ## a ## comp
1081 #define CHFt_CONST_FIA( a ) a \
1082  ,D_DECL6( i ## a ## lo0 \
1083  , i ## a ## lo1 \
1084  , i ## a ## lo2 \
1085  , i ## a ## lo3 \
1086  , i ## a ## lo4 \
1087  , i ## a ## lo5 ) \
1088  ,D_DECL6( i ## a ## hi0 \
1089  , i ## a ## hi1 \
1090  , i ## a ## hi2 \
1091  , i ## a ## hi3 \
1092  , i ## a ## hi4 \
1093  , i ## a ## hi5 ) \
1094  , n ## a ## comp
1095 #define CHFt_CONST_FRA( a ) a \
1096  ,D_DECL6( i ## a ## lo0 \
1097  , i ## a ## lo1 \
1098  , i ## a ## lo2 \
1099  , i ## a ## lo3 \
1100  , i ## a ## lo4 \
1101  , i ## a ## lo5 ) \
1102  ,D_DECL6( i ## a ## hi0 \
1103  , i ## a ## hi1 \
1104  , i ## a ## hi2 \
1105  , i ## a ## hi3 \
1106  , i ## a ## hi4 \
1107  , i ## a ## hi5 ) \
1108  , n ## a ## comp
1109 #define CHFt_CONST_FCA( a ) a \
1110  ,D_DECL6( i ## a ## lo0 \
1111  , i ## a ## lo1 \
1112  , i ## a ## lo2 \
1113  , i ## a ## lo3 \
1114  , i ## a ## lo4 \
1115  , i ## a ## lo5 ) \
1116  ,D_DECL6( i ## a ## hi0 \
1117  , i ## a ## hi1 \
1118  , i ## a ## hi2 \
1119  , i ## a ## hi3 \
1120  , i ## a ## hi4 \
1121  , i ## a ## hi5 ) \
1122  , n ## a ## comp
1123 #define CHFt_FIA1( a ) a \
1124  ,D_DECL6( i ## a ## lo0 \
1125  , i ## a ## lo1 \
1126  , i ## a ## lo2 \
1127  , i ## a ## lo3 \
1128  , i ## a ## lo4 \
1129  , i ## a ## lo5 ) \
1130  ,D_DECL6( i ## a ## hi0 \
1131  , i ## a ## hi1 \
1132  , i ## a ## hi2 \
1133  , i ## a ## hi3 \
1134  , i ## a ## hi4 \
1135  , i ## a ## hi5 )
1136 #define CHFt_FRA1( a ) a \
1137  ,D_DECL6( i ## a ## lo0 \
1138  , i ## a ## lo1 \
1139  , i ## a ## lo2 \
1140  , i ## a ## lo3 \
1141  , i ## a ## lo4 \
1142  , i ## a ## lo5 ) \
1143  ,D_DECL6( i ## a ## hi0 \
1144  , i ## a ## hi1 \
1145  , i ## a ## hi2 \
1146  , i ## a ## hi3 \
1147  , i ## a ## hi4 \
1148  , i ## a ## hi5 )
1149 #define CHFt_FCA1( a ) a \
1150  ,D_DECL6( i ## a ## lo0 \
1151  , i ## a ## lo1 \
1152  , i ## a ## lo2 \
1153  , i ## a ## lo3 \
1154  , i ## a ## lo4 \
1155  , i ## a ## lo5 ) \
1156  ,D_DECL6( i ## a ## hi0 \
1157  , i ## a ## hi1 \
1158  , i ## a ## hi2 \
1159  , i ## a ## hi3 \
1160  , i ## a ## hi4 \
1161  , i ## a ## hi5 )
1162 #define CHFt_CONST_FIA1( a ) a \
1163  ,D_DECL6( i ## a ## lo0 \
1164  , i ## a ## lo1 \
1165  , i ## a ## lo2 \
1166  , i ## a ## lo3 \
1167  , i ## a ## lo4 \
1168  , i ## a ## lo5 ) \
1169  ,D_DECL6( i ## a ## hi0 \
1170  , i ## a ## hi1 \
1171  , i ## a ## hi2 \
1172  , i ## a ## hi3 \
1173  , i ## a ## hi4 \
1174  , i ## a ## hi5 )
1175 #define CHFt_CONST_FBA1( a ) a \
1176  ,D_DECL6( i ## a ## lo0 \
1177  , i ## a ## lo1 \
1178  , i ## a ## lo2 \
1179  , i ## a ## lo3 \
1180  , i ## a ## lo4 \
1181  , i ## a ## lo5 ) \
1182  ,D_DECL6( i ## a ## hi0 \
1183  , i ## a ## hi1 \
1184  , i ## a ## hi2 \
1185  , i ## a ## hi3 \
1186  , i ## a ## hi4 \
1187  , i ## a ## hi5 )
1188 #define CHFt_CONST_FRA1( a ) a \
1189  ,D_DECL6( i ## a ## lo0 \
1190  , i ## a ## lo1 \
1191  , i ## a ## lo2 \
1192  , i ## a ## lo3 \
1193  , i ## a ## lo4 \
1194  , i ## a ## lo5 ) \
1195  ,D_DECL6( i ## a ## hi0 \
1196  , i ## a ## hi1 \
1197  , i ## a ## hi2 \
1198  , i ## a ## hi3 \
1199  , i ## a ## hi4 \
1200  , i ## a ## hi5 )
1201 #define CHFt_CONST_FCA1( a ) a \
1202  ,D_DECL6( i ## a ## lo0 \
1203  , i ## a ## lo1 \
1204  , i ## a ## lo2 \
1205  , i ## a ## lo3 \
1206  , i ## a ## lo4 \
1207  , i ## a ## lo5 ) \
1208  ,D_DECL6( i ## a ## hi0 \
1209  , i ## a ## hi1 \
1210  , i ## a ## hi2 \
1211  , i ## a ## hi3 \
1212  , i ## a ## hi4 \
1213  , i ## a ## hi5 )
1214 
1215 //[NOTE: Chombo multidimensional arrays can depend on SpaceDim]
1216 //[NOTE: CHVector and CHMatrix are converted to CHFt_RCHARRAY
1217 #define CHFt_CONST_ICHARRAY(rank, ia) ia, DIMARGt_X(rank, ia)
1218 #define CHFt_ICHARRAY( rank, ia) ia, DIMARGt_X(rank, ia)
1219 #define CHFt_CONST_RCHARRAY(rank, ra) ra, DIMARGt_X(rank, ra)
1220 #define CHFt_RCHARRAY( rank, ra) ra, DIMARGt_X(rank, ra)
1221 #define CHFt_CONST_CCHARRAY(rank, ra) ra, DIMARGt_X(rank, ra)
1222 #define CHFt_CCHARRAY( rank, ra) ra, DIMARGt_X(rank, ra)
1223 
1224 #include "BaseNamespaceFooter.H"
1225 #endif