[219] | 1 | #ifndef __XMLIO_NC4_DATA_OUTPUT__ |
---|
| 2 | #define __XMLIO_NC4_DATA_OUTPUT__ |
---|
| 3 | |
---|
[335] | 4 | /// xios headers /// |
---|
[219] | 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "onetcdf4.hpp" |
---|
| 7 | #include "data_output.hpp" |
---|
| 8 | |
---|
[335] | 9 | namespace xios |
---|
[219] | 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 |
---|
[379] | 27 | (const StdString & filename, bool exist, MPI_Comm comm_file, bool multifile, bool isCollective=true); |
---|
[219] | 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); |
---|
[318] | 37 | bool singleDomain ; |
---|
[335] | 38 | bool isCollective ; |
---|
[219] | 39 | protected : |
---|
| 40 | |
---|
| 41 | /// Ecriture /// |
---|
[347] | 42 | virtual void writeDomain_ (CDomain* domain); |
---|
| 43 | virtual void writeAxis_ (CAxis* axis); |
---|
[391] | 44 | virtual void writeTimeDimension_(void); |
---|
[347] | 45 | virtual void writeField_ (CField* field); |
---|
| 46 | virtual void writeFieldData_ (CField* field); |
---|
| 47 | virtual void writeFile_ (CFile* file); |
---|
[286] | 48 | virtual void closeFile_ (void); |
---|
[321] | 49 | virtual void syncFile_ (void); |
---|
[347] | 50 | virtual void writeTimeAxis_ (CField* field, |
---|
[343] | 51 | const boost::shared_ptr<CCalendar> cal); |
---|
[219] | 52 | |
---|
| 53 | protected : |
---|
[449] | 54 | void writeUnstructuredDomain (CDomain* domain); |
---|
[219] | 55 | void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid); |
---|
[391] | 56 | void writeLocalAttributes_IOIPSL(int ibegin, int ni, int jbegin, int nj, int ni_glo, int nj_glo, int rank, int size) ; |
---|
[219] | 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 | |
---|
| 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, |
---|
| 73 | int data_ni = 0, |
---|
| 74 | int data_nj = 0, |
---|
| 75 | int data_ibegin = 0, |
---|
| 76 | int data_jbegin = 0); |
---|
| 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); |
---|
[369] | 84 | |
---|
[219] | 85 | private : |
---|
| 86 | |
---|
| 87 | /// Traitement /// |
---|
| 88 | StdString getTimeStamp(void) const; |
---|
| 89 | |
---|
| 90 | /// Propriétés privées /// |
---|
[379] | 91 | MPI_Comm comm_file; |
---|
[219] | 92 | const StdString filename; |
---|
| 93 | |
---|
| 94 | }; // class CNc4DataOutput |
---|
| 95 | |
---|
[335] | 96 | } // namespace xios |
---|
[219] | 97 | |
---|
| 98 | #endif //__XMLIO_NC4_DATA_OUTPUT__ |
---|