source: XIOS/branchs/xios-2.0/src/generate_fortran_interface.cpp @ 1627

Last change on this file since 1627 was 981, checked in by mhnguyen, 7 years ago

Fortran interfaces:

+) Adding Fortran interfaces of transformation

Test
+) Only complilation on Curie

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