From a9245d4fa33ce7e0a681300540d4ec675a1e688a Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 23 Apr 2019 22:57:27 +0200 Subject: specify array shape in declaration --- src/bettermath.F90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/bettermath.F90') diff --git a/src/bettermath.F90 b/src/bettermath.F90 index c77bedf..091eb9c 100644 --- a/src/bettermath.F90 +++ b/src/bettermath.F90 @@ -41,10 +41,9 @@ CONTAINS FUNCTION bettmull_4(A, B) result(C) IMPLICIT none real(kind=4), intent(in), dimension(1:,1:) :: A, B - real(kind=4), dimension(:,:), allocatable :: C + real(kind=4), dimension(size(A, 1), size(B, 2)) :: C integer :: i, j, k - allocate(C(size(A, 1), size(B, 2))) C = 0 DO j = 1, size(B, 2) @@ -61,10 +60,9 @@ CONTAINS FUNCTION bettmull_8(A, B) result(C) IMPLICIT none real(kind=8), intent(in), dimension(1:,1:) :: A, B - real(kind=8), dimension(:,:), allocatable :: C + real(kind=8), dimension(size(A, 1), size(B, 2)) :: C integer :: i, j, k - allocate(C(size(A, 1), size(B, 2))) C = 0 DO j = 1, size(B, 2) @@ -81,10 +79,9 @@ CONTAINS FUNCTION bettmull_16(A, B) result(C) IMPLICIT none real(kind=16), intent(in), dimension(1:,1:) :: A, B - real(kind=16), dimension(:,:), allocatable :: C + real(kind=16), dimension(size(A, 1), size(B, 2)) :: C integer :: i, j, k - allocate(C(size(A, 1), size(B, 2))) C = 0 DO j = 1, size(B, 2) -- cgit v1.2.3