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 | |
---|
9 | namespace 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_file, 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_ (CDomain* domain); |
---|
43 | virtual void writeAxis_ (CAxis* axis); |
---|
44 | virtual void writeTimeDimension_(void); |
---|
45 | virtual void writeField_ (CField* field); |
---|
46 | virtual void writeAttribute_ (CVariable* var); |
---|
47 | virtual void writeAttribute_ (CVariable* var, const string& fieldId); |
---|
48 | virtual void writeFieldData_ (CField* field); |
---|
49 | virtual void writeFile_ (CFile* file); |
---|
50 | virtual void closeFile_ (void); |
---|
51 | virtual void syncFile_ (void); |
---|
52 | virtual void writeTimeAxis_ (CField* field, |
---|
53 | const boost::shared_ptr<CCalendar> cal); |
---|
54 | |
---|
55 | protected : |
---|
56 | void writeUnstructuredDomain (CDomain* domain); |
---|
57 | void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid); |
---|
58 | void writeLocalAttributes_IOIPSL(int ibegin, int ni, int jbegin, int nj, int ni_glo, int nj_glo, int rank, int size) ; |
---|
59 | void writeTimeAxisAttributes(const StdString & axis_name, |
---|
60 | const StdString & calendar, |
---|
61 | const StdString & units, |
---|
62 | const StdString & time_origin, |
---|
63 | const StdString & time_bounds = StdString("bounds"), |
---|
64 | const StdString & standard_name = StdString("time"), |
---|
65 | const StdString & long_name = StdString("Time axis"), |
---|
66 | const StdString & title = StdString("Time")); |
---|
67 | |
---|
68 | void writeFileAttributes(const StdString & name, |
---|
69 | const StdString & description, |
---|
70 | const StdString & conventions, |
---|
71 | const StdString & production, |
---|
72 | const StdString & timeStamp); |
---|
73 | |
---|
74 | void writeMaskAttributes(const StdString & mask_name, |
---|
75 | int data_dim, |
---|
76 | int data_ni = 0, |
---|
77 | int data_nj = 0, |
---|
78 | int data_ibegin = 0, |
---|
79 | int data_jbegin = 0); |
---|
80 | |
---|
81 | void writeAxisAttributes(const StdString & axis_name, |
---|
82 | const StdString & axis, |
---|
83 | const StdString & standard_name, |
---|
84 | const StdString & long_name, |
---|
85 | const StdString & units, |
---|
86 | const StdString & nav_model); |
---|
87 | |
---|
88 | private : |
---|
89 | |
---|
90 | /// Traitement /// |
---|
91 | StdString getTimeStamp(void) const; |
---|
92 | |
---|
93 | /// Propriétés privées /// |
---|
94 | MPI_Comm comm_file; |
---|
95 | const StdString filename; |
---|
96 | |
---|
97 | }; // class CNc4DataOutput |
---|
98 | |
---|
99 | } // namespace xios |
---|
100 | |
---|
101 | #endif //__XMLIO_NC4_DATA_OUTPUT__ |
---|