[591] | 1 | #ifndef __XIOS_NC4_DATA_OUTPUT__ |
---|
| 2 | #define __XIOS_NC4_DATA_OUTPUT__ |
---|
[219] | 3 | |
---|
[591] | 4 | /// XIOS headers /// |
---|
| 5 | #include "xios_spl.hpp" |
---|
[219] | 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 |
---|
[517] | 27 | (const StdString & filename, bool exist, bool useClassicFormat, |
---|
| 28 | MPI_Comm comm_file, bool multifile, bool isCollective=true); |
---|
[219] | 29 | |
---|
| 30 | CNc4DataOutput(const CNc4DataOutput & dataoutput); // Not implemented. |
---|
| 31 | CNc4DataOutput(const CNc4DataOutput * const dataoutput); // Not implemented. |
---|
| 32 | |
---|
| 33 | /// Accesseur /// |
---|
| 34 | const StdString & getFileName(void) const; |
---|
| 35 | |
---|
| 36 | /// Destructeur /// |
---|
| 37 | virtual ~CNc4DataOutput(void); |
---|
[318] | 38 | bool singleDomain ; |
---|
[335] | 39 | bool isCollective ; |
---|
[219] | 40 | protected : |
---|
| 41 | |
---|
| 42 | /// Ecriture /// |
---|
[676] | 43 | virtual void writeDomain_ (CDomain* domain); |
---|
| 44 | virtual void writeAxis_ (CAxis* axis); |
---|
| 45 | virtual void writeGridCompressed_(CGrid* grid); |
---|
[391] | 46 | virtual void writeTimeDimension_(void); |
---|
[676] | 47 | virtual void writeField_ (CField* field); |
---|
| 48 | virtual void writeAttribute_(CVariable* var); |
---|
| 49 | virtual void writeAttribute_(CVariable* var, const string& fieldId); |
---|
| 50 | virtual void writeFieldData_(CField* field); |
---|
| 51 | virtual void writeFile_ (CFile* file); |
---|
| 52 | virtual void closeFile_ (void); |
---|
[321] | 53 | virtual void syncFile_ (void); |
---|
[676] | 54 | virtual void writeTimeAxis_ (CField* field, |
---|
| 55 | const boost::shared_ptr<CCalendar> cal); |
---|
[219] | 56 | |
---|
| 57 | protected : |
---|
[488] | 58 | void writeUnstructuredDomain (CDomain* domain); |
---|
[219] | 59 | void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid); |
---|
[628] | 60 | void writeLocalAttributes_IOIPSL(const StdString& dimXid, const StdString& dimYid, |
---|
| 61 | int ibegin, int ni, int jbegin, int nj, int ni_glo, int nj_glo, int rank, int size); |
---|
[219] | 62 | void writeTimeAxisAttributes(const StdString & axis_name, |
---|
| 63 | const StdString & calendar, |
---|
| 64 | const StdString & units, |
---|
| 65 | const StdString & time_origin, |
---|
[488] | 66 | const StdString & time_bounds = StdString("bounds"), |
---|
[219] | 67 | const StdString & standard_name = StdString("time"), |
---|
[613] | 68 | const StdString & long_name = StdString("Time axis")); |
---|
[219] | 69 | |
---|
| 70 | void writeFileAttributes(const StdString & name, |
---|
| 71 | const StdString & description, |
---|
| 72 | const StdString & conventions, |
---|
| 73 | const StdString & production, |
---|
| 74 | const StdString & timeStamp); |
---|
| 75 | |
---|
| 76 | void writeMaskAttributes(const StdString & mask_name, |
---|
| 77 | int data_dim, |
---|
| 78 | int data_ni = 0, |
---|
| 79 | int data_nj = 0, |
---|
| 80 | int data_ibegin = 0, |
---|
| 81 | int data_jbegin = 0); |
---|
| 82 | |
---|
| 83 | void writeAxisAttributes(const StdString & axis_name, |
---|
| 84 | const StdString & axis, |
---|
| 85 | const StdString & standard_name, |
---|
| 86 | const StdString & long_name, |
---|
| 87 | const StdString & units, |
---|
| 88 | const StdString & nav_model); |
---|
[369] | 89 | |
---|
[219] | 90 | private : |
---|
| 91 | |
---|
| 92 | /// Traitement /// |
---|
| 93 | StdString getTimeStamp(void) const; |
---|
| 94 | |
---|
| 95 | /// Propriétés privées /// |
---|
[379] | 96 | MPI_Comm comm_file; |
---|
[219] | 97 | const StdString filename; |
---|
| 98 | |
---|
| 99 | }; // class CNc4DataOutput |
---|
| 100 | |
---|
[335] | 101 | } // namespace xios |
---|
[219] | 102 | |
---|
[591] | 103 | #endif //__XIOS_NC4_DATA_OUTPUT__ |
---|