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

Last change on this file since 623 was 613, checked in by rlacroix, 9 years ago

Improve CF compliance: Various cosmetic changes.

  • Remove the axis attribute from the latitute and longitude coordinate variables when using curvilinear or unstructured grids.
  • Add the axis="Z" attribute only when the positive attribute is set for an axis.
  • Rename the conventions attribute to Conventions.
  • Add a global title attribute with the same content as the global description attribute. The old attribute might be removed in the future.
  • Remove the title attribute from the time coordinates.
  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 4.1 KB
Line 
1#ifndef __XIOS_NC4_DATA_OUTPUT__
2#define __XIOS_NC4_DATA_OUTPUT__
3
4/// XIOS headers ///
5#include "xios_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, bool useClassicFormat,
28                MPI_Comm comm_file, bool multifile, bool isCollective=true);
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);
38            bool singleDomain ;
39            bool isCollective ;
40         protected :
41
42            /// Ecriture ///
43            virtual void writeDomain_    (CDomain* domain);
44            virtual void writeAxis_      (CAxis* axis);
45            virtual void writeTimeDimension_(void);
46            virtual void writeField_     (CField* field);
47            virtual void writeAttribute_ (CVariable* var);
48            virtual void writeAttribute_ (CVariable* var, const string& fieldId);
49            virtual void writeFieldData_ (CField* field);
50            virtual void writeFile_      (CFile* file);
51            virtual void closeFile_      (void);
52            virtual void syncFile_      (void);
53            virtual void writeTimeAxis_  (CField* field,
54                                          const boost::shared_ptr<CCalendar> cal);
55
56         protected :
57            void writeUnstructuredDomain (CDomain* domain);
58            void writeLocalAttributes(int ibegin, int ni, int jbegin, int nj, StdString domid);
59            void writeLocalAttributes_IOIPSL(int ibegin, int ni, int jbegin, int nj, int ni_glo, int nj_glo, int rank, int size) ;
60            void writeTimeAxisAttributes(const StdString & axis_name,
61                                         const StdString & calendar,
62                                         const StdString & units,
63                                         const StdString & time_origin,
64                                         const StdString & time_bounds   = StdString("bounds"),
65                                         const StdString & standard_name = StdString("time"),
66                                         const StdString & long_name     = StdString("Time axis"));
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 //__XIOS_NC4_DATA_OUTPUT__
Note: See TracBrowser for help on using the repository browser.