45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 #ifdef DEBUG_DUMP_PREFIX
55 static std::string s_material;
56 static std::string s_timeLevel;
57 static std::ofstream* s_fout = NULL;
58 #endif // DEBUG_DUMP_PREFIX
60 static void io_pane(
const char* fname,
const COM::Pane* pane,
61 const COM::Attribute* attr,
const char* material,
62 const char* timelevel,
const char* mfile,
63 const std::string& errorhandle,
const int mode);
65 static void io_pane_header(
const char* fname,
const COM::Pane* pane,
66 const char* blockname,
const char* material,
67 const char* timelevel,
const char* mfile,
68 const std::string& errorhandle,
const int mode);
71 const char* timelevel,
const char* coordsys,
73 const std::string& errorhandle,
const int mode);
76 const char* timelevel,
const char* coordsys,
77 const std::string& errorhandle,
81 const COM::Attribute* attr,
const char* timelevel,
83 const std::string& errorhandle,
const int mode);
85 static void io_hdf_data(
const char* fname,
const char* label,
const char* units,
86 const char* format,
const char* coordsys,
int rank,
87 int shape[],
int ng1,
int ng2,
int dim,
88 const COM_Type type,
const void* p,
int stride,
89 const std::string& errorhandle,
const int mode,
90 const void* minv,
const void* maxv);
92 static void min_element(
const void* begin,
const int rank,
const int shape[],
93 const int ng1,
const int ng2,
const COM_Type type,
96 static void max_element(
const void* begin,
const int rank,
const int shape[],
97 const int ng1,
const int ng2,
const COM_Type type,
104 const int shape[],
const int ng1,
const int ng2,
108 const int shape[],
const int ng1,
const int ng2,
116 static int write_data(
const char* fname,
const char* label,
const char* units,
117 const char* format,
const char* coordsys,
const int _rank,
118 const int _shape[],
const int ng1,
const int ng2,
119 const COM_Type type,
const void* p,
const void* minv,
120 const void* maxv,
const std::string& errorhandle,
125 inline void append_str(std::vector<char>& vec,
const char* str)
127 vec.insert(vec.end(), str, str + std::strlen(str));
131 const COM::Attribute* attr,
const char* material,
132 const char* timelevel,
int pane_id,
133 const std::string& errorhandle,
int mode)
135 const Window* w = attr->window();
138 io_pane(fname.c_str(), &pn, attr, material, timelevel,
139 !mfile.empty() ? mfile.c_str() : NULL, errorhandle, mode);
142 static void io_pane(
const char* fname,
const COM::Pane* pane,
143 const COM::Attribute* attr,
const char* material,
144 const char* timelevel,
const char* mfile,
145 const std::string& errorhandle,
const int mode)
148 std::sprintf(buf,
"%04d", pane->id());
149 std::string blockname = buf;
151 std::string coordsys(material);
152 coordsys.append(
"|");
153 coordsys.append(blockname);
155 bool with_mesh = mfile == NULL || std::strlen(mfile) == 0 ||
159 #ifdef DEBUG_DUMP_PREFIX
160 s_material = material;
163 std::istringstream in(timelevel);
165 std::ostringstream out;
167 s_timeLevel = out.str();
169 #endif // DEBUG_DUMP_PREFIX
174 mfile && std::strcmp( fname, mfile) )
176 timelevel, mfile, errorhandle, mode);
181 "Must not write mesh along with nc, conn or pconn");
194 timelevel, NULL, errorhandle, mode);
199 timelevel, NULL, errorhandle, mode);
210 std::vector<const Attribute*> attrs;
211 pane->attributes(attrs);
212 std::vector<const Attribute*>::const_iterator it;
213 for (it=attrs.begin(); it!=attrs.end(); ++it) {
219 timelevel, NULL, errorhandle, mode);
224 const char* blockname,
const char* material,
225 const char* timelevel,
const char* mfile,
226 const std::string& errorhandle,
const int mode)
230 if (pane->is_structured())
232 else if (pane->dimension() == 2)
238 std::ostringstream sout;
239 if (mesh_type == 2) {
240 sout << mesh_type <<
'|';
242 sout << pane->size_of_ghost_layers();
245 std::vector<const Connectivity*> elems;
246 pane->connectivities(elems);
247 sout << mesh_type <<
'|';
248 if (pane->size_of_nodes() == 0)
251 sout << pane->size_of_ghost_nodes();
254 std::vector<const Connectivity*>::const_iterator it;
255 for (it=elems.begin(); it!=elems.end(); ++it) {
257 if ((*it)->size_of_items() == 0)
260 sout <<
',' << (*it)->size_of_ghost_elements();
264 if (mfile && std::strlen(mfile) != 0 && std::strcmp(fname, mfile) != 0)
265 sout <<
'|' << mfile;
266 std::string
s = sout.str();
270 shape[0] = s.size() + 1;
272 write_data(fname, blockname, timelevel,
"block header", material,
273 1, shape, 0, 0,
COM_CHAR, s.c_str(), NULL, NULL, errorhandle,
278 const char* timelevel,
const char* coordsys,
280 const std::string& errorhandle,
const int mode)
282 #ifdef DEBUG_DUMP_PREFIX
283 s_fout =
new std::ofstream((DEBUG_DUMP_PREFIX + s_material +
".nc_" + s_timeLevel +
".hdf").c_str(), std::ios_base::app);
284 #endif // DEBUG_DUMP_PREFIX
285 int ncomp=pane->attribute(
COM::COM_NC)->size_of_components();
288 timelevel, coordsys, errorhandle, mode);
290 #ifdef DEBUG_DUMP_PREFIX
293 #endif // DEBUG_DUMP_PREFIX
297 const char* timelevel,
const char* coordsys,
298 const std::string& errorhandle,
const int mode)
300 if (!pane->is_unstructured())
304 std::vector<const Connectivity*> elems;
305 pane->connectivities(elems);
306 std::vector<int> conn;
309 std::vector<const Connectivity*>::const_iterator it;
310 for (it=elems.begin(); it!=elems.end(); ++it) {
314 const int* e = (*it)->pointer();
315 shape[0] = (*it)->size_of_nodes_pe();
316 shape[1] = (*it)->size_of_items();
318 conn.resize(shape[0] * shape[1]);
319 const int length = (*it)->capacity();
320 bool is_staggered = ((*it)->stride() == 1);
324 std::ostringstream sout;
325 sout << (*it)->name() <<
"|p";
328 sout <<
',' << (*it)->size_of_ghost_items();
331 sout <<
" AT TIME " << timelevel;
332 std::string label = sout.str();
336 for (
int i=0;
i<shape[1]; ++
i){
337 for (
int j=0;
j<shape[0]; ++
j) {
338 conn[
j*shape[1]+
i] = e[is_staggered?
j*length+
i:
i*shape[0]+
j];
342 maxv = pane->size_of_nodes();
347 conn.resize(shape[0], 0);
352 std::string str = (*it)->name();
355 io_hdf_data(fname, label.c_str(),
"", str.c_str(), coordsys, 2, shape,
356 0, 0, 1,
COM_INT, &conn[0], 1, errorhandle, mode, &minv, &maxv);
361 const COM::Attribute* attr,
const char* timelevel,
362 const char* coordsys,
363 const std::string& errorhandle,
const int mode)
366 #ifdef DEBUG_DUMP_PREFIX
367 bool alreadyOpen = (s_fout != NULL);
369 s_fout =
new std::ofstream((DEBUG_DUMP_PREFIX + s_material +
'.' + attr->name() +
'_' + s_timeLevel +
".hdf").c_str(), std::ios_base::app);
371 #endif // DEBUG_DUMP_PREFIX
372 int ncomp = attr->size_of_components();
374 int rank, shape[3], num_items, ng1 = 0, ng2 = 0;
375 if (attr->is_nodal()) {
376 if (pane->is_unstructured()) {
378 shape[0] = num_items = pane->size_of_nodes();
379 ng2 = pane->size_of_ghost_nodes();
380 shape[1] = shape[2] = 1;
383 ng1 = ng2 = pane->size_of_ghost_layers();
384 shape[0] = pane->size_k();
385 shape[1] = pane->size_j();
386 shape[2] = pane->size_i();
387 num_items = shape[0] * shape[1] * shape[2];
390 else if (attr->is_elemental()) {
391 if (pane->is_unstructured()) {
393 shape[0] = num_items = pane->size_of_elements();
394 ng2 = pane->size_of_ghost_elements();
395 shape[1] = shape[2] = 1;
398 ng1 = ng2 = pane->size_of_ghost_layers();
399 shape[0] = pane->size_k() - 1;
400 shape[1] = pane->size_j() - 1;
401 shape[2] = pane->size_i() - 1;
402 if (shape[0] == 0) shape[0] = 1;
403 num_items = shape[0] * shape[1] * shape[2];
405 }
else if (attr->data_type() !=
COM_VOID
408 shape[0] = num_items = attr->size_of_items();
409 ng2 = attr->size_of_ghost_items();
410 shape[1] = shape[2] = 1;
418 std::vector<char> buf(
std::max(num_items, 1) * sizeof_type);
419 std::fill(buf.begin(), buf.end(), 0);
425 bool is_vector3 = ncomp==3 && (attr->is_nodal() || attr->is_elemental());
426 bool is_tensor9 = ncomp==9 && (attr->is_nodal() || attr->is_elemental());
429 if (mode >= 0 && (is_vector3 || is_tensor9)) {
430 void* begin = &buf[0];
431 for (
int i=0;
i<ncomp; ++
i) {
432 const Attribute* pa = pane->attribute(attr->id() +
i + 1);
435 attr->data_type(), &buf[0]);
449 std::string unit = attr->unit();
452 std::ostringstream sout;
459 std::string a_name = attr->name();
460 sout << a_name <<
'|' << attr->location();
461 int li0 = sout.str().size();
462 sout <<
',' << ng2 <<
" AT TIME " << timelevel;
464 DEBUG_MSG(
"Preparing to write attribute '" << attr->name() <<
"' (ncomp == "
467 for (
int i=0;
i<ncomp; ++
i) {
468 int label_index = li0;
469 const Attribute* pa = pane->attribute(attr->id() +
i + (ncomp>1));
471 DEBUG_MSG(
"Preparing to write attribute '" << pa->
name() <<
'\'');
473 std::string label = sout.str();
474 if ( is_vector3 || is_tensor9) {
478 label[0] =
'x'+
i / 3;
479 label[1] =
'x' +
i % 3;
485 label_index += a_name.find(
'-') + 1;
486 label = a_name.substr(0,a_name.find(
'-')+1)+sout.str();
491 label[0] = label[0] + (
'x' -
'1');
495 if (num_items == 0) {
496 shape[0] = shape[rank-1] = 1;
497 label[label_index] =
'0';
498 #ifdef DEBUG_DUMP_PREFIX
501 #endif // DEBUG_DUMP_PREFIX
502 }
else if (pa->
pointer() == NULL) {
503 label[label_index] =
'@';
504 #ifdef DEBUG_DUMP_PREFIX
507 #endif // DEBUG_DUMP_PREFIX
509 label[label_index] =
',';
513 const void* addr = pa->
pointer();
520 DEBUG_MSG(
"fname == " << fname <<
", label == '" << label <<
"', unit == '" << unit <<
"', ng1 == " << ng1 <<
", ng2 == " << ng2);
521 io_hdf_data(fname, label.c_str(), unit.c_str(), a_name.c_str(),
522 coordsys,
rank, shape, ng1, ng2, 1, attr->data_type(),
523 addr, strd, errorhandle, mode, minv, maxv);
525 #ifdef DEBUG_DUMP_PREFIX
530 #endif // DEBUG_DUMP_PREFIX
534 static void io_hdf_data(
const char* fname,
const char* label,
const char* units,
535 const char* format,
const char* coordsys,
int rank,
536 int shape[],
int ng1,
int ng2,
int dim,
537 const COM_Type type,
const void* p,
int stride,
538 const std::string& errorhandle,
const int mode,
539 const void* minv,
const void* maxv)
549 if (coordsys == NULL) {
550 const char* cend = std::strchr(label,
'-');
552 if (cend && label[0] >=
'x' && label[0] <=
'z') {
555 for (
int i=0;
i<
n; ++
i)
556 crd[
i] = label[
i] + (
'1' -
'x');
565 std::vector<char> w(s * length);
567 std::memcpy(&w[
i*s], &((
const char*)p)[
i*stride*s], s);
569 write_data(fname, label, units, format, coordsys,
570 rank, shape, ng1, ng2, type, &w[0], minv, maxv, errorhandle);
572 write_data(fname, label, units, format, coordsys,
573 rank, shape, ng1, ng2, type, p, minv, maxv, errorhandle);
579 std::vector<char> coors(coordsys ? std::strlen(coordsys) + 3 : 3);
581 std::vector<char> fmt;
582 std::vector<char> w(s * length);
584 fmt.reserve(std::strlen(format) + 1);
586 for (
int k=0;
k<dim; ++
k) {
589 std::strcpy(&coors[0], coordsys);
594 l.push_back(
'x' +
k);
600 if (coordsys == NULL) {
604 }
else if (dim == 9) {
614 if (coordsys == NULL) {
615 coors[0] =
'1' +
k / 3;
616 coors[1] =
'1' +
k % 3;
619 }
else if (label != NULL) {
620 std::vector<char> buf(std::strlen(label) + 5);
621 std::sprintf(&buf[0],
"%d-%s",
k + 1, label);
624 const char* cend = std::strchr(&buf[0],
' ');
627 fmt.insert(fmt.end(), (
const char*)&buf[0], cend);
631 std::strcpy(&coors[0],
"0");
641 std::memcpy(&w[
i*s], &((
const char*)p)[(
i*dim+
k)*s], s);
643 write_data(fname, &l[0], units, &fmt[0], &coors[0],
644 rank, shape, ng1, ng2, type, &w[0], minv, maxv, errorhandle);
652 template <
typename T>
654 const int ng1,
const int ng2)
659 if (ng1 == 0 && ng2 == 0) {
667 const T* result = NULL;
668 for (
int i=0;
i<shape[0]-ng2; ++
i) {
669 for (
int j=0; j<(rank>1?shape[1]:1); ++
j) {
670 for (
int k=0; k<(rank>2?shape[2]:1); ++
k, ++t) {
674 && k <
std::max(1, shape[2] - ng2)) {
675 if (result == NULL || *result > *t)
687 template <
typename T>
689 const int ng1,
const int ng2)
694 if (ng1 == 0 && ng2 == 0) {
701 const T* result = NULL;
702 for (
int i=0;
i<shape[0]-ng2; ++
i) {
703 for (
int j=0; j<(rank>1?shape[1]:1); ++
j) {
704 for (
int k=0; k<(rank>2?shape[2]:1); ++
k, ++t) {
708 && k <
std::max(1, shape[2] - ng2)) {
709 if (result == NULL || *result < *t)
719 #define HUGE_VALF 1e+36F
723 const int ng1,
const int ng2,
const COM_Type type,
729 const void* p =
min_element__((
const char*)begin, rank, shape, ng1, ng2);
730 *(
char*)f = p ? *(
const char*)p :
'\0';
736 const void* p =
min_element__((
const int*)begin, rank, shape, ng1, ng2);
737 *(
int*)f = p ? *(
const int*)p : 0xEFFFFFFF;
743 const void* p =
min_element__((
const float*)begin, rank, shape, ng1, ng2);
744 *(
float*)f = p ? *(
const float*)p :
HUGE_VALF;
750 const void* p =
min_element__((
const double*)begin, rank, shape, ng1,
752 *(
double*)f = p ? *(
const double*)p : HUGE_VAL;
763 const int ng1,
const int ng2,
const COM_Type type,
769 const void* p =
max_element__((
const char*)begin, rank, shape, ng1, ng2);
770 *(
char*)f = p ? *(
const char*)p :
'\0';
776 const void* p =
max_element__((
const int*)begin, rank, shape, ng1, ng2);
777 *(
int*)f = p ? *(
const int*)p : -0xEFFFFFFF;
783 const void* p =
max_element__((
const float*)begin, rank, shape, ng1, ng2);
784 *(
float*)f = p ? *(
const float*)p : -
HUGE_VALF;
790 const void* p =
max_element__((
const double*)begin, rank, shape, ng1,
792 *(
double*)f = p ? *(
const double*)p : -HUGE_VAL;
809 float t = ((
float*)a)[
i*stride];
810 ((
float*)ssum)[
i] += t * t;
817 double t = ((
double*)a)[
i*stride];
818 ((
double*)ssum)[
i] += t * t;
825 int t = ((
int*)a)[
i*stride];
826 ((
int*)ssum)[
i] += t * t;
838 const int shape[],
const int ng1,
const int ng2,
844 const void* t =
min_element__((
const float*)begin, rank, shape, ng1, ng2);
846 *(
float*)v =
std::sqrt(*(
const float*)t);
854 const void* t =
min_element__((
const double*)begin, rank, shape, ng1,
857 *(
double*)v =
std::sqrt(*(
const double*)t);
859 *(
double*)v = HUGE_VAL;
865 const void* t =
min_element__((
const int*)begin, rank, shape, ng1,
868 *(
int*)v = (
int)
std::sqrt(
double(*(
const int*)t));
870 *(
int*)v = 0xEFFFFFFF;
880 const int shape[],
const int ng1,
const int ng2,
886 const void* t =
max_element__((
const float*)begin, rank, shape, ng1, ng2);
888 *(
float*)v =
std::sqrt(*(
const float*)t);
896 const void* t =
max_element__((
const double*)begin, rank, shape, ng1,
899 *(
double*)v =
std::sqrt(*(
const double*)t);
907 const void* t =
max_element__((
const int*)begin, rank, shape, ng1,
910 *(
int*)v = (
int)
std::sqrt(
double(*(
const int*)t));
943 #define HDF_CHECK(routine, args) \
945 intn status = HDF4::routine args; \
946 if (status == FAIL && errorhandle != "ignore") { \
947 std::cerr << "Rocout::write_attribute: " #routine " (line " \
948 << __LINE__ << " in " << __FILE__ << ") failed: " \
949 << HDF4::error_msg() << '\n' \
950 << "in write_data( fname == '" << fname << "', label == '" \
951 << label << "', units == '" << units << "', ... , rank == " \
952 << rank << ", shape[] == { " << shape[0]; \
953 { int x; for (x=1; x<rank; ++x) std::cerr << ", " << shape[x]; } \
954 std::cerr << " }, ... )" << std::endl; \
955 if (errorhandle == "abort") { \
956 if (COMMPI_Initialized()) \
957 MPI_Abort(MPI_COMM_WORLD, 0); \
964 static int write_data(
const char* fname,
const char* label,
const char* units,
965 const char* format,
const char* coordsys,
const int _rank,
966 const int _shape[],
const int ng1,
const int ng2,
967 const COM_Type type,
const void* p,
const void* minv,
968 const void* maxv,
const std::string& errorhandle,
972 int32 shape[] = { _shape[0], _shape[1], _shape[2] };
973 #ifdef DEBUG_DUMP_PREFIX
975 #endif // DEBUG_DUMP_PREFIX
977 if (_shape[0] == 0 || _shape[rank-1] == 0)
980 #ifdef DEBUG_DUMP_PREFIX
981 numItems *= shape[
i];
982 #endif // DEBUG_DUMP_PREFIX
984 std::cerr <<
"Rocout Error: Dimension (starting with 1) " <<
i + 1
985 <<
" of data " << format <<
" is " << shape[
i]
986 <<
".\n A positive number is expected. Aborting..."
992 #ifdef DEBUG_DUMP_PREFIX
998 for (i=0; i<numItems; ++
i)
999 *s_fout << i <<
" : " << (
int)((
const char*)p)[
i] <<
'\n';
1002 for (i=0; i<numItems; ++
i)
1003 *s_fout << i <<
" : " << ((
const int*)p)[i] <<
'\n';
1006 for (i=0; i<numItems; ++
i)
1007 *s_fout << i <<
" : " << ((
const float*)p)[i] <<
'\n';
1010 for (i=0; i<numItems; ++
i)
1011 *s_fout << i <<
" : " << ((
const double*)p)[i] <<
'\n';
1017 *s_fout <<
"###########################################\n";
1020 #endif // DEBUG_DUMP_PREFIX
1025 HDF_CHECK(DFSDsetdatastrs, (label, units, format, coordsys));
1030 min_element(p, _rank, _shape, ng1, ng2, type, &t1);
1032 max_element(p, _rank, _shape, ng1, ng2, type, &t2);
1035 HDF_CHECK(DFSDsetrange, (const_cast<void*>(maxv), const_cast<void*>(minv)));
1038 HDF_CHECK(DFSDadddata, (fname, rank, shape, const_cast<void*>(p)));
1040 HDF_CHECK(DFSDputdata, (fname, rank, shape, const_cast<void*>(p)));
1055 return (
sizeof(
int) == 4) ? DFNT_INT32 : DFNT_INT64;
1059 return (
sizeof(
float) == 4) ? DFNT_FLOAT32 : DFNT_FLOAT64;
1063 if (
sizeof(
double) == 4)
1064 return DFNT_FLOAT32;
1065 else if (
sizeof(
double) == 8)
1066 return DFNT_FLOAT64;
1068 return DFNT_FLOAT128;
int COM_Type
Indices for derived data types.
A Pane object contains a mesh, pane attribute, and field variables.
static void io_pane_connectivity(const char *fname, const COM::Pane *pane, const char *timelevel, const char *coordsys, const std::string &errorhandle, const int mode)
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
static void min_element(const void *begin, const int rank, const int shape[], const int ng1, const int ng2, const COM_Type type, void *f)
void append_str(std::vector< char > &vec, const char *str)
#define HDF_CHECK(routine, args)
New informative error-checking macro to replace hdf_error_message().
An Attribute object is a data member of a window.
#define COM_assertion_msg(EX, msg)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
A Window object contains multiple panes and multiple data attributes.
static void io_pane_header(const char *fname, const COM::Pane *pane, const char *blockname, const char *material, const char *timelevel, const char *mfile, const std::string &errorhandle, const int mode)
const T * max_element__(const T *begin, const int rank, const int shape[], const int ng1, const int ng2)
Template implementation for determining the maximum entry in an array.
static void max_sqrt_element(const void *begin, const int rank, const int shape[], const int ng1, const int ng2, const COM_Type type, void *v)
double length(Vector3D *const v, int n)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
static int write_data(const char *fname, const char *label, const char *units, const char *format, const char *coordsys, const int _rank, const int _shape[], const int ng1, const int ng2, const COM_Type type, const void *p, const void *minv, const void *maxv, const std::string &errorhandle, const int mode=1)
Rocout creates a series of Roccom windows by reading in a list of files.
const void * pointer() const
Obtain a constant pointer to the physical address.
static void max_element(const void *begin, const int rank, const int shape[], const int ng1, const int ng2, const COM_Type type, void *f)
const T * min_element__(const T *begin, const int rank, const int shape[], const int ng1, const int ng2)
Template implementation for determining the minimum entry in an array.
const std::string & name() const
Obtain the name of the attribute.
static void io_pane_coordinates(const char *fname, const COM::Pane *pane, const char *timelevel, const char *coordsys, const char *unit, const std::string &errorhandle, const int mode)
static int get_sizeof(MPI_Datatype i)
Get the size of a given MPI data type.
int stride() const
Obtain the stride of the attribute in base datatype.
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Pane & pane(const int pane_id, bool insert=false)
Find the pane with given ID. If not found, insert a pane with given ID.
static void io_hdf_data(const char *fname, const char *label, const char *units, const char *format, const char *coordsys, int rank, int shape[], int ng1, int ng2, int dim, const COM_Type type, const void *p, int stride, const std::string &errorhandle, const int mode, const void *minv, const void *maxv)
static void squared_sum(const void *a, const int length, const int stride, const COM_Type type, void *ssum)
static void io_pane_attribute(const char *fname, const COM::Pane *pane, const COM::Attribute *attr, const char *timelevel, const char *coordsys, const std::string &errorhandle, const int mode)
static void min_sqrt_element(const void *begin, const int rank, const int shape[], const int ng1, const int ng2, const COM_Type type, void *v)
static int comtype2hdftype(COM_Type i)
void write_attr_HDF4(const std::string &fname, const std::string &mfile, const COM::Attribute *attr, const char *material, const char *timelevel, int pane_id, const std::string &errorhandle, int mode)
static void io_pane(const char *fname, const COM::Pane *pane, const COM::Attribute *attr, const char *material, const char *timelevel, const char *mfile, const std::string &errorhandle, const int mode)