Commit ac37d5fc authored by gsell's avatar gsell

Fortran API:

- use new enumeration of types for I/O. HDF5 types are not used any more in the high level API
parent 98349610
......@@ -11,11 +11,6 @@
#include "h5core/h5_log.h"
#include "h5core/h5b_attribs.h"
#define H5_R8_T H5_FLOAT64
#define H5_R4_T H5_FLOAT32
#define H5_I8_T H5_INT64
#define H5_I4_T H5_INT32
/*
__ _ _ _ ___ _ __ _ _
/ _` | | | |/ _ \ '__| | | |
......@@ -163,7 +158,7 @@ h5bl_writefieldattrib_string (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_STRING,
H5_STRING_T,
attrib_value2, strlen(attrib_value2)+1 );
free (attrib_value2);
H5_API_RETURN (h5err);
......@@ -193,7 +188,7 @@ h5bl_readfieldattrib_string (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_STRING, attrib_value);
H5_STRING_T, attrib_value);
h5_strc2for (attrib_value, l_attrib_value);
H5_API_RETURN (h5err);
......@@ -231,7 +226,7 @@ h5bl_writefieldattrib_r8 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_R8_T,
H5_FLOAT64_T,
attrib_value, *attrib_nelems));
}
......@@ -259,7 +254,7 @@ h5bl_readfieldattrib_r8 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_R8_T,
H5_FLOAT64_T,
attrib_value));
}
......@@ -288,7 +283,7 @@ h5bl_writefieldattrib_r4 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_R4_T,
H5_FLOAT32_T,
attrib_value, *attrib_nelems));
}
......@@ -316,7 +311,7 @@ h5bl_readfieldattrib_r4 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_R4_T,
H5_FLOAT32_T,
attrib_value));
}
......@@ -353,7 +348,7 @@ h5bl_writefieldattrib_i8 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_I8_T,
H5_INT64_T,
attrib_value, *attrib_nelems));
}
......@@ -382,7 +377,7 @@ h5bl_readfieldattrib_i8 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_I8_T,
H5_INT64_T,
attrib_value));
}
......@@ -411,7 +406,7 @@ h5bl_writefieldattrib_i4 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_I4_T,
H5_INT32_T,
attrib_value, *attrib_nelems));
}
......@@ -439,7 +434,7 @@ h5bl_readfieldattrib_i4 (
f,
field_name, l_field_name,
attrib_name, l_attrib_name,
H5_I4_T,
H5_INT32_T,
attrib_value));
}
......@@ -470,7 +465,7 @@ h5bl_get_fieldorigin (
f,
field_name, l_field_name,
H5BLOCK_FIELD_ORIGIN_NAME, sizeof (H5BLOCK_FIELD_ORIGIN_NAME),
H5_R8_T,
H5_FLOAT64_T,
origin));
*x_origin = origin[0];
*y_origin = origin[1];
......@@ -506,7 +501,7 @@ h5bl_set_fieldorigin (
f,
field_name, l_field_name,
H5BLOCK_FIELD_ORIGIN_NAME, sizeof (H5BLOCK_FIELD_ORIGIN_NAME),
H5_R8_T,
H5_FLOAT64_T,
origin, 3));
H5_API_RETURN (H5_SUCCESS);
......@@ -539,7 +534,7 @@ h5bl_get_fieldspacing (
f,
field_name, l_field_name,
H5BLOCK_FIELD_ORIGIN_NAME, sizeof (H5BLOCK_FIELD_ORIGIN_NAME),
H5_R8_T,
H5_FLOAT64_T,
spacing));
*x_spacing = spacing[0];
*y_spacing = spacing[1];
......@@ -575,7 +570,7 @@ h5bl_set_fieldspacing (
f,
field_name, l_field_name,
H5BLOCK_FIELD_ORIGIN_NAME, sizeof (H5BLOCK_FIELD_SPACING_NAME),
H5_R8_T,
H5_FLOAT64_T,
spacing));
H5_API_RETURN (H5_SUCCESS);
......
......@@ -27,7 +27,7 @@ h5bl_3d_write_scalar_field_r8 (
(h5_file_p)f, l_name, name, buffer);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_scalar_data (
f, name2, (void*)buffer, H5T_NATIVE_DOUBLE );
f, name2, (void*)buffer, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -48,7 +48,7 @@ h5bl_3d_read_scalar_field_r8 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_scalar_data (
f, name2, buffer, H5T_NATIVE_DOUBLE );
f, name2, buffer, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -72,7 +72,7 @@ h5bl_3d_write_vector3d_field_r8 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -96,7 +96,7 @@ h5bl_3d_read_vector3d_field_r8 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_DOUBLE );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_FLOAT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -117,7 +117,7 @@ h5bl_3d_write_scalar_field_r4 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_scalar_data (
f, name2, (void*)buffer, H5T_NATIVE_FLOAT );
f, name2, (void*)buffer, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -138,7 +138,7 @@ h5bl_3d_read_scalar_field_r4 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_scalar_data (
f, name2, buffer, H5T_NATIVE_FLOAT );
f, name2, buffer, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -162,7 +162,7 @@ h5bl_3d_write_vector3d_field_r4 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -186,7 +186,7 @@ h5bl_3d_read_vector3d_field_r4 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_FLOAT );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_FLOAT32_T );
free ( name2 );
H5_API_RETURN (herr);
}
......@@ -207,7 +207,7 @@ h5bl_3d_write_scalar_field_i8 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_scalar_data (
f, name2, (void*)buffer, H5T_NATIVE_INT64 );
f, name2, (void*)buffer, H5_INT64_T );
free ( name2 );
H5_API_RETURN (herr);
}
......@@ -228,7 +228,7 @@ h5bl_3d_read_scalar_field_i8 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_scalar_data (
f, name2, buffer, H5T_NATIVE_INT64 );
f, name2, buffer, H5_INT64_T );
free (name2);
H5_API_RETURN (herr);
}
......@@ -252,7 +252,7 @@ h5bl_3d_write_vector3d_field_i8 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_INT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -276,7 +276,7 @@ h5bl_3d_read_vector3d_field_i8 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT64 );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_INT64_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -297,7 +297,7 @@ h5bl_3d_write_scalar_field_i4 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_scalar_data (
f, name2, (void*)buffer, H5T_NATIVE_INT32 );
f, name2, (void*)buffer, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -318,7 +318,7 @@ h5bl_3d_read_scalar_field_i4 (
(h5_file_p)f, name, buffer, l_name);
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_scalar_data (
f, name2, buffer, H5T_NATIVE_INT32 );
f, name2, buffer, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -342,7 +342,7 @@ h5bl_3d_write_vector3d_field_i4 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_write_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -366,7 +366,7 @@ h5bl_3d_read_vector3d_field_i4 (
char *name2 = h5_strdupfor2c ( name, l_name );
h5_err_t herr = h5b_read_vector3d_data (
f, name2,
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5T_NATIVE_INT32 );
(void*)x_buf, (void*)y_buf, (void*)z_buf, H5_INT32_T );
free ( name2 );
H5_API_RETURN(herr);
}
......@@ -224,7 +224,6 @@ h5pt_getdatasetinfo (
dataset_type,
(h5_size_t*)dataset_nelem);
h5_strc2for (dataset_name, l_dataset_name);
convert_type2for (dataset_type);
H5_API_RETURN (h5err);
}
......
......@@ -68,7 +68,6 @@ h5_getfileattribinfo (
attrib_type,
(h5_size_t*)attrib_nelem);
h5_strc2for (attrib_name, l_attrib_name);
convert_type2for (attrib_type);
H5_API_RETURN (h5err);
}
......@@ -97,7 +96,6 @@ h5_getfileattribinfo_by_name (
name,
_type,
(h5_size_t*)_nelem);
convert_type2for (_type);
H5_API_RETURN (h5err);
}
......@@ -160,7 +158,7 @@ h5_writefileattrib_string (
(h5_file_p)f, l_name, name, l_buffer, buffer);
char *buffer2 = h5_strdupfor2c (buffer, l_buffer);
h5_int64_t herr = write_file_attrib (
f, name, l_name, H5_STRING, buffer2, strlen(buffer2)+1 );
f, name, l_name, H5_STRING_T, buffer2, strlen(buffer2)+1 );
free (buffer2);
H5_API_RETURN (herr);
}
......@@ -180,7 +178,7 @@ h5_readfileattrib_string (
H5_API_ENTER (h5_int64_t,
"fh=%p, name='%.*s', buffer='%.*s'",
(h5_file_p)f, l_name, name, l_buffer, buffer);
h5_int64_t herr = read_file_attrib (f, name, l_name, H5_STRING, buffer);
h5_int64_t herr = read_file_attrib (f, name, l_name, H5_STRING_T, buffer);
h5_strc2for (buffer, l_buffer);
H5_API_RETURN (herr);
}
......@@ -203,7 +201,7 @@ h5_writefileattrib_r8 (
H5_API_RETURN (write_file_attrib(
f,
name, l_name,
H5_FLOAT64,
H5_FLOAT64_T,
buffer, (hsize_t)*nelem));
}
......@@ -224,7 +222,7 @@ h5_readfileattrib_r8 (
H5_API_RETURN (read_file_attrib(
f,
name, l_name,
H5_FLOAT64,
H5_FLOAT64_T,
(void*)buffer));
}
......@@ -246,7 +244,7 @@ h5_writefileattrib_r4 (
H5_API_RETURN (write_file_attrib(
f,
name, l_name,
H5_FLOAT32,
H5_FLOAT32_T,
buffer, (hsize_t)*nelem));
}
......@@ -267,7 +265,7 @@ h5_readfileattrib_r4 (
H5_API_RETURN (read_file_attrib(
f,
name, l_name,
H5_FLOAT32,
H5_FLOAT32_T,
buffer));
}
......@@ -289,7 +287,7 @@ h5_writefileattrib_i8 (
H5_API_RETURN (write_file_attrib(
f,
name, l_name,
H5T_NATIVE_INT64,
H5_INT64_T,
buffer, (hsize_t)*nelem));
}
......@@ -310,7 +308,7 @@ h5_readfileattrib_i8 (
H5_API_RETURN (read_file_attrib(
f,
name, l_name,
H5T_NATIVE_INT64,
H5_INT64_T,
buffer));
}
......@@ -332,7 +330,7 @@ h5_writefileattrib_i4 (
H5_API_RETURN (write_file_attrib(
f,
name, l_name,
H5T_NATIVE_INT32,
H5_INT32_T,
buffer, (hsize_t)*nelem));
}
......@@ -353,7 +351,7 @@ h5_readfileattrib_i4 (
H5_API_RETURN (read_file_attrib(
f,
name, l_name,
H5T_NATIVE_INT32,
H5_INT32_T,
buffer));
}
......@@ -414,7 +412,6 @@ h5_getstepattribinfo (
attrib_type,
(h5_size_t*)attrib_nelem);
h5_strc2for (attrib_name, l_attrib_name);
convert_type2for (attrib_type);
H5_API_RETURN (h5err);
}
......@@ -443,7 +440,6 @@ h5_getstepattribinfo_by_name (
name,
_type,
(h5_size_t*)_nelem);
convert_type2for (_type);
H5_API_RETURN (h5err);
}
......@@ -508,7 +504,7 @@ h5_writestepattrib_string (
(h5_file_p)f, l_name, name, l_buffer, buffer);
char *buffer2 = h5_strdupfor2c (buffer, l_buffer);
h5_int64_t herr = write_step_attrib (
f, name, l_name, H5_STRING, buffer2, strlen(buffer2)+1 );
f, name, l_name, H5_STRING_T, buffer2, strlen(buffer2)+1 );
free (buffer2);
H5_API_RETURN (herr);
}
......@@ -528,7 +524,7 @@ h5_readstepattrib_string (
H5_API_ENTER (h5_int64_t,
"f=%p, name='%.*s', buffer='%.*s'",
(h5_file_p)f, l_name, name, l_buffer, buffer);
h5_int64_t herr = read_step_attrib (f, name, l_name, H5_STRING, buffer);
h5_int64_t herr = read_step_attrib (f, name, l_name, H5_STRING_T, buffer);
h5_strc2for (buffer, l_buffer);
H5_API_RETURN (herr);
}
......@@ -551,7 +547,7 @@ h5_writestepattrib_r8 (
H5_API_RETURN (write_step_attrib(
f,
name, l_name,
H5_FLOAT64,
H5_FLOAT64_T,
buffer, (hsize_t)*nelem));
}
......@@ -572,7 +568,7 @@ h5_readstepattrib_r8 (
H5_API_RETURN (read_step_attrib(
f,
name, l_name,
H5_FLOAT64,
H5_FLOAT64_T,
(void*)buffer));
}
......@@ -594,7 +590,7 @@ h5_writestepattrib_r4 (
H5_API_RETURN (write_step_attrib(
f,
name, l_name,
H5_FLOAT32,
H5_FLOAT32_T,
buffer, (hsize_t)*nelem));
}
......@@ -615,7 +611,7 @@ h5_readstepattrib_r4 (
H5_API_RETURN (read_step_attrib(
f,
name, l_name,
H5_FLOAT32,
H5_FLOAT32_T,
buffer));
}
......@@ -637,7 +633,7 @@ h5_writestepattrib_i8 (
H5_API_RETURN (write_step_attrib(
f,
name, l_name,
H5T_NATIVE_INT64,
H5_INT64_T,
buffer, (hsize_t)*nelem));
}
......@@ -658,7 +654,7 @@ h5_readstepattrib_i8 (
H5_API_RETURN (read_step_attrib(
f,
name, l_name,
H5T_NATIVE_INT64,
H5_INT64_T,
buffer));
}
......@@ -680,7 +676,7 @@ h5_writestepattrib_i4 (
H5_API_RETURN (write_step_attrib(
f,
name, l_name,
H5T_NATIVE_INT32,
H5_INT32_T,
buffer, (hsize_t)*nelem));
}
......@@ -701,6 +697,6 @@ h5_readstepattrib_i4 (
H5_API_RETURN (read_step_attrib(
f,
name, l_name,
H5T_NATIVE_INT32,
H5_INT32_T,
buffer));
}
......@@ -31,26 +31,6 @@
# error "Unknown Fortran symbol mangling"
#endif
#define convert_type2for(type) \
if (*type == H5_STRING) { \
*type = 1; \
} else if (*type == H5_INT16) { \
*type = 2; \
} else if (*type == H5_INT32) { \
*type = 3; \
} else if (*type == H5_INT64) { \
*type = 4; \
} else if (*type == H5_FLOAT32) { \
*type = 5; \
} else if (*type == H5_FLOAT64) { \
*type = 6; \
} else { \
H5_API_LEAVE ( \
h5_error ( \
H5_ERR_H5, \
"Unknown attribute type")); \
}
static inline char*
h5_strdupfor2c (
const char* s,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment