setup_dp_1d_dataset_buffer Subroutine

public subroutine setup_dp_1d_dataset_buffer(buf, val)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), allocatable :: buf(:)
real(kind=dp), intent(in), target :: val(:)

Contents


Source Code

    subroutine setup_dp_1d_dataset_buffer(buf,val)
      ! allocate a buffer for reading dp_1d_datasets
      real(dp), allocatable, intent(out) :: buf(:)
      real(dp), target, intent(in) :: val(:)

      integer :: dims, ierr

      dims = size(val)
      ! if we change the number of replicas, we have to be careful
      if(lenof_sign /= tmp_lenof_sign) then
         if(dims .eq. lenof_sign) then
            allocate(buf(tmp_lenof_sign), stat = ierr)
         endif
      else
         ! else, the buffer is not very interesting
         allocate(buf(dims))
      endif
    end subroutine setup_dp_1d_dataset_buffer