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

Last change on this file since 1524 was 1492, checked in by oabramkina, 6 years ago

Updating fortran interface for attributes that have been recently introduced and the following filters:

duplicate_scalar_to_axis
reduce_axis_to_axis
reduce_scalar_to_scalar
reorder_domain
temporal_splitting.

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