chunk_size Subroutine

public subroutine chunk_size(elsize, dims, cdims)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: elsize

Size of elements in bytes

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

Dimensions of dataset

integer(kind=HSIZE_T), intent(out), dimension(:):: cdims

Maximum allowed chunk size/dims


Called by

proc~~chunk_size~~CalledByGraph proc~chunk_size chunk_size proc~h5ltmake_compressed_dataset_double_f_4 h5ltmake_compressed_dataset_double_f_4 proc~h5ltmake_compressed_dataset_double_f_4->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_1 h5ltmake_compressed_dataset_int_f_1 proc~h5ltmake_compressed_dataset_int_f_1->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_2 h5ltmake_compressed_dataset_int_f_2 proc~h5ltmake_compressed_dataset_int_f_2->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_3 h5ltmake_compressed_dataset_int_f_3 proc~h5ltmake_compressed_dataset_int_f_3->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_2 h5ltmake_compressed_dataset_double_f_2 proc~h5ltmake_compressed_dataset_double_f_2->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_1 h5ltmake_compressed_dataset_double_f_1 proc~h5ltmake_compressed_dataset_double_f_1->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_5 h5ltmake_compressed_dataset_double_f_5 proc~h5ltmake_compressed_dataset_double_f_5->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_3 h5ltmake_compressed_dataset_double_f_3 proc~h5ltmake_compressed_dataset_double_f_3->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_4 h5ltmake_compressed_dataset_int_f_4 proc~h5ltmake_compressed_dataset_int_f_4->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_5 h5ltmake_compressed_dataset_int_f_5 proc~h5ltmake_compressed_dataset_int_f_5->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_6 h5ltmake_compressed_dataset_int_f_6 proc~h5ltmake_compressed_dataset_int_f_6->proc~chunk_size proc~h5ltmake_compressed_dataset_int_f_7 h5ltmake_compressed_dataset_int_f_7 proc~h5ltmake_compressed_dataset_int_f_7->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_6 h5ltmake_compressed_dataset_double_f_6 proc~h5ltmake_compressed_dataset_double_f_6->proc~chunk_size proc~h5ltmake_compressed_dataset_double_f_7 h5ltmake_compressed_dataset_double_f_7 proc~h5ltmake_compressed_dataset_double_f_7->proc~chunk_size interface~h5ltmake_compressed_dataset_double_f h5ltmake_compressed_dataset_double_f interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_4 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_2 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_1 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_5 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_3 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_f_6 interface~h5ltmake_compressed_dataset_double_f->proc~h5ltmake_compressed_dataset_double_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_1 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_2 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_3 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_4 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_5 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_6 interface~h5ltmake_compressed_dataset_int_f->proc~h5ltmake_compressed_dataset_int_f_7 proc~write_einstein write_einstein proc~write_einstein->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_d_he3 write_bt_D_He3 proc~write_bt_d_he3->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_d_d write_bt_D_D proc~write_bt_d_d->interface~h5ltmake_compressed_dataset_double_f proc~write_fida_weights write_fida_weights proc~write_fida_weights->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_d_t write_bt_D_T proc~write_bt_d_t->interface~h5ltmake_compressed_dataset_double_f proc~write_bb_h_h write_bb_H_H proc~write_bb_h_h->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_h_e write_bt_H_e proc~write_bt_h_e->interface~h5ltmake_compressed_dataset_double_f proc~write_bb_h_e write_bb_H_e proc~write_bb_h_e->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_h_h write_bt_H_H proc~write_bt_h_h->interface~h5ltmake_compressed_dataset_double_f proc~write_bb_h_aq write_bb_H_Aq proc~write_bb_h_aq->interface~h5ltmake_compressed_dataset_double_f proc~write_spectra write_spectra proc~write_spectra->interface~h5ltmake_compressed_dataset_double_f proc~write_npa write_npa proc~write_npa->interface~h5ltmake_compressed_dataset_double_f proc~write_npa->interface~h5ltmake_compressed_dataset_int_f proc~write_cfpd_weights write_cfpd_weights proc~write_cfpd_weights->interface~h5ltmake_compressed_dataset_double_f proc~write_bb_d_t write_bb_D_T proc~write_bb_d_t->interface~h5ltmake_compressed_dataset_double_f proc~write_bb_d_he3 write_bb_D_He3 proc~write_bb_d_he3->interface~h5ltmake_compressed_dataset_double_f proc~write_bt_h_aq write_bt_H_Aq proc~write_bt_h_aq->interface~h5ltmake_compressed_dataset_double_f proc~write_npa_weights write_npa_weights proc~write_npa_weights->interface~h5ltmake_compressed_dataset_double_f proc~write_beam_grid write_beam_grid proc~write_npa_weights->proc~write_beam_grid proc~write_beam_grid->interface~h5ltmake_compressed_dataset_double_f proc~write_neutral_population write_neutral_population proc~write_neutral_population->interface~h5ltmake_compressed_dataset_double_f proc~write_neutral_population->interface~h5ltmake_compressed_dataset_int_f proc~write_birth_profile write_birth_profile proc~write_birth_profile->interface~h5ltmake_compressed_dataset_double_f proc~write_birth_profile->interface~h5ltmake_compressed_dataset_int_f proc~write_birth_profile->proc~write_beam_grid proc~write_bb_d_d write_bb_D_D proc~write_bb_d_d->interface~h5ltmake_compressed_dataset_double_f proc~write_neutrons write_neutrons proc~write_neutrons->interface~h5ltmake_compressed_dataset_double_f program~fidasim fidasim program~fidasim->proc~write_spectra program~fidasim->proc~write_npa program~fidasim->proc~write_birth_profile proc~neutron_f neutron_f program~fidasim->proc~neutron_f proc~fida_weights_los fida_weights_los program~fidasim->proc~fida_weights_los proc~write_neutrals write_neutrals program~fidasim->proc~write_neutrals proc~neutron_mc neutron_mc program~fidasim->proc~neutron_mc proc~cfpd_f cfpd_f program~fidasim->proc~cfpd_f proc~fida_weights_mc fida_weights_mc program~fidasim->proc~fida_weights_mc proc~npa_weights npa_weights program~fidasim->proc~npa_weights proc~neutron_f->proc~write_neutrons proc~fida_weights_los->proc~write_fida_weights proc~write_neutrals->proc~write_beam_grid proc~write_neutrals->proc~write_neutral_population proc~neutron_mc->proc~write_neutrons proc~cfpd_f->proc~write_cfpd_weights proc~fida_weights_mc->proc~write_fida_weights proc~npa_weights->proc~write_npa_weights program~generate_tables generate_tables program~generate_tables->proc~write_einstein program~generate_tables->proc~write_bt_d_he3 program~generate_tables->proc~write_bt_d_d program~generate_tables->proc~write_bb_h_h program~generate_tables->proc~write_bt_h_e program~generate_tables->proc~write_bb_h_e program~generate_tables->proc~write_bt_h_h program~generate_tables->proc~write_bb_h_aq program~generate_tables->proc~write_bb_d_he3 program~generate_tables->proc~write_bt_h_aq program~generate_tables->proc~write_bb_d_d

Contents

Source Code


Source Code

subroutine chunk_size(elsize, dims, cdims)
    integer, intent(in)                          :: elsize
        !+ Size of elements in bytes
    integer(HSIZE_T), dimension(*), intent(in)   :: dims
        !+ Dimensions of dataset
    integer(HSIZE_T), dimension(:), intent(out)  :: cdims
        !+ Maximum allowed chunk size/dims

    real, parameter :: max_bytes = 4*1e9 !GigaBytes

    integer :: d
    real(Float64) :: nbytes


    d = size(cdims)
    cdims(1:d) = dims(1:d)
    nbytes = elsize*product(1.d0*cdims)
    do while ((nbytes.gt.max_bytes).and.(d.gt.0))
        cdims(d) = max(floor(cdims(d)*max_bytes/nbytes,Int32),1)
        nbytes = elsize*product(1.d0*cdims)
        d = d - 1
    enddo

end subroutine chunk_size