source: XIOS/trunk/src/generate_fortran_interface.cpp @ 1549

Last change on this file since 1549 was 1549, checked in by oabramkina, 3 years ago

Adding a new domain transformation "domain_extract".

For now it has only the functionalities of zoom.

  • 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.1 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  CReduceDomainToAxis reduceDomainToAxis;
44  CReduceAxisToAxis reduceAxisToAxis;
45  CExtractDomainToAxis extractDomainToAxis;
46  CTemporalSplitting temporalSplitting;
47
48  CReduceAxisToScalar reduceAxisToScalar;
49  CExtractAxisToScalar extractAxisToScalar;
50  CReduceDomainToScalar reduceDomainToScalar;
51  CDuplicateScalarToAxis duplicateScalarToAxis;
52  CReduceScalarToScalar reduceScalarToScalar;
53 
54  ostringstream oss;
55  ofstream file;
56
57  file.open((path+"scalar_interface_attr.F90").c_str());
58  scalar.generateFortran2003Interface(file);
59  file.close();
60
61  file.open((path+"icscalar_attr.cpp").c_str());
62  scalar.generateCInterface(file);
63  file.close();
64
65  file.open((path+"iscalar_attr.F90").c_str());
66  scalar.generateFortranInterface(file);
67  file.close();
68
69  file.open((path+"scalargroup_interface_attr.F90").c_str());
70  scalargroup.generateFortran2003Interface(file);
71  file.close();
72
73  file.open((path+"icscalargroup_attr.cpp").c_str());
74  scalargroup.generateCInterface(file);
75  file.close();
76
77  file.open((path+"iscalargroup_attr.F90").c_str());
78  scalargroup.generateFortranInterface(file);
79  file.close();
80
81  file.open((path+"axis_interface_attr.F90").c_str());
82  axis.generateFortran2003Interface(file);
83  file.close();
84
85  file.open((path+"icaxis_attr.cpp").c_str());
86  axis.generateCInterface(file);
87  file.close();
88
89  file.open((path+"iaxis_attr.F90").c_str());
90  axis.generateFortranInterface(file);
91  file.close();
92
93  file.open((path+"axisgroup_interface_attr.F90").c_str());
94  axisgroup.generateFortran2003Interface(file);
95  file.close();
96
97  file.open((path+"icaxisgroup_attr.cpp").c_str());
98  axisgroup.generateCInterface(file);
99  file.close();
100
101  file.open((path+"iaxisgroup_attr.F90").c_str());
102  axisgroup.generateFortranInterface(file);
103  file.close();
104
105  file.open((path+"domain_interface_attr.F90").c_str());
106  domain.generateFortran2003Interface(file);
107  file.close();
108
109  file.open((path+"icdomain_attr.cpp").c_str());
110  domain.generateCInterface(file);
111  file.close();
112
113  file.open((path+"idomain_attr.F90").c_str());
114  domain.generateFortranInterface(file);
115  file.close();
116
117  file.open((path+"domaingroup_interface_attr.F90").c_str());
118  domaingroup.generateFortran2003Interface(file);
119  file.close();
120
121  file.open((path+"icdomaingroup_attr.cpp").c_str());
122  domaingroup.generateCInterface(file);
123  file.close();
124
125  file.open((path+"idomaingroup_attr.F90").c_str());
126  domaingroup.generateFortranInterface(file);
127  file.close();
128
129
130  file.open((path+"grid_interface_attr.F90").c_str());
131  grid.generateFortran2003Interface(file);
132  file.close();
133
134  file.open((path+"icgrid_attr.cpp").c_str());
135  grid.generateCInterface(file);
136  file.close();
137
138  file.open((path+"igrid_attr.F90").c_str());
139  grid.generateFortranInterface(file);
140  file.close();
141
142  file.open((path+"gridgroup_interface_attr.F90").c_str());
143  gridgroup.generateFortran2003Interface(file);
144  file.close();
145
146  file.open((path+"icgridgroup_attr.cpp").c_str());
147  gridgroup.generateCInterface(file);
148  file.close();
149
150  file.open((path+"igridgroup_attr.F90").c_str());
151  gridgroup.generateFortranInterface(file);
152  file.close();
153
154
155  file.open((path+"field_interface_attr.F90").c_str());
156  field.generateFortran2003Interface(file);
157  file.close();
158
159  file.open((path+"icfield_attr.cpp").c_str());
160  field.generateCInterface(file);
161  file.close();
162
163  file.open((path+"ifield_attr.F90").c_str());
164  field.generateFortranInterface(file);
165  file.close();
166
167  file.open((path+"fieldgroup_interface_attr.F90").c_str());
168  fieldgroup.generateFortran2003Interface(file);
169  file.close();
170
171  file.open((path+"icfieldgroup_attr.cpp").c_str());
172  fieldgroup.generateCInterface(file);
173  file.close();
174
175  file.open((path+"ifieldgroup_attr.F90").c_str());
176  fieldgroup.generateFortranInterface(file);
177  file.close();
178
179
180
181  file.open((path+"variable_interface_attr.F90").c_str());
182  variable.generateFortran2003Interface(file);
183  file.close();
184
185  file.open((path+"icvariable_attr.cpp").c_str());
186  variable.generateCInterface(file);
187  file.close();
188
189  file.open((path+"ivariable_attr.F90").c_str());
190  variable.generateFortranInterface(file);
191  file.close();
192
193  file.open((path+"variablegroup_interface_attr.F90").c_str());
194  variablegroup.generateFortran2003Interface(file);
195  file.close();
196
197  file.open((path+"icvariablegroup_attr.cpp").c_str());
198  variablegroup.generateCInterface(file);
199  file.close();
200
201  file.open((path+"ivariablegroup_attr.F90").c_str());
202  variablegroup.generateFortranInterface(file);
203  file.close();
204
205
206
207  file.open((path+"file_interface_attr.F90").c_str());
208  afile.generateFortran2003Interface(file);
209  file.close();
210
211  file.open((path+"icfile_attr.cpp").c_str());
212  afile.generateCInterface(file);
213  file.close();
214
215  file.open((path+"ifile_attr.F90").c_str());
216  afile.generateFortranInterface(file);
217  file.close();
218
219  file.open((path+"filegroup_interface_attr.F90").c_str());
220  filegroup.generateFortran2003Interface(file);
221  file.close();
222
223  file.open((path+"icfilegroup_attr.cpp").c_str());
224  filegroup.generateCInterface(file);
225  file.close();
226
227  file.open((path+"ifilegroup_attr.F90").c_str());
228  filegroup.generateFortranInterface(file);
229  file.close();
230
231
232  file.open((path+"calendar_wrapper_interface_attr.F90").c_str());
233  calendarWrapper.generateFortran2003Interface(file);
234  file.close();
235
236  file.open((path+"iccalendar_wrapper_attr.cpp").c_str());
237  calendarWrapper.generateCInterface(file);
238  file.close();
239
240  file.open((path+"icalendar_wrapper_attr.F90").c_str());
241  calendarWrapper.generateFortranInterface(file);
242  file.close();
243
244  /*!
245    Domain transformations
246  */
247  file.open((path+"zoom_domain_interface_attr.F90").c_str());
248  zoomDomain.generateFortran2003Interface(file);
249  file.close();
250
251  file.open((path+"iczoom_domain_attr.cpp").c_str());
252  zoomDomain.generateCInterface(file);
253  file.close();
254
255  file.open((path+"izoom_domain_attr.F90").c_str());
256  zoomDomain.generateFortranInterface(file);
257  file.close();
258
259  file.open((path+"interpolate_domain_interface_attr.F90").c_str());
260  interpolateDomain.generateFortran2003Interface(file);
261  file.close();
262
263  file.open((path+"icinterpolate_domain_attr.cpp").c_str());
264  interpolateDomain.generateCInterface(file);
265  file.close();
266
267  file.open((path+"iinterpolate_domain_attr.F90").c_str());
268  interpolateDomain.generateFortranInterface(file);
269  file.close();
270
271  file.open((path+"generate_rectilinear_domain_interface_attr.F90").c_str());
272  genDomain.generateFortran2003Interface(file);
273  file.close();
274
275  file.open((path+"icgenerate_rectilinear_domain_attr.cpp").c_str());
276  genDomain.generateCInterface(file);
277  file.close();
278
279  file.open((path+"igenerate_rectilinear_domain_attr.F90").c_str());
280  genDomain.generateFortranInterface(file);
281  file.close();
282
283  file.open((path+"compute_connectivity_domain_interface_attr.F90").c_str());
284  compConDomain.generateFortran2003Interface(file);
285  file.close();
286
287  file.open((path+"iccompute_connectivity_domain_attr.cpp").c_str());
288  compConDomain.generateCInterface(file);
289  file.close();
290
291  file.open((path+"icompute_connectivity_domain_attr.F90").c_str());
292  compConDomain.generateFortranInterface(file);
293  file.close();
294
295  file.open((path+"expand_domain_interface_attr.F90").c_str());
296  expandDomain.generateFortran2003Interface(file);
297  file.close();
298
299  file.open((path+"icexpand_domain_attr.cpp").c_str());
300  expandDomain.generateCInterface(file);
301  file.close();
302
303  file.open((path+"iexpand_domain_attr.F90").c_str());
304  expandDomain.generateFortranInterface(file);
305  file.close();
306
307  file.open((path+"reorder_domain_interface_attr.F90").c_str());
308  reorderDomain.generateFortran2003Interface(file);
309  file.close();
310
311  file.open((path+"icreorder_domain_attr.cpp").c_str());
312  reorderDomain.generateCInterface(file);
313  file.close();
314
315  file.open((path+"ireorder_domain_attr.F90").c_str());
316  reorderDomain.generateFortranInterface(file);
317
318  file.open((path+"extract_domain_interface_attr.F90").c_str());
319  extractDomain.generateFortran2003Interface(file);
320  file.close();
321
322  file.open((path+"icextract_domain_attr.cpp").c_str());
323  extractDomain.generateCInterface(file);
324  file.close();
325
326  file.open((path+"iextract_domain_attr.F90").c_str());
327  extractDomain.generateFortranInterface(file);
328
329  file.close();
330 
331  /*!
332    Axis transformations
333  */
334  file.open((path+"zoom_axis_interface_attr.F90").c_str());
335  zoomAxis.generateFortran2003Interface(file);
336  file.close();
337
338  file.open((path+"iczoom_axis_attr.cpp").c_str());
339  zoomAxis.generateCInterface(file);
340  file.close();
341
342  file.open((path+"izoom_axis_attr.F90").c_str());
343  zoomAxis.generateFortranInterface(file);
344  file.close();
345
346  file.open((path+"interpolate_axis_interface_attr.F90").c_str());
347  interpolateAxis.generateFortran2003Interface(file);
348  file.close();
349
350  file.open((path+"icinterpolate_axis_attr.cpp").c_str());
351  interpolateAxis.generateCInterface(file);
352  file.close();
353
354  file.open((path+"iinterpolate_axis_attr.F90").c_str());
355  interpolateAxis.generateFortranInterface(file);
356  file.close();
357
358  file.open((path+"inverse_axis_interface_attr.F90").c_str());
359  inverseAxis.generateFortran2003Interface(file);
360  file.close();
361
362  file.open((path+"icinverse_axis_attr.cpp").c_str());
363  inverseAxis.generateCInterface(file);
364  file.close();
365
366  file.open((path+"iinverse_axis_attr.F90").c_str());
367  inverseAxis.generateFortranInterface(file);
368  file.close();
369
370  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
371  reduceDomainToAxis.generateFortran2003Interface(file);
372  file.close();
373 
374  file.open((path+"icreduce_domain_to_axis_attr.cpp").c_str());
375  reduceDomainToAxis.generateCInterface(file);
376  file.close();
377
378  file.open((path+"ireduce_domain_to_axis_attr.F90").c_str());
379  reduceDomainToAxis.generateFortranInterface(file);
380  file.close();
381
382  file.open((path+"reduce_axis_to_axis_interface_attr.F90").c_str());
383  reduceAxisToAxis.generateFortran2003Interface(file);
384  file.close();
385 
386  file.open((path+"icreduce_axis_to_axis_attr.cpp").c_str());
387  reduceAxisToAxis.generateCInterface(file);
388  file.close();
389
390  file.open((path+"ireduce_axis_to_axis_attr.F90").c_str());
391  reduceAxisToAxis.generateFortranInterface(file);
392  file.close();
393 
394  file.open((path+"extract_domain_to_axis_interface_attr.F90").c_str());
395  extractDomainToAxis.generateFortran2003Interface(file);
396  file.close();
397
398  file.open((path+"icextract_domain_to_axis_attr.cpp").c_str());
399  extractDomainToAxis.generateCInterface(file);
400  file.close();
401
402  file.open((path+"iextract_domain_to_axis_attr.F90").c_str());
403  extractDomainToAxis.generateFortranInterface(file);
404  file.close();
405
406
407  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
408  temporalSplitting.generateFortran2003Interface(file);
409  file.close();
410
411  file.open((path+"ictemporal_splitting_attr.cpp").c_str());
412  temporalSplitting.generateCInterface(file);
413  file.close();
414
415  file.open((path+"itemporal_splitting_attr.F90").c_str());
416  temporalSplitting.generateFortranInterface(file);
417  file.close();
418
419
420  file.open((path+"duplicate_scalar_to_axis_interface_attr.F90").c_str());
421  duplicateScalarToAxis.generateFortran2003Interface(file);
422  file.close();
423 
424  file.open((path+"icduplicate_scalar_to_axis_attr.cpp").c_str());
425  duplicateScalarToAxis.generateCInterface(file);
426  file.close();
427 
428  file.open((path+"iduplicate_scalar_to_axis_attr.F90").c_str());
429  duplicateScalarToAxis.generateFortranInterface(file);
430  file.close();
431  /*!
432    Scalar transformations
433  */
434  file.open((path+"reduce_axis_to_scalar_interface_attr.F90").c_str());
435  reduceAxisToScalar.generateFortran2003Interface(file);
436  file.close();
437
438  file.open((path+"icreduce_axis_to_scalar_attr.cpp").c_str());
439  reduceAxisToScalar.generateCInterface(file);
440  file.close();
441
442  file.open((path+"ireduce_axis_to_scalar_attr.F90").c_str());
443  reduceAxisToScalar.generateFortranInterface(file);
444  file.close();
445
446  file.open((path+"extract_axis_to_scalar_interface_attr.F90").c_str());
447  extractAxisToScalar.generateFortran2003Interface(file);
448  file.close();
449
450  file.open((path+"icextract_axis_to_scalar_attr.cpp").c_str());
451  extractAxisToScalar.generateCInterface(file);
452  file.close();
453
454  file.open((path+"iextract_axis_to_scalar_attr.F90").c_str());
455  extractAxisToScalar.generateFortranInterface(file);
456  file.close();
457
458
459  file.open((path+"reduce_domain_to_scalar_interface_attr.F90").c_str());
460  reduceDomainToScalar.generateFortran2003Interface(file);
461  file.close();
462
463  file.open((path+"icreduce_domain_to_scalar_attr.cpp").c_str());
464  reduceDomainToScalar.generateCInterface(file);
465  file.close();
466
467  file.open((path+"ireduce_domain_to_scalar_attr.F90").c_str());
468  reduceDomainToScalar.generateFortranInterface(file);
469  file.close();
470
471
472  file.open((path+"reduce_scalar_to_scalar_interface_attr.F90").c_str());
473  reduceScalarToScalar.generateFortran2003Interface(file);
474  file.close();
475
476  file.open((path+"icreduce_scalar_to_scalar_attr.cpp").c_str());
477  reduceScalarToScalar.generateCInterface(file);
478  file.close();
479
480  file.open((path+"ireduce_scalar_to_scalar_attr.F90").c_str());
481  reduceScalarToScalar.generateFortranInterface(file);
482  file.close();
483
484
485
486
487
488  file.open((path+"context_interface_attr.F90").c_str());
489  context->generateFortran2003Interface(file);
490  file.close();
491
492  file.open((path+"iccontext_attr.cpp").c_str());
493  context->generateCInterface(file);
494  file.close();
495
496  file.open((path+"icontext_attr.F90").c_str());
497  context->generateFortranInterface(file);
498  file.close();
499}
Note: See TracBrowser for help on using the repository browser.