allocate_1d_dp Module Subroutine

pure module subroutine allocate_1d_dp(array_, size_)

allocate a 1d array and fill it with 0s (double precision version)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), allocatable :: array_(:)
integer(kind=int32), intent(in) :: size_

Contents

Source Code


Source Code

      pure module subroutine allocate_1d_dp(array_, size_)
         !! allocate a 1d array and fill it with 0s (double precision version)
         real(dp), allocatable, intent(inout)  :: array_(:)
         integer(int32), intent(in)            :: size_
         !---------------------------------------------------------------------!
         if (allocated(array_)) deallocate(array_)
         allocate(array_(size_))
         array_ = 0
         !---------------------------------------------------------------------!
      end subroutine allocate_1d_dp