read_gdata Subroutine

private subroutine read_gdata(this, gdata_buf, ndets, initial)

Type Bound

gdata_io_t

Arguments

Type IntentOptional Attributes Name
class(gdata_io_t), intent(in) :: this
real(kind=dp), intent(in) :: gdata_buf(:,:)
integer, intent(in) :: ndets
integer, intent(in), optional :: initial

Contents

Source Code


Source Code

    subroutine read_gdata(this, gdata_buf, ndets, initial)
        ! Reads the gdata from a buffer to the global_det_data array
        ! Input: gdata_buf - Buffer containing the read data, first dimension has
        !                    to be this%entry_size()
        !        ndets - number of entries to read (can be less than the size of gdata_buf)
        !        initial - optionally, an offset where to start writing
        class(gdata_io_t), intent(in) :: this
        real(dp), intent(in) :: gdata_buf(:, :)
        integer, intent(in) :: ndets
        integer, intent(in), optional :: initial

        ! do a sanity check: there has to be some data
        if (this%t_io()) then
            if (this%entry_size() <= size(gdata_buf, dim=1)) then
                if (tAutoAdaptiveShift) then
                    ! set the global det data for auto adaptive shift
                    call readFVals( &
                        gdata_buf(this%fvals_start:this%fvals_end, :), ndets, initial)
                end if
                if (tScaleBlooms) then
                    ! set the global det data for bloom scaling
                    call set_all_max_ratios( &
                        gdata_buf(this%max_ratio_start:this%max_ratio_end, :), ndets, initial)
                end if
                if (tAccumPopsActive) then
                    ! set the global det data for accumlated population
                    call readAPVals( &
                        gdata_buf(this%apvals_start:this%apvals_end, :), ndets, initial)
                end if
            else
                write(stderr, *) "WARNING: Dimension mismatch in read_gdata, ignoring all read data"
            end if
        end if
    end subroutine read_gdata