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

Last change on this file since 1275 was 1275, checked in by ymipsl, 7 years ago

implement diurnal cycle transformation taken as a grid tranformation : scalar -> axis

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