source: XIOS/dev/XIOS_DEV_CMIP6/src/generate_fortran_interface.cpp @ 1301

Last change on this file since 1301 was 1301, checked in by ymipsl, 3 years ago

Add new transformation : reduce axis_to_axis
This a global reduction implying all process whih own the same source axis global point.

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