diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-04-23 22:57:27 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-04-23 22:57:27 +0200 |
commit | a9245d4fa33ce7e0a681300540d4ec675a1e688a (patch) | |
tree | 5f2b787d5d8c43b32a53cb62d97d536454cd172c /src/bettermath.F90 | |
parent | e328b72fd7d407b42ad49e40f6ea6fd0041d562a (diff) | |
download | fortran-assignment1-a9245d4fa33ce7e0a681300540d4ec675a1e688a.tar.gz fortran-assignment1-a9245d4fa33ce7e0a681300540d4ec675a1e688a.zip |
specify array shape in declaration
Diffstat (limited to 'src/bettermath.F90')
-rw-r--r-- | src/bettermath.F90 | 9 |
1 files changed, 3 insertions, 6 deletions
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) |