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

Last change on this file since 1314 was 1314, checked in by ymipsl, 7 years ago

Add 2 new spatial transformations :

  • reduce_scalar_to_scalar : global reduction between scalar
  • duplicate_scalar_to_axis : a scalar value is duplicated on each level of the axis.

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