Problème erreur code Fortran (débutant)
Bonjour à tous
Voilà je débute en Fortran et je voudrai simplement faire une matrice 2x2 et l'afficher.
J'ai repris ce code d'une doc du logiciel SAMCEF qui utilise dans des routines des bouts de code Fortran.
voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
SUBROUTINE MC531 (SS)
C
DIMENSION SS(NDIM,NDIM)
INTEGER NDIM
C
C
AK = 5000
C
SS(1,1) = AK
SS(2,2) = AK
SS(1,2) = -AK
SS(2,1) = -AK
C
do i = 1, n
write(*,*) i, SS(i)
enddo
END |
Voici l'erreur que j'obtient :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Matrice.f: In subroutine `mc531':
Matrice.f:16:
write(*,*) i, SS(i)
1 2
Too few elements (1 missing) as of (2) for array reference at (1)
Matrice.f:3:
DIMENSION SS(NDIM,NDIM)
1
Matrice.f:19: (continued):
END
2
Invalid declaration of or reference to symbol `ndim' at (2) [initially seen at (
1)] |
Pour compiler j'utilise la commande suivante : g77 Matrice.f -o Matrice.exe
Une idée ?
Merci d'avance.