// Copyright (C) 2012, 2013, 2014 PISM Authors // // This file is part of PISM. // // PISM is free software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // PISM is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License // along with PISM; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef _PISMNC3FILE_H_ #define _PISMNC3FILE_H_ #include "PISMNCFile.hh" class PISMNC3File : public PISMNCFile { public: PISMNC3File(MPI_Comm com); virtual ~PISMNC3File(); // open/create/close int open(std::string filename, int mode); int create(std::string filename); int close(); // redef/enddef int enddef() const; int redef() const; // dim int def_dim(std::string name, size_t length) const; int inq_dimid(std::string dimension_name, bool &exists) const; int inq_dimlen(std::string dimension_name, unsigned int &result) const; int inq_unlimdim(std::string &result) const; int inq_dimname(int j, std::string &result) const; int inq_ndims(int &result) const; // var int def_var(std::string name, PISM_IO_Type nctype, std::vector dims) const; int get_vara_double(std::string variable_name, std::vector start, std::vector count, double *ip) const; int put_vara_double(std::string variable_name, std::vector start, std::vector count, const double *op) const; int get_varm_double(std::string variable_name, std::vector start, std::vector count, std::vector imap, double *ip) const; int put_varm_double(std::string variable_name, std::vector start, std::vector count, std::vector imap, const double *op) const; int inq_nvars(int &result) const; int inq_vardimid(std::string variable_name, std::vector &result) const; int inq_varnatts(std::string variable_name, int &result) const; int inq_varid(std::string variable_name, bool &exists) const; int inq_varname(unsigned int j, std::string &result) const; int inq_vartype(std::string variable_name, PISM_IO_Type &result) const; // att int get_att_double(std::string variable_name, std::string att_name, std::vector &result) const; int get_att_text(std::string variable_name, std::string att_name, std::string &result) const; using PISMNCFile::put_att_double; int put_att_double(std::string variable_name, std::string att_name, PISM_IO_Type xtype, const std::vector &data) const; int put_att_text(std::string variable_name, std::string att_name, std::string value) const; int inq_attname(std::string variable_name, unsigned int n, std::string &result) const; int inq_atttype(std::string variable_name, std::string att_name, PISM_IO_Type &result) const; // misc int set_fill(int fillmode, int &old_modep) const; virtual std::string get_format() const; private: int m_rank; int get_var_double(std::string variable_name, std::vector start, std::vector count, std::vector imap, double *ip, bool mapped) const; int put_var_double(std::string variable_name, std::vector start, std::vector count, std::vector imap, const double *op, bool mapped) const; }; #endif /* _PISMNC3FILE_H_ */