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, 7 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
RevLine 
[591]1#include "xios.hpp"
[352]2#include "generate_interface.hpp"
[313]3#include "indent.hpp"
[352]4#include "attribute_template.hpp"
5#include "object_template.hpp"
6#include "group_template.hpp"
[786]7#include "node_type.hpp"
[313]8
9int main (int argc, char ** argv, char ** UNUSED (env))
10{
[549]11//  string path="./src/attr_interface/";
12  string path="./interface/";
13
14  CContext* context=CContext::create("interface");
15  CCalendarWrapper calendarWrapper;
[891]16  CScalar scalar;
17  CScalarGroup scalargroup;
[549]18  CAxis axis;
19  CAxisGroup axisgroup;
[313]20  CField field;
[549]21  CFieldGroup fieldgroup;
[472]22  CVariable variable;
[549]23  CVariableGroup variablegroup;
24  CDomain domain;
25  CDomainGroup domaingroup;
26  CGrid grid;
27  CGridGroup gridgroup;
28
[313]29  CFile afile;
30  CFileGroup filegroup;
[549]31
[891]32  CInterpolateDomain interpolateDomain;
[784]33  CZoomDomain zoomDomain;
[891]34  CGenerateRectilinearDomain genDomain;
[934]35  CComputeConnectivityDomain compConDomain;
[981]36  CExpandDomain expandDomain;
[784]37
[786]38  CInterpolateAxis interpolateAxis;
[891]39  CZoomAxis zoomAxis;
[786]40  CInverseAxis inverseAxis;
[981]41  CReduceDomainToAxis reduceDomainToAxis;
[1301]42  CReduceAxisToAxis reduceAxisToAxis;
[981]43  CExtractDomainToAxis extractDomainToAxis;
[1275]44  CTemporalSplitting temporalSplitting;
[786]45
[891]46  CReduceAxisToScalar reduceAxisToScalar;
[981]47  CExtractAxisToScalar extractAxisToScalar;
48  CReduceDomainToScalar reduceDomainToScalar;
[1275]49 
[549]50  ostringstream oss;
[313]51  ofstream file;
[549]52
[891]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
[549]77  file.open((path+"axis_interface_attr.F90").c_str());
78  axis.generateFortran2003Interface(file);
[313]79  file.close();
[549]80
81  file.open((path+"icaxis_attr.cpp").c_str());
82  axis.generateCInterface(file);
[313]83  file.close();
[549]84
85  file.open((path+"iaxis_attr.F90").c_str());
86  axis.generateFortranInterface(file);
[313]87  file.close();
[549]88
89  file.open((path+"axisgroup_interface_attr.F90").c_str());
90  axisgroup.generateFortran2003Interface(file);
[313]91  file.close();
[549]92
93  file.open((path+"icaxisgroup_attr.cpp").c_str());
94  axisgroup.generateCInterface(file);
[313]95  file.close();
[549]96
97  file.open((path+"iaxisgroup_attr.F90").c_str());
98  axisgroup.generateFortranInterface(file);
[313]99  file.close();
[549]100
101  file.open((path+"domain_interface_attr.F90").c_str());
102  domain.generateFortran2003Interface(file);
[313]103  file.close();
[549]104
105  file.open((path+"icdomain_attr.cpp").c_str());
106  domain.generateCInterface(file);
[313]107  file.close();
[549]108
109  file.open((path+"idomain_attr.F90").c_str());
110  domain.generateFortranInterface(file);
[313]111  file.close();
[549]112
113  file.open((path+"domaingroup_interface_attr.F90").c_str());
114  domaingroup.generateFortran2003Interface(file);
[313]115  file.close();
[549]116
117  file.open((path+"icdomaingroup_attr.cpp").c_str());
118  domaingroup.generateCInterface(file);
[313]119  file.close();
[549]120
121  file.open((path+"idomaingroup_attr.F90").c_str());
122  domaingroup.generateFortranInterface(file);
[313]123  file.close();
[549]124
125
126  file.open((path+"grid_interface_attr.F90").c_str());
127  grid.generateFortran2003Interface(file);
[313]128  file.close();
[549]129
130  file.open((path+"icgrid_attr.cpp").c_str());
131  grid.generateCInterface(file);
[313]132  file.close();
[549]133
134  file.open((path+"igrid_attr.F90").c_str());
135  grid.generateFortranInterface(file);
[313]136  file.close();
[549]137
138  file.open((path+"gridgroup_interface_attr.F90").c_str());
139  gridgroup.generateFortran2003Interface(file);
[313]140  file.close();
[549]141
142  file.open((path+"icgridgroup_attr.cpp").c_str());
143  gridgroup.generateCInterface(file);
[313]144  file.close();
[549]145
146  file.open((path+"igridgroup_attr.F90").c_str());
147  gridgroup.generateFortranInterface(file);
[313]148  file.close();
[549]149
150
151  file.open((path+"field_interface_attr.F90").c_str());
152  field.generateFortran2003Interface(file);
[313]153  file.close();
[549]154
155  file.open((path+"icfield_attr.cpp").c_str());
156  field.generateCInterface(file);
[313]157  file.close();
[549]158
159  file.open((path+"ifield_attr.F90").c_str());
160  field.generateFortranInterface(file);
[313]161  file.close();
[549]162
163  file.open((path+"fieldgroup_interface_attr.F90").c_str());
164  fieldgroup.generateFortran2003Interface(file);
[313]165  file.close();
[549]166
167  file.open((path+"icfieldgroup_attr.cpp").c_str());
168  fieldgroup.generateCInterface(file);
[313]169  file.close();
[549]170
171  file.open((path+"ifieldgroup_attr.F90").c_str());
172  fieldgroup.generateFortranInterface(file);
[313]173  file.close();
174
175
[549]176
177  file.open((path+"variable_interface_attr.F90").c_str());
178  variable.generateFortran2003Interface(file);
[472]179  file.close();
[549]180
181  file.open((path+"icvariable_attr.cpp").c_str());
182  variable.generateCInterface(file);
[472]183  file.close();
[549]184
185  file.open((path+"ivariable_attr.F90").c_str());
186  variable.generateFortranInterface(file);
[472]187  file.close();
[549]188
189  file.open((path+"variablegroup_interface_attr.F90").c_str());
190  variablegroup.generateFortran2003Interface(file);
[472]191  file.close();
[549]192
193  file.open((path+"icvariablegroup_attr.cpp").c_str());
194  variablegroup.generateCInterface(file);
[472]195  file.close();
[549]196
197  file.open((path+"ivariablegroup_attr.F90").c_str());
198  variablegroup.generateFortranInterface(file);
[472]199  file.close();
200
201
202
[549]203  file.open((path+"file_interface_attr.F90").c_str());
204  afile.generateFortran2003Interface(file);
[313]205  file.close();
[549]206
207  file.open((path+"icfile_attr.cpp").c_str());
208  afile.generateCInterface(file);
[313]209  file.close();
[549]210
211  file.open((path+"ifile_attr.F90").c_str());
212  afile.generateFortranInterface(file);
[313]213  file.close();
[549]214
215  file.open((path+"filegroup_interface_attr.F90").c_str());
216  filegroup.generateFortran2003Interface(file);
[313]217  file.close();
[549]218
219  file.open((path+"icfilegroup_attr.cpp").c_str());
220  filegroup.generateCInterface(file);
[313]221  file.close();
[549]222
223  file.open((path+"ifilegroup_attr.F90").c_str());
224  filegroup.generateFortranInterface(file);
[313]225  file.close();
[549]226
227
228  file.open((path+"calendar_wrapper_interface_attr.F90").c_str());
229  calendarWrapper.generateFortran2003Interface(file);
[313]230  file.close();
[549]231
232  file.open((path+"iccalendar_wrapper_attr.cpp").c_str());
233  calendarWrapper.generateCInterface(file);
[313]234  file.close();
[549]235
236  file.open((path+"icalendar_wrapper_attr.F90").c_str());
237  calendarWrapper.generateFortranInterface(file);
[313]238  file.close();
[549]239
[981]240  /*!
241    Domain transformations
242  */
[784]243  file.open((path+"zoom_domain_interface_attr.F90").c_str());
244  zoomDomain.generateFortran2003Interface(file);
245  file.close();
[549]246
[784]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
[786]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
[934]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
[981]291  file.open((path+"expand_domain_interface_attr.F90").c_str());
292  expandDomain.generateFortran2003Interface(file);
293  file.close();
[934]294
[981]295  file.open((path+"icexpand_domain_attr.cpp").c_str());
296  expandDomain.generateCInterface(file);
297  file.close();
[934]298
[981]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();
[934]309
[981]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
[786]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
[981]342  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
343  reduceDomainToAxis.generateFortran2003Interface(file);
344  file.close();
[1301]345 
346  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
347  reduceDomainToAxis.generateFortran2003Interface(file);
348  file.close();
[981]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();
[1301]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();
[981]373 
374  file.open((path+"extract_domain_to_axis_interface_attr.F90").c_str());
375  extractDomainToAxis.generateFortran2003Interface(file);
376  file.close();
377
[1275]378  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
379  temporalSplitting.generateFortran2003Interface(file);
380  file.close();
381
[981]382  file.open((path+"icextract_domain_to_axis_attr.cpp").c_str());
383  extractDomainToAxis.generateCInterface(file);
384  file.close();
385
[1275]386  file.open((path+"ictemporal_splitting_attr.cpp").c_str());
387  temporalSplitting.generateCInterface(file);
388  file.close();
389
[981]390  file.open((path+"iextract_domain_to_axis_attr.F90").c_str());
391  extractDomainToAxis.generateFortranInterface(file);
392  file.close();
393
[1275]394  file.open((path+"itemporal_splitting_attr.F90").c_str());
395  temporalSplitting.generateFortranInterface(file);
396  file.close();
[981]397
[1275]398
[981]399  /*!
400    Scalar transformations
401  */
[891]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
[981]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
[1275]430  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
431  temporalSplitting.generateFortran2003Interface(file);
432  file.close();
433
[981]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
[549]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();
[313]453}
Note: See TracBrowser for help on using the repository browser.