source: XIOS/dev/branch_yushan_merged/src/data_output.cpp @ 1205

Last change on this file since 1205 was 1205, checked in by yushan, 7 years ago

branch merged with trunk @1200

  • 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
RevLine 
[219]1#include "data_output.hpp"
2
[352]3#include "attribute_template.hpp"
4#include "group_template.hpp"
[219]5#include "context.hpp"
[1176]6//mpi.hpp
[335]7namespace xios
[219]8{
[1205]9      /// ////////////////////// Définitions ////////////////////// ///
[219]10
11      CDataOutput::~CDataOutput(void)
12      { /* Ne rien faire de plus */ }
13
14      //----------------------------------------------------------------
15
[676]16      void CDataOutput::writeGrid(CGrid* grid, bool allowCompressedOutput /*= false*/)
[219]17      {
[887]18        this->writeGrid(grid->getDomains(), grid->getAxis(), grid->getScalars());
[676]19
20        if (allowCompressedOutput)
21          writeGridCompressed_(grid);
[219]22      }
23
24      //----------------------------------------------------------------
25
[347]26      void CDataOutput::writeFile(CFile*  file)
[219]27      {
28         this->writeFile_(file);
29      }
[472]30
31      void CDataOutput::writeAttribute(CVariable*  var)
32      {
33         this->writeAttribute_(var) ;
34      }
35
[321]36      void CDataOutput::syncFile(void)
37      {
38         this->syncFile_();
39      }
[219]40
[286]41      void CDataOutput::closeFile(void)
42      {
43         this->closeFile_();
44      }
45
[219]46      //----------------------------------------------------------------
47
[676]48      void CDataOutput::writeGrid(CDomain* domain, CAxis* axis)
[219]49      {
50         this->writeDomain_(domain);
51         this->writeAxis_(axis);
52      }
53
[540]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
[887]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
[219]72      //----------------------------------------------------------------
73
[347]74      void CDataOutput::writeGrid(CDomain* domain)
[219]75      {
76         this->writeDomain_(domain);
77      }
78
[391]79      void CDataOutput::writeTimeDimension(void)
80      {
81         this->writeTimeDimension_();
82      }
83
[219]84      //----------------------------------------------------------------
85
[1096]86      void CDataOutput::writeFieldTimeAxis(CField* field)
[219]87      {
[347]88         CContext* context = CContext::getCurrent() ;
[343]89         boost::shared_ptr<CCalendar> calendar = context->getCalendar();
[540]90
[219]91         this->writeTimeAxis_(field, calendar);
92      }
[1096]93     
94      void CDataOutput::writeField(CField* field)
95      {
96         this->writeField_(field);
97      }
[219]98
99      //----------------------------------------------------------------
100
[347]101      void CDataOutput::writeFieldGrid(CField* field)
[219]102      {
[676]103         this->writeGrid(field->getRelGrid(),
104                         !field->indexed_output.isEmpty() && field->indexed_output);
[219]105      }
[540]106
[219]107      //----------------------------------------------------------------
[540]108
[347]109      void CDataOutput::writeFieldData(CField* field)
[219]110      {
[540]111//         CGrid* grid = CGrid::get(field->grid_ref.getValue());
112//         CDomain* domain = CDomain::get(grid->domain_ref.getValue());
[219]113         this->writeFieldData_(field);
114      }
[540]115
[219]116      ///----------------------------------------------------------------
117
[335]118} // namespace xios
Note: See TracBrowser for help on using the repository browser.