Observatoire de Paris - Code Fortran  version1.0
mod_mat.f90
Aller à la documentation de ce fichier.
1 module mod_mat
2 implicit none
3 
4 Contains
10 subroutine matmul(n,a,b,c)
11  implicit none ! on force l'initialisation de toutes les variables
12  integer, intent(in) :: n
13  real(kind=kind(1.d0)), intent(in) :: a(n,n),b(n,n)
14  real(kind=kind(1.d0)), intent(out) :: c(n,n)
15  integer :: i,j,k,ii,jj,kk
16  integer :: is
17 
18  c = 0.
19  is = 20
20  do j = 1,n,is
21  do i = 1,n,is
22  do k = 1,n,is
23  do jj = j,min(n,j+is-1)
24  do ii = i,min(n,i+is-1)
25  do kk = k,min(n,k+is-1)
26  c(ii,jj) = c(ii,jj) + a(ii,kk)*b(kk,jj)
27  end do
28  end do
29  end do
30  end do
31  end do
32  end do
33 
34 end subroutine matmul
35 end module mod_mat
subroutine matmul(n, a, b, c)
matrix-matrix product
Definition: mod_mat.f90:11