source: XIOS3/trunk/src/generate_fortran_interface.cpp @ 2551

Last change on this file since 2551 was 2507, checked in by ymipsl, 13 months ago

Merging XIOS3_ATTACHED branch into XIOS3 trunk.

YM

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:eol-style set to native
File size: 14.8 KB
Line 
1#include "xios.hpp"
2#include "generate_interface.hpp"
3#include "indent.hpp"
4#include "attribute_template.hpp"
5#include "object_template.hpp"
6#include "group_template.hpp"
7#include "node_type.hpp"
8
9int main (int argc, char ** argv, char ** UNUSED (env))
10{
11//  string path="./src/attr_interface/";
12  string path="./interface/";
13
14  CContext* context=CContext::create("interface");
15  CCalendarWrapper calendarWrapper;
16  CScalar scalar;
17  CScalarGroup scalargroup;
18  CAxis axis;
19  CAxisGroup axisgroup;
20  CField field;
21  CFieldGroup fieldgroup;
22  CVariable variable;
23  CVariableGroup variablegroup;
24  CDomain domain;
25  CDomainGroup domaingroup;
26  CGrid grid;
27  CGridGroup gridgroup;
28
29  CFile afile;
30  CFileGroup filegroup;
31
32  CInterpolateDomain interpolateDomain;
33  CZoomDomain zoomDomain;
34  CGenerateRectilinearDomain genDomain;
35  CComputeConnectivityDomain compConDomain;
36  CExpandDomain expandDomain;
37  CReorderDomain reorderDomain;
38  CExtractDomain extractDomain;
39
40  CInterpolateAxis interpolateAxis;
41  CZoomAxis zoomAxis;
42  CInverseAxis inverseAxis;
43  CExtractAxis extractAxis;
44
45  CReduceDomainToAxis reduceDomainToAxis;
46  CReduceAxisToAxis reduceAxisToAxis;
47  CExtractDomainToAxis extractDomainToAxis;
48  CTemporalSplitting temporalSplitting;
49
50  CReduceAxisToScalar reduceAxisToScalar;
51  CExtractAxisToScalar extractAxisToScalar;
52  CReduceDomainToScalar reduceDomainToScalar;
53  CDuplicateScalarToAxis duplicateScalarToAxis;
54  CReduceScalarToScalar reduceScalarToScalar;
55
56  CRedistributeDomain redistributeDomain ;
57  CRedistributeAxis   redistributeAxis ;
58  CRedistributeScalar redistributeScalar ;
59 
60  ostringstream oss;
61  ofstream file;
62
63  file.open((path+"scalar_interface_attr.F90").c_str());
64  scalar.generateFortran2003Interface(file);
65  file.close();
66
67  file.open((path+"icscalar_attr.cpp").c_str());
68  scalar.generateCInterface(file);
69  file.close();
70
71  file.open((path+"iscalar_attr.F90").c_str());
72  scalar.generateFortranInterface(file);
73  file.close();
74
75  file.open((path+"scalargroup_interface_attr.F90").c_str());
76  scalargroup.generateFortran2003Interface(file);
77  file.close();
78
79  file.open((path+"icscalargroup_attr.cpp").c_str());
80  scalargroup.generateCInterface(file);
81  file.close();
82
83  file.open((path+"iscalargroup_attr.F90").c_str());
84  scalargroup.generateFortranInterface(file);
85  file.close();
86
87  file.open((path+"axis_interface_attr.F90").c_str());
88  axis.generateFortran2003Interface(file);
89  file.close();
90
91  file.open((path+"icaxis_attr.cpp").c_str());
92  axis.generateCInterface(file);
93  file.close();
94
95  file.open((path+"iaxis_attr.F90").c_str());
96  axis.generateFortranInterface(file);
97  file.close();
98
99  file.open((path+"axisgroup_interface_attr.F90").c_str());
100  axisgroup.generateFortran2003Interface(file);
101  file.close();
102
103  file.open((path+"icaxisgroup_attr.cpp").c_str());
104  axisgroup.generateCInterface(file);
105  file.close();
106
107  file.open((path+"iaxisgroup_attr.F90").c_str());
108  axisgroup.generateFortranInterface(file);
109  file.close();
110
111  file.open((path+"domain_interface_attr.F90").c_str());
112  domain.generateFortran2003Interface(file);
113  file.close();
114
115  file.open((path+"icdomain_attr.cpp").c_str());
116  domain.generateCInterface(file);
117  file.close();
118
119  file.open((path+"idomain_attr.F90").c_str());
120  domain.generateFortranInterface(file);
121  file.close();
122
123  file.open((path+"domaingroup_interface_attr.F90").c_str());
124  domaingroup.generateFortran2003Interface(file);
125  file.close();
126
127  file.open((path+"icdomaingroup_attr.cpp").c_str());
128  domaingroup.generateCInterface(file);
129  file.close();
130
131  file.open((path+"idomaingroup_attr.F90").c_str());
132  domaingroup.generateFortranInterface(file);
133  file.close();
134
135
136  file.open((path+"grid_interface_attr.F90").c_str());
137  grid.generateFortran2003Interface(file);
138  file.close();
139
140  file.open((path+"icgrid_attr.cpp").c_str());
141  grid.generateCInterface(file);
142  file.close();
143
144  file.open((path+"igrid_attr.F90").c_str());
145  grid.generateFortranInterface(file);
146  file.close();
147
148  file.open((path+"gridgroup_interface_attr.F90").c_str());
149  gridgroup.generateFortran2003Interface(file);
150  file.close();
151
152  file.open((path+"icgridgroup_attr.cpp").c_str());
153  gridgroup.generateCInterface(file);
154  file.close();
155
156  file.open((path+"igridgroup_attr.F90").c_str());
157  gridgroup.generateFortranInterface(file);
158  file.close();
159
160
161  file.open((path+"field_interface_attr.F90").c_str());
162  field.generateFortran2003Interface(file);
163  file.close();
164
165  file.open((path+"icfield_attr.cpp").c_str());
166  field.generateCInterface(file);
167  file.close();
168
169  file.open((path+"ifield_attr.F90").c_str());
170  field.generateFortranInterface(file);
171  file.close();
172
173  file.open((path+"fieldgroup_interface_attr.F90").c_str());
174  fieldgroup.generateFortran2003Interface(file);
175  file.close();
176
177  file.open((path+"icfieldgroup_attr.cpp").c_str());
178  fieldgroup.generateCInterface(file);
179  file.close();
180
181  file.open((path+"ifieldgroup_attr.F90").c_str());
182  fieldgroup.generateFortranInterface(file);
183  file.close();
184
185
186
187  file.open((path+"variable_interface_attr.F90").c_str());
188  variable.generateFortran2003Interface(file);
189  file.close();
190
191  file.open((path+"icvariable_attr.cpp").c_str());
192  variable.generateCInterface(file);
193  file.close();
194
195  file.open((path+"ivariable_attr.F90").c_str());
196  variable.generateFortranInterface(file);
197  file.close();
198
199  file.open((path+"variablegroup_interface_attr.F90").c_str());
200  variablegroup.generateFortran2003Interface(file);
201  file.close();
202
203  file.open((path+"icvariablegroup_attr.cpp").c_str());
204  variablegroup.generateCInterface(file);
205  file.close();
206
207  file.open((path+"ivariablegroup_attr.F90").c_str());
208  variablegroup.generateFortranInterface(file);
209  file.close();
210
211
212
213  file.open((path+"file_interface_attr.F90").c_str());
214  afile.generateFortran2003Interface(file);
215  file.close();
216
217  file.open((path+"icfile_attr.cpp").c_str());
218  afile.generateCInterface(file);
219  file.close();
220
221  file.open((path+"ifile_attr.F90").c_str());
222  afile.generateFortranInterface(file);
223  file.close();
224
225  file.open((path+"filegroup_interface_attr.F90").c_str());
226  filegroup.generateFortran2003Interface(file);
227  file.close();
228
229  file.open((path+"icfilegroup_attr.cpp").c_str());
230  filegroup.generateCInterface(file);
231  file.close();
232
233  file.open((path+"ifilegroup_attr.F90").c_str());
234  filegroup.generateFortranInterface(file);
235  file.close();
236
237
238  file.open((path+"calendar_wrapper_interface_attr.F90").c_str());
239  calendarWrapper.generateFortran2003Interface(file);
240  file.close();
241
242  file.open((path+"iccalendar_wrapper_attr.cpp").c_str());
243  calendarWrapper.generateCInterface(file);
244  file.close();
245
246  file.open((path+"icalendar_wrapper_attr.F90").c_str());
247  calendarWrapper.generateFortranInterface(file);
248  file.close();
249
250  /*!
251    Domain transformations
252  */
253  file.open((path+"zoom_domain_interface_attr.F90").c_str());
254  zoomDomain.generateFortran2003Interface(file);
255  file.close();
256
257  file.open((path+"iczoom_domain_attr.cpp").c_str());
258  zoomDomain.generateCInterface(file);
259  file.close();
260
261  file.open((path+"izoom_domain_attr.F90").c_str());
262  zoomDomain.generateFortranInterface(file);
263  file.close();
264
265  file.open((path+"extract_domain_interface_attr.F90").c_str());
266  extractDomain.generateFortran2003Interface(file);
267  file.close();
268
269  file.open((path+"icextract_domain_attr.cpp").c_str());
270  extractDomain.generateCInterface(file);
271  file.close();
272
273  file.open((path+"iextract_domain_attr.F90").c_str());
274  extractDomain.generateFortranInterface(file);
275  file.close();
276
277  file.open((path+"interpolate_domain_interface_attr.F90").c_str());
278  interpolateDomain.generateFortran2003Interface(file);
279  file.close();
280
281  file.open((path+"icinterpolate_domain_attr.cpp").c_str());
282  interpolateDomain.generateCInterface(file);
283  file.close();
284
285  file.open((path+"iinterpolate_domain_attr.F90").c_str());
286  interpolateDomain.generateFortranInterface(file);
287  file.close();
288
289  file.open((path+"generate_rectilinear_domain_interface_attr.F90").c_str());
290  genDomain.generateFortran2003Interface(file);
291  file.close();
292
293  file.open((path+"icgenerate_rectilinear_domain_attr.cpp").c_str());
294  genDomain.generateCInterface(file);
295  file.close();
296
297  file.open((path+"igenerate_rectilinear_domain_attr.F90").c_str());
298  genDomain.generateFortranInterface(file);
299  file.close();
300
301  file.open((path+"compute_connectivity_domain_interface_attr.F90").c_str());
302  compConDomain.generateFortran2003Interface(file);
303  file.close();
304
305  file.open((path+"iccompute_connectivity_domain_attr.cpp").c_str());
306  compConDomain.generateCInterface(file);
307  file.close();
308
309  file.open((path+"icompute_connectivity_domain_attr.F90").c_str());
310  compConDomain.generateFortranInterface(file);
311  file.close();
312
313  file.open((path+"expand_domain_interface_attr.F90").c_str());
314  expandDomain.generateFortran2003Interface(file);
315  file.close();
316
317  file.open((path+"icexpand_domain_attr.cpp").c_str());
318  expandDomain.generateCInterface(file);
319  file.close();
320
321  file.open((path+"iexpand_domain_attr.F90").c_str());
322  expandDomain.generateFortranInterface(file);
323  file.close();
324
325  file.open((path+"reorder_domain_interface_attr.F90").c_str());
326  reorderDomain.generateFortran2003Interface(file);
327  file.close();
328
329  file.open((path+"icreorder_domain_attr.cpp").c_str());
330  reorderDomain.generateCInterface(file);
331  file.close();
332
333  file.open((path+"ireorder_domain_attr.F90").c_str());
334  reorderDomain.generateFortranInterface(file);
335  file.close();
336
337  file.open((path+"iredistribute_domain_attr.F90").c_str());
338  redistributeDomain.generateFortranInterface(file);
339  file.close();
340 
341  /*!
342    Axis transformations
343  */
344  file.open((path+"zoom_axis_interface_attr.F90").c_str());
345  zoomAxis.generateFortran2003Interface(file);
346  file.close();
347
348  file.open((path+"iczoom_axis_attr.cpp").c_str());
349  zoomAxis.generateCInterface(file);
350  file.close();
351
352  file.open((path+"izoom_axis_attr.F90").c_str());
353  zoomAxis.generateFortranInterface(file);
354  file.close();
355
356  file.open((path+"interpolate_axis_interface_attr.F90").c_str());
357  interpolateAxis.generateFortran2003Interface(file);
358  file.close();
359
360  file.open((path+"icinterpolate_axis_attr.cpp").c_str());
361  interpolateAxis.generateCInterface(file);
362  file.close();
363
364  file.open((path+"iinterpolate_axis_attr.F90").c_str());
365  interpolateAxis.generateFortranInterface(file);
366  file.close();
367
368  file.open((path+"inverse_axis_interface_attr.F90").c_str());
369  inverseAxis.generateFortran2003Interface(file);
370  file.close();
371
372  file.open((path+"extract_axis_interface_attr.F90").c_str());
373  extractAxis.generateFortran2003Interface(file);
374  file.close();
375
376  file.open((path+"icinverse_axis_attr.cpp").c_str());
377  inverseAxis.generateCInterface(file);
378  file.close();
379
380  file.open((path+"iinverse_axis_attr.F90").c_str());
381  inverseAxis.generateFortranInterface(file);
382  file.close();
383
384  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
385  reduceDomainToAxis.generateFortran2003Interface(file);
386  file.close();
387 
388  file.open((path+"icreduce_domain_to_axis_attr.cpp").c_str());
389  reduceDomainToAxis.generateCInterface(file);
390  file.close();
391
392  file.open((path+"ireduce_domain_to_axis_attr.F90").c_str());
393  reduceDomainToAxis.generateFortranInterface(file);
394  file.close();
395
396  file.open((path+"reduce_axis_to_axis_interface_attr.F90").c_str());
397  reduceAxisToAxis.generateFortran2003Interface(file);
398  file.close();
399 
400  file.open((path+"icreduce_axis_to_axis_attr.cpp").c_str());
401  reduceAxisToAxis.generateCInterface(file);
402  file.close();
403
404  file.open((path+"ireduce_axis_to_axis_attr.F90").c_str());
405  reduceAxisToAxis.generateFortranInterface(file);
406  file.close();
407 
408  file.open((path+"extract_domain_to_axis_interface_attr.F90").c_str());
409  extractDomainToAxis.generateFortran2003Interface(file);
410  file.close();
411
412  file.open((path+"icextract_domain_to_axis_attr.cpp").c_str());
413  extractDomainToAxis.generateCInterface(file);
414  file.close();
415
416  file.open((path+"iextract_domain_to_axis_attr.F90").c_str());
417  extractDomainToAxis.generateFortranInterface(file);
418  file.close();
419
420
421  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
422  temporalSplitting.generateFortran2003Interface(file);
423  file.close();
424
425  file.open((path+"ictemporal_splitting_attr.cpp").c_str());
426  temporalSplitting.generateCInterface(file);
427  file.close();
428
429  file.open((path+"itemporal_splitting_attr.F90").c_str());
430  temporalSplitting.generateFortranInterface(file);
431  file.close();
432
433
434  file.open((path+"duplicate_scalar_to_axis_interface_attr.F90").c_str());
435  duplicateScalarToAxis.generateFortran2003Interface(file);
436  file.close();
437 
438  file.open((path+"icduplicate_scalar_to_axis_attr.cpp").c_str());
439  duplicateScalarToAxis.generateCInterface(file);
440  file.close();
441 
442  file.open((path+"iduplicate_scalar_to_axis_attr.F90").c_str());
443  duplicateScalarToAxis.generateFortranInterface(file);
444  file.close();
445
446  file.open((path+"iredistribute_axis_attr.F90").c_str());
447  redistributeAxis.generateFortranInterface(file);
448  file.close();
449
450  /*!
451    Scalar transformations
452  */
453  file.open((path+"reduce_axis_to_scalar_interface_attr.F90").c_str());
454  reduceAxisToScalar.generateFortran2003Interface(file);
455  file.close();
456
457  file.open((path+"icreduce_axis_to_scalar_attr.cpp").c_str());
458  reduceAxisToScalar.generateCInterface(file);
459  file.close();
460
461  file.open((path+"ireduce_axis_to_scalar_attr.F90").c_str());
462  reduceAxisToScalar.generateFortranInterface(file);
463  file.close();
464
465  file.open((path+"extract_axis_to_scalar_interface_attr.F90").c_str());
466  extractAxisToScalar.generateFortran2003Interface(file);
467  file.close();
468
469  file.open((path+"icextract_axis_to_scalar_attr.cpp").c_str());
470  extractAxisToScalar.generateCInterface(file);
471  file.close();
472
473  file.open((path+"iextract_axis_to_scalar_attr.F90").c_str());
474  extractAxisToScalar.generateFortranInterface(file);
475  file.close();
476
477
478  file.open((path+"reduce_domain_to_scalar_interface_attr.F90").c_str());
479  reduceDomainToScalar.generateFortran2003Interface(file);
480  file.close();
481
482  file.open((path+"icreduce_domain_to_scalar_attr.cpp").c_str());
483  reduceDomainToScalar.generateCInterface(file);
484  file.close();
485
486  file.open((path+"ireduce_domain_to_scalar_attr.F90").c_str());
487  reduceDomainToScalar.generateFortranInterface(file);
488  file.close();
489
490
491  file.open((path+"reduce_scalar_to_scalar_interface_attr.F90").c_str());
492  reduceScalarToScalar.generateFortran2003Interface(file);
493  file.close();
494
495  file.open((path+"icreduce_scalar_to_scalar_attr.cpp").c_str());
496  reduceScalarToScalar.generateCInterface(file);
497  file.close();
498
499  file.open((path+"ireduce_scalar_to_scalar_attr.F90").c_str());
500  reduceScalarToScalar.generateFortranInterface(file);
501  file.close();
502
503  file.open((path+"iredistribute_scalar_attr.F90").c_str());
504  redistributeScalar.generateFortranInterface(file);
505  file.close();
506
507
508
509
510  file.open((path+"context_interface_attr.F90").c_str());
511  context->generateFortran2003Interface(file);
512  file.close();
513
514  file.open((path+"iccontext_attr.cpp").c_str());
515  context->generateCInterface(file);
516  file.close();
517
518  file.open((path+"icontext_attr.F90").c_str());
519  context->generateFortranInterface(file);
520  file.close();
521}
Note: See TracBrowser for help on using the repository browser.