h5ltmake_compressed_dataset_int_f_7 Subroutine

public subroutine h5ltmake_compressed_dataset_int_f_7(loc_id, dset_name, rank, dims, buf, error, compress, level)

Write a compressed 32-bit integer dataset of dimension 7

Arguments

TypeIntentOptionalAttributesName
integer(kind=hid_t), intent(in) :: loc_id

HDF5 file or group identifier

character(len=*), intent(in) :: dset_name

Name of the dataset to create

integer, intent(in) :: rank

Number of dimensions of dataspace

integer(kind=HSIZE_T), intent(in), dimension(*):: dims

Array of the size of each dimension

integer, intent(in), dimension(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)):: buf

Buffer with data to be written to the dataset

integer, intent(out) :: error

HDF5 error code

logical, intent(in), optional :: compress

Flag to compress

integer, intent(in), optional :: level

Compression level


Calls

proc~~h5ltmake_compressed_dataset_int_f_7~~CallsGraph proc~h5ltmake_compressed_dataset_int_f_7 h5ltmake_compressed_dataset_int_f_7 proc~chunk_size chunk_size proc~h5ltmake_compressed_dataset_int_f_7->proc~chunk_size h5sclose_f h5sclose_f proc~h5ltmake_compressed_dataset_int_f_7->h5sclose_f h5pset_chunk_f h5pset_chunk_f proc~h5ltmake_compressed_dataset_int_f_7->h5pset_chunk_f h5ltmake_dataset_int_f h5ltmake_dataset_int_f proc~h5ltmake_compressed_dataset_int_f_7->h5ltmake_dataset_int_f h5pcreate_f h5pcreate_f proc~h5ltmake_compressed_dataset_int_f_7->h5pcreate_f h5pset_shuffle_f h5pset_shuffle_f proc~h5ltmake_compressed_dataset_int_f_7->h5pset_shuffle_f h5pset_deflate_f h5pset_deflate_f proc~h5ltmake_compressed_dataset_int_f_7->h5pset_deflate_f h5dcreate_f h5dcreate_f proc~h5ltmake_compressed_dataset_int_f_7->h5dcreate_f h5dwrite_f h5dwrite_f proc~h5ltmake_compressed_dataset_int_f_7->h5dwrite_f h5dclose_f h5dclose_f proc~h5ltmake_compressed_dataset_int_f_7->h5dclose_f h5pclose_f h5pclose_f proc~h5ltmake_compressed_dataset_int_f_7->h5pclose_f h5screate_simple_f h5screate_simple_f proc~h5ltmake_compressed_dataset_int_f_7->h5screate_simple_f

Called by

proc~~h5ltmake_compressed_dataset_int_f_7~~CalledByGraph proc~h5ltmake_compressed_dataset_int_f_7 h5ltmake_compressed_dataset_int_f_7 interface~h5ltmake_compressed_dataset_int_f h5ltmake_compressed_dataset_int_f interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_7 proc~write_birth_profile write_birth_profile proc~write_birth_profile->interface~h5ltmake_compressed_dataset_int_f proc~write_neutral_population write_neutral_population proc~write_neutral_population->interface~h5ltmake_compressed_dataset_int_f proc~write_npa write_npa proc~write_npa->interface~h5ltmake_compressed_dataset_int_f program~fidasim fidasim program~fidasim->proc~write_birth_profile program~fidasim->proc~write_npa proc~write_neutrals write_neutrals program~fidasim->proc~write_neutrals proc~write_neutrals->proc~write_neutral_population

Contents


Source Code

subroutine h5ltmake_compressed_dataset_int_f_7(loc_id,&
           dset_name, rank, dims, buf, error, compress, level  )
    !+ Write a compressed 32-bit integer dataset of dimension 7

    IMPLICIT NONE

    integer(hid_t), intent(in)                                           :: loc_id
        !+ HDF5 file or group identifier
    character(len=*), intent(in)                                         :: dset_name
        !+ Name of the dataset to create
    integer, intent(in)                                                  :: rank
        !+ Number of dimensions of dataspace
    integer(HSIZE_T), dimension(*), intent(in)                           :: dims
        !+ Array of the size of each dimension
    integer, intent(in), &
      dimension(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf
        !+ Buffer with data to be written to the dataset
    integer, intent(out)                                                 :: error
        !+ HDF5 error code
    logical, intent(in), optional                                        :: compress
        !+ Flag to compress
    integer, intent(in), optional                                        :: level
        !+ Compression level

    integer(HID_T) :: did, sid, plist_id
    integer(HSIZE_T) :: cdims(7)

    logical :: do_chunk
    integer :: c

    do_chunk=default_compress
    if(present(compress)) then
        do_chunk = compress
    endif

    c = default_compression_level
    if(present(level)) then
        c = level
    endif

    if(.not.compress_data) then
        call h5ltmake_dataset_int_f(loc_id, dset_name, rank, dims, buf, error)
    else
        call h5screate_simple_f(rank, dims, sid, error)
        call h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error)

        if(do_chunk) then
            call h5pset_shuffle_f(plist_id, error)
            call h5pset_deflate_f(plist_id, c, error)

            call chunk_size(Int32, dims, cdims)
            call h5pset_chunk_f(plist_id, rank, cdims, error)
        endif

        call h5dcreate_f(loc_id, dset_name, H5T_NATIVE_INTEGER, sid, &
             did, error, dcpl_id=plist_id)

        call h5dwrite_f(did, H5T_NATIVE_INTEGER, buf, dims, error)

        call h5sclose_f(sid, error)
        call h5pclose_f(plist_id, error)
        call h5dclose_f(did, error)
    endif

end subroutine h5ltmake_compressed_dataset_int_f_7