[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 | |
---|
| 9 | int 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; |
---|
[784] | 37 | |
---|
[786] | 38 | CInterpolateAxis interpolateAxis; |
---|
[891] | 39 | CZoomAxis zoomAxis; |
---|
[786] | 40 | CInverseAxis inverseAxis; |
---|
[981] | 41 | CReduceDomainToAxis reduceDomainToAxis; |
---|
| 42 | CExtractDomainToAxis extractDomainToAxis; |
---|
[786] | 43 | |
---|
[891] | 44 | CReduceAxisToScalar reduceAxisToScalar; |
---|
[981] | 45 | CExtractAxisToScalar extractAxisToScalar; |
---|
| 46 | CReduceDomainToScalar reduceDomainToScalar; |
---|
[891] | 47 | |
---|
[549] | 48 | ostringstream oss; |
---|
[313] | 49 | ofstream file; |
---|
[549] | 50 | |
---|
[891] | 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 | |
---|
[549] | 75 | file.open((path+"axis_interface_attr.F90").c_str()); |
---|
| 76 | axis.generateFortran2003Interface(file); |
---|
[313] | 77 | file.close(); |
---|
[549] | 78 | |
---|
| 79 | file.open((path+"icaxis_attr.cpp").c_str()); |
---|
| 80 | axis.generateCInterface(file); |
---|
[313] | 81 | file.close(); |
---|
[549] | 82 | |
---|
| 83 | file.open((path+"iaxis_attr.F90").c_str()); |
---|
| 84 | axis.generateFortranInterface(file); |
---|
[313] | 85 | file.close(); |
---|
[549] | 86 | |
---|
| 87 | file.open((path+"axisgroup_interface_attr.F90").c_str()); |
---|
| 88 | axisgroup.generateFortran2003Interface(file); |
---|
[313] | 89 | file.close(); |
---|
[549] | 90 | |
---|
| 91 | file.open((path+"icaxisgroup_attr.cpp").c_str()); |
---|
| 92 | axisgroup.generateCInterface(file); |
---|
[313] | 93 | file.close(); |
---|
[549] | 94 | |
---|
| 95 | file.open((path+"iaxisgroup_attr.F90").c_str()); |
---|
| 96 | axisgroup.generateFortranInterface(file); |
---|
[313] | 97 | file.close(); |
---|
[549] | 98 | |
---|
| 99 | file.open((path+"domain_interface_attr.F90").c_str()); |
---|
| 100 | domain.generateFortran2003Interface(file); |
---|
[313] | 101 | file.close(); |
---|
[549] | 102 | |
---|
| 103 | file.open((path+"icdomain_attr.cpp").c_str()); |
---|
| 104 | domain.generateCInterface(file); |
---|
[313] | 105 | file.close(); |
---|
[549] | 106 | |
---|
| 107 | file.open((path+"idomain_attr.F90").c_str()); |
---|
| 108 | domain.generateFortranInterface(file); |
---|
[313] | 109 | file.close(); |
---|
[549] | 110 | |
---|
| 111 | file.open((path+"domaingroup_interface_attr.F90").c_str()); |
---|
| 112 | domaingroup.generateFortran2003Interface(file); |
---|
[313] | 113 | file.close(); |
---|
[549] | 114 | |
---|
| 115 | file.open((path+"icdomaingroup_attr.cpp").c_str()); |
---|
| 116 | domaingroup.generateCInterface(file); |
---|
[313] | 117 | file.close(); |
---|
[549] | 118 | |
---|
| 119 | file.open((path+"idomaingroup_attr.F90").c_str()); |
---|
| 120 | domaingroup.generateFortranInterface(file); |
---|
[313] | 121 | file.close(); |
---|
[549] | 122 | |
---|
| 123 | |
---|
| 124 | file.open((path+"grid_interface_attr.F90").c_str()); |
---|
| 125 | grid.generateFortran2003Interface(file); |
---|
[313] | 126 | file.close(); |
---|
[549] | 127 | |
---|
| 128 | file.open((path+"icgrid_attr.cpp").c_str()); |
---|
| 129 | grid.generateCInterface(file); |
---|
[313] | 130 | file.close(); |
---|
[549] | 131 | |
---|
| 132 | file.open((path+"igrid_attr.F90").c_str()); |
---|
| 133 | grid.generateFortranInterface(file); |
---|
[313] | 134 | file.close(); |
---|
[549] | 135 | |
---|
| 136 | file.open((path+"gridgroup_interface_attr.F90").c_str()); |
---|
| 137 | gridgroup.generateFortran2003Interface(file); |
---|
[313] | 138 | file.close(); |
---|
[549] | 139 | |
---|
| 140 | file.open((path+"icgridgroup_attr.cpp").c_str()); |
---|
| 141 | gridgroup.generateCInterface(file); |
---|
[313] | 142 | file.close(); |
---|
[549] | 143 | |
---|
| 144 | file.open((path+"igridgroup_attr.F90").c_str()); |
---|
| 145 | gridgroup.generateFortranInterface(file); |
---|
[313] | 146 | file.close(); |
---|
[549] | 147 | |
---|
| 148 | |
---|
| 149 | file.open((path+"field_interface_attr.F90").c_str()); |
---|
| 150 | field.generateFortran2003Interface(file); |
---|
[313] | 151 | file.close(); |
---|
[549] | 152 | |
---|
| 153 | file.open((path+"icfield_attr.cpp").c_str()); |
---|
| 154 | field.generateCInterface(file); |
---|
[313] | 155 | file.close(); |
---|
[549] | 156 | |
---|
| 157 | file.open((path+"ifield_attr.F90").c_str()); |
---|
| 158 | field.generateFortranInterface(file); |
---|
[313] | 159 | file.close(); |
---|
[549] | 160 | |
---|
| 161 | file.open((path+"fieldgroup_interface_attr.F90").c_str()); |
---|
| 162 | fieldgroup.generateFortran2003Interface(file); |
---|
[313] | 163 | file.close(); |
---|
[549] | 164 | |
---|
| 165 | file.open((path+"icfieldgroup_attr.cpp").c_str()); |
---|
| 166 | fieldgroup.generateCInterface(file); |
---|
[313] | 167 | file.close(); |
---|
[549] | 168 | |
---|
| 169 | file.open((path+"ifieldgroup_attr.F90").c_str()); |
---|
| 170 | fieldgroup.generateFortranInterface(file); |
---|
[313] | 171 | file.close(); |
---|
| 172 | |
---|
| 173 | |
---|
[549] | 174 | |
---|
| 175 | file.open((path+"variable_interface_attr.F90").c_str()); |
---|
| 176 | variable.generateFortran2003Interface(file); |
---|
[472] | 177 | file.close(); |
---|
[549] | 178 | |
---|
| 179 | file.open((path+"icvariable_attr.cpp").c_str()); |
---|
| 180 | variable.generateCInterface(file); |
---|
[472] | 181 | file.close(); |
---|
[549] | 182 | |
---|
| 183 | file.open((path+"ivariable_attr.F90").c_str()); |
---|
| 184 | variable.generateFortranInterface(file); |
---|
[472] | 185 | file.close(); |
---|
[549] | 186 | |
---|
| 187 | file.open((path+"variablegroup_interface_attr.F90").c_str()); |
---|
| 188 | variablegroup.generateFortran2003Interface(file); |
---|
[472] | 189 | file.close(); |
---|
[549] | 190 | |
---|
| 191 | file.open((path+"icvariablegroup_attr.cpp").c_str()); |
---|
| 192 | variablegroup.generateCInterface(file); |
---|
[472] | 193 | file.close(); |
---|
[549] | 194 | |
---|
| 195 | file.open((path+"ivariablegroup_attr.F90").c_str()); |
---|
| 196 | variablegroup.generateFortranInterface(file); |
---|
[472] | 197 | file.close(); |
---|
| 198 | |
---|
| 199 | |
---|
| 200 | |
---|
[549] | 201 | file.open((path+"file_interface_attr.F90").c_str()); |
---|
| 202 | afile.generateFortran2003Interface(file); |
---|
[313] | 203 | file.close(); |
---|
[549] | 204 | |
---|
| 205 | file.open((path+"icfile_attr.cpp").c_str()); |
---|
| 206 | afile.generateCInterface(file); |
---|
[313] | 207 | file.close(); |
---|
[549] | 208 | |
---|
| 209 | file.open((path+"ifile_attr.F90").c_str()); |
---|
| 210 | afile.generateFortranInterface(file); |
---|
[313] | 211 | file.close(); |
---|
[549] | 212 | |
---|
| 213 | file.open((path+"filegroup_interface_attr.F90").c_str()); |
---|
| 214 | filegroup.generateFortran2003Interface(file); |
---|
[313] | 215 | file.close(); |
---|
[549] | 216 | |
---|
| 217 | file.open((path+"icfilegroup_attr.cpp").c_str()); |
---|
| 218 | filegroup.generateCInterface(file); |
---|
[313] | 219 | file.close(); |
---|
[549] | 220 | |
---|
| 221 | file.open((path+"ifilegroup_attr.F90").c_str()); |
---|
| 222 | filegroup.generateFortranInterface(file); |
---|
[313] | 223 | file.close(); |
---|
[549] | 224 | |
---|
| 225 | |
---|
| 226 | file.open((path+"calendar_wrapper_interface_attr.F90").c_str()); |
---|
| 227 | calendarWrapper.generateFortran2003Interface(file); |
---|
[313] | 228 | file.close(); |
---|
[549] | 229 | |
---|
| 230 | file.open((path+"iccalendar_wrapper_attr.cpp").c_str()); |
---|
| 231 | calendarWrapper.generateCInterface(file); |
---|
[313] | 232 | file.close(); |
---|
[549] | 233 | |
---|
| 234 | file.open((path+"icalendar_wrapper_attr.F90").c_str()); |
---|
| 235 | calendarWrapper.generateFortranInterface(file); |
---|
[313] | 236 | file.close(); |
---|
[549] | 237 | |
---|
[981] | 238 | /*! |
---|
| 239 | Domain transformations |
---|
| 240 | */ |
---|
[784] | 241 | file.open((path+"zoom_domain_interface_attr.F90").c_str()); |
---|
| 242 | zoomDomain.generateFortran2003Interface(file); |
---|
| 243 | file.close(); |
---|
[549] | 244 | |
---|
[784] | 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 | |
---|
[786] | 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 | |
---|
[934] | 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 | |
---|
[981] | 289 | file.open((path+"expand_domain_interface_attr.F90").c_str()); |
---|
| 290 | expandDomain.generateFortran2003Interface(file); |
---|
| 291 | file.close(); |
---|
[934] | 292 | |
---|
[981] | 293 | file.open((path+"icexpand_domain_attr.cpp").c_str()); |
---|
| 294 | expandDomain.generateCInterface(file); |
---|
| 295 | file.close(); |
---|
[934] | 296 | |
---|
[981] | 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(); |
---|
[934] | 307 | |
---|
[981] | 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 | |
---|
[786] | 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 | |
---|
[981] | 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 | */ |
---|
[891] | 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 | |
---|
[981] | 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 | |
---|
[549] | 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(); |
---|
[313] | 415 | } |
---|