source: XIOS/dev/branch_openmp/src/generate_fortran_interface.cpp @ 1460

Last change on this file since 1460 was 1460, checked in by yushan, 6 years ago

branch_openmp merged with XIOS_DEV_CMIP6@1459

  • 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.7 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;
[1460]37  CReorderDomain reorderDomain;
[784]38
[786]39  CInterpolateAxis interpolateAxis;
[891]40  CZoomAxis zoomAxis;
[786]41  CInverseAxis inverseAxis;
[981]42  CReduceDomainToAxis reduceDomainToAxis;
[1460]43  CReduceAxisToAxis reduceAxisToAxis;
[981]44  CExtractDomainToAxis extractDomainToAxis;
[1460]45  CTemporalSplitting temporalSplitting;
[786]46
[891]47  CReduceAxisToScalar reduceAxisToScalar;
[981]48  CExtractAxisToScalar extractAxisToScalar;
49  CReduceDomainToScalar reduceDomainToScalar;
[1460]50  CDuplicateScalarToAxis duplicateScalarToAxis;
51  CReduceScalarToScalar reduceScalarToScalar;
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);
[1460]304
305  file.open((path+"reorder_domain_interface_attr.F90").c_str());
306  reorderDomain.generateFortran2003Interface(file);
[981]307  file.close();
[1460]308
309  file.open((path+"icreorder_domain_attr.cpp").c_str());
310  reorderDomain.generateCInterface(file);
311  file.close();
312
313  file.open((path+"ireorder_domain_attr.F90").c_str());
314  reorderDomain.generateFortranInterface(file);
315
316  file.close();
[981]317 
318  /*!
319    Axis transformations
320  */
321  file.open((path+"zoom_axis_interface_attr.F90").c_str());
322  zoomAxis.generateFortran2003Interface(file);
323  file.close();
[934]324
[981]325  file.open((path+"iczoom_axis_attr.cpp").c_str());
326  zoomAxis.generateCInterface(file);
327  file.close();
328
329  file.open((path+"izoom_axis_attr.F90").c_str());
330  zoomAxis.generateFortranInterface(file);
331  file.close();
332
333  file.open((path+"interpolate_axis_interface_attr.F90").c_str());
334  interpolateAxis.generateFortran2003Interface(file);
335  file.close();
336
337  file.open((path+"icinterpolate_axis_attr.cpp").c_str());
338  interpolateAxis.generateCInterface(file);
339  file.close();
340
341  file.open((path+"iinterpolate_axis_attr.F90").c_str());
342  interpolateAxis.generateFortranInterface(file);
343  file.close();
344
[786]345  file.open((path+"inverse_axis_interface_attr.F90").c_str());
346  inverseAxis.generateFortran2003Interface(file);
347  file.close();
348
349  file.open((path+"icinverse_axis_attr.cpp").c_str());
350  inverseAxis.generateCInterface(file);
351  file.close();
352
353  file.open((path+"iinverse_axis_attr.F90").c_str());
354  inverseAxis.generateFortranInterface(file);
355  file.close();
356
[981]357  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
358  reduceDomainToAxis.generateFortran2003Interface(file);
359  file.close();
[1460]360 
[981]361  file.open((path+"icreduce_domain_to_axis_attr.cpp").c_str());
362  reduceDomainToAxis.generateCInterface(file);
363  file.close();
364
365  file.open((path+"ireduce_domain_to_axis_attr.F90").c_str());
366  reduceDomainToAxis.generateFortranInterface(file);
367  file.close();
[1460]368
369  file.open((path+"reduce_axis_to_axis_interface_attr.F90").c_str());
370  reduceAxisToAxis.generateFortran2003Interface(file);
371  file.close();
372 
373  file.open((path+"icreduce_axis_to_axis_attr.cpp").c_str());
374  reduceAxisToAxis.generateCInterface(file);
375  file.close();
376
377  file.open((path+"ireduce_axis_to_axis_attr.F90").c_str());
378  reduceAxisToAxis.generateFortranInterface(file);
379  file.close();
[981]380 
381  file.open((path+"extract_domain_to_axis_interface_attr.F90").c_str());
382  extractDomainToAxis.generateFortran2003Interface(file);
383  file.close();
384
385  file.open((path+"icextract_domain_to_axis_attr.cpp").c_str());
386  extractDomainToAxis.generateCInterface(file);
387  file.close();
388
389  file.open((path+"iextract_domain_to_axis_attr.F90").c_str());
390  extractDomainToAxis.generateFortranInterface(file);
391  file.close();
392
393
[1460]394  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
395  temporalSplitting.generateFortran2003Interface(file);
396  file.close();
397
398  file.open((path+"ictemporal_splitting_attr.cpp").c_str());
399  temporalSplitting.generateCInterface(file);
400  file.close();
401
402  file.open((path+"itemporal_splitting_attr.F90").c_str());
403  temporalSplitting.generateFortranInterface(file);
404  file.close();
405
406
407  file.open((path+"duplicate_scalar_to_axis_interface_attr.F90").c_str());
408  duplicateScalarToAxis.generateFortran2003Interface(file);
409  file.close();
410 
411  file.open((path+"icduplicate_scalar_to_axis_attr.cpp").c_str());
412  duplicateScalarToAxis.generateCInterface(file);
413  file.close();
414 
415  file.open((path+"iduplicate_scalar_to_axis_attr.F90").c_str());
416  duplicateScalarToAxis.generateFortranInterface(file);
417  file.close();
[981]418  /*!
419    Scalar transformations
420  */
[891]421  file.open((path+"reduce_axis_to_scalar_interface_attr.F90").c_str());
422  reduceAxisToScalar.generateFortran2003Interface(file);
423  file.close();
424
425  file.open((path+"icreduce_axis_to_scalar_attr.cpp").c_str());
426  reduceAxisToScalar.generateCInterface(file);
427  file.close();
428
429  file.open((path+"ireduce_axis_to_scalar_attr.F90").c_str());
430  reduceAxisToScalar.generateFortranInterface(file);
431  file.close();
432
[981]433  file.open((path+"extract_axis_to_scalar_interface_attr.F90").c_str());
434  extractAxisToScalar.generateFortran2003Interface(file);
435  file.close();
436
437  file.open((path+"icextract_axis_to_scalar_attr.cpp").c_str());
438  extractAxisToScalar.generateCInterface(file);
439  file.close();
440
441  file.open((path+"iextract_axis_to_scalar_attr.F90").c_str());
442  extractAxisToScalar.generateFortranInterface(file);
443  file.close();
444
[1460]445
[981]446  file.open((path+"reduce_domain_to_scalar_interface_attr.F90").c_str());
447  reduceDomainToScalar.generateFortran2003Interface(file);
448  file.close();
449
450  file.open((path+"icreduce_domain_to_scalar_attr.cpp").c_str());
451  reduceDomainToScalar.generateCInterface(file);
452  file.close();
453
454  file.open((path+"ireduce_domain_to_scalar_attr.F90").c_str());
455  reduceDomainToScalar.generateFortranInterface(file);
456  file.close();
457
[1460]458
459  file.open((path+"reduce_scalar_to_scalar_interface_attr.F90").c_str());
460  reduceScalarToScalar.generateFortran2003Interface(file);
461  file.close();
462
463  file.open((path+"icreduce_scalar_to_scalar_attr.cpp").c_str());
464  reduceScalarToScalar.generateCInterface(file);
465  file.close();
466
467  file.open((path+"ireduce_scalar_to_scalar_attr.F90").c_str());
468  reduceScalarToScalar.generateFortranInterface(file);
469  file.close();
470
471
472
473
474
[549]475  file.open((path+"context_interface_attr.F90").c_str());
476  context->generateFortran2003Interface(file);
477  file.close();
478
479  file.open((path+"iccontext_attr.cpp").c_str());
480  context->generateCInterface(file);
481  file.close();
482
483  file.open((path+"icontext_attr.F90").c_str());
484  context->generateFortranInterface(file);
485  file.close();
[313]486}
Note: See TracBrowser for help on using the repository browser.