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