continued working on Fortran interface

This commit is contained in:
Marc Howison
2010-07-10 00:00:54 +00:00
parent 9f3fd3b053
commit 2c267f173a
41 changed files with 4482 additions and 3649 deletions
+3
View File
@@ -16,6 +16,9 @@
#ifndef __H5_H
#define __H5_H
#include "H5_inquiry.h"
#include "H5_attribs.h"
h5_file_t *
H5OpenFile (
const char * filename,
+88 -162
View File
@@ -1,202 +1,128 @@
#ifndef __H5BLOCK_H
#define __H5BLOCK_H
#ifdef __cplusplus
extern "C" {
#endif
/*!
Interface for block structured field data
*/
#include "H5.h"
#include "H5Block_readwrite.h"
h5_err_t
H5BlockDefine3DFieldLayout (
h5_file_t *f,
const h5_size_t i_start,
const h5_size_t i_end,
const h5_size_t j_start,
const h5_size_t j_end,
const h5_size_t k_start,
const h5_size_t k_end
H5Block3dSetView (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i_start, /*!< IN: start index of \c i */
const h5_int64_t i_end, /*!< IN: end index of \c i */
const h5_int64_t j_start, /*!< IN: start index of \c j */
const h5_int64_t j_end, /*!< IN: end index of \c j */
const h5_int64_t k_start, /*!< IN: start index of \c k */
const h5_int64_t k_end /*!< IN: end index of \c k */
);
h5_err_t
H5Block3dGetPartitionOfProc (
h5_file_t *f,
const h5_int64_t proc,
h5_size_t *i_start,
h5_size_t *i_end,
h5_size_t *j_start,
h5_size_t *j_end,
h5_size_t *k_start,
h5_size_t *k_end
H5Block3dGetView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c k */
h5_size_t *k_end /*!< OUT: end index of \c k */
);
h5_err_t
H5Block3dGetReducedPartitionOfProc (
h5_file_t *f,
h5_id_t proc,
h5_size_t *i_start,
h5_size_t *i_end,
h5_size_t *j_start,
h5_size_t *j_end,
h5_size_t *k_start,
h5_size_t *k_end
H5Block3dSetChunk (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: size of \c i */
const h5_int64_t j, /*!< IN: size of \c j */
const h5_int64_t k /*!< IN: size of \c k */
);
h5_id_t
H5Block3dGetProcOf (
h5_file_t *f,
h5_size_t i,
h5_size_t j,
h5_size_t k
h5_err_t
H5Block3dGetChunk (
h5_file_t *const f, /*!< IN: File handle */
const char *field_name, /*!< IN: name of dataset */
h5_size_t *dims /*!< OUT: array containing the chunk dimensions */
);
h5_int64_t
H5Block3dWriteScalarFieldFloat64 (
h5_file_t *f,
const char *name,
const h5_float64_t *data
h5_err_t
H5Block3dGetReducedView (
h5_file_t *const f, /*!< IN: File handle */
const int proc, /*!< IN: Processor to get partition from */
h5_size_t *i_start, /*!< OUT: start index of \c i */
h5_size_t *i_end, /*!< OUT: end index of \c i */
h5_size_t *j_start, /*!< OUT: start index of \c j */
h5_size_t *j_end, /*!< OUT: end index of \c j */
h5_size_t *k_start, /*!< OUT: start index of \c j */
h5_size_t *k_end /*!< OUT: end index of \c j */
);
h5_int64_t
H5Block3dReadScalarFieldFloat64 (
h5_file_t *f,
const char *name,
h5_float64_t *data
int
H5Block3dGetProc (
h5_file_t *const f, /*!< IN: File handle */
const h5_int64_t i, /*!< IN: \c i coordinate */
const h5_int64_t j, /*!< IN: \c j coordinate */
const h5_int64_t k /*!< IN: \c k coordinate */
);
h5_int64_t
h5_size_t
H5BlockGetNumFields (
h5_file_t *f
h5_file_t *const f /*!< IN: file handle */
);
h5_int64_t
h5_err_t
H5BlockGetFieldInfo (
h5_file_t *f,
const h5_int64_t idx,
char *name,
const h5_int64_t len_name,
h5_int64_t *grid_rank,
h5_int64_t *grid_dims,
h5_int64_t *field_dims
h5_file_t *const f, /*!< IN: file handle */
const h5_size_t idx, /*!< IN: index of field */
char *name, /*!< OUT: field name */
const h5_size_t len_name, /*!< IN: buffer size */
h5_size_t *grid_rank, /*!< OUT: grid rank */
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
h5_size_t *field_rank, /*!< OUT: field rank */
h5_int64_t *type /*!< OUT: datatype */
);
h5_int64_t
h5_err_t
H5BlockGetFieldInfoByName (
h5_file_t *f,
const char *field_name,
h5_int64_t *grid_rank,
h5_int64_t *grid_dims,
h5_int64_t *field_dims
h5_file_t *const f, /*!< IN: file handle */
const char *name, /*!< IN: field name */
h5_size_t *grid_rank, /*!< OUT: grid rank */
h5_size_t *grid_dims, /*!< OUT: grid dimensions */
h5_size_t *field_rank, /*!< OUT: field rank */
h5_int64_t *type /*!< OUT: datatype */
);
h5_int64_t
H5Block3dGetFieldOrigin (
h5_file_t *f,
const char *field_name,
h5_float64_t *x_origin,
h5_float64_t *y_origin,
h5_float64_t *z_origin
);
h5_int64_t
H5Block3dSetFieldOrigin (
h5_file_t *f,
const char *field_name,
const h5_float64_t x_origin,
const h5_float64_t y_origin,
const h5_float64_t z_origin
);
h5_int64_t
H5Block3dGetFieldSpacing (
h5_file_t *f,
const char *field_name,
h5_float64_t *x_spacing,
h5_float64_t *y_spacing,
h5_float64_t *z_spacing
);
h5_int64_t
H5Block3dSetFieldSpacing (
h5_file_t *f,
const char *field_name,
const h5_float64_t x_spacing,
const h5_float64_t y_spacing,
const h5_float64_t z_spacing
);
h5_int64_t
H5Block3dWrite3dVectorFieldFloat64 (
h5_file_t *f,
const char *name,
const h5_float64_t *xval,
const h5_float64_t *yval,
const h5_float64_t *zval
);
h5_int64_t
H5Block3dRead3dVectorFieldFloat64 (
h5_file_t *f,
const char *name,
h5_float64_t *xval,
h5_float64_t *yval,
h5_float64_t *zval
);
h5_int64_t
H5BlockWriteFieldAttrib (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const h5_int64_t attrib_type,
const void *attrib_value,
const h5_int64_t attrib_nelem
);
h5_int64_t
h5_err_t
H5BlockWriteFieldAttribString (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const char *attrib_value
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: field name */
const char *attrib_name, /*!< IN: attribute name */
const char *value /*!< IN: attribute value */
);
h5_int64_t
h5_err_t
H5BlockReadFieldAttribString (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: field name */
const char *attrib_name, /*!< IN: attribute name */
char *buffer /*!< OUT: attribute value */
);
h5_ssize_t
H5BlockGetNumFieldAttribs (
h5_file_t *f,
const char *field_name
h5_file_t *const f, /*<! IN: file handle */
const char *field_name /*<! IN: field name */
);
h5_int64_t
H5BlockGetFieldAttribInfo (
h5_file_t *f,
const char *field_name,
const h5_int64_t attrib_idx,
char *attrib_name,
const h5_int64_t len_of_attrib_name,
h5_int64_t *attrib_type,
h5_int64_t *attrib_nelem
h5_file_t *const f, /*!< [in] Handle to open file */
const char *field_name, /*<! IN: field name */
const h5_size_t attrib_idx, /*!< [in] Index of attribute to
get infos about */
char *attrib_name, /*!< [out] Name of attribute */
const h5_size_t len_of_attrib_name,
/*!< [in] length of buffer \c name */
h5_int64_t *attrib_type, /*!< [out] Type of value. */
h5_size_t *attrib_nelem /*!< [out] Number of elements */
);
h5_int64_t
H5BlockReadFieldAttrib (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
void *attrib_value
);
h5_int64_t
H5BlockHasFieldData (
h5_file_t *f
);
#ifdef __cplusplus
}
#endif
#endif
+201
View File
@@ -0,0 +1,201 @@
#ifndef __H5BLOCK_READWRITE_H
#define __H5BLOCK_READWRITE_H
h5_err_t
H5Block3dWriteScalarFieldFloat64 (
h5_file_t *f,
const char *name,
const h5_float64_t *data
);
h5_err_t
H5Block3dReadScalarFieldFloat64 (
h5_file_t *f,
const char *name,
h5_float64_t *data
);
h5_err_t
H5Block3dWriteVector3dFieldFloat64 (
h5_file_t *f,
const char *name,
const h5_float64_t *x_data,
const h5_float64_t *y_data,
const h5_float64_t *z_data
);
h5_err_t
H5Block3dReadVector3dFieldFloat64 (
h5_file_t *f,
const char *name,
h5_float64_t *x_data,
h5_float64_t *y_data,
h5_float64_t *z_data
);
h5_err_t
H5Block3dWriteScalarFieldFloat32 (
h5_file_t *f,
const char *name,
const h5_float32_t *data
);
h5_err_t
H5Block3dReadScalarFieldFloat32 (
h5_file_t *f,
const char *name,
h5_float32_t *data
);
h5_err_t
H5Block3dWriteVector3dFieldFloat32 (
h5_file_t *f,
const char *name,
const h5_float32_t *x_data,
const h5_float32_t *y_data,
const h5_float32_t *z_data
);
h5_err_t
H5Block3dReadVector3dFieldFloat32 (
h5_file_t *f,
const char *name,
h5_float32_t *x_data,
h5_float32_t *y_data,
h5_float32_t *z_data
);
h5_err_t
H5Block3dWriteScalarFieldInt64 (
h5_file_t *f,
const char *name,
const h5_int64_t *data
);
h5_err_t
H5Block3dReadScalarFieldInt64 (
h5_file_t *f,
const char *name,
h5_int64_t *data
);
h5_err_t
H5Block3dWriteVector3dFieldInt64 (
h5_file_t *f,
const char *name,
const h5_int64_t *x_data,
const h5_int64_t *y_data,
const h5_int64_t *z_data
);
h5_err_t
H5Block3dReadVector3dFieldInt64 (
h5_file_t *f,
const char *name,
h5_int64_t *x_data,
h5_int64_t *y_data,
h5_int64_t *z_data
);
h5_err_t
H5Block3dWriteScalarFieldInt32 (
h5_file_t *f,
const char *name,
const h5_int32_t *data
);
h5_err_t
H5Block3dReadScalarFieldInt32 (
h5_file_t *f,
const char *name,
h5_int32_t *data
);
h5_err_t
H5Block3dWriteVector3dFieldInt32 (
h5_file_t *f,
const char *name,
const h5_int32_t *x_data,
const h5_int32_t *y_data,
const h5_int32_t *z_data
);
h5_err_t
H5Block3dReadVector3dFieldInt32 (
h5_file_t *f,
const char *name,
h5_int32_t *x_data,
h5_int32_t *y_data,
h5_int32_t *z_data
);
h5_err_t
H5BlockWriteFieldAttribFloat64 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const h5_float64_t *values,
const h5_size_t nvalues
);
h5_err_t
H5BlockReadFieldAttribFloat64 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
h5_float64_t *buffer
);
h5_err_t
H5BlockWriteFieldAttribFloat32 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const h5_float32_t *values,
const h5_size_t nvalues
);
h5_err_t
H5BlockReadFieldAttribFloat32 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
h5_float32_t *buffer
);
h5_err_t
H5BlockWriteFieldAttribInt64 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const h5_int64_t *values,
const h5_size_t nvalues
);
h5_err_t
H5BlockReadFieldAttribInt64 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
h5_int64_t *buffer
);
h5_err_t
H5BlockWriteFieldAttribInt32 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
const h5_int32_t *values,
const h5_size_t nvalues
);
h5_err_t
H5BlockReadFieldAttribInt32 (
h5_file_t *f,
const char *field_name,
const char *attrib_name,
h5_int32_t *buffer
);
#endif
-1
View File
@@ -19,7 +19,6 @@
#ifndef __H5FED_H
#define __H5FED_H
#include "H5.h"
#include "H5Fed_adjacency.h"
#include "H5Fed_inquiry.h"
#include "H5Fed_retrieve.h"
-2
View File
@@ -7,8 +7,6 @@ extern "C" {
#include "h5core/h5_core.h"
#include "H5.h"
#include "H5_inquiry.h"
#include "H5_attribs.h"
#include "H5Part.h"
#include "H5Block.h"
#include "H5Fed.h"
+1
View File
@@ -14,6 +14,7 @@
#include "h5u_readwrite.h"
#include "h5u_model.h"
#include "h5b_readwrite.h"
#include "h5b_model.h"
#include "h5b_attribs.h"
+12
View File
@@ -75,4 +75,16 @@ h5_traverse_steps (
h5_file_t * f /*!< file handle */
);
char *
h5_strdupfor2c (
const char *s,
const ssize_t len
);
char *
h5_strc2for (
char * const str,
const ssize_t l_str
);
#endif
+9
View File
@@ -11,6 +11,15 @@ h5_write_field_attrib (
const h5_int64_t attrib_nelem /*!< IN: number of elements */
);
h5_err_t
h5_read_field_attrib (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: field name */
const char *attrib_name, /*!< IN: attribute name */
const h5_int64_t attrib_type, /*!< IN: attribute type */
void *buffer /*!< OUT: attribute value */
);
h5_ssize_t
h5b_get_num_field_attribs (
h5_file_t *const f, /*<! IN: file handle */
+40
View File
@@ -0,0 +1,40 @@
#ifndef __H5B_READWRITE_H
#define __H5B_READWRITE_H
h5_err_t
h5b_write_scalar_data (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: name of field */
const void *data, /*!< IN: data to write */
const hid_t type /*!< IN: data type */
);
h5_err_t
h5b_write_vector3d_data (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: name of field */
const void *xdata, /*!< IN: x data to write */
const void *ydata, /*!< IN: y data to write */
const void *zdata, /*!< IN: z data to write */
const hid_t type /*!< IN: data type */
);
h5_err_t
h5b_read_scalar_data (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: name of field */
void *data, /*!< OUT: read bufer */
const hid_t type /*!< IN: data type */
);
h5_err_t
h5b_read_vector3d_data (
h5_file_t *const f, /*!< IN: file handle */
const char *field_name, /*!< IN: name of field */
void *xdata, /*!< IN: x data to write */
void *ydata, /*!< IN: y data to write */
void *zdata, /*!< IN: z data to write */
const hid_t type /*!< IN: data type */
);
#endif