IODA
IodaIO.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2019 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #include "ioda/io/IodaIO.h"
9 
10 #include <string>
11 
12 #include "oops/mpi/mpi.h"
13 #include "oops/util/abor1_cpp.h"
14 #include "oops/util/Logger.h"
15 
16 
17 namespace ioda {
18 
19 // -----------------------------------------------------------------------------
20 IodaIO::IodaIO(const std::string & FileName, const std::string & FileMode,
21  const std::size_t MaxFrameSize) :
22  fname_(FileName), fmode_(FileMode), num_unexpect_dtypes_(0),
23  num_excess_dims_(0), max_frame_size_(MaxFrameSize) {
24 }
25 
26 // -----------------------------------------------------------------------------
28 
29 // -----------------------------------------------------------------------------
30 /*!
31  * \details This method returns the path to the file.
32  */
33 
34 std::string IodaIO::fname() const {
35  return fname_;
36 }
37 
38 // -----------------------------------------------------------------------------
39 /*!
40  * \details This method returns the mode (read, write, etc) for access to the file.
41  */
42 
43 std::string IodaIO::fmode() const {
44  return fmode_;
45 }
46 
47 // -----------------------------------------------------------------------------
48 /*!
49  * \details This method returns the number of unique locations in the obs data.
50  */
51 
52 std::size_t IodaIO::nlocs() const {
53  return nlocs_;
54 }
55 
56 // -----------------------------------------------------------------------------
57 /*!
58  * \details This method returns the number of unique variables in the obs data.
59  */
60 
61 std::size_t IodaIO::nvars() const {
62  return nvars_;
63 }
64 
65 /*!
66  * \details This method returns whether any unexpected data types were encountered
67  * on variables from the input file.
68  */
69 
71  return (num_unexpect_dtypes_ > 0);
72 }
73 
74 /*!
75  * \details This method returns whether any variables with excess dimensions were
76  * encountered when reading the input file.
77  */
78 
79 bool IodaIO::excess_dims() const {
80  return (num_excess_dims_ > 0);
81 }
82 
83 // -----------------------------------------------------------------------------
84 /*!
85  * \details This method returns the begin iterator for the groups contained
86  * in the group, variable information map.
87  */
88 
90  return grp_var_info_.begin();
91 }
92 
93 // -----------------------------------------------------------------------------
94 /*!
95  * \details This method returns the end iterator for the groups contained
96  * in the group, variable information map.
97  */
98 
100  return grp_var_info_.end();
101 }
102 
103 // -----------------------------------------------------------------------------
104 /*!
105  * \details This method returns the group name for the current iteration
106  * in the group, variable information map.
107  *
108  * \param[in] igrp Group iterator for GrpVarInfoMap
109  */
110 
112  return igrp->first;
113 }
114 
115 // -----------------------------------------------------------------------------
116 /*!
117  * \details This method returns the begin iterator for the variables, of a
118  * particular group, contained in the group, variable information map.
119  *
120  * \param[in] igrp Group iterator for GrpVarInfoMap
121  */
122 
124  return igrp->second.begin();
125 }
126 
127 // -----------------------------------------------------------------------------
128 /*!
129  * \details This method returns the end iterator for the variables, of a
130  * particular group, contained in the group, variable information map.
131  *
132  * \param[in] igrp Group iterator for GrpVarInfoMap
133  */
134 
136  return igrp->second.end();
137 }
138 
139 // -----------------------------------------------------------------------------
140 /*!
141  * \details This method returns the variable name for the current iteration
142  * in the group, variable information map.
143  *
144  * \param[in] ivar Variable iterator for GrpVarInfoMap
145  */
146 
148  return ivar->first;
149 }
150 
151 // -----------------------------------------------------------------------------
152 /*!
153  * \details This method returns the variable data type for the current iteration
154  * in the group, variable information map.
155  *
156  * \param[in] ivar Variable iterator for GrpVarInfoMap
157  */
158 
160  return ivar->second.dtype;
161 }
162 
163 // -----------------------------------------------------------------------------
164 /*!
165  * \details This method returns the variable data type for the current iteration
166  * in the group, variable information map.
167  *
168  * \param[in] GroupName Group key for GrpVarInfoMap
169  * \param[in] VarName Variable key for GrpVarInfoMap
170  */
171 
172 bool IodaIO::grp_var_exists(const std::string & GroupName, const std::string & VarName) {
173  bool GroupExists = false;
174  bool VarExists = false;
175 
176  // Check for group, and if group exists check for the variable
177  GroupIter igrp = grp_var_info_.find(GroupName);
178  GroupExists = !(igrp == grp_var_info_.end());
179  if (!GroupExists) {
180  std::string ErrorMsg = "Group name is not available: " + GroupName;
181  oops::Log::error() << ErrorMsg << std::endl;
182  }
183 
184  if (GroupExists) {
185  VarIter ivar = igrp->second.find(VarName);
186  VarExists = !(ivar == igrp->second.end());
187  if (!VarExists) {
188  std::string ErrorMsg = "Group name, variable name combination is not available: " +
189  GroupName + ", " + VarName;
190  oops::Log::error() << ErrorMsg << std::endl;
191  }
192  }
193 
194  return GroupExists & VarExists;
195 }
196 
197 // -----------------------------------------------------------------------------
198 /*!
199  * \details This method returns the variable data type for the group name, variable
200  * name combination in the group, variable information map.
201  *
202  * \param[in] GroupName Group key for GrpVarInfoMap
203  * \param[in] VarName Variable key for GrpVarInfoMap
204  */
205 
206 std::string IodaIO::var_dtype(const std::string & GroupName, const std::string & VarName) {
207  if (!grp_var_exists(GroupName, VarName)) {
208  std::string ErrorMsg = "Group name, variable name combination is not available: " +
209  GroupName + ", " + VarName;
210  ABORT(ErrorMsg);
211  }
212 
213  GroupIter igrp = grp_var_info_.find(GroupName);
214  VarIter ivar = igrp->second.find(VarName);
215  return ivar->second.dtype;
216 }
217 
218 // -----------------------------------------------------------------------------
219 /*!
220  * \details This method returns the variable shape for the current iteration
221  * in the group, variable information map.
222  *
223  * \param[in] ivar Variable iterator for GrpVarInfoMap
224  */
225 
226 std::vector<std::size_t> IodaIO::var_shape(IodaIO::VarIter ivar) {
227  return ivar->second.shape;
228 }
229 
230 // -----------------------------------------------------------------------------
231 /*!
232  * \details This method returns the variable shape for the group name, variable name
233  * combination in the group, variable information map.
234  *
235  * \param[in] GroupName Group key for GrpVarInfoMap
236  * \param[in] VarName Variable key for GrpVarInfoMap
237  */
238 
239 std::vector<std::size_t> IodaIO::var_shape(const std::string & GroupName,
240  const std::string & VarName) {
241  if (!grp_var_exists(GroupName, VarName)) {
242  std::string ErrorMsg = "Group name, variable name combination is not available: " +
243  GroupName + ", " + VarName;
244  ABORT(ErrorMsg);
245  }
246 
247  GroupIter igrp = grp_var_info_.find(GroupName);
248  VarIter ivar = igrp->second.find(VarName);
249  return ivar->second.shape;
250 }
251 
252 // -----------------------------------------------------------------------------
253 /*!
254  * \details This method returns the variable shape in the file for the current iteration
255  * in the group, variable information map.
256  *
257  * \param[in] ivar Variable iterator for GrpVarInfoMap
258  */
259 
260 std::vector<std::size_t> IodaIO::file_shape(IodaIO::VarIter ivar) {
261  return ivar->second.file_shape;
262 }
263 
264 // -----------------------------------------------------------------------------
265 /*!
266  * \details This method returns the variable shape in the file for the group name,
267  * variable name combination in the group, variable information map.
268  *
269  * \param[in] GroupName Group key for GrpVarInfoMap
270  * \param[in] VarName Variable key for GrpVarInfoMap
271  */
272 
273 std::vector<std::size_t> IodaIO::file_shape(const std::string & GroupName,
274  const std::string & VarName) {
275  if (!grp_var_exists(GroupName, VarName)) {
276  std::string ErrorMsg = "Group name, variable name combination is not available: " +
277  GroupName + ", " + VarName;
278  ABORT(ErrorMsg);
279  }
280 
281  GroupIter igrp = grp_var_info_.find(GroupName);
282  VarIter ivar = igrp->second.find(VarName);
283  return ivar->second.file_shape;
284 }
285 
286 // -----------------------------------------------------------------------------
287 /*!
288  * \details This method returns the variable name in the file for the current iteration
289  * in the group, variable information map.
290  *
291  * \param[in] ivar Variable iterator for GrpVarInfoMap
292  */
293 
295  return ivar->second.file_name;
296 }
297 
298 // -----------------------------------------------------------------------------
299 /*!
300  * \details This method returns the variable name in the file for the group name,
301  * variable name combination in the group, variable information map.
302  *
303  * \param[in] GroupName Group key for GrpVarInfoMap
304  * \param[in] VarName Variable key for GrpVarInfoMap
305  */
306 
307 std::string IodaIO::file_name(const std::string & GroupName, const std::string & VarName) {
308  if (!grp_var_exists(GroupName, VarName)) {
309  std::string ErrorMsg = "Group name, variable name combination is not available: " +
310  GroupName + ", " + VarName;
311  ABORT(ErrorMsg);
312  }
313 
314  GroupIter igrp = grp_var_info_.find(GroupName);
315  VarIter ivar = igrp->second.find(VarName);
316  return ivar->second.file_name;
317 }
318 
319 // -----------------------------------------------------------------------------
320 /*!
321  * \details This method returns the variable type in the file for the current iteration
322  * in the group, variable information map.
323  *
324  * \param[in] ivar Variable iterator for GrpVarInfoMap
325  */
326 
328  return ivar->second.file_type;
329 }
330 
331 // -----------------------------------------------------------------------------
332 /*!
333  * \details This method returns the variable type in the file for the group name,
334  * variable name combination in the group, variable information map.
335  *
336  * \param[in] GroupName Group key for GrpVarInfoMap
337  * \param[in] VarName Variable key for GrpVarInfoMap
338  */
339 
340 std::string IodaIO::file_type(const std::string & GroupName, const std::string & VarName) {
341  if (!grp_var_exists(GroupName, VarName)) {
342  std::string ErrorMsg = "Group name, variable name combination is not available: " +
343  GroupName + ", " + VarName;
344  ABORT(ErrorMsg);
345  }
346 
347  GroupIter igrp = grp_var_info_.find(GroupName);
348  VarIter ivar = igrp->second.find(VarName);
349  return ivar->second.file_type;
350 }
351 
352 // -----------------------------------------------------------------------------
353 /*!
354  * \details This method returns the variable id for the current iteration
355  * in the group, variable information map.
356  *
357  * \param[in] ivar Variable iterator for GrpVarInfoMap
358  */
359 
360 std::size_t IodaIO::var_id(IodaIO::VarIter ivar) {
361  return ivar->second.var_id;
362 }
363 
364 // -----------------------------------------------------------------------------
365 /*!
366  * \details This method returns the variable id for the group name, variable
367  * name combination in the group, variable information map.
368  *
369  * \param[in] GroupName Group key for GrpVarInfoMap
370  * \param[in] VarName Variable key for GrpVarInfoMap
371  */
372 
373 std::size_t IodaIO::var_id(const std::string & GroupName, const std::string & VarName) {
374  if (!grp_var_exists(GroupName, VarName)) {
375  std::string ErrorMsg = "Group name, variable name combination is not available: " +
376  GroupName + ", " + VarName;
377  ABORT(ErrorMsg);
378  }
379 
380  GroupIter igrp = grp_var_info_.find(GroupName);
381  VarIter ivar = igrp->second.find(VarName);
382  return ivar->second.var_id;
383 }
384 
385 // -----------------------------------------------------------------------------
386 /*!
387  * \details This method adds an entry to the group, variable information map.
388  *
389  * \param[in] GroupName Group key for GrpVarInfoMap
390  * \param[in] VarName Variable key for GrpVarInfoMap
391  * \param[in]
392  */
393 
394 void IodaIO::grp_var_insert(const std::string & GroupName, const std::string & VarName,
395  const std::string & VarType, const std::vector<std::size_t> & VarShape,
396  const std::string & FileVarName, const std::string & FileType,
397  const std::size_t MaxStringSize) {
398  GrpVarInsert(GroupName, VarName, VarType, VarShape, FileVarName, FileType, MaxStringSize);
399 }
400 
401 // -----------------------------------------------------------------------------
402 /*!
403  * \details This method returns a flag indicating the existence of the given
404  * dimension name. True indicates the dimension exists, false
405  * indicates the dimension does not exist.
406  *
407  * \param[in] name Dimension name
408  */
409 
410 bool IodaIO::dim_exists(const std::string & name) {
411  return (dim_info_.find(name) != dim_info_.end());
412 }
413 
414 // -----------------------------------------------------------------------------
415 /*!
416  * \details This method returns the begin iterator for the dimension container
417  */
418 
420  return dim_info_.begin();
421 }
422 
423 // -----------------------------------------------------------------------------
424 /*!
425  * \details This method returns the end iterator for the dimension container
426  */
427 
429  return dim_info_.end();
430 }
431 
432 // -----------------------------------------------------------------------------
433 /*!
434  * \details This method returns the dimension name given a dimension iterator.
435  *
436  * \param[in] idim Dimension iterator
437  */
438 
440  return idim->first;
441 }
442 
443 // -----------------------------------------------------------------------------
444 /*!
445  * \details This method returns the dimension id given a dimension iterator.
446  *
447  * \param[in] idim Dimension iterator
448  */
449 
451  return idim->second.id;
452 }
453 
454 // -----------------------------------------------------------------------------
455 /*!
456  * \details This method returns the dimension size given a dimension iterator.
457  *
458  * \param[in] idim Dimension iterator
459  */
460 
462  return idim->second.size;
463 }
464 
465 // -----------------------------------------------------------------------------
466 /*!
467  * \details This method returns the dimension size given a dimension id.
468  *
469  * \param[in] id Dimension id
470  */
471 
472 std::size_t IodaIO::dim_id_size(const int & id) {
473  DimIter idim;
474  for (idim = dim_info_.begin(); idim != dim_info_.end(); idim++) {
475  if (id == idim->second.id) {
476  break;
477  }
478  }
479 
480  if (idim == dim_info_.end()) {
481  std::string ErrorMsg =
482  "IodaIO::dim_id_size: Dimension id does not exist: " + std::to_string(id);
483  ABORT(ErrorMsg);
484  }
485 
486  return idim->second.size;
487 }
488 
489 // -----------------------------------------------------------------------------
490 /*!
491  * \details This method returns the dimension name given a dimension id.
492  *
493  * \param[in] id Dimension id
494  */
495 
496 std::string IodaIO::dim_id_name(const int & id) {
497  DimIter idim;
498  for (idim = dim_info_.begin(); idim != dim_info_.end(); idim++) {
499  if (id == idim->second.id) {
500  break;
501  }
502  }
503 
504  if (idim == dim_info_.end()) {
505  std::string ErrorMsg =
506  "IodaIO::dim_id_name: Dimension id does not exist: " + std::to_string(id);
507  ABORT(ErrorMsg);
508  }
509 
510  return idim->first;
511 }
512 
513 // -----------------------------------------------------------------------------
514 /*!
515  * \details This method returns the dimension size given a dimension name.
516  *
517  * \param[in] name Dimension name
518  */
519 
520 std::size_t IodaIO::dim_name_size(const std::string & name) {
521  if (!dim_exists(name)) {
522  std::string ErrorMsg = "IodaIO::dim_name_size: Dimension name does not exist: " + name;
523  ABORT(ErrorMsg);
524  }
525 
526  return dim_info_.find(name)->second.size;
527 }
528 
529 // -----------------------------------------------------------------------------
530 /*!
531  * \details This method returns the dimension id given a dimension name.
532  *
533  * \param[in] name Dimension name
534  */
535 
536 int IodaIO::dim_name_id(const std::string & name) {
537  if (!dim_exists(name)) {
538  std::string ErrorMsg = "IodaIO::dim_name_id: Dimension name does not exist: " + name;
539  ABORT(ErrorMsg);
540  }
541 
542  return dim_info_.find(name)->second.id;
543 }
544 
545 /*!
546  * \details This method inserts an entry into the dim info container
547  *
548  * \param[in] name Dimension name
549  */
550 
551 void IodaIO::dim_insert(const std::string & Name, const std::size_t Size) {
552  DimInsert(Name, Size);
553 }
554 // -----------------------------------------------------------------------------
555 /*!
556  * \brief beginning frame iterator
557  */
558 
560  return frame_info_.begin();
561 }
562 
563 // -----------------------------------------------------------------------------
564 /*!
565  * \brief ending frame iterator
566  */
567 
569  return frame_info_.end();
570 }
571 
572 // -----------------------------------------------------------------------------
573 /*!
574  * \brief initialize frame access
575  */
576 
578  InitializeFrame();
579 }
580 
581 // -----------------------------------------------------------------------------
582 /*!
583  * \brief finalize frame access
584  */
585 
587  FinalizeFrame();
588 }
589 
590 // -----------------------------------------------------------------------------
591 /*!
592  * \brief start value of current frame
593  */
594 
595 std::size_t IodaIO::frame_start(IodaIO::FrameIter & iframe) {
596  return iframe->start;
597 }
598 
599 // -----------------------------------------------------------------------------
600 /*!
601  * \brief size value of current frame
602  */
603 
604 std::size_t IodaIO::frame_size(IodaIO::FrameIter & iframe) {
605  return iframe->size;
606 }
607 
608 // -----------------------------------------------------------------------------
609 /*!
610  * \brief initialize the frame info container
611  */
612 
613 void IodaIO::frame_info_init(std::size_t MaxVarSize) {
614  // Chop the MaxVarSize into max_frame_size_ pieces. Make sure the total
615  // of the sizes of all frames adds up to MaxVarSize.
616  std::size_t FrameStart = 0;
617  while (FrameStart < MaxVarSize) {
618  std::size_t FrameSize = max_frame_size_;
619  if ((FrameStart + FrameSize) > MaxVarSize) {
620  FrameSize = MaxVarSize - FrameStart;
621  }
622  IodaIO::FrameInfoRec Finfo(FrameStart, FrameSize);
623  frame_info_.push_back(Finfo);
624 
625  FrameStart += max_frame_size_;
626  }
627 }
628 
629 // -----------------------------------------------------------------------------
630 /*!
631  * \brief insert item into the frame info container
632  */
633 
634 void IodaIO::frame_info_insert(std::size_t Start, std::size_t Size) {
635  IodaIO::FrameInfoRec Finfo(Start, Size);
636  frame_info_.push_back(Finfo);
637 }
638 
639 // -----------------------------------------------------------------------------
640 /*!
641  * \brief initialize the frame data container
642  */
643 
648 }
649 
650 // -----------------------------------------------------------------------------
651 /*!
652  * \brief read from the file into the frame containers
653  */
654 
656  ReadFrame(iframe);
657 }
658 
659 // -----------------------------------------------------------------------------
660 /*!
661  * \brief write from the frame containers into the file
662  */
663 
665  WriteFrame(iframe);
666 }
667 
668 // -----------------------------------------------------------------------------
669 /*!
670  * \details This method extracts the group and variable names from
671  * the given compound name.
672  *
673  * \param[in] Name Compound name (eg, Temperature@ObsValue)
674  * \param[out] GroupName Group name (eg, ObsValue)
675  * \param[out] VarName Variable name (eg, Temperature)
676  */
677 
678 void IodaIO::ExtractGrpVarName(const std::string & Name, std::string & GroupName,
679  std::string & VarName) {
680  std::size_t Spos = Name.find("@");
681  if (Spos != Name.npos) {
682  GroupName = Name.substr(Spos+1);
683  VarName = Name.substr(0, Spos);
684  } else {
685  std::string ErrMsg =
686  std::string("IodaIO::ExtractGrpVarName: Input file contains variables ") +
687  std::string("that are missing group names (ie, no @GroupName suffix).");
688  ABORT(ErrMsg);
689  }
690 }
691 
692 } // namespace ioda
ioda::IodaIO::VarIter
VarInfoMap::const_iterator VarIter
group-variable map, variable iterator
Definition: src/io/IodaIO.h:230
ioda::IodaIO::grp_var_insert
void grp_var_insert(const std::string &GroupName, const std::string &VarName, const std::string &VarType, const std::vector< std::size_t > &VarShape, const std::string &FileVarName, const std::string &FileType, const std::size_t MaxStringSize=0)
Definition: IodaIO.cc:394
ioda::IodaIO::num_unexpect_dtypes_
std::size_t num_unexpect_dtypes_
count of unexpected data types
Definition: src/io/IodaIO.h:400
ioda::IodaIO::dim_insert
void dim_insert(const std::string &, const std::size_t)
Definition: IodaIO.cc:551
ioda::IodaIO::fname
std::string fname() const
Definition: IodaIO.cc:34
ioda::IodaIO::dim_exists
bool dim_exists(const std::string &)
Definition: IodaIO.cc:410
ioda::IodaIO::GroupIter
GroupVarInfoMap::const_iterator GroupIter
group-variable map, group iterator
Definition: src/io/IodaIO.h:218
ioda::IodaIO::group_end
GroupIter group_end()
Definition: IodaIO.cc:99
ioda::IodaIO::nlocs
std::size_t nlocs() const
Definition: IodaIO.cc:52
ioda::IodaIO::frame_info_
FrameInfo frame_info_
frame information vector
Definition: src/io/IodaIO.h:412
ioda::IodaIO::max_frame_size_
std::size_t max_frame_size_
maximum frame size
Definition: src/io/IodaIO.h:415
ioda::IodaIO::FrameIter
FrameInfo::const_iterator FrameIter
Definition: src/io/IodaIO.h:275
ioda::IodaIO::fmode_
std::string fmode_
file mode
Definition: src/io/IodaIO.h:391
ioda::IodaIO::int_frame_data_
std::unique_ptr< FrameDataMap< int > > int_frame_data_
Containers for file frame.
Definition: src/io/IodaIO.h:418
ioda::IodaIO::frame_start
std::size_t frame_start(FrameIter &)
start value of current frame
Definition: IodaIO.cc:595
ioda::IodaIO::dim_info_
DimInfoMap dim_info_
dimension information map
Definition: src/io/IodaIO.h:409
ioda::IodaIO::InitializeFrame
virtual void InitializeFrame()=0
ioda::IodaIO::var_name
std::string var_name(VarIter)
Definition: IodaIO.cc:147
ioda::IodaIO::GrpVarInsert
virtual void GrpVarInsert(const std::string &GroupName, const std::string &VarName, const std::string &VarType, const std::vector< std::size_t > &VarShape, const std::string &FileVarName, const std::string &FileType, const std::size_t MaxStringSize)=0
ioda::IodaIO::fmode
std::string fmode() const
Definition: IodaIO.cc:43
ioda::IodaIO::frame_write
void frame_write(FrameIter &)
write from the frame containers into the file
Definition: IodaIO.cc:664
ioda::IodaIO::dim_name_size
std::size_t dim_name_size(const std::string &)
Definition: IodaIO.cc:520
ioda::IodaIO::frame_read
void frame_read(FrameIter &)
read from the file into the frame containers
Definition: IodaIO.cc:655
ioda::IodaIO::FinalizeFrame
virtual void FinalizeFrame()=0
ioda::IodaIO::var_id
std::size_t var_id(VarIter)
Definition: IodaIO.cc:360
ioda
Definition: IodaUtils.cc:13
ioda::IodaIO::float_frame_data_
std::unique_ptr< FrameDataMap< float > > float_frame_data_
Definition: src/io/IodaIO.h:419
ioda::IodaIO::dim_id_name
std::string dim_id_name(const int &)
Definition: IodaIO.cc:496
ioda::IodaIO::var_end
VarIter var_end(GroupIter)
Definition: IodaIO.cc:135
ioda::IodaIO::frame_finalize
void frame_finalize()
finalize frame access
Definition: IodaIO.cc:586
ioda::IodaIO::FrameInfoRec
Definition: src/io/IodaIO.h:174
ioda::IodaIO::dim_name_id
int dim_name_id(const std::string &)
Definition: IodaIO.cc:536
ioda::IodaIO::DimInsert
virtual void DimInsert(const std::string &Name, const std::size_t Size)=0
ioda::IodaIO::num_excess_dims_
std::size_t num_excess_dims_
count of too many dimensions
Definition: src/io/IodaIO.h:403
ioda::IodaIO::unexpected_data_types
bool unexpected_data_types() const
Definition: IodaIO.cc:70
ioda::IodaIO::nvars_
std::size_t nvars_
number of unique variables
Definition: src/io/IodaIO.h:397
ioda::IodaIO::dim_end
DimIter dim_end()
Definition: IodaIO.cc:428
ioda::IodaIO::frame_data_init
void frame_data_init()
initialize the frame data container
Definition: IodaIO.cc:644
ioda::IodaIO::frame_end
FrameIter frame_end()
ending frame iterator
Definition: IodaIO.cc:568
ioda::IodaIO::file_name
std::string file_name(VarIter)
Definition: IodaIO.cc:294
ioda::IodaIO::frame_info_init
void frame_info_init(std::size_t MaxVarSize)
initialize the frame info container
Definition: IodaIO.cc:613
ioda::IodaIO::file_type
std::string file_type(VarIter)
Definition: IodaIO.cc:327
ioda::IodaIO::dim_id_size
std::size_t dim_id_size(const int &)
Definition: IodaIO.cc:472
ioda::IodaIO::grp_var_info_
GroupVarInfoMap grp_var_info_
group-variable information map
Definition: src/io/IodaIO.h:406
ioda::IodaIO::~IodaIO
virtual ~IodaIO()=0
Definition: IodaIO.cc:27
ioda::IodaIO::frame_begin
FrameIter frame_begin()
beginning frame iterator
Definition: IodaIO.cc:559
ioda::IodaIO::frame_initialize
void frame_initialize()
initialize frame access
Definition: IodaIO.cc:577
ioda::IodaIO::frame_size
std::size_t frame_size(FrameIter &)
size value of current frame
Definition: IodaIO.cc:604
ioda::IodaIO::dim_id
int dim_id(DimIter)
Definition: IodaIO.cc:450
ioda::IodaIO::excess_dims
bool excess_dims() const
Definition: IodaIO.cc:79
ioda::IodaIO::var_begin
VarIter var_begin(GroupIter)
Definition: IodaIO.cc:123
ioda::IodaIO::group_begin
GroupIter group_begin()
Definition: IodaIO.cc:89
ioda::IodaIO::var_dtype
std::string var_dtype(VarIter)
Definition: IodaIO.cc:159
ioda::IodaIO::WriteFrame
virtual void WriteFrame(IodaIO::FrameIter &iframe)=0
ioda::IodaIO::dim_size
std::size_t dim_size(DimIter)
Definition: IodaIO.cc:461
ioda::IodaIO::fname_
std::string fname_
file name
Definition: src/io/IodaIO.h:383
ioda::IodaIO::dim_name
std::string dim_name(DimIter)
Definition: IodaIO.cc:439
ioda::IodaIO::grp_var_exists
bool grp_var_exists(const std::string &, const std::string &)
Definition: IodaIO.cc:172
ioda::IodaIO::ReadFrame
virtual void ReadFrame(IodaIO::FrameIter &iframe)=0
ioda::IodaIO::IodaIO
IodaIO(const std::string &FileName, const std::string &FileMode, const std::size_t MaxFrameSize)
Definition: IodaIO.cc:20
ioda::IodaIO::var_shape
std::vector< std::size_t > var_shape(VarIter)
Definition: IodaIO.cc:226
ioda::IodaIO::DimIter
DimInfoMap::const_iterator DimIter
Definition: src/io/IodaIO.h:256
ioda::IodaIO::nvars
std::size_t nvars() const
Definition: IodaIO.cc:61
ioda::IodaIO::string_frame_data_
std::unique_ptr< FrameDataMap< std::string > > string_frame_data_
Definition: src/io/IodaIO.h:420
ioda::IodaIO::ExtractGrpVarName
static void ExtractGrpVarName(const std::string &Name, std::string &GroupName, std::string &VarName)
Definition: IodaIO.cc:678
ioda::IodaIO::group_name
std::string group_name(GroupIter)
Definition: IodaIO.cc:111
ioda::IodaIO::nlocs_
std::size_t nlocs_
number of unique locations
Definition: src/io/IodaIO.h:394
ioda::FrameDataMap
frame data map
Definition: src/io/IodaIO.h:36
ioda::IodaIO::frame_info_insert
void frame_info_insert(std::size_t Start, std::size_t Size)
insert item into the frame info container
Definition: IodaIO.cc:634
ioda::IodaIO::file_shape
std::vector< std::size_t > file_shape(VarIter)
Definition: IodaIO.cc:260
ioda::IodaIO::dim_begin
DimIter dim_begin()
Definition: IodaIO.cc:419