Observatoire de Paris - Code Fortran
version1.0
src_f
tp_opt_doc.f90
Aller à la documentation de ce fichier.
1
37
38
program
tp_opt_ok
39
use
mod_initialise
40
use
mod_mat
41
use
mod_scalapackfx_tools
42
implicit none
! on force l'initialisation de toutes les variables
43
47
type
matrix
48
integer
:: n
49
real
(kind=8), pointer,
dimension(:,:)
:: val
50
type
(
initvar
) :: initvaria
51
end type
matrix
52
53
real
(kind=kind(1.d0)),
allocatable
:: a(:,:),b(:,:)
54
real
(kind=kind(1.d0)),
allocatable
:: c(:,:)
! c = A*B
55
real
(kind=kind(1.d0)),
allocatable
:: x(:)
56
real
(kind=kind(1.d0)) :: ddot
57
58
integer
:: n
! taille des matrices
59
60
61
62
n = 1000
63
64
! initialisation des matrices
65
allocate
(a(n,n))
66
call
inita
(n,a)
67
allocate
(b(n,n))
68
call
initb
(n,b)
69
70
! Multiplication A*B
71
allocate
(c(n,n))
72
call
matmul
(n,a,b,c)
73
74
! initialisation de x
75
allocate
(x(n))
76
call
initx
(n,x)
77
78
! Produit matrice vecteur: x = C*x
79
call
matvec(n,c,x)
80
81
! Calcul de la norme
82
call
norm(n,x)
83
84
end program
tp_opt_ok
mod_scalapackfx_tools
Definition:
mod_all_object.f90:1
mod_initialise
Definition:
mod_initialise.f90:32
tp_opt_ok
program tp_opt_ok
Definition:
tp_opt_doc.f90:38
matrix
Definition:
tp_opt_doc.f90:47
mod_initialise::initvar
Definition:
mod_initialise.f90:44
mod_mat::matmul
subroutine matmul(n, a, b, c)
matrix-matrix product
Definition:
mod_mat.f90:11
mod_initialise::initb
subroutine initb(n, b)
Definition:
mod_initialise.f90:99
mod_mat
Definition:
mod_mat.f90:1
mod_initialise::inita
subroutine inita(n, a)
Definition:
mod_initialise.f90:64
mod_initialise::initx
subroutine initx(n, x)
X initialization.
Definition:
mod_initialise.f90:129
Généré par
1.8.15