source: XIOS/trunk/src/output/nc4_data_output.hpp @ 340

Last change on this file since 340 was 337, checked in by ymipsl, 12 years ago

remove "io" namespace

YM

File size: 4.3 KB
Line 
1#ifndef __XMLIO_NC4_DATA_OUTPUT__
2#define __XMLIO_NC4_DATA_OUTPUT__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "onetcdf4.hpp"
7#include "data_output.hpp"
8
9namespace xios
10{
11      /// ////////////////////// Déclarations ////////////////////// ///
12
13      class CNc4DataOutput
14         : protected CONetCDF4
15         , public virtual CDataOutput
16      {
17         public :
18
19            /// Définition de type ///
20            typedef CONetCDF4   SuperClassWriter;
21            typedef CDataOutput SuperClass;
22
23            /// Constructeurs ///
24            CNc4DataOutput
25               (const StdString & filename, bool exist);
26            CNc4DataOutput
27               (const StdString & filename, bool exist, MPI_Comm comm_server, bool multifile, bool isCollective=true);
28
29            CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
30            CNc4DataOutput(const CNc4DataOutput * const dataoutput); // Not implemented.
31
32            /// Accesseur ///
33            const StdString & getFileName(void) const;
34
35            /// Destructeur ///
36            virtual ~CNc4DataOutput(void);
37            bool singleDomain ;
38            bool isCollective ;
39         protected :
40
41            /// Ecriture ///
42            virtual void writeDomain_    (const boost::shared_ptr<tree::CDomain>   domain);
43            virtual void writeAxis_      (const boost::shared_ptr<tree::CAxis>     axis);
44            virtual void writeField_     (const boost::shared_ptr<tree::CField>    field);
45            virtual void writeFieldData_ (const boost::shared_ptr<tree::CField>    field);
46            virtual void writeFile_      (const boost::shared_ptr<tree::CFile>     file);
47            virtual void closeFile_      (void);
48            virtual void syncFile_      (void);
49            virtual void writeTimeAxis_  (const boost::shared_ptr<tree::CField>    field,
50                                          const boost::shared_ptr<date::CCalendar> cal);
51
52         protected :
53         
54            void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid);
55
56            void writeTimeAxisAttributes(const StdString & axis_name,
57                                         const StdString & calendar,
58                                         const StdString & units,
59                                         const StdString & time_origin,
60                                         const StdString & standard_name = StdString("time"),
61                                         const StdString & long_name     = StdString("Time axis"),
62                                         const StdString & title         = StdString("Time"));
63
64            void writeFileAttributes(const StdString & name,
65                                     const StdString & description,
66                                     const StdString & conventions,
67                                     const StdString & production,
68                                     const StdString & timeStamp);
69
70            void writeMaskAttributes(const StdString & mask_name,
71                                     int data_dim,
72                                     int data_ni     = 0,
73                                     int data_nj     = 0,
74                                     int data_ibegin = 0,
75                                     int data_jbegin = 0);
76
77            void writeAxisAttributes(const StdString & axis_name,
78                                     const StdString & axis,
79                                     const StdString & standard_name,
80                                     const StdString & long_name,
81                                     const StdString & units,
82                                     const StdString & nav_model);
83            template <class T>
84               void writeAxisData(const StdString & axis_name,
85                                  const ARRAY(T, 1) data,
86                                  bool collective, StdSize record,
87                                  const std::vector<StdSize> * start = NULL,
88                                  const std::vector<StdSize> * count = NULL);
89
90         private :
91
92            /// Traitement ///
93            StdString getTimeStamp(void) const;
94
95            /// Propriétés privées ///
96            MPI_Comm comm_server;
97            const StdString filename;
98
99      }; // class CNc4DataOutput
100
101} // namespace xios
102
103#endif //__XMLIO_NC4_DATA_OUTPUT__
Note: See TracBrowser for help on using the repository browser.