BROKEN: (not variable) Write 1d atribute variable string array to hdf5 file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=hid_t), | intent(in) | :: | location |
hdf5 file or group id |
||
| character(len=*), | intent(in) | :: | attribute_name | |||
| character(len=*), | intent(in) | :: | value_in(:) |
from scalar up to rank 3 |
||
| integer(kind=size_t), | intent(in) | :: | length(:) |
subroutine write_attribute_vstr1d(location,attribute_name,value_in,length) !! BROKEN: (not variable) Write 1d atribute variable string array to hdf5 file integer(hid_t), intent(in) :: location !! hdf5 file or group id character(*), intent(in) :: attribute_name character(*), intent(in) :: value_in(:) !! from scalar up to rank 3 integer(size_t), intent(in) :: length(:) !! BROKEN: unused right now integer(hid_t) :: dspc_id, dset_id, tstr_id integer(hsize_t) :: dims2(2),dims1(1) integer :: i,err character(:),allocatable :: val(:) dims2(1) = len(value_in) + 1 dims2(2) = size(value_in) dims1(1) = dims2(2) allocate(character(dims2(1)) :: val(dims2(2))) do i = 1, size(val) val(i) = trim(value_in(i))//char(0) enddo call h5tcopy_f(H5T_C_S1, tstr_id, err) call h5tset_size_f(tstr_id, dims2(1), err) call h5screate_simple_f(1, dims1, dspc_id, err) call h5acreate_f(location, attribute_name, tstr_id, dspc_id, dset_id, err) call h5awrite_f(dset_id, tstr_id, val, dims2, err) call h5tclose_f(tstr_id,err) call h5sclose_f(dspc_id,err) call h5aclose_f(dset_id,err) end subroutine write_attribute_vstr1d