allocate_3d_dp Module Subroutine

pure module subroutine allocate_3d_dp(array_, size1_, size2_, size3_)

allocate a 3d 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) :: size1_
integer(kind=int32), intent(in) :: size2_
integer(kind=int32), intent(in) :: size3_

Contents

Source Code


Source Code

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