source: XIOS/trunk/src/data_output.cpp @ 1542

Last change on this file since 1542 was 1542, checked in by oabramkina, 2 years ago

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
  • 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
File size: 3.4 KB
Line 
1#include "data_output.hpp"
2
3#include "attribute_template.hpp"
4#include "group_template.hpp"
5#include "context.hpp"
6
7namespace xios
8{
9      /// ////////////////////// Définitions ////////////////////// ///
10
11      CDataOutput::~CDataOutput(void)
12      { /* Ne rien faire de plus */ }
13
14      //----------------------------------------------------------------
15
16      void CDataOutput::writeGrid(CGrid* grid, bool allowCompressedOutput /*= false*/)
17      {
18        this->writeGrid(grid->getDomains(), grid->getAxis(), grid->getScalars());
19
20        if (allowCompressedOutput)
21          writeGridCompressed_(grid);
22      }
23
24      //----------------------------------------------------------------
25
26      void CDataOutput::writeFile(CFile*  file)
27      {
28         this->writeFile_(file);
29      }
30
31      void CDataOutput::writeAttribute(CVariable*  var)
32      {
33         this->writeAttribute_(var) ;
34      }
35
36      void CDataOutput::syncFile(void)
37      {
38         this->syncFile_();
39      }
40
41      void CDataOutput::closeFile(void)
42      {
43         this->closeFile_();
44      }
45
46      //----------------------------------------------------------------
47
48      void CDataOutput::writeGrid(CDomain* domain, CAxis* axis)
49      {
50         this->writeDomain_(domain);
51         this->writeAxis_(axis);
52      }
53
54      void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis)
55      {
56        int domSize = domains.size();
57        int aSize = axis.size();
58        for (int i = 0; i < domSize; ++i) this->writeDomain_(domains[i]);
59        for (int i = 0; i < aSize; ++i) this->writeAxis_(axis[i]);
60      }
61
62      void CDataOutput::writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, std::vector<CScalar*> scalars)
63      {
64        int domSize = domains.size();
65        int aSize = axis.size();
66        int sSize = scalars.size();
67        for (int i = 0; i < domSize; ++i) this->writeDomain_(domains[i]);
68        for (int i = 0; i < aSize; ++i) this->writeAxis_(axis[i]);
69        for (int i = 0; i < sSize; ++i) this->writeScalar_(scalars[i]);
70      }
71
72      //----------------------------------------------------------------
73
74      void CDataOutput::writeGrid(CDomain* domain)
75      {
76         this->writeDomain_(domain);
77      }
78
79      void CDataOutput::writeTimeDimension(void)
80      {
81         this->writeTimeDimension_();
82      }
83
84      //----------------------------------------------------------------
85
86      void CDataOutput::writeFieldTimeAxis(CField* field)
87      {
88         CContext* context = CContext::getCurrent() ;
89         std::shared_ptr<CCalendar> calendar = context->getCalendar();
90
91         this->writeTimeAxis_(field, calendar);
92      }
93     
94      void CDataOutput::writeField(CField* field)
95      {
96         this->writeField_(field);
97      }
98
99      //----------------------------------------------------------------
100
101      void CDataOutput::writeFieldGrid(CField* field)
102      {
103         this->writeGrid(field->getRelGrid(),
104                         !field->indexed_output.isEmpty() && field->indexed_output);
105      }
106
107      //----------------------------------------------------------------
108
109      void CDataOutput::writeFieldData(CField* field)
110      {
111//         CGrid* grid = CGrid::get(field->grid_ref.getValue());
112//         CDomain* domain = CDomain::get(grid->domain_ref.getValue());
113         this->writeFieldData_(field);
114      }
115
116      ///----------------------------------------------------------------
117
118} // namespace xios
Note: See TracBrowser for help on using the repository browser.