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