diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2003-03-05 20:18:31 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2003-03-05 20:18:31 (GMT) |
commit | ff5c7fe0d55373fb636364d8e02239ad1ac2dd17 (patch) | |
tree | 74c9fd25a6dfbe5f9e2dd357e10b6c5679e0faca /fortran/src | |
parent | 1e7558dbd00e68b02a295c049a5b4b8bc175fe10 (diff) | |
download | hdf5-ff5c7fe0d55373fb636364d8e02239ad1ac2dd17.zip hdf5-ff5c7fe0d55373fb636364d8e02239ad1ac2dd17.tar.gz hdf5-ff5c7fe0d55373fb636364d8e02239ad1ac2dd17.tar.bz2 |
[svn-r6464]
Purpose:
Maintenance
Description:
* Added support for generic properties.
* Added support for time allocation properties.
* Added support for variable length datatypes (only datatypes based
on INTEGER, REAL and CHARACTER Fortran types are supported).
* added some missing functions
Solution:
I am checking in new Fortran APIs and their man pages to support
1.5 features listed above.
Not all APIs have tests yet. APIs were written in Fall 2002, and I am afraid
that I will loose the code or totally forget what I did if I wait longer. ;-)
Platforms tested:
arabica (fortran), eirene (fortran), modi4 (parallel, fortran)
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Df.c | 490 | ||||
-rw-r--r-- | fortran/src/H5Dff.f90 | 535 | ||||
-rw-r--r-- | fortran/src/H5Pf.c | 942 | ||||
-rw-r--r-- | fortran/src/H5Pff.f90 | 2262 | ||||
-rw-r--r-- | fortran/src/H5Sf.c | 202 | ||||
-rw-r--r-- | fortran/src/H5Sff.f90 | 371 | ||||
-rw-r--r-- | fortran/src/H5Tf.c | 27 | ||||
-rw-r--r-- | fortran/src/H5Tff.f90 | 49 | ||||
-rw-r--r-- | fortran/src/H5_f.c | 41 | ||||
-rw-r--r-- | fortran/src/H5_ff.f90 | 3 | ||||
-rw-r--r-- | fortran/src/H5f90global.f90 | 98 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 182 | ||||
-rw-r--r-- | fortran/src/HDF5.f90 | 1 | ||||
-rw-r--r-- | fortran/src/HDF5mpio.f90 | 1 |
14 files changed, 5119 insertions, 85 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 8870565..3d5c78a 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1,4 +1,5 @@ #include "H5f90.h" +#define MAX(a,b) (((a)>(b)) ? (a) : (b)) /*---------------------------------------------------------------------------- * Name: h5dcreate_c @@ -1017,3 +1018,492 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) return ret_value; } +/*---------------------------------------------------------------------------- + * Name: nh5dget_storage_size_c + * Purpose: Call H5Dget_storage_size to return the amount of storage + * required for a dataset + * Inputs: dset_id - identifier of the dataset + * Outputs: size - the amount of storage required for a dataset + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, October 22, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) +{ + int ret_value = -1; + hsize_t c_size; + hid_t c_dset_id; + + c_dset_id = (hid_t)*dset_id; + c_size = H5Dget_storage_size(c_dset_id); + if (c_size == 0) return ret_value; + *size = (hsize_t_f)c_size; + ret_value = 0; + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: nh5dvlen_get_max_len_c + * Purpose: Get the maximum size of the VL dataset element + * Inputs: dset_id - identifier of the dataset + * type_id - datatype identifier + * space_id - dataspace identifier + * Outputs: len - maximum length of the VL dataset element + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, October 22, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) +{ + int ret_value = -1; + size_t c_len; + hid_t c_dset_id; + hid_t c_type_id; + hid_t c_space_id; + hvl_t *c_buf; + int i,j; + hssize_t num_elem; + + c_dset_id = (hid_t)*dset_id; + c_type_id = (hid_t)*type_id; + c_space_id = (hid_t)*space_id; + + num_elem = H5Sget_select_npoints(c_space_id); + if( num_elem < 0) return ret_value; + + c_buf = (hvl_t *)malloc(sizeof(hvl_t)*num_elem); + if (c_buf == NULL) return ret_value; + if(H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf)) goto DONE; + + c_len = 0; + for (i=0; i < num_elem; i++) c_len = MAX(c_len, c_buf[i].len); + *len = (size_t_f)c_len; + ret_value = 0; + +DONE: + + H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf); + free(c_buf); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: nh5dwrite_vl_integer_c + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * len - array element lenghts + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Wednesday, October 23, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + int *tmp; + size_t max_len; + + hvl_t *c_buf; + int i, j; + hsize_t num_elem; + + max_len = (size_t)dims[0]; + num_elem = dims[1]; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t)); + if (c_buf == NULL) return ret_value; + tmp = buf; + for (i=0; i < num_elem; i++) { + c_buf[i].len = (size_t)len[i]; + c_buf[i].p = tmp; + tmp = tmp + max_len; + } + /* + * Call H5Dwrite function. + */ + status = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + + if( status < 0) goto DONE; + ret_value = 0; +DONE: + free(c_buf); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: nh5dread_vl_integer_c + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * Outputs: buf - data buffer + * len - array element lenghts + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Wednesday, October 24, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + size_t max_len; + + hvl_t *c_buf; + size_t i; + hssize_t num_elem; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + max_len = (size_t)dims[0]; + num_elem = H5Sget_select_npoints(c_mem_space_id); + if(num_elem != dims[1]) return ret_value; + + c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t)); + if (c_buf == NULL) return ret_value; + /* + * Call H5Dread function. + */ + status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + if ( status >=0 ) { + for (i=0; i < num_elem; i++) { + len[i] = (size_t_f)c_buf[i].len; + memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(int)); + } + } + ret_value = num_elem; +DONE: + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + free(c_buf); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: nh5dwrite_vl_string_c + * Purpose: Write variable length strings from Fortran program + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = number of strings of size max_len + * len - array of strings lengths + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 28, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + char *tmp, *tmp_p; + size_t max_len; + size_t buf_len; + + char **c_buf; + int i, j; + hsize_t num_elem; + + max_len = (size_t)dims[0]; + num_elem = dims[1]; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + /* + * Allocate arra of character pointers + */ + c_buf = (char **)malloc(num_elem * sizeof(char *)); + if (c_buf == NULL) return ret_value; + + /* Copy data to long C string */ + tmp = (char *)HD5f2cstring(buf, max_len*num_elem); + if (tmp == NULL) { free(c_buf); + return ret_value; + } + /* + * Move data from temorary buffer + */ + tmp_p = tmp; + for (i=0; i < num_elem; i++) { + c_buf[i] = (char *) malloc(len[i]+1); + memcpy(c_buf[i], tmp_p, len[i]); + c_buf[i][len[i]] = '\0'; + tmp_p = tmp_p + max_len; + } + + /* + * Call H5Dwrite function. + */ + status = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + + if( status < 0) goto DONE; + ret_value = 0; +DONE: + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + free(c_buf); + free(tmp); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: nh5dread_vl_string_c + * Purpose: Read variable length strings from Fortran program + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = number of strings of size max_len + * Output: buf - data buffer + * len - array of strings lengths + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, November 1, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + char *tmp, *tmp_p; + size_t max_len; + size_t buf_len; + + char **c_buf; + int i, j; + hsize_t num_elem; + + max_len = (size_t)dims[0]; + num_elem = dims[1]; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + /* + * Allocate array of character pointers + */ + c_buf = (char **)malloc(num_elem * sizeof(char *)); + if (c_buf == NULL) return ret_value; + + /* + * Call H5Dread function. + */ + status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + if (status < 0) { free(c_buf); + return ret_value; + } + /* Copy data to long C string */ + tmp = (char *)malloc(max_len*num_elem +1); + tmp_p = tmp; + for (i=0; i<max_len*num_elem; i++) tmp[i] = ' '; + tmp[max_len*num_elem] = '\0'; + for (i=0; i < num_elem; i++) { + memcpy(tmp_p, c_buf[i], strlen(c_buf[i])); + len[i] = (size_t_f)strlen(c_buf[i]); + tmp_p = tmp_p + max_len; + } + HD5packFstring(tmp, _fcdtocp(buf), max_len*num_elem); + ret_value = 0; +DONE: + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + free(c_buf); + free(tmp); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: nh5dwrite_vl_real_c + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * buf - data buffer + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * len - array element lenghts + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, November 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + float *tmp; + size_t max_len; + + hvl_t *c_buf; + int i, j; + hsize_t num_elem; + + max_len = (size_t)dims[0]; + num_elem = dims[1]; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t)); + if (c_buf == NULL) return ret_value; + tmp = buf; + for (i=0; i < num_elem; i++) { + c_buf[i].len = (size_t)len[i]; + c_buf[i].p = tmp; + tmp = tmp + max_len; + } + /* + * Call H5Dwrite function. + */ + status = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + + if( status < 0) goto DONE; + ret_value = 0; +DONE: + free(c_buf); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: nh5dread_vl_real_c + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * Outputs: buf - data buffer + * len - array element lenghts + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, November 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + size_t max_len; + + hvl_t *c_buf; + size_t i; + hssize_t num_elem; + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + + max_len = (size_t)dims[0]; + num_elem = H5Sget_select_npoints(c_mem_space_id); + if(num_elem != dims[1]) return ret_value; + + c_buf = (hvl_t *)malloc(num_elem * sizeof(hvl_t)); + if (c_buf == NULL) return ret_value; + /* + * Call H5Dread function. + */ + status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); + if ( status >=0 ) { + for (i=0; i < num_elem; i++) { + len[i] = (size_t_f)c_buf[i].len; + memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(float)); + } + } + ret_value = num_elem; +DONE: + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); + free(c_buf); + return ret_value; +} + diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index 25bc708..beebf5c 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -188,6 +188,18 @@ END INTERFACE + INTERFACE h5dwrite_vl_f + MODULE PROCEDURE h5dwrite_vl_integer + MODULE PROCEDURE h5dwrite_vl_real + MODULE PROCEDURE h5dwrite_vl_string + END INTERFACE + + INTERFACE h5dread_vl_f + MODULE PROCEDURE h5dread_vl_integer + MODULE PROCEDURE h5dread_vl_real + MODULE PROCEDURE h5dread_vl_string + END INTERFACE + CONTAINS !---------------------------------------------------------------------- @@ -9237,4 +9249,527 @@ hdferr = h5dget_create_plist_c(dataset_id, plist_id) END SUBROUTINE h5dget_create_plist_f +!---------------------------------------------------------------------- +! Name: h5dget_storage_size_f +! +! Purpose: Returns the amount of storage requires by a dataset +! +! Inputs: +! dataset_id - dataset identifier +! Outputs: +! size - datastorage size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 15, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + + SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dget_storage_size_f +!DEC$endif + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size + ! Amount of storage + ! allocated for dataset + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5dget_storage_size_c(dataset_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DGET_STORAGE_SIZE_C'::h5dget_storage_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5dget_storage_size_c + END INTERFACE + + hdferr = h5dget_storage_size_c(dataset_id, size) + END SUBROUTINE h5dget_storage_size_f + +!---------------------------------------------------------------------- +! Name: h5dvlen_get_max_len_f +! +! Purpose: Returns maximum lenght of the VL array elements +! +! Inputs: +! dataset_id - dataset identifier +! type_id - datatype identifier +! space_id - dataspace identifier +! Outputs: +! size - buffer size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 15, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + + SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len, hdferr) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dvlen_get_max_len_f +!DEC$endif + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(SIZE_T), INTENT(OUT) :: len ! Maximum length of the element + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DVLEN_GET_MAX_LEN_C'::h5dvlen_get_max_len_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(SIZE_T), INTENT(OUT) :: len + END FUNCTION h5dvlen_get_max_len_c + END INTERFACE + + hdferr = h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) + END SUBROUTINE h5dvlen_get_max_len_f + + SUBROUTINE h5dwrite_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dwrite_vl_integer +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the lenght of each + ! element + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DWRITE_VL_INTEGER_C'::h5dwrite_vl_integer_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_integer_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dwrite_vl_integer + + SUBROUTINE h5dread_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dread_vl_integer +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store + ! the lenght of each + ! element + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error + + INTERFACE + INTEGER FUNCTION h5dread_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DREAD_VL_INTEGER_C'::h5dread_vl_integer_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_vl_integer_c + END INTERFACE + + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dread_vl_integer + + SUBROUTINE h5dwrite_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dwrite_vl_real +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the lenght of each + ! element + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DWRITE_VL_REAL_C'::h5dwrite_vl_real_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_real_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dwrite_vl_real + + SUBROUTINE h5dread_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dread_vl_real +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store + ! the lenght of each + ! element + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error + + INTERFACE + INTEGER FUNCTION h5dread_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DREAD_VL_REAL_C'::h5dread_vl_real_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_vl_real_c + END INTERFACE + + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) + + END SUBROUTINE h5dread_vl_real + + SUBROUTINE h5dwrite_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dwrite_vl_string +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len ! Array to store + ! the lenght of each + ! element + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default +! CHARACTER, DIMENSION(dims(1)*dims(2)) :: tmp_buf + integer i, j + + INTERFACE + INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & +! xfer_prp_default, tmp_buf, dims, str_len) + xfer_prp_default, buf, dims, str_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DWRITE_VL_STRING_C'::h5dwrite_vl_string_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len +! CHARACTER, INTENT(IN), & +! DIMENSION(dims(1)*dims(2)) :: tmp_buf + CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf + END FUNCTION h5dwrite_vl_string_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id +! do i = 1, dims(2) +! do j = 1, dims(1) +! tmp_buf((i-1)*dims(1) +j) = buf(i)(j:j) +! enddo +! enddo +! write(*,*) (tmp_buf(j:j), j=1,dims(1)*dims(2)) +! write(*,*) str_len(1), str_len(2), str_len(3), str_len(4) + + hdferr = h5dwrite_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) + + END SUBROUTINE h5dwrite_vl_string + + SUBROUTINE h5dread_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dread_vl_string +!DEC$endif + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len ! Array to store + ! the lenght of each + ! element + CHARACTER(LEN=*), INTENT(OUT), & + DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id + ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id + ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default +! CHARACTER, DIMENSION(dims(1)*dims(2)) :: tmp_buf +! integer i, j + + INTERFACE + INTEGER FUNCTION h5dread_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & +! xfer_prp_default, tmp_buf, dims, str_len) + xfer_prp_default, buf, dims, str_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5DREAD_VL_STRING_C'::h5dread_vl_string_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len +! CHARACTER, INTENT(IN), & +! DIMENSION(dims(1)*dims(2)) :: tmp_buf + CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf + END FUNCTION h5dread_vl_string_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + if (present(xfer_prp)) xfer_prp_default = xfer_prp + if (present(mem_space_id)) mem_space_id_default = mem_space_id + if (present(file_space_id)) file_space_id_default = file_space_id +! do i = 1, dims(2) +! do j = 1, dims(1) +! tmp_buf((i-1)*dims(1) +j) = buf(i)(j:j) +! enddo +! enddo +! write(*,*) (tmp_buf(j:j), j=1,dims(1)*dims(2)) +! write(*,*) str_len(1), str_len(2), str_len(3), str_len(4) + + hdferr = h5dread_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) + RETURN + END SUBROUTINE h5dread_vl_string END MODULE H5D diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 0e08e28..27de148 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -4,53 +4,24 @@ /*---------------------------------------------------------------------------- * Name: h5pcreate_c * Purpose: Call H5Pcreate to create a property list - * Inputs: classtype - type of the property list + * Inputs: class - property list class identifier * Outputs: prp_id - identifier of the created property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Saturday, August 14, 1999 + * Wednesday, October 9, 2002 * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id ) +nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) { - hid_t c_classtype; + hid_t c_class; int CASE; int ret_value = 0; hid_t c_prp_id; - /*CASE = (int)*classtype; */ - c_classtype = (hid_t)*classtype; -/* - - switch (CASE) { - - case (H5P_FILE_CREATE_F): - c_classtype = H5P_FILE_CREATE; - break; - - case(H5P_FILE_ACCESS_F): - c_classtype = H5P_FILE_ACCESS; - break; - - case(H5P_DATASET_CREATE_F): - c_classtype = H5P_DATASET_CREATE; - break; - - case(H5P_DATASET_XFER_F): - c_classtype = H5P_DATASET_XFER; - break; - - case(H5P_MOUNT_F): - c_classtype = H5P_MOUNT; - break; - - default: - ret_value = -1; - return ret_value; - } -*/ - c_prp_id = H5Pcreate(c_classtype); + + c_class = (hid_t)*class; + c_prp_id = H5Pcreate(c_class); if ( c_prp_id < 0 ) ret_value = -1; *prp_id = (hid_t_f)c_prp_id; @@ -1937,3 +1908,902 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) ret_value = 0; return ret_value; } +/*---------------------------------------------------------------------------- + * Name: h5pfill_value_defined_c + * Purpose: Call H5Pfill_value_defined to check if fill value is defined + * Inputs: prp_id - dataset creation property list identifier + * Outputs: flag - fill value status flag + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, October 4, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) +{ + int ret_value = -1; + hid_t c_prp_id; + H5D_fill_value_t c_flag; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pfill_value_defined(c_prp_id, &c_flag) < 0 ) return ret_value; + *flag = (int_f)c_flag; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_alloc_time_c + * Purpose: Call H5Pget_alloc_time to get space allocation + * time for dataset during creation + * Inputs: prp_id - dataset creation property list identifier + * Outputs: flag - allocation time flag + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, October 4, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +{ + int ret_value = -1; + hid_t c_prp_id; + H5D_alloc_time_t c_flag; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_alloc_time(c_prp_id, &c_flag) < 0 ) return ret_value; + *flag = (int_f)c_flag; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_alloc_time_c + * Purpose: Call H5Pset_alloc_time to get space allocation + * time for dataset during creation + * Inputs: prp_id - dataset creation property list identifier + * flag - allocation time flag + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, October 4, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +{ + int ret_value = -1; + hid_t c_prp_id; + H5D_alloc_time_t c_flag; + + c_prp_id = (hid_t)*prp_id; + c_flag = (H5D_alloc_time_t)*flag; + if ( H5Pset_alloc_time(c_prp_id, c_flag) < 0 ) return ret_value; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_fill_time_c + * Purpose: Call H5Pget_fill_time to get fill value writing + * time for dataset during creation + * Inputs: prp_id - dataset creation property list identifier + * Outputs: flag - fill value writing time flag + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, October 4, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) +{ + int ret_value = -1; + hid_t c_prp_id; + H5D_fill_time_t c_flag; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_fill_time(c_prp_id, &c_flag) < 0 ) return ret_value; + *flag = (int_f)c_flag; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_fill_time_c + * Purpose: Call H5Pset_fill_time to set fill value writing + * time for dataset during creation + * Inputs: prp_id - dataset creation property list identifier + * flag - fill value writing time flag + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, October 4, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) +{ + int ret_value = -1; + hid_t c_prp_id; + H5D_fill_time_t c_flag; + + c_prp_id = (hid_t)*prp_id; + c_flag = (H5D_fill_time_t)*flag; + if ( H5Pset_fill_time(c_prp_id, c_flag) < 0 ) return ret_value; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_meta_block_size_c + * Purpose: Call H5Pset_meta_block_size to set size of metadata block + * Inputs: prp_id - file access property list identifier + * size - size of the metadata block + * Outputs: NONE + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + hsize_t c_size; + + c_prp_id = (hid_t)*prp_id; + c_size = (hsize_t)*size; + if ( H5Pset_meta_block_size(c_prp_id, c_size) < 0 ) ret_value = -1; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_meta_block_size_c + * Purpose: Call H5Pget_meta_block_size to get size of metadata block + * Inputs: prp_id - file access property list identifier + * Outputs: + * size - size of the metadata block + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + hsize_t c_size; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_meta_block_size(c_prp_id, &c_size) < 0 ) ret_value = -1; + *size = (hsize_t_f)c_size; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_sieve_buf_size_c + * Purpose: Call H5Pset_sieve_buf_size to set size of datasieve buffer + * Inputs: prp_id - file access property list identifier + * size - size of the buffer + * Outputs: NONE + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + size_t c_size; + + c_prp_id = (hid_t)*prp_id; + c_size = (size_t)*size; + if ( H5Pset_sieve_buf_size(c_prp_id, c_size) < 0 ) ret_value = -1; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_sieve_buf_size_c + * Purpose: Call H5Pget_sieve_buf_size to get size of datasieve buffer + * Inputs: prp_id - file access property list identifier + * Outputs: + * size - size of the buffer + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + size_t c_size; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_sieve_buf_size(c_prp_id, &c_size) < 0 ) ret_value = -1; + *size = (size_t_f)c_size; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_small_data_block_size_c + * Purpose: Call H5Pset_small_data_block_size to set size of raw small data block + * Inputs: prp_id - file access property list identifier + * size - size of the block + * Outputs: NONE + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + hsize_t c_size; + + c_prp_id = (hid_t)*prp_id; + c_size = (hsize_t)*size; + if ( H5Pset_small_data_block_size(c_prp_id, c_size) < 0 ) ret_value = -1; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_small_data_block_size_c + * Purpose: Call H5Pget_small_data_block_size to get size of raw small data block + * Inputs: prp_id - file access property list identifier + * Outputs: + * size - size of the block + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + hsize_t c_size; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_small_data_block_size(c_prp_id, &c_size) < 0 ) ret_value = -1; + *size = (hsize_t_f)c_size; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_hyper_vector_size_c + * Purpose: Call H5Pset_hyper_vector_size to set size of the hyper vector + * Inputs: prp_id - dataset transfer property list identifier + * size - size of the vector + * Outputs: NONE + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + size_t c_size; + + c_prp_id = (hid_t)*prp_id; + c_size = (size_t)*size; + if ( H5Pset_hyper_vector_size(c_prp_id, c_size) < 0 ) ret_value = -1; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_hyper_vector_size_c + * Purpose: Call H5Pget_hyper_vector_size to get size of the hyper vector + * Inputs: prp_id - dataset transfer property list identifier + * Outputs: + * size - size of the vector + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +{ + int ret_value = 0; + hid_t c_prp_id; + size_t c_size; + + c_prp_id = (hid_t)*prp_id; + if ( H5Pget_hyper_vector_size(c_prp_id, &c_size) < 0 ) ret_value = -1; + *size = (size_t_f)c_size; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pcreate_class_c + * Purpose: Call H5Pcreate_class ito create a new property class + * Inputs: parent - property list class identifier + * name - name of the new class + * name_len - lenght of the "name" buffer + * Outputs: class - new class identifier + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class) +{ + int ret_value = -1; + hid_t c_parent; + hid_t c_class; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + c_parent = (hid_t)*parent; + + /* + * Call H5Pcreate_class function. + */ + c_class = H5Pcreate_class(c_parent, c_name, NULL, NULL,NULL,NULL,NULL,NULL); + if (c_class < 0) goto DONE; + *class = (hid_t_f)c_class; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pregisterc_c + * Purpose: Call h5pregister_c to registers a permanent property + * Inputs: class - property list class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * size - property size + * value - property value of character type + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) +{ + int ret_value = -1; + + /* + * Call h5pregister_c function + */ + ret_value = nh5pregister_c(class, name, name_len, size, _fcdtocp(value)); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pregister_c + * Purpose: Call H5Pregister to registers a permanent property + * Inputs: class - property list class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * size - property size + * value - property value + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void *value) +{ + int ret_value = -1; + hid_t c_class; + char* c_name; + size_t c_size; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + c_size = (size_t)*size; + c_class = (hid_t)*class; + + /* + * Call H5Pregister function. + */ + if( H5Pregister(c_class, c_name, c_size, value, NULL,NULL,NULL,NULL,NULL,NULL) <0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pinsertc_c + * Purpose: Call h5pinsert_c to register a temporary property + * Inputs: plist - property list identifier + * name - name of the new property + * name_len - length of the "name" buffer + * size - property size + * value - property value of character type + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) +{ + int ret_value = -1; + + /* + * Call h5pinsert_c function + */ + ret_value = nh5pinsert_c(plist, name, name_len, size, _fcdtocp(value)); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pinsert_c + * Purpose: Call H5Pinsert to iinsert a temporary property + * Inputs: plist - property list class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * size - property size + * value - property value + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value) +{ + int ret_value = -1; + hid_t c_plist; + char* c_name; + size_t c_size; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + c_size = (size_t)*size; + c_plist = (hid_t)*plist; + + /* + * Call H5Pinsert function. + */ + if( H5Pinsert(c_plist, c_name, c_size, value, NULL,NULL,NULL,NULL,NULL) <0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pexist_c + * Purpose: Call H5Pexist to querie whether a property name exists + * in a property list or class + * Inputs: plist - property list or property class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * Returns: nonnegative on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len) +{ + int ret_value = -1; + hid_t c_class; + char* c_name; + htri_t status; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + + c_class = (hid_t)*class; + /* + * Call H5Pexist function. + */ + status = H5Pexist(c_class, c_name); + ret_value = status; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pisa_class_c + * Purpose: Call H5Pisa_class to querie whether a property is a + * member of a class + * Inputs: plist - property list identifier + * class - property class identifier + * Returns: nonnegative on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pisa_class_c(hid_t_f *plist, hid_t_f *class) +{ + int ret_value = -1; + hid_t c_class; + hid_t c_plist; + htri_t status; + + c_class = (hid_t)*class; + c_plist = (hid_t)*plist; + + /* + * Call H5Pisa_class function. + */ + status = H5Pisa_class(c_plist, c_class); + ret_value = status; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_size_c + * Purpose: Call H5Pget_size to querie the size of the property + * Inputs: plist - property list to query + * name - name of the property + * name_len - length of the "name" buffer + * Outputs: size - size of the property in bytes + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) +{ + int ret_value = -1; + hid_t c_plist; + char* c_name; + size_t c_size; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + + c_plist = (hid_t)*plist; + /* + * Call H5Pget_size function. + */ + if( H5Pget_size(c_plist, c_name, &c_size) < 0) goto DONE; + *size = (size_t_f)c_size; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_nprops_c + * Purpose: Call H5Pget_nporps to get number of the properties in the list + * Inputs: plist - property list to query + * Outputs: nprops - number of properties in the list + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) +{ + int ret_value = -1; + hid_t c_plist; + size_t c_nprops; + + c_plist = (hid_t)*plist; + + /* + * Call H5Pget_nprops function. + */ + if( H5Pget_nprops(c_plist, &c_nprops) < 0) return ret_value; + + *nprops = (size_t_f)c_nprops; + ret_value = 0; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_class_parent_c + * Purpose: Call H5Pget_class_parent to get the parent class of + * a genereic property class + * Inputs: prp_id - property list to query + * Outputs: parent_id - parent classs identifier + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) +{ + int ret_value = -1; + hid_t c_prp_id; + hid_t c_parent_id; + + c_prp_id = (hid_t)*prp_id; + + /* + * Call H5Pget_class_parent function. + */ + c_parent_id = H5Pget_class_parent(c_prp_id); + if( c_parent_id < 0) return ret_value; + + *parent_id =(hid_t_f)c_parent_id; + ret_value = 0; +} +/*---------------------------------------------------------------------------- + * Name: h5pcopy_prop_c + * Purpose: Call H5Pcopy_prop to copy a property from one list or + * class to another + * Inputs: dst_id - identifier of destination property list + * src_id - identifier of source property list + * name - name of the property + * name_len - length of the "name" buffer + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) +{ + int ret_value = -1; + hid_t c_dst_id, c_src_id; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + + c_dst_id = (hid_t)*dst_id; + c_src_id = (hid_t)*src_id; + /* + * Call H5Pcopy_prop function. + */ + if( H5Pcopy_prop(c_dst_id, c_src_id, c_name) < 0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5premove_c + * Purpose: Call H5Premove to remove a property from a list + * Inputs: plid - identifier of property list + * name - name of the property to remove + * name_len - length of the "name" buffer + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) +{ + int ret_value = -1; + hid_t c_plid; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + + c_plid = (hid_t)*plid; + /* + * Call H5Premove function. + */ + if( H5Premove(c_plid, c_name) < 0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5punregister_c + * Purpose: Call H5Punregister to remove a property from a property class + * Inputs: class - identifier of property class + * name - name of the property to unregister + * name_len - length of the "name" buffer + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len) +{ + int ret_value = -1; + hid_t c_class; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + + c_class = (hid_t)*class; + /* + * Call H5Punregister function. + */ + if( H5Punregister(c_class, c_name) < 0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pclose_class_c + * Purpose: Call H5Pclose_class to close property class + * Inputs: class - identifier of property class to close + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pclose_class_c(hid_t_f *class) +{ + int ret_value = -1; + hid_t c_class; + + c_class = (hid_t)*class; + /* + * Call H5Pclose_class function. + */ + if( H5Pclose_class(c_class) < 0) return ret_value; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pget_class_name_c + * Purpose: Call H5Pget_class_name to get property class name + * Inputs: class - identifier of property class + * name - ibuffer to retrieve name in + * name_len - length of the "name" buffer + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len) +{ + int ret_value = -1; + hid_t c_class; + char* c_name; + + + c_class = (hid_t)*class; + /* + * Call H5Pget_class_name function. + */ + c_name = H5Pget_class_name(c_class); + if( c_name == NULL) goto DONE; + + HD5packFstring(c_name, _fcdtocp(name), (int)*name_len); + ret_value = strlen(c_name); + +DONE: + HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pset_c + * Purpose: Call h5setc_c to set property with the character string value + * Inputs: plist - property list identifier + * name - name of property + * name_len - length of the "name" buffer + * value - property value of character type + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) +{ + int ret_value = -1; + + /* + * Call h5pset_c function + */ + ret_value = nh5pset_c(plist, name, name_len, _fcdtocp(value)); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pset_c + * Purpose: Call H5Pset to set property value + * Inputs: plist - property list class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * value - property value + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) +{ + int ret_value = -1; + hid_t c_plist; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + c_plist = (hid_t)*plist; + + /* + * Call H5Pset function. + */ + if( H5Pset(c_plist, c_name, value) <0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5pgetc_c + * Purpose: Call h5set_c to set property with the character string value + * Inputs: plist - property list identifier + * name - name of property + * name_len - length of the "name" buffer + * Output: value - property value of character type + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) +{ + int ret_value = -1; + + /* + * Call h5pget_c function + */ + ret_value = nh5pget_c(plist, name, name_len, _fcdtocp(value)); + return ret_value; +} + +/*---------------------------------------------------------------------------- + * Name: h5pget_c + * Purpose: Call H5Pget to set property value + * Inputs: plist - property list class identifier + * name - name of the new property + * name_len - length of the "name" buffer + * Output: value - property value + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * October 11, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) +{ + int ret_value = -1; + hid_t c_plist; + char* c_name; + + c_name = (char *)HD5f2cstring(name, (int)*name_len); + if (c_name == NULL) goto DONE; + c_plist = (hid_t)*plist; + + /* + * Call H5Pset function. + */ + if( H5Pget(c_plist, c_name, value) <0) goto DONE; + ret_value = 0; + +DONE: + if(c_name != NULL) HDfree(c_name); + return ret_value; +} diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index f360660..f97bd2b 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -23,6 +23,42 @@ MODULE PROCEDURE h5pget_fill_value_char END INTERFACE + INTERFACE h5pset_f + MODULE PROCEDURE h5pset_integer + MODULE PROCEDURE h5pset_real +! Comment if on T3E + MODULE PROCEDURE h5pset_double +! End comment if on T3E + MODULE PROCEDURE h5pset_char + END INTERFACE + + INTERFACE h5pget_f + MODULE PROCEDURE h5pget_integer + MODULE PROCEDURE h5pget_real +! Comment if on T3E + MODULE PROCEDURE h5pget_double +! End comment if on T3E + MODULE PROCEDURE h5pget_char + END INTERFACE + + INTERFACE h5pregister_f + MODULE PROCEDURE h5pregister_integer + MODULE PROCEDURE h5pregister_real +! Comment if on T3E + MODULE PROCEDURE h5pregister_double +! End comment if on T3E + MODULE PROCEDURE h5pregister_char + END INTERFACE + + INTERFACE h5pinsert_f + MODULE PROCEDURE h5pinsert_integer + MODULE PROCEDURE h5pinsert_real +! Comment if on T3E + MODULE PROCEDURE h5pinsert_double +! End comment if on T3E + MODULE PROCEDURE h5pinsert_char + END INTERFACE + CONTAINS !---------------------------------------------------------------------- @@ -32,7 +68,7 @@ ! list class. ! ! Inputs: -! classtype - type of the property list to be created. +! class - type of the property class to be created. ! Possible values are: ! H5P_FILE_CREATE_F ! H5P_FILE_ACCESS_F @@ -56,7 +92,7 @@ ! ! Comment: !---------------------------------------------------------------------- - SUBROUTINE h5pcreate_f(classtype, prp_id, hdferr) + SUBROUTINE h5pcreate_f(class, prp_id, hdferr) ! !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) @@ -64,7 +100,7 @@ !DEC$endif ! IMPLICIT NONE - INTEGER, INTENT(IN) :: classtype ! The type of the property list + INTEGER(HID_T), INTENT(IN) :: class ! The type of the property list ! to be created. Possible values ! are: ! H5P_FILE_CREATE_F @@ -79,17 +115,17 @@ ! MS FORTRAN needs explicit interface for C functions called here. ! INTERFACE - INTEGER FUNCTION h5pcreate_c(classtype, prp_id) + INTEGER FUNCTION h5pcreate_c(class, prp_id) USE H5GLOBAL !DEC$ IF DEFINED(HDF5F90_WINDOWS) !MS$ATTRIBUTES C,reference,alias:'_H5PCREATE_C'::h5pcreate_c !DEC$ ENDIF - INTEGER, INTENT(IN) :: classtype + INTEGER(HID_T), INTENT(IN) :: class INTEGER(HID_T), INTENT(OUT) :: prp_id END FUNCTION h5pcreate_c END INTERFACE - hdferr = h5pcreate_c(classtype, prp_id) + hdferr = h5pcreate_c(class, prp_id) END SUBROUTINE h5pcreate_f !---------------------------------------------------------------------- @@ -3429,5 +3465,2219 @@ hdferr = h5pget_buffer_c(plist_id, size) END SUBROUTINE h5pget_buffer_f +!---------------------------------------------------------------------- +! Name: h5pfill_value_defined_f +! +! Purpose: Check if fill value is defined. +! +! Inputs: +! plist_id - dataset creation property list identifier +! Outputs: +! flag - fill value status flag +! Possible values are: +! H5D_FILL_VALUE_ERROR_F +! H5D_FILL_VALUE_UNDEFINED_F +! H5D_FILL_VALUE_DEFAULT_F +! H5D_FILL_VALUE_USER_DEFINED_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 4, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pfill_value_defined_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pfill_value_defined_c(plist_id, flag) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PFILL_VALUE_DEFINED_C'::h5pfill_value_defined_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pfill_value_defined_c + END INTERFACE + + hdferr = h5pfill_value_defined_c(plist_id, flag) + END SUBROUTINE h5pfill_value_defined_f + +!---------------------------------------------------------------------- +! Name: h5pset_alloc_time_f +! +! Purpose: Set space allocation time for dataset during creation. +! +! Inputs: +! plist_id - dataset creation property list identifier +! flag - allocation time flag +! Possible values are: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 4, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_alloc_time_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pset_alloc_time_c(plist_id, flag) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_ALLOC_TIME_C'::h5pset_alloc_time_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_alloc_time_c + END INTERFACE + + hdferr = h5pset_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pset_alloc_time_f + +!---------------------------------------------------------------------- +! Name: h5pget_alloc_time_f +! +! Purpose: Get space allocation time for dataset during creation. +! +! Inputs: +! plist_id - dataset creation property list identifier +! Outputs: +! flag - allocation time flag +! Possible values are: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 4, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_alloc_time_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pget_alloc_time_c(plist_id, flag) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_ALLOC_TIME_C'::h5pget_alloc_time_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_alloc_time_c + END INTERFACE + + hdferr = h5pget_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pget_alloc_time_f + +!---------------------------------------------------------------------- +! Name: h5pset_fill_time_f +! +! Purpose: Set fill value writing time for dataset +! +! Inputs: +! plist_id - dataset creation property list identifier +! flag - fill time flag +! Possible values are: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 4, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_fill_time_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pset_fill_time_c(plist_id, flag) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_FILL_TIME_C'::h5pset_fill_time_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fill_time_c + END INTERFACE + + hdferr = h5pset_fill_time_c(plist_id, flag) + END SUBROUTINE h5pset_fill_time_f + +!---------------------------------------------------------------------- +! Name: h5pget_fill_time_f +! +! Purpose: Get fill value writing time for dataset +! +! Inputs: +! plist_id - dataset creation property list identifier +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! flag - fill time flag +! Possible values are: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! NONE +! +! Programmer: Elena Pourmal +! October 4, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_fill_time_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER FUNCTION h5pget_fill_time_c(plist_id, flag) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_FILL_TIME_C'::h5pget_fill_time_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_fill_time_c + END INTERFACE + + hdferr = h5pget_fill_time_c(plist_id, flag) + END SUBROUTINE h5pget_fill_time_f + +!---------------------------------------------------------------------- +! Name: h5pset_meta_block_size_f +! +! Purpose: Sets the minimum size of metadata block allocations +! +! Inputs: +! plist_id - file access property list identifier +! size - metatdata block size +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_meta_block_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pset_meta_block_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_META_BLOCK_SIZE_C'::h5pset_meta_block_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_meta_block_size_c + END INTERFACE + + hdferr = h5pset_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pset_meta_block_size_f + +!---------------------------------------------------------------------- +! Name: h5pget_meta_block_size_f +! +! Purpose: Gets the minimum size of metadata block allocations +! +! Inputs: +! plist_id - file access property list identifier +! Outputs: +! size - metatdata block size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_meta_block_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_meta_block_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_META_BLOCK_SIZE_C'::h5pset_meta_block_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_meta_block_size_c + END INTERFACE + + hdferr = h5pget_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pget_meta_block_size_f + +!---------------------------------------------------------------------- +! Name: h5pset_sieve_buf_size_f +! +! Purpose: Sets the maximum size of the data sieve buffer +! +! Inputs: +! plist_id - file access property list identifier +! size - sieve buffer size +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_sieve_buf_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pset_sieve_buf_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_SIEVE_BUF_SIZE_C'::h5pset_sieve_buf_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_sieve_buf_size_c + END INTERFACE + + hdferr = h5pset_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pset_sieve_buf_size_f + +!---------------------------------------------------------------------- +! Name: h5pget_sieve_buf_size_f +! +! Purpose: Gets the maximum size of the data sieve buffer +! +! Inputs: +! plist_id - file access property list identifier +! Outputs: +! size - sieve buffer size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_sieve_buf_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_sieve_buf_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_SIEVE_BUF_SIZE_C'::h5pget_sieve_buf_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_sieve_buf_size_c + END INTERFACE + + hdferr = h5pget_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pget_sieve_buf_size_f + +!---------------------------------------------------------------------- +! Name: h5pset_small_data_block_size_f +! +! Purpose: Sets the minimum size of "small" raw data block +! +! Inputs: +! plist_id - file access property list identifier +! size - small raw data block size +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_small_data_block_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pset_small_data_block_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_SMALL_DATA_BLOCK_SIZE_C'::h5pset_small_data_block_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_small_data_block_size_c + END INTERFACE + + hdferr = h5pset_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pset_small_data_block_size_f + +!---------------------------------------------------------------------- +! Name: h5pget_small_data_block_size_f +! +! Purpose: Gets the minimum size of "small" raw data block +! +! Inputs: +! plist_id - file access property list identifier +! Outputs: +! size - small raw data block size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_small_data_block_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_small_data_block_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_SMALL_DATA_BLOCK_SIZE_C'::h5pget_small_data_block_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pget_small_data_block_size_c + END INTERFACE + + hdferr = h5pget_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pget_small_data_block_size_f + +!---------------------------------------------------------------------- +! Name: h5pset_hyper_vector_size_f +! +! Purpose: Set the number of "I/O" vectors (vector size) +! +! Inputs: +! plist_id - dataset transfer property list identifier +! size - vector size +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_hyper_vector_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pset_hyper_vector_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_HYPER_VECTOR_SIZE_C'::h5pset_hyper_vector_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_hyper_vector_size_c + END INTERFACE + + hdferr = h5pset_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pset_hyper_vector_size_f + +!---------------------------------------------------------------------- +! Name: h5pget_hyper_vector_size_f +! +! Purpose: Get the number of "I/O" vectors (vector size) +! +! Inputs: +! plist_id - dataset transfer property list identifier +! Outputs: +! size - vector size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_hyper_vector_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_hyper_vector_size_c(plist_id, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_HYPER_VECTOR_SIZE_C'::h5pget_hyper_vector_size_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_hyper_vector_size_c + END INTERFACE + + hdferr = h5pget_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pget_hyper_vector_size_f + +!---------------------------------------------------------------------- +! Name: h5pset_integer +! +! Purpose: Sets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_integer +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_C'::h5pset_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER, INTENT(IN) :: value + END FUNCTION h5pset_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pset_c(prp_id, name , name_len, value) + END SUBROUTINE h5pset_integer + +!---------------------------------------------------------------------- +! Name: h5pset_real +! +! Purpose: Sets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_real(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_real +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_C'::h5pset_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + REAL, INTENT(IN) :: value + END FUNCTION h5pset_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pset_c(prp_id, name , name_len, value) + END SUBROUTINE h5pset_real + +!---------------------------------------------------------------------- +! Name: h5pset_double +! +! Purpose: Sets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_double(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_double +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + DOUBLE PRECISION, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSET_C'::h5pset_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + DOUBLE PRECISION, INTENT(IN) :: value + END FUNCTION h5pset_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pset_c(prp_id, name , name_len, value) + END SUBROUTINE h5pset_double + +!---------------------------------------------------------------------- +! Name: h5pset_char +! +! Purpose: Sets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pset_char(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pset_char +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + INTEGER :: value_len + + INTERFACE + INTEGER FUNCTION h5psetc_c(prp_id, name, name_len, value, value_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSETC_C'::h5psetc_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5psetc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5psetc_c(prp_id, name , name_len, value, value_len) + END SUBROUTINE h5pset_char + +!---------------------------------------------------------------------- +! Name: h5pget_integer +! +! Purpose: Gets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! Outputs: +! value - value of property +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_integer +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_C'::h5pget_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER, INTENT(OUT) :: value + END FUNCTION h5pget_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name , name_len, value) + END SUBROUTINE h5pget_integer + +!---------------------------------------------------------------------- +! Name: h5pget_real +! +! Purpose: Gets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! Outputs: +! value - value of property +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_real(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_real +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_C'::h5pget_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + REAL, INTENT(OUT) :: value + END FUNCTION h5pget_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name , name_len, value) + END SUBROUTINE h5pget_real + +!---------------------------------------------------------------------- +! Name: h5pget_double +! +! Purpose: Gets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! Outputs: +! value - value of property +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_double(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_double +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + DOUBLE PRECISION, INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_C'::h5pget_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + DOUBLE PRECISION, INTENT(OUT) :: value + END FUNCTION h5pget_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name , name_len, value) + END SUBROUTINE h5pget_double + +!---------------------------------------------------------------------- +! Name: h5pget_char +! +! Purpose: Gets a property list value +! +! Inputs: +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! Outputs: +! value - value of property +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_char(prp_id, name, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_char +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + INTEGER :: value_len + + INTERFACE + INTEGER FUNCTION h5pgetc_c(prp_id, name, name_len, value, value_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PSETC_C'::h5psetc_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + CHARACTER(LEN=*), INTENT(OUT) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pgetc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pgetc_c(prp_id, name , name_len, value, value_len) + END SUBROUTINE h5pget_char + +!---------------------------------------------------------------------- +! Name: h5pexist_f +! +! Purpose: Queries whether a property name exists in a property list or class. +! +! Inputs: +! prp_id - iproperty list identifier to query +! name - name of property to check for +! Outputs: +! flag - logical flag +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pexist_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. + ! otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pexist_c(prp_id, name, name_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PEXIST_C'::h5pexist_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pexist_c + END INTERFACE + flag = .FALSE. + name_len = LEN(name) + hdferr = h5pexist_c(prp_id, name , name_len) + if (hdferr > 0) then + flag = .TRUE. + hdferr = 0 + endif + END SUBROUTINE h5pexist_f + +!---------------------------------------------------------------------- +! Name: h5pget_size_f +! +! Purpose: Queries the size of a property value in bytes. +! +! Inputs: +! prp_id - property list identifier to query +! name - name of property to query +! Outputs: +! size - size of property in bytes +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_size_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query + INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_size_c(prp_id, name, name_len, size) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_SIZE_C'::h5pget_size_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_size_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pget_size_c(prp_id, name , name_len, size) + END SUBROUTINE h5pget_size_f + +!---------------------------------------------------------------------- +! Name: h5pget_npros_f +! +! Purpose: Queries number of properties in property list or class +! +! Inputs: +! prp_id - iproperty list identifier to query +! Outputs: +! nprops - number of properties in property object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_nprops_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: nprops ! iNumber of properties + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_nprops_c(prp_id, nprops) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_NPROPS_C'::h5pget_nprops_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: nprops + END FUNCTION h5pget_nprops_c + END INTERFACE + hdferr = h5pget_nprops_c(prp_id, nprops) + END SUBROUTINE h5pget_nprops_f + +!---------------------------------------------------------------------- +! Name: h5pget_class_name_f +! +! Purpose: Queries the ithe name of a class. +! +! Inputs: +! prp_id - property list identifier to query +! Outputs: +! name - name of a class +! hdferr: - error code +! +! Success: Actual lenght of the class name +! If provided buffer "name" is +! smaller, than name will be +! truncated to fit into +! provided user buffer +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_class_name_f(prp_id, name, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_class_name_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(INOUT) :: name ! Buffer to retireve class name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pget_class_name_c(prp_id, name, name_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_CLASS_NAME_C'::h5pget_class_name_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pget_class_name_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pget_class_name_c(prp_id, name , name_len) + END SUBROUTINE h5pget_class_name_f + +!---------------------------------------------------------------------- +! Name: h5pget_class_parent_f +! +! Purpose: Retrieves the parent class of a genric property class. +! +! Inputs: +! prp_id - property list identifier to query +! Outputs: +! parent_id - identifier of the parent class +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pget_class_parent_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list + ! identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pget_class_parent_c(prp_id, parent_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PGET_CLASS_PARENT_C'::h5pget_class_parent_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: parent_id + END FUNCTION h5pget_class_parent_c + END INTERFACE + hdferr = h5pget_class_parent_c(prp_id, parent_id) + END SUBROUTINE h5pget_class_parent_f + +!---------------------------------------------------------------------- +! Name: h5pisa_class_f +! +! Purpose: Determines whether a property list is a member of a class. +! +! Inputs: +! plist - property list identifier +! pclass - identifier of the property class +! Outputs: +! flag - .TRUE. if a member, .FALSE. otherwise +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pisa_class_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier + LOGICAL, INTENT(OUT) :: flag ! logical flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pisa_class_c(plist, pclass) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PISA_CLASS_C'::h5pisa_class_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: plist + INTEGER(HID_T), INTENT(IN) :: pclass + END FUNCTION h5pisa_class_c + END INTERFACE + flag = .FALSE. + hdferr = h5pisa_class_c(plist, pclass) + if (hdferr .gt. 0) then + flag = .TRUE. + hdferr = 0 + endif + END SUBROUTINE h5pisa_class_f + +!---------------------------------------------------------------------- +! Name: h5pcopy_prop_f +! +! Purpose: Copies a property from one list or class to another. +! +! Inputs: +! dst_id - Identifier of the destination property list +! src_id - Identifier of the source property list +! name - name of the property to copy +! Outputs: +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pcopy_prop_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list + ! identifier + INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Property name + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pcopy_prop_c(dst_id, src_id, name, name_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PCOPY_PROP_C'::h5pcopy_prop_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: dst_id + INTEGER(HID_T), INTENT(IN) :: src_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pcopy_prop_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) + END SUBROUTINE h5pcopy_prop_f + +!---------------------------------------------------------------------- +! Name: h5premove_f +! +! Purpose: Removes a property from a property list. + +! +! Inputs: +! plid - Property list identofoer +! name - name of the property to remove +! Outputs: +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5premove_f(plid, name, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5premove_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plid ! property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5premove_c(plid, name, name_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PREMOVE_C'::h5premove_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plid + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5premove_c + END INTERFACE + name_len = LEN(name) + hdferr = h5premove_c(plid, name , name_len) + END SUBROUTINE h5premove_f + +!---------------------------------------------------------------------- +! Name: h5punregister_f +! +! Purpose: Removes a property from a property list class. + +! +! Inputs: +! class - Property list class identifier +! name - name of the property to remove +! Outputs: +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5punregister_f(class, name, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5punregister_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5punregister_c(class, name, name_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PUNREGISTER_C'::h5punregister_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5punregister_c + END INTERFACE + name_len = LEN(name) + hdferr = h5punregister_c(class, name , name_len) + END SUBROUTINE h5punregister_f + +!---------------------------------------------------------------------- +! Name: h5pclose_class_f +! +! Purpose: Closes an existing property list class. + +! +! Inputs: +! class - Property list class identifier +! Outputs: +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pclose_class_f(class, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pclose_class_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5pclose_class_c(class) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PCLOSE_CLASS_C'::h5pclose_class_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: class + END FUNCTION h5pclose_class_c + END INTERFACE + hdferr = h5pclose_class_c(class) + END SUBROUTINE h5pclose_class_f + +!---------------------------------------------------------------------- +! Name: h5pcreate_class_f +! +! Purpose: Create a new property list class + +! +! Inputs: +! parent - Property list identifier of the parent class +! Possible values include: +! H5P_NO_CLASS_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_MOUNT_F +! name - name of the class we are creating +! Outputs: +! class - porperty list class identifier +! hdferr: - error code +! +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 9, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pcreate_class_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: parent ! parent property list class + ! identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property tocreate + INTEGER(HID_T), INTENT(OUT) :: class ! property list class identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pcreate_class_c(parent, name, name_len,& + class) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PCREATE_CLASS_C'::h5pcreate_class_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: parent + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(HID_T), INTENT(OUT) :: class + END FUNCTION h5pcreate_class_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pcreate_class_c(parent, name , name_len, & + class) + END SUBROUTINE h5pcreate_class_f + +!---------------------------------------------------------------------- +! Name: h5pregister_integer +! +! Purpose: Registers a permanent property with a property list class. +! +! Inputs: +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pregister_integer +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PREGISTER_C'::h5pregister_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER, INTENT(IN) :: value + END FUNCTION h5pregister_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pregister_c(class, name , name_len, size, value) + END SUBROUTINE h5pregister_integer + +!---------------------------------------------------------------------- +! Name: h5pregister_real +! +! Purpose: Registers a permanent property with a property list class. +! +! Inputs: +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pregister_real(class, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pregister_real +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PREGISTER_C'::h5pregister_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + REAL, INTENT(IN) :: value + END FUNCTION h5pregister_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pregister_c(class, name , name_len, size, value) + END SUBROUTINE h5pregister_real + +!---------------------------------------------------------------------- +! Name: h5pregister_double +! +! Purpose: Registers a permanent property with a property list class. +! +! Inputs: +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pregister_double(class, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pregister_double +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + DOUBLE PRECISION, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PREGISTER_C'::h5pregister_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + DOUBLE PRECISION, INTENT(IN) :: value + END FUNCTION h5pregister_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pregister_c(class, name , name_len, size, value) + END SUBROUTINE h5pregister_double + +!---------------------------------------------------------------------- +! Name: h5pregister_char +! +! Purpose: Registers a permanent property with a property list class. +! +! Inputs: +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pregister_char(class, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pregister_char +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + INTEGER :: value_len + + INTERFACE + INTEGER FUNCTION h5pregisterc_c(class, name, name_len, size, value, & + value_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PREGISTERC_C'::h5pregisterc_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pregisterc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pregisterc_c(class, name , name_len, size, value, value_len) + END SUBROUTINE h5pregister_char + +!---------------------------------------------------------------------- +! Name: h5pinsert_integer +! +! Purpose: Registers a temporary property with a property list class. +! +! Inputs: +! plist - property list identifier +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pinsert_integer +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PINSERT_C'::h5pinsert_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER, INTENT(IN) :: value + END FUNCTION h5pinsert_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_integer + +!---------------------------------------------------------------------- +! Name: h5pinsert_real +! +! Purpose: Registers a temporary property with a property list class. +! +! Inputs: +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pinsert_real +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PINSERT_C'::h5pinsert_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + REAL, INTENT(IN) :: value + END FUNCTION h5pinsert_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_real + +!---------------------------------------------------------------------- +! Name: h5pinsert_double +! +! Purpose: Registers a temporary property with a property list class. +! +! Inputs: +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pinsert_double +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + DOUBLE PRECISION, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTERFACE + INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PINSERT_C'::h5pinsert_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + DOUBLE PRECISION, INTENT(IN) :: value + END FUNCTION h5pinsert_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_double + +!---------------------------------------------------------------------- +! Name: h5pinsert_char +! +! Purpose: Registers a temporary property with a property list class. +! +! Inputs: +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! October 10, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5pinsert_char +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + INTEGER :: value_len + + INTERFACE + INTEGER FUNCTION h5pinsertc_c(plist, name, name_len, size, value, value_len) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5PINSERTC_C'::h5pinsertc_c + !DEC$ ENDIF + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pinsertc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pinsertc_c(plist, name , name_len, size, value, value_len) + END SUBROUTINE h5pinsert_char END MODULE H5P diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index df51ca3..646a465 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -226,32 +226,25 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t c_num_blocks; int i, rank; - hsize_t* c_startblock,* c_buf; + hsize_t c_startblock, *c_buf; c_space_id = *space_id; c_num_blocks = * num_blocks; rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0 ) return ret_value; - - c_startblock = (hsize_t*)malloc(sizeof(hsize_t)*rank); - if (!c_startblock) return ret_value; - for (i = 0; i < rank; i++) - { - c_startblock[i] = (hsize_t)startblock[i]; - } + c_startblock = (hsize_t)*startblock; c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_blocks*2*rank); if (!c_buf) return ret_value; - ret_value = H5Sget_select_hyper_blocklist(c_space_id, *c_startblock, + ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock, c_num_blocks, c_buf); for(i = 0; i < c_num_blocks*2*rank; i++) { buf[i] = (hsize_t_f)c_buf[i] +1; } HDfree(c_buf); - HDfree(c_startblock); if (ret_value >= 0 ) ret_value = 0; return ret_value; } @@ -330,7 +323,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, int ret_value = -1; hid_t c_space_id; hsize_t c_num_points; - hsize_t* c_startpoint,* c_buf; + hsize_t c_startpoint,* c_buf; int i,j, rank; c_space_id = *space_id; @@ -339,14 +332,10 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0 ) return ret_value; - c_startpoint = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); - if (!c_startpoint) return ret_value; - for (i =0; i < rank; i++) - c_startpoint[i] = (hsize_t)startpoint[i]; - + c_startpoint = (hsize_t)*startpoint; c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_points*rank); if (!c_buf) return ret_value; - ret_value = H5Sget_select_elem_pointlist(c_space_id, *startpoint, + ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint, c_num_points, c_buf); for (i = c_num_points*rank-1; i >= 0; i--) { buf[i] = (hsize_t_f)(c_buf[i]+1); @@ -354,7 +343,6 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, if (ret_value >= 0 ) ret_value = 0; - HDfree(c_startpoint); HDfree(c_buf); return ret_value; @@ -764,7 +752,6 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab - * maximum_size - aray with maximum sizes of dimensions * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 @@ -789,16 +776,16 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize rank = H5Sget_simple_extent_ndims(*space_id); if (rank < 0 ) return ret_value; c_start = (hssize_t *)HDmalloc(sizeof(hssize_t)*rank); - if (!c_start) return ret_value; + if (!c_start) goto DONE; c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); - if (!c_count) return ret_value; + if (!c_count) goto DONE; c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); - if (!c_stride) return ret_value; + if (!c_stride) goto DONE; c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); - if (!c_block) return ret_value; + if (!c_block) goto DONE; /* @@ -822,10 +809,171 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize c_space_id = *space_id; status = H5Sselect_hyperslab(c_space_id, c_op, c_start, c_stride, c_count, c_block); if ( status >= 0 ) ret_value = 0; - HDfree(c_start); - HDfree(c_count); - HDfree(c_stride); - HDfree(c_block); +DONE: + if(!c_start ) HDfree(c_start); + if(!c_count ) HDfree(c_count); + if(!c_stride) HDfree(c_stride); + if(!c_block ) HDfree(c_block); + return ret_value; +} +#ifdef NEW_HYPERSLAB_API +/*---------------------------------------------------------------------------- + * Name: h5scombine_hyperslab_c + * Purpose: Call H5Scombine_hyperslab + * Inputs: space_id - identifier of the dataspace + * operator - defines how the new selection is combined + * start - offset of start of hyperslab + * count - number of blocks included in the hyperslab + * stride - hyperslab stride (interval between blocks) + * block - size of block in the hyperslab + * Outputs: hyper_id - identifier for the new dataspace + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) +{ + int ret_value = -1; + hid_t c_space_id; + hid_t c_hyper_id; + hssize_t *c_start; + hsize_t *c_count; + hsize_t *c_stride; + hsize_t *c_block; + + H5S_seloper_t c_op; + herr_t status; + int rank; + int i; + + rank = H5Sget_simple_extent_ndims(*space_id); + if (rank < 0 ) return ret_value; + c_start = (hssize_t *)HDmalloc(sizeof(hssize_t)*rank); + if (!c_start) goto DONE; + + c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); + if (!c_count) goto DONE; + + c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); + if (!c_stride) goto DONE; + + c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank); + if (!c_block) goto DONE; + + + /* + * Reverse dimensions due to C-FORTRAN storage order. + */ + + for (i=0; i < rank; i++) { + int t= (rank - i) - 1; + c_start[i] = (hssize_t)start[t]; + c_count[i] = (hsize_t)count[t]; + c_stride[i] = (hsize_t)stride[t]; + c_block[i] = (hsize_t)block[t]; + } + + c_op = (H5S_seloper_t)*op; + + c_space_id = (hid_t)*space_id; + c_hyper_id = H5Scombine_hyperslab(c_space_id, c_op, c_start, c_stride, c_count, c_block); + if ( c_hyper_id < 0 ) goto DONE; + *hyper_id = (hid_t_f)c_hyper_id; + ret_value = 0; +DONE: + if(!c_start ) HDfree(c_start); + if(!c_count ) HDfree(c_count); + if(!c_stride) HDfree(c_stride); + if(!c_block ) HDfree(c_block); + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5scombine_select_c + * Purpose: Call H5Scombine_ select + * Inputs: space1_id - identifier of the first dataspace + * operator - defines how the new selection is combined + * space2_id - identifier of the second dataspace + * Outputs: ds_id - identifier for the new dataspace + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) +{ + int ret_value = -1; + hid_t c_space1_id; + hid_t c_space2_id; + hid_t c_ds_id; + H5S_seloper_t c_op; + + c_op = (H5S_seloper_t)*op; + + c_space1_id = (hid_t)*space1_id; + c_space2_id = (hid_t)*space2_id; + c_ds_id = H5Scombine_select(c_space1_id, c_op, c_space2_id); + if ( c_ds_id < 0 ) return ret_value; + *ds_id = (hid_t_f)c_ds_id; + ret_value = 0; + return ret_value; +} +/*---------------------------------------------------------------------------- + * Name: h5sselect_select_c + * Purpose: Call H5Sselect_ select + * Inputs: space1_id - identifier of the first dataspace to modify + * operator - defines how the new selection is combined + * space2_id - identifier of the second dataspace + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) +{ + int ret_value = -1; + hid_t c_space1_id; + hid_t c_space2_id; + H5S_seloper_t c_op; + + c_op = (H5S_seloper_t)*op; + + c_space1_id = (hid_t)*space1_id; + c_space2_id = (hid_t)*space2_id; + if( H5Sselect_select(c_space1_id, c_op, c_space2_id)< 0) return ret_value; + ret_value = 0; + return ret_value; +} +#endif /*NEW_HYPERSLAB_API*/ +/*---------------------------------------------------------------------------- + * Name: h5sget_select_type_c + * Purpose: Call H5Sget_select_type + * Inputs: space_id - identifier of the dataspace + * Outputs: type - type of selection + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Monday, October 7, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ + +int_f +nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) +{ + int ret_value = -1; + hid_t c_space_id; + H5S_sel_type c_type; + + c_space_id = (hid_t)*space_id; + c_type = H5Sget_select_type(c_space_id); + if(c_type < 0) return ret_value; + *type = (int_f)c_type; + ret_value = 0; return ret_value; } diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index d5d1c48..a458945 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -350,7 +350,7 @@ IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: startblock !Hyperslab block to start with. INTEGER(HSIZE_T), INTENT(IN) :: num_blocks !number of hyperslab blocks @@ -372,8 +372,8 @@ !MS$ATTRIBUTES C,reference,alias:'_H5SGET_SELECT_HYPER_BLOCKLIST_C'::h5sget_select_hyper_blocklist_c !DEC$ ENDIF INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: startblock - INTEGER(HSSIZE_T), INTENT(IN) :: num_blocks + INTEGER(HSIZE_T), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: num_blocks INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf END FUNCTION h5sget_select_hyper_blocklist_c END INTERFACE @@ -544,7 +544,7 @@ ! IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T),DIMENSION(*), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: startpoint !Element point to start with. INTEGER(HSIZE_T), INTENT(IN) :: num_points !Number of element points to get @@ -563,7 +563,7 @@ !MS$ATTRIBUTES C,reference,alias:'_H5SGET_SELECT_ELEM_POINTLIST_C'::h5sget_select_elem_pointlist_c !DEC$ ENDIF INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T),DIMENSION(*), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: startpoint INTEGER(HSIZE_T), INTENT(IN) :: num_points INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf END FUNCTION h5sget_select_elem_pointlist_c @@ -1562,5 +1562,366 @@ deallocate(def_stride) END SUBROUTINE h5sselect_hyperslab_f +!---------------------------------------------------------------------- +! Name: h5scombine_hyperslab_f +! +! Purpose: Combine a hyperslab selection with the current +! selection for a dataspace +! +! Inputs: +! space_id - dataspace of selection to use +! operator - flag, valid values are: +! H5S_SELECT_NOOP_F +! H5S_SELECT_SET_F +! H5S_SELECT_OR_F +! H5S_SELECT_AND_F +! H5S_SELECT_XOR_F +! H5S_SELECT_NOTB_F +! H5S_SELECT_NOTA_F +! H5S_SELECT_APPEND_F +! H5S_SELECT_PREPEND_F +! start - array with hyperslab offsets +! count - number of blocks included in the +! hyperslab +! Outputs: +! hyper_id - identifier for the new hyperslab +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! stride - array with hyperslab strides +! block - array with hyperslab block sizes +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: Commented out until 1.6 ? 10/08/2002 +!---------------------------------------------------------------------- + +! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, & +! hyper_id, hdferr, stride, block) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5scombine_hyperslab_f +!DEC$endif +! +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start + ! Starting coordinates of the hyperslab +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + ! Number of blocks to select + ! from dataspace +! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride + ! Array of how many elements to move + ! in each direction +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block + ! Sizes of element block +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride +! INTEGER :: rank +! INTEGER :: error1, error2 + +! INTERFACE +! INTEGER FUNCTION h5scombine_hyperslab_c(space_id, operator, & +! start, count, stride, block, hyper_id) +! USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c + !DEC$ ENDIF +! INTEGER(HID_T), INTENT(IN) :: space_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block +! INTEGER(HID_T), INTENT(OUT) :: hyper_id +! END FUNCTION h5scombine_hyperslab_c +! END INTERFACE + +! if (present(stride).and. present(block)) then +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, block, hyper_id) +! return +! endif + ! Case of optional parameters. + ! + ! Find the rank of the dataspace to allocate memery for + ! default stride and block arrays. + ! +! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) +! if( hdferr .EQ. -1) return + ! +! if (present(stride).and. .not.present(block)) then +! allocate(def_block(rank), stat=error1) +! if (error1.NE.0) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, def_block, hyper_id) +! deallocate(def_block) +! return +! endif + +! if (.not.present(stride).and. present(block)) then +! allocate(def_stride(rank), stat=error2) +! if (error2.NE.0) then +! hdferr = -1 +! return +! endif +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, block, hyper_id) +! deallocate(def_stride) +! return +! endif +! allocate(def_block(rank), stat=error1) +! allocate(def_stride(rank), stat=error2) +! if ((error1.NE.0) .OR. (error2.NE.0)) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, def_block, hyper_id) +! deallocate(def_block) +! deallocate(def_stride) + +! END SUBROUTINE h5scombine_hyperslab_f + +!---------------------------------------------------------------------- +! Name: h5scombine_select_f +! +! Purpose: Combine two hyperslab selections with an operation +! and return a dataspace with resulting selection. +! +! Inputs: +! space1_id - dataspace of selection to use +! operator - flag, valid values are: +! H5S_SELECT_NOOP_F +! H5S_SELECT_SET_F +! H5S_SELECT_OR_F +! H5S_SELECT_AND_F +! H5S_SELECT_XOR_F +! H5S_SELECT_NOTB_F +! H5S_SELECT_NOTA_F +! H5S_SELECT_APPEND_F +! H5S_SELECT_PREPEND_F +! space2_id - dataspace of selection to use +! Outputs: +! ds_id - idataspace identifier with the new selection +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: - NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: commented out until 1.6 release(?) 10/08/2002 +!---------------------------------------------------------------------- + +! SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, & +! ds_id, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5scombine_select_f +!DEC$endif +! +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! +! INTERFACE +! INTEGER FUNCTION h5scombine_select_c(space1_id, operator, & +! space2_id, ds_id) +! USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5SCOMBINE_SELECT_C'::h5scombine_select_c + !DEC$ ENDIF +! INTEGER(HID_T), INTENT(IN) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HID_T), INTENT(OUT) :: ds_id +! END FUNCTION h5scombine_select_c +! END INTERFACE + +! hdferr = h5scombine_select_c(space1_id, operator, space2_id, & +! ds_id) +! return + +! END SUBROUTINE h5scombine_select_f + +!---------------------------------------------------------------------- +! Name: h5sselect_select_f +! +! Purpose: Refine a hyperslab selection with an operation +! using second hyperslab +! +! Inputs: +! space1_id - dataspace of selection to modify +! operator - flag, valid values are: +! H5S_SELECT_NOOP_F +! H5S_SELECT_SET_F +! H5S_SELECT_OR_F +! H5S_SELECT_AND_F +! H5S_SELECT_XOR_F +! H5S_SELECT_NOTB_F +! H5S_SELECT_NOTA_F +! H5S_SELECT_APPEND_F +! H5S_SELECT_PREPEND_F +! space2_id - dataspace of selection to use +! +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: - NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment:Commented out until 1.6 release(?) 10/08/2002 EIP +!---------------------------------------------------------------------- + +! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, & +! hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5sselect_select_f +!DEC$endif +! +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to + ! modify +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: + ! H5S_SELECT_NOOP_F + ! H5S_SELECT_SET_F + ! H5S_SELECT_OR_F + ! H5S_SELECT_AND_F + ! H5S_SELECT_XOR_F + ! H5S_SELECT_NOTB_F + ! H5S_SELECT_NOTA_F + ! H5S_SELECT_APPEND_F + ! H5S_SELECT_PREPEND_F + ! +! INTEGER, INTENT(OUT) :: hdferr ! Error code + +! INTERFACE +! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, & +! space2_id) +! USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5SSELECT_SELECT_C'::h5sselect_select_c + !DEC$ ENDIF +! INTEGER(HID_T), INTENT(INOUT) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! END FUNCTION h5sselect_select_c +! END INTERFACE + +! hdferr = h5sselect_select_c(space1_id, operator, space2_id) +! return + +! END SUBROUTINE h5sselect_select_f + +!---------------------------------------------------------------------- +! Name: h5sget_select_type_f +! +! Purpose: Retrieve the type of selection +! +! Inputs: +! space_id - dataspace iidentifier with selection +! Outputs: +! type - flag, valid values are: +! H5S_SEL_ERROR_F +! H5S_SEL_NONE_F +! H5S_SEL_POINTS_F +! H5S_SEL_HYPERSLABS_F +! H5S_SEL_ALL_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: - NONE +! +! Programmer: Elena Pourmal +! October 7, 2002 +! +! Modifications: +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5sget_select_type_f(space_id, type, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5sget_select_type_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to + INTEGER, INTENT(OUT) :: type ! Selection type + ! H5S_SEL_ERROR_F + ! H5S_SEL_NONE_F + ! H5S_SEL_POINTS_F + ! H5S_SEL_HYPERSLABS_F + ! H5S_SEL_ALL_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5sget_select_type_c(space_id, type) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5SGET_SELECT_TYPEC'::h5sget_select_type_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: type + END FUNCTION h5sget_select_type_c + END INTERFACE + + hdferr = h5sget_select_type_c(space_id, type) + return + + END SUBROUTINE h5sget_select_type_f END MODULE H5S diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 690d969..19d07b1 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1545,9 +1545,8 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) /*---------------------------------------------------------------------------- * Name: h5tget_tag_c - * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_tag to set an opaque datatype tag - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the datatype * Outputs: tag - Unique ASCII string with which the opaque * datatype is to be tagged * taglen - length of tag @@ -1573,3 +1572,27 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen) ret_value = 0; return ret_value; } +/*---------------------------------------------------------------------------- + * Name: h5tvlen_create_c + * Purpose: Call H5Tvlen_create to create VL dtatype + * Inputs: type_id - identifier of the base datatype + * Outputs: vltype_id - identifier of the VL datatype + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Wednesday, October 23, 2002 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) +{ + int ret_value = -1; + hid_t c_type_id; + hid_t c_vltype_id; + + c_type_id = (hid_t)*type_id; + c_vltype_id = H5Tvlen_create(c_type_id); + if (c_vltype_id < 0 ) return ret_value; + *vltype_id = (hid_t_f)c_vltype_id; + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index 61319e0..e215318 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -3055,4 +3055,53 @@ hdferr = h5tget_tag_c(type_id, tag, taglen) END SUBROUTINE h5tget_tag_f +!---------------------------------------------------------------------- +! Name: h5tvlen_create_f +! +! Purpose: Creates a new variable-lenght datatype. +! +! Inputs: +! type_id - identifier iof base datatype +! Outputs: +! vltype_id - identifier for VL datatype +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! Wednesday, October 23, 2002 +! +! Modifications: +! +! Comment: Only basic Fortran base datatypes are supported +!---------------------------------------------------------------------- + + SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5tvlen_create_f +!DEC$endif +! + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(OUT) :: vltype_id ! VL datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTERFACE + INTEGER FUNCTION h5tvlen_create_c(type_id, vltype_id) + USE H5GLOBAL + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !MS$ATTRIBUTES C,reference,alias:'_H5TVLEN_CREATE_C'::h5tvlen_create_c + !DEC$ ENDIF + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(OUT) :: vltype_id + END FUNCTION h5tvlen_create_c + END INTERFACE + + hdferr = h5tvlen_create_c(type_id, vltype_id) + END SUBROUTINE h5tvlen_create_f + END MODULE H5T diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 93d7331..3f86dc9 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -77,6 +77,12 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; +/* + * Define Fortran H5T_STRING type to store non-fixed size strings + */ + if ((c_type_id = H5Tcopy(H5T_C_S1)) < 0) return ret_value; + if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value; + integertypes[16] = c_type_id; ret_value = 0; return ret_value; @@ -169,6 +175,22 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5d_flags[0] = H5D_COMPACT; h5d_flags[1] = H5D_CONTIGUOUS; h5d_flags[2] = H5D_CHUNKED; + h5d_flags[3] = H5D_ALLOC_TIME_ERROR; + h5d_flags[4] = H5D_ALLOC_TIME_DEFAULT; + h5d_flags[5] = H5D_ALLOC_TIME_EARLY; + h5d_flags[6] = H5D_ALLOC_TIME_LATE; + h5d_flags[7] = H5D_ALLOC_TIME_INCR; + h5d_flags[8] = H5D_SPACE_STATUS_ERROR; + h5d_flags[9] = H5D_SPACE_STATUS_NOT_ALLOCATED; + h5d_flags[10] = H5D_SPACE_STATUS_PART_ALLOCATED; + h5d_flags[11] = H5D_SPACE_STATUS_ALLOCATED; + h5d_flags[12] = H5D_FILL_TIME_ERROR; + h5d_flags[13] = H5D_FILL_TIME_ALLOC; + h5d_flags[14] = H5D_FILL_TIME_NEVER; + h5d_flags[15] = H5D_FILL_VALUE_ERROR; + h5d_flags[16] = H5D_FILL_VALUE_UNDEFINED; + h5d_flags[17] = H5D_FILL_VALUE_DEFAULT; + h5d_flags[18] = H5D_FILL_VALUE_USER_DEFINED; /* * H5E flags @@ -260,6 +282,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5p_flags[3] = H5P_DATASET_XFER; h5p_flags[4] = H5P_MOUNT; h5p_flags[5] = H5P_DEFAULT; + h5p_flags[6] = H5P_NO_CLASS; /* * H5R flags @@ -280,6 +303,22 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5s_flags[4] = (int_f)H5S_UNLIMITED; h5s_flags[5] = H5S_ALL; + h5s_flags[6] = H5S_SELECT_NOOP; + h5s_flags[7] = H5S_SELECT_AND; + h5s_flags[8] = H5S_SELECT_XOR; + h5s_flags[9] = H5S_SELECT_NOTB; + h5s_flags[10] = H5S_SELECT_NOTA; + h5s_flags[11] = H5S_SELECT_APPEND; + h5s_flags[12] = H5S_SELECT_PREPEND; + h5s_flags[13] = H5S_SELECT_INVALID; + + + h5s_flags[14] = H5S_SEL_ERROR; + h5s_flags[15] = H5S_SEL_NONE; + h5s_flags[16] = H5S_SEL_POINTS; + h5s_flags[17] = H5S_SEL_HYPERSLABS; + h5s_flags[18] = H5S_SEL_ALL; + /* * H5T flags */ @@ -313,6 +352,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5t_flags[25] = H5T_STR_NULLPAD; h5t_flags[26] = H5T_STR_SPACEPAD; h5t_flags[27] = H5T_STR_ERROR; + h5t_flags[28] = H5T_VLEN; + h5t_flags[29] = H5T_ARRAY; ret_value = 0; return ret_value; diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index 6af524a..e29c0e4 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -1,4 +1,6 @@ + MODULE H5LIB + CONTAINS !---------------------------------------------------------------------- ! Name: h5open_f ! @@ -347,3 +349,4 @@ error = h5dont_atexit_c() END SUBROUTINE h5dont_atexit_f + END MODULE H5LIB diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 2295ae8..7a4a296 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -24,7 +24,7 @@ ! Do not forget to change the following line when new predefined ! integer data types are added - INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 16 + INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 17 INTEGER(HID_T) H5T_NATIVE_INTEGER, & H5T_NATIVE_REAL, & @@ -51,7 +51,8 @@ H5T_STD_U32BE, & H5T_STD_U32LE, & H5T_STD_U64BE, & - H5T_STD_U64LE + H5T_STD_U64LE, & + H5T_STRING INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types @@ -85,6 +86,7 @@ EQUIVALENCE (integer_types(14), H5T_STD_U32LE) EQUIVALENCE (integer_types(15), H5T_STD_U64BE) EQUIVALENCE (integer_types(16), H5T_STD_U64LE) + EQUIVALENCE (integer_types(17), H5T_STRING) ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & @@ -206,7 +208,7 @@ ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 3 + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 19 INTEGER H5D_flags(H5D_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ @@ -217,10 +219,50 @@ INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F + INTEGER :: H5D_ALLOC_TIME_ERROR_F + INTEGER :: H5D_ALLOC_TIME_DEFAULT_F + INTEGER :: H5D_ALLOC_TIME_EARLY_F + INTEGER :: H5D_ALLOC_TIME_LATE_F + INTEGER :: H5D_ALLOC_TIME_INCR_F + + INTEGER :: H5D_SPACE_STS_ERROR_F + INTEGER :: H5D_SPACE_STS_NOT_ALLOCATED_F + INTEGER :: H5D_SPACE_STS_PART_ALLOCATED_F + INTEGER :: H5D_SPACE_STS_ALLOCATED_F + + INTEGER :: H5D_FILL_TIME_ERROR_F + INTEGER :: H5D_FILL_TIME_ALLOC_F + INTEGER :: H5D_FILL_TIME_NEVER_F + + INTEGER :: H5D_FILL_VALUE_ERROR_F + INTEGER :: H5D_FILL_VALUE_UNDEFINED_F + INTEGER :: H5D_FILL_VALUE_DEFAULT_F + INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F + EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) + EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) + EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) + EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) + EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) + EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) + + EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) + EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) + EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) + EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) + + EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) + EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) + EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) + + EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) + EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) + EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) + EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) + ! ! H5FD flags declaration ! @@ -323,7 +365,7 @@ ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 6 + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 7 INTEGER H5P_flags(H5P_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ @@ -336,6 +378,7 @@ INTEGER :: H5P_DATASET_XFER_F INTEGER :: H5P_MOUNT_F INTEGER :: H5P_DEFAULT_F + INTEGER :: H5P_NO_CLASS_F EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) @@ -343,6 +386,7 @@ EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) EQUIVALENCE(H5P_flags(5), H5P_MOUNT_F) EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) + EQUIVALENCE(H5P_flags(7), H5P_NO_CLASS_F) ! ! H5P flags declaration @@ -363,7 +407,7 @@ ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 6 + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 19 INTEGER H5S_flags(H5S_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ @@ -372,11 +416,28 @@ INTEGER :: H5S_SCALAR_F INTEGER :: H5S_SIMPLE_F - INTEGER :: H5S_SELECT_SET_F - INTEGER :: H5S_SELECT_OR_F + INTEGER :: H5S_UNLIMITED_F INTEGER :: H5S_ALL_F + INTEGER :: H5S_SELECT_NOOP_F + INTEGER :: H5S_SELECT_SET_F + INTEGER :: H5S_SELECT_OR_F + INTEGER :: H5S_SELECT_AND_F + INTEGER :: H5S_SELECT_XOR_F + INTEGER :: H5S_SELECT_NOTB_F + INTEGER :: H5S_SELECT_NOTA_F + INTEGER :: H5S_SELECT_APPEND_F + INTEGER :: H5S_SELECT_PREPEND_F + INTEGER :: H5S_SELECT_INVALID_F + + + INTEGER :: H5S_SEL_ERROR_F + INTEGER :: H5S_SEL_NONE_F + INTEGER :: H5S_SEL_POINTS_F + INTEGER :: H5S_SEL_HYPERSLABS_F + INTEGER :: H5S_SEL_ALL_F + EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) EQUIVALENCE(H5S_flags(3), H5S_SELECT_SET_F) @@ -384,10 +445,27 @@ EQUIVALENCE(H5S_flags(5), H5S_UNLIMITED_F) EQUIVALENCE(H5S_flags(6), H5S_ALL_F) + EQUIVALENCE(H5S_flags(7), H5S_SELECT_NOOP_F) + EQUIVALENCE(H5S_flags(8), H5S_SELECT_AND_F) + EQUIVALENCE(H5S_flags(9), H5S_SELECT_XOR_F) + EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTB_F) + EQUIVALENCE(H5S_flags(11), H5S_SELECT_NOTA_F) + EQUIVALENCE(H5S_flags(12), H5S_SELECT_APPEND_F) + EQUIVALENCE(H5S_flags(13), H5S_SELECT_PREPEND_F) + EQUIVALENCE(H5S_flags(14), H5S_SELECT_INVALID_F) + + + EQUIVALENCE(H5S_flags(15), H5S_SEL_ERROR_F) + EQUIVALENCE(H5S_flags(16), H5S_SEL_NONE_F) + EQUIVALENCE(H5S_flags(17), H5S_SEL_POINTS_F) + EQUIVALENCE(H5S_flags(18), H5S_SEL_HYPERSLABS_F) + EQUIVALENCE(H5S_flags(19), H5S_SEL_ALL_F) + + ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 28 + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 30 INTEGER H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ @@ -404,6 +482,8 @@ INTEGER :: H5T_COMPOUND_F INTEGER :: H5T_REFERENCE_F INTEGER :: H5T_ENUM_F + INTEGER :: H5T_VLEN_F + INTEGER :: H5T_ARRAY_F INTEGER :: H5T_ORDER_LE_F INTEGER :: H5T_ORDER_BE_F INTEGER :: H5T_ORDER_VAX_F @@ -451,6 +531,8 @@ EQUIVALENCE(H5T_flags(26), H5T_STR_NULLPAD_F) EQUIVALENCE(H5T_flags(27), H5T_STR_SPACEPAD_F) EQUIVALENCE(H5T_flags(28), H5T_STR_ERROR_F) + EQUIVALENCE(H5T_flags(29), H5T_VLEN_F) + EQUIVALENCE(H5T_flags(30), H5T_ARRAY_F) END MODULE H5GLOBAL diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 129c7a5..72c30d3 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -94,6 +94,10 @@ H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_id # define nh5sextent_copy_c FNAME(H5SEXTENT_COPY_C) # define nh5sset_extent_none_c FNAME(H5SSET_EXTENT_NONE_C) # define nh5sselect_hyperslab_c FNAME(H5SSELECT_HYPERSLAB_C) +# define nh5scombine_hyperslab_c FNAME(H5SCOMBINE_HYPERSLAB_C) +# define nh5scombine_select_c FNAME(H5SCOMBINE_SELECT_C) +# define nh5sselect_select_c FNAME(H5SSELECT_SELECT_C) +# define nh5sget_select_type_c FNAME(H5SGET_SELECT_TYPE_C) # define nh5sselect_elements_c FNAME(H5SSELECT_ELEMENTS_C) #else /* !DF_CAPFNAMES */ # define nh5screate_simple_c FNAME(h5screate_simple_c) @@ -120,6 +124,10 @@ H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_id # define nh5sextent_copy_c FNAME(h5sextent_copy_c) # define nh5sset_extent_none_c FNAME(h5sset_extent_none_c) # define nh5sselect_hyperslab_c FNAME(h5sselect_hyperslab_c) +# define nh5scombine_hyperslab_c FNAME(h5scombine_hyperslab_c) +# define nh5scombine_select_c FNAME(h5scombine_select_c) +# define nh5sselect_select_c FNAME(h5sselect_select_c) +# define nh5sget_select_type_c FNAME(h5sget_select_type_c) # define nh5sselect_elements_c FNAME(h5sselect_elements_c) #endif /* DF_CAPFNAMES */ #endif @@ -170,6 +178,14 @@ H5_DLL int_f nh5sset_extent_none_c ( hid_t_f *space_id ); H5_DLL int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block); +H5_DLL int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); + +H5_DLL int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); + +H5_DLL int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); + +H5_DLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op); + H5_DLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hssize_t_f *coord); @@ -195,6 +211,14 @@ H5_DLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *ne # define nh5dget_type_c FNAME(H5DGET_TYPE_C) # define nh5dget_create_plist_c FNAME(H5DGET_CREATE_PLIST_C) # define nh5dextend_c FNAME(H5DEXTEND_C) +# define nh5dget_storage_size_c FNAME(H5DGET_STORAGE_SIZE_C) +# define nh5dvlen_get_max_len_c FNAME(H5DVLEN_GET_MAX_LEN_C) +# define nh5dwrite_vl_integer_c FNAME(H5DWRITE_VL_INTEGER_C) +# define nh5dread_vl_integer_c FNAME(H5DREAD_VL_INTEGER_C) +# define nh5dwrite_vl_real_c FNAME(H5DWRITE_VL_REAL_C) +# define nh5dread_vl_real_c FNAME(H5DREAD_VL_REAL_C) +# define nh5dwrite_vl_string_c FNAME(H5DWRITE_VL_STRING_C) +# define nh5dread_vl_string_c FNAME(H5DREAD_VL_STRING_C) #else /* !DF_CAPFNAMES */ # define nh5dcreate_c FNAME(h5dcreate_c) # define nh5dclose_c FNAME(h5dclose_c) @@ -211,6 +235,14 @@ H5_DLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *ne # define nh5dget_type_c FNAME(h5dget_type_c) # define nh5dget_create_plist_c FNAME(h5dget_create_plist_c) # define nh5dextend_c FNAME(h5dextend_c) +# define nh5dget_storage_size_c FNAME(h5dget_storage_size_c) +# define nh5dvlen_get_max_len_c FNAME(h5dvlen_get_max_len_c) +# define nh5dwrite_vl_integer_c FNAME(h5dwrite_vl_integer_c) +# define nh5dread_vl_integer_c FNAME(h5dread_vl_integer_c) +# define nh5dwrite_vl_real_c FNAME(h5dwrite_vl_real_c) +# define nh5dread_vl_real_c FNAME(h5dread_vl_real_c) +# define nh5dwrite_vl_string_c FNAME(h5dwrite_vl_string_c) +# define nh5dread_vl_string_c FNAME(h5dread_vl_string_c) #endif /* DF_CAPFNAMES */ #endif @@ -224,6 +256,24 @@ H5_DLL int_f nh5dclose_c ( hid_t_f *dset_id ); H5_DLL int_f nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, int_f *dims); +H5_DLL int_f nh5dwrite_vl_integer_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); + +H5_DLL int_f nh5dread_vl_integer_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len); + +H5_DLL int_f nh5dwrite_vl_real_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); + +H5_DLL int_f nh5dread_vl_real_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len); + +H5_DLL int_f nh5dwrite_vl_string_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); + +H5_DLL int_f nh5dread_vl_string_c +(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len); + H5_DLL int_f nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, int_f *dims); @@ -253,6 +303,10 @@ H5_DLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id); H5_DLL int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id); H5_DLL int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims); + +H5_DLL int_f nh5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len); + +H5_DLL int_f nh5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size); /* * Functions from H5Gf.c */ @@ -452,6 +506,7 @@ H5_DLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); # define nh5tget_array_ndims_c FNAME(H5TGET_ARRAY_NDIMS_C) # define nh5tget_array_dims_c FNAME(H5TGET_ARRAY_DIMS_C) # define nh5tget_super_c FNAME(H5TGET_SUPER_C) +# define nh5tvlen_create_c FNAME(H5TVLEN_CREATE_C) #else # define nh5topen_c FNAME(h5topen_c) @@ -507,6 +562,7 @@ H5_DLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); # define nh5tget_array_ndims_c FNAME(h5tget_array_ndims_c) # define nh5tget_array_dims_c FNAME(h5tget_array_dims_c) # define nh5tget_super_c FNAME(h5tget_super_c) +# define nh5tvlen_create_c FNAME(h5tvlen_create_c) #endif #endif @@ -590,6 +646,8 @@ H5_DLL int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims); H5_DLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id); +H5_DLL int_f +nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id); /* @@ -659,6 +717,39 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id); # define nh5pset_fclose_degree_c FNAME(H5PSET_FCLOSE_DEGREE_C) # define nh5pset_buffer_c FNAME(H5PSET_BUFFER_C) # define nh5pget_buffer_c FNAME(H5PGET_BUFFER_C) +# define nh5pfill_value_defined_c FNAME(H5PFILL_VALUE_DEFINED_C) +# define nh5pset_alloc_time_c FNAME(H5PSET_ALLOC_TIME_C) +# define nh5pget_alloc_time_c FNAME(H5PGET_ALLOC_TIME_C) +# define nh5pset_fill_time_c FNAME(H5PSET_FILL_TIME_C) +# define nh5pget_fill_time_c FNAME(H5PGET_FILL_TIME_C) +# define nh5pset_meta_block_size_c FNAME(H5PSET_META_BLOCK_SIZE_C) +# define nh5pget_meta_block_size_c FNAME(H5PGET_META_BLOCK_SIZE_C) +# define nh5pset_sieve_buf_size_c FNAME(H5PSET_SIEVE_BUF_SIZE_C) +# define nh5pget_sieve_buf_size_c FNAME(H5PGET_SIEVE_BUF_SIZE_C) +# define nh5pset_hyper_vector_size_c FNAME(H5PSET_HYPER_VECTOR_SIZE_C) +# define nh5pget_hyper_vector_size_c FNAME(H5PGET_HYPER_VECTOR_SIZE_C) +# define nh5pset_small_data_block_size_c FNAME(H5PSET_SMALL_DATA_BLOCK_SIZE_C) +# define nh5pget_small_data_block_size_c FNAME(H5PGET_SMALL_DATA_BLOCK_SIZE_C) +# define nh5pcreate_class_c FNAME(H5PCREATE_CLASS_C) +# define nh5pregister_c FNAME(H5PREGISTER_C) +# define nh5pregisterc_c FNAME(H5PREGISTERC_C) +# define nh5pinsert_c FNAME(H5PINSERT_C) +# define nh5pinsertc_c FNAME(H5PINSERTC_C) +# define nh5pset_c FNAME(H5PSET_C) +# define nh5psetc_c FNAME(H5PSETC_C) +# define nh5pget_c FNAME(H5PGET_C) +# define nh5pgetc_c FNAME(H5PGETC_C) +# define nh5pexist_c FNAME(H5PEXIST_C) +# define nh5pget_size_c FNAME(H5PGET_SIZE_C) +# define nh5pget_nprops_c FNAME(H5PGET_NPROPS_C) +# define nh5pget_class_parent_c FNAME(H5PGET_CLASS_PARENT_C) +# define nh5pequal_c FNAME(H5PEQUAL_C) +# define nh5pisa_class_c FNAME(H5PISA_CLASS_C) +# define nh5pcopy_prop_c FNAME(H5PCOPY_PROP_C) +# define nh5premove_c FNAME(H5PREMOVE_C) +# define nh5punregister_c FNAME(H5PUNREGISTER_C) +# define nh5pclose_class_c FNAME(H5PCLOSE_CLASS_C) +# define nh5pget_class_name_c FNAME(H5PGET_CLASS_NAME_C) #else # define nh5pcreate_c FNAME(h5pcreate_c) @@ -721,12 +812,45 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id); # define nh5pset_fclose_degree_c FNAME(h5pset_fclose_degree_c) # define nh5pset_buffer_c FNAME(h5pset_buffer_c) # define nh5pget_buffer_c FNAME(h5pget_buffer_c) +# define nh5pfill_value_defined_c FNAME(h5pfill_value_defined_c) +# define nh5pset_alloc_time_c FNAME(h5pset_alloc_time_c) +# define nh5pget_alloc_time_c FNAME(h5pget_alloc_time_c) +# define nh5pset_fill_time_c FNAME(h5pset_fill_time_c) +# define nh5pget_fill_time_c FNAME(h5pget_fill_time_c) +# define nh5pset_meta_block_size_c FNAME(h5pset_meta_block_size_c) +# define nh5pget_meta_block_size_c FNAME(h5pget_meta_block_size_c) +# define nh5pset_sieve_buf_size_c FNAME(h5pset_sieve_buf_size_c) +# define nh5pget_sieve_buf_size_c FNAME(h5pget_sieve_buf_size_c) +# define nh5pset_hyper_vector_size_c FNAME(h5pset_hyper_vector_size_c) +# define nh5pget_hyper_vector_size_c FNAME(h5pget_hyper_vector_size_c) +# define nh5pset_small_data_block_size_c FNAME(h5pset_small_data_block_size_c) +# define nh5pget_small_data_block_size_c FNAME(h5pget_small_data_block_size_c) +# define nh5pcreate_class_c FNAME(h5pcreate_class_c) +# define nh5pregister_c FNAME(h5pregister_c) +# define nh5pregisterc_c FNAME(h5pregisterc_c) +# define nh5pinsert_c FNAME(h5pinsert_c) +# define nh5pinsertc_c FNAME(h5pinsertc_c) +# define nh5pset_c FNAME(h5pset_c) +# define nh5psetc_c FNAME(h5psetc_c) +# define nh5pget_c FNAME(h5pget_c) +# define nh5pgetc_c FNAME(h5pgetc_c) +# define nh5pexist_c FNAME(h5pexist_c) +# define nh5pget_size_c FNAME(h5pget_size_c) +# define nh5pget_nprops_c FNAME(h5pget_nprops_c) +# define nh5pget_class_parent_c FNAME(h5pget_class_parent_c) +# define nh5pequal_c FNAME(h5pequal_c) +# define nh5pisa_class_c FNAME(h5pisa_class_c) +# define nh5pcopy_prop_c FNAME(h5pcopy_prop_c) +# define nh5premove_c FNAME(h5premove_c) +# define nh5punregister_c FNAME(h5punregister_c) +# define nh5pclose_class_c FNAME(h5pclose_class_c) +# define nh5pget_class_name_c FNAME(h5pget_class_name_c) #endif #endif -H5_DLL int_f nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id ); +H5_DLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ); H5_DLL int_f nh5pclose_c ( hid_t_f *prp_id ); @@ -843,10 +967,66 @@ H5_DLL int_f nh5pget_dxpl_mpio_rc(hid_t_f *prp_id, int_f* data_xfer_mode); H5_DLL int_f nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); + H5_DLL int_f nh5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree); H5_DLL int_f nh5pget_fclose_degree_c(hid_t_f *fapl, int_f *degree); H5_DLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size); H5_DLL int_f nh5pset_buffer_c(hid_t_f *plist, hsize_t_f *size); + +H5_DLL int_f nh5pfill_value_define_c(hid_t_f *plist, int_f *flag); +H5_DLL int_f nh5pset_alloc_time_c(hid_t_f *plist, int_f *flag); +H5_DLL int_f nh5pget_alloc_time_c(hid_t_f *plist, int_f *flag); +H5_DLL int_f nh5pset_fill_time_c(hid_t_f *plist, int_f *flag); +H5_DLL int_f nh5pget_fill_time_c(hid_t_f *plist, int_f *flag); +H5_DLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size); + +H5_DLL int_f nh5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_DLL int_f nh5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_DLL int_f nh5pset_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); +H5_DLL int_f nh5pget_sieve_buf_size_c(hid_t_f *plist, size_t_f *size); +H5_DLL int_f nh5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_DLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); +H5_DLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); +H5_DLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); + +H5_DLL int_f +nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class); + +H5_DLL int_f +nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value); + +H5_DLL int_f +nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); + +H5_DLL int_f +nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); + +H5_DLL int_f +nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); + +H5_DLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); + +H5_DLL int_f +nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); + +H5_DLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); + +H5_DLL int_f +nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); + +H5_DLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); +H5_DLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); +H5_DLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); +H5_DLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); +H5_DLL int_f nh5pequal_c(hid_t_f *plist1_id, hid_t_f *plist2_id, int_f *c_flag); +H5_DLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); +H5_DLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len); +H5_DLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); +H5_DLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len); +H5_DLL int_f nh5pclose_class_c(hid_t_f * class); +H5_DLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len); + + /* * Functions frome H5Rf.c */ diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 index 264eb13..3a7486f 100644 --- a/fortran/src/HDF5.f90 +++ b/fortran/src/HDF5.f90 @@ -11,4 +11,5 @@ USE H5T USE H5P USE H5R + USE H5LIB END MODULE HDF5 diff --git a/fortran/src/HDF5mpio.f90 b/fortran/src/HDF5mpio.f90 index 31bc9a5..cca941b 100644 --- a/fortran/src/HDF5mpio.f90 +++ b/fortran/src/HDF5mpio.f90 @@ -12,4 +12,5 @@ USE H5P USE H5FDMPIO USE H5R + USE H5LIB END MODULE HDF5 |