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

Last change on this file since 1460 was 1460, checked in by yushan, 3 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
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  CReorderDomain reorderDomain;
38
39  CInterpolateAxis interpolateAxis;
40  CZoomAxis zoomAxis;
41  CInverseAxis inverseAxis;
42  CReduceDomainToAxis reduceDomainToAxis;
43  CReduceAxisToAxis reduceAxisToAxis;
44  CExtractDomainToAxis extractDomainToAxis;
45  CTemporalSplitting temporalSplitting;
46
47  CReduceAxisToScalar reduceAxisToScalar;
48  CExtractAxisToScalar extractAxisToScalar;
49  CReduceDomainToScalar reduceDomainToScalar;
50  CDuplicateScalarToAxis duplicateScalarToAxis;
51  CReduceScalarToScalar reduceScalarToScalar;
52 
53  ostringstream oss;
54  ofstream file;
55
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
80  file.open((path+"axis_interface_attr.F90").c_str());
81  axis.generateFortran2003Interface(file);
82  file.close();
83
84  file.open((path+"icaxis_attr.cpp").c_str());
85  axis.generateCInterface(file);
86  file.close();
87
88  file.open((path+"iaxis_attr.F90").c_str());
89  axis.generateFortranInterface(file);
90  file.close();
91
92  file.open((path+"axisgroup_interface_attr.F90").c_str());
93  axisgroup.generateFortran2003Interface(file);
94  file.close();
95
96  file.open((path+"icaxisgroup_attr.cpp").c_str());
97  axisgroup.generateCInterface(file);
98  file.close();
99
100  file.open((path+"iaxisgroup_attr.F90").c_str());
101  axisgroup.generateFortranInterface(file);
102  file.close();
103
104  file.open((path+"domain_interface_attr.F90").c_str());
105  domain.generateFortran2003Interface(file);
106  file.close();
107
108  file.open((path+"icdomain_attr.cpp").c_str());
109  domain.generateCInterface(file);
110  file.close();
111
112  file.open((path+"idomain_attr.F90").c_str());
113  domain.generateFortranInterface(file);
114  file.close();
115
116  file.open((path+"domaingroup_interface_attr.F90").c_str());
117  domaingroup.generateFortran2003Interface(file);
118  file.close();
119
120  file.open((path+"icdomaingroup_attr.cpp").c_str());
121  domaingroup.generateCInterface(file);
122  file.close();
123
124  file.open((path+"idomaingroup_attr.F90").c_str());
125  domaingroup.generateFortranInterface(file);
126  file.close();
127
128
129  file.open((path+"grid_interface_attr.F90").c_str());
130  grid.generateFortran2003Interface(file);
131  file.close();
132
133  file.open((path+"icgrid_attr.cpp").c_str());
134  grid.generateCInterface(file);
135  file.close();
136
137  file.open((path+"igrid_attr.F90").c_str());
138  grid.generateFortranInterface(file);
139  file.close();
140
141  file.open((path+"gridgroup_interface_attr.F90").c_str());
142  gridgroup.generateFortran2003Interface(file);
143  file.close();
144
145  file.open((path+"icgridgroup_attr.cpp").c_str());
146  gridgroup.generateCInterface(file);
147  file.close();
148
149  file.open((path+"igridgroup_attr.F90").c_str());
150  gridgroup.generateFortranInterface(file);
151  file.close();
152
153
154  file.open((path+"field_interface_attr.F90").c_str());
155  field.generateFortran2003Interface(file);
156  file.close();
157
158  file.open((path+"icfield_attr.cpp").c_str());
159  field.generateCInterface(file);
160  file.close();
161
162  file.open((path+"ifield_attr.F90").c_str());
163  field.generateFortranInterface(file);
164  file.close();
165
166  file.open((path+"fieldgroup_interface_attr.F90").c_str());
167  fieldgroup.generateFortran2003Interface(file);
168  file.close();
169
170  file.open((path+"icfieldgroup_attr.cpp").c_str());
171  fieldgroup.generateCInterface(file);
172  file.close();
173
174  file.open((path+"ifieldgroup_attr.F90").c_str());
175  fieldgroup.generateFortranInterface(file);
176  file.close();
177
178
179
180  file.open((path+"variable_interface_attr.F90").c_str());
181  variable.generateFortran2003Interface(file);
182  file.close();
183
184  file.open((path+"icvariable_attr.cpp").c_str());
185  variable.generateCInterface(file);
186  file.close();
187
188  file.open((path+"ivariable_attr.F90").c_str());
189  variable.generateFortranInterface(file);
190  file.close();
191
192  file.open((path+"variablegroup_interface_attr.F90").c_str());
193  variablegroup.generateFortran2003Interface(file);
194  file.close();
195
196  file.open((path+"icvariablegroup_attr.cpp").c_str());
197  variablegroup.generateCInterface(file);
198  file.close();
199
200  file.open((path+"ivariablegroup_attr.F90").c_str());
201  variablegroup.generateFortranInterface(file);
202  file.close();
203
204
205
206  file.open((path+"file_interface_attr.F90").c_str());
207  afile.generateFortran2003Interface(file);
208  file.close();
209
210  file.open((path+"icfile_attr.cpp").c_str());
211  afile.generateCInterface(file);
212  file.close();
213
214  file.open((path+"ifile_attr.F90").c_str());
215  afile.generateFortranInterface(file);
216  file.close();
217
218  file.open((path+"filegroup_interface_attr.F90").c_str());
219  filegroup.generateFortran2003Interface(file);
220  file.close();
221
222  file.open((path+"icfilegroup_attr.cpp").c_str());
223  filegroup.generateCInterface(file);
224  file.close();
225
226  file.open((path+"ifilegroup_attr.F90").c_str());
227  filegroup.generateFortranInterface(file);
228  file.close();
229
230
231  file.open((path+"calendar_wrapper_interface_attr.F90").c_str());
232  calendarWrapper.generateFortran2003Interface(file);
233  file.close();
234
235  file.open((path+"iccalendar_wrapper_attr.cpp").c_str());
236  calendarWrapper.generateCInterface(file);
237  file.close();
238
239  file.open((path+"icalendar_wrapper_attr.F90").c_str());
240  calendarWrapper.generateFortranInterface(file);
241  file.close();
242
243  /*!
244    Domain transformations
245  */
246  file.open((path+"zoom_domain_interface_attr.F90").c_str());
247  zoomDomain.generateFortran2003Interface(file);
248  file.close();
249
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
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
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
294  file.open((path+"expand_domain_interface_attr.F90").c_str());
295  expandDomain.generateFortran2003Interface(file);
296  file.close();
297
298  file.open((path+"icexpand_domain_attr.cpp").c_str());
299  expandDomain.generateCInterface(file);
300  file.close();
301
302  file.open((path+"iexpand_domain_attr.F90").c_str());
303  expandDomain.generateFortranInterface(file);
304
305  file.open((path+"reorder_domain_interface_attr.F90").c_str());
306  reorderDomain.generateFortran2003Interface(file);
307  file.close();
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();
317 
318  /*!
319    Axis transformations
320  */
321  file.open((path+"zoom_axis_interface_attr.F90").c_str());
322  zoomAxis.generateFortran2003Interface(file);
323  file.close();
324
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
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
357  file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str());
358  reduceDomainToAxis.generateFortran2003Interface(file);
359  file.close();
360 
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();
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();
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
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();
418  /*!
419    Scalar transformations
420  */
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
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
445
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
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
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();
486}
Note: See TracBrowser for help on using the repository browser.