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

Last change on this file since 460 was 391, checked in by ymipsl, 12 years ago

-Add min_digits attribute
-Add global attribute to be compatible with IOIPSL rebuild

YM

File size: 2.6 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"
6
[335]7namespace xios
[219]8{
9      /// ////////////////////// Définitions ////////////////////// ///
10
11      CDataOutput::~CDataOutput(void)
12      { /* Ne rien faire de plus */ }
13
14      //----------------------------------------------------------------
15
[347]16      void CDataOutput::writeGrid(CGrid* grid)
[219]17      {
18         if (grid->domain_ref.isEmpty())
[335]19            ERROR("CDataOutput::writeGrid(grid)",
[219]20                   << " domain is not defined !");
21
22         if (grid->axis_ref.isEmpty())
23         {
[346]24            this->writeGrid(CDomain::get(grid->domain_ref.getValue()));
[219]25         }
26         else
27         {
[346]28            this->writeGrid(CDomain::get(grid->domain_ref.getValue()),
29                            CAxis::get(grid->axis_ref.getValue()));
[219]30         }
31      }
32
33      //----------------------------------------------------------------
34
[347]35      void CDataOutput::writeFile(CFile*  file)
[219]36      {
37         this->writeFile_(file);
38      }
[321]39 
40      void CDataOutput::syncFile(void)
41      {
42         this->syncFile_();
43      }
[219]44
[286]45      void CDataOutput::closeFile(void)
46      {
47         this->closeFile_();
48      }
49
[219]50      //----------------------------------------------------------------
51
[347]52      void CDataOutput::writeGrid(CDomain* domain,CAxis* axis)
[219]53      {
54         this->writeDomain_(domain);
55         this->writeAxis_(axis);
56      }
57
58      //----------------------------------------------------------------
59
[347]60      void CDataOutput::writeGrid(CDomain* domain)
[219]61      {
62         this->writeDomain_(domain);
63      }
64
[391]65      void CDataOutput::writeTimeDimension(void)
66      {
67         this->writeTimeDimension_();
68      }
69
[219]70      //----------------------------------------------------------------
71
[347]72      void CDataOutput::writeField(CField* field)
[219]73      {
[347]74         CContext* context = CContext::getCurrent() ;
[343]75         boost::shared_ptr<CCalendar> calendar = context->getCalendar();
[219]76         
77         this->writeField_(field);
78         this->writeTimeAxis_(field, calendar);
79      }
80
81      //----------------------------------------------------------------
82
[347]83      void CDataOutput::writeFieldGrid(CField* field)
[219]84      {
85         this->writeGrid(field->getRelGrid());
86      }
87     
88      //----------------------------------------------------------------
89     
[347]90      void CDataOutput::writeFieldData(CField* field)
[219]91      {
[347]92         CGrid* grid = CGrid::get(field->grid_ref.getValue());
93         CDomain* domain = CDomain::get(grid->domain_ref.getValue());
[219]94         this->writeFieldData_(field);
95      }
96     
97      ///----------------------------------------------------------------
98
[335]99} // namespace xios
Note: See TracBrowser for help on using the repository browser.