1 #ifndef teca_cf_layout_manager_h
2 #define teca_cf_layout_manager_h
4 #include "teca_metadata.h"
5 #include "teca_variant_array.h"
6 #include "teca_array_collection.h"
7 #include "teca_netcdf_util.h"
15 using p_teca_cf_layout_manager = std::shared_ptr<teca_cf_layout_manager>;
25 static p_teca_cf_layout_manager New(MPI_Comm comm,
26 long file_id,
long first_index,
long n_indices)
28 return p_teca_cf_layout_manager(
30 first_index, n_indices));
34 int create(
const std::string &file_name,
const std::string &date_format,
35 const teca_metadata &md_in,
int mode_flags,
int use_unlimited_dim);
42 const std::vector<std::string> &point_arrays,
43 const std::vector<std::string> &info_arrays,
int compression_level);
48 const const_p_teca_array_collection &point_arrays,
49 const const_p_teca_array_collection &info_arrays);
52 int close() {
return this->handle.close(); }
55 bool opened() {
return bool(this->handle); }
58 bool defined() {
return this->n_dims > 0; }
63 return this->n_written == this->n_indices;
70 int to_stream(std::ostream &os);
74 first_index(-1), n_indices(-1)
78 long fid,
long first_id,
long n_ids) : comm(fcomm), file_id(fid),
79 first_index(first_id), n_indices(n_ids), n_written(0), n_dims(0),
95 std::string file_name;
106 int use_unlimited_dim;
109 using var_def_t = std::pair<int,unsigned int>;
110 std::map<std::string, var_def_t> var_def;
111 std::string t_variable;
112 p_teca_double_array t;