Bonjour,

J'utilise un programme fortran qui analyse des colonnes de chiffres dans des fichiers externes. En fait, ces fichiers correspondent a des spectres dont la premiere colonne est en longueur d'onde (nanometre). L'utilisateur choisit un domaine de longueur d'onde qui est transformé en domaine de vitesse grace à l'effet Doppler. En gros, il prend la premiere colonne, il fait une operation dessus pour donner une nouvelle colonne qui est placée avant l'ancienne. Tout ça donne donc un fichier de sortie avec une colonne en plus.

Seulement, à l'exécution du programme, j'ai le message d'erreur suivant:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
*** glibc detected *** ./vitesse: free(): invalid next size (normal): 0x0952b5a0 ***
======= Backtrace: =========
/lib/libc.so.6[0x885d06]
/lib/libc.so.6(cfree+0x90)[0x8891e0]
./vitesse[0x805a3db]
./vitesse[0x804b0aa]
./vitesse[0x804a7c0]
./vitesse[0x804a4f5]
./vitesse[0x8049ba1]
/lib/libc.so.6(__libc_start_main+0xdc)[0x832dec]
./vitesse[0x8049ab1]
======= Memory map: ========
007ff000-00819000 r-xp 00000000 fd:00 100496                             /lib/ld-2.5.so
00819000-0081a000 r-xp 00019000 fd:00 100496                             /lib/ld-2.5.so
0081a000-0081b000 rwxp 0001a000 fd:00 100496                             /lib/ld-2.5.so
0081d000-0095a000 r-xp 00000000 fd:00 98320                              /lib/libc-2.5.so
0095a000-0095c000 r-xp 0013d000 fd:00 98320                              /lib/libc-2.5.so
0095c000-0095d000 rwxp 0013f000 fd:00 98320                              /lib/libc-2.5.so
0095d000-00960000 rwxp 0095d000 00:00 0 
00962000-00964000 r-xp 00000000 fd:00 98327                              /lib/libdl-2.5.so
00964000-00965000 r-xp 00001000 fd:00 98327                              /lib/libdl-2.5.so
00965000-00966000 rwxp 00002000 fd:00 98327                              /lib/libdl-2.5.so
00968000-0098d000 r-xp 00000000 fd:00 98373                              /lib/libm-2.5.so
0098d000-0098e000 r-xp 00024000 fd:00 98373                              /lib/libm-2.5.so
0098e000-0098f000 rwxp 00025000 fd:00 98373                              /lib/libm-2.5.so
00a8b000-00a96000 r-xp 00000000 fd:00 98377                              /lib/libgcc_s-4.1.2-20080102.so.1
00a96000-00a97000 rwxp 0000a000 fd:00 98377                              /lib/libgcc_s-4.1.2-20080102.so.1
08048000-080ae000 r-xp 00000000 00:16 8929409                            /home3/fabas/Fortran/prog/vitesse
080ae000-080b2000 rwxp 00066000 00:16 8929409                            /home3/fabas/Fortran/prog/vitesse
080b2000-080b6000 rwxp 080b2000 00:00 0 
09523000-09544000 rwxp 09523000 00:00 0 
f7900000-f7921000 rwxp f7900000 00:00 0 
f7921000-f7a00000 ---p f7921000 00:00 0 
f7aaf000-f7f97000 rwxp f7aaf000 00:00 0 
f7fb0000-f7fb1000 rwxp f7fb0000 00:00 0 
fffaa000-fffb1000 rwxp fffaa000 00:00 0                                  [stack]
ffffe000-fffff000 r-xp ffffe000 00:00 0 
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC        Routine            Line        Source             
vitesse            0806A3E4  Unknown               Unknown  Unknown
vitesse            0804C046  Unknown               Unknown  Unknown
vitesse            0804D74D  Unknown               Unknown  Unknown
.                  FFFFE500  Unknown               Unknown  Unknown
Unknown            00000006  Unknown               Unknown  Unknown
libc.so.6          00847621  Unknown               Unknown  Unknown
libc.so.6          0087DE5B  Unknown               Unknown  Unknown
libc.so.6          00885D06  Unknown               Unknown  Unknown
libc.so.6          008891E0  Unknown               Unknown  Unknown
vitesse            0805A3DB  Unknown               Unknown  Unknown
vitesse            0804B0AA  Unknown               Unknown  Unknown
vitesse            0804A7C0  Unknown               Unknown  Unknown
vitesse            0804A4F5  Unknown               Unknown  Unknown
vitesse            08049BA1  Unknown               Unknown  Unknown
libc.so.6          00832DEC  Unknown               Unknown  Unknown
vitesse            08049AB1  Unknown               Unknown  Unknown
Le programme s'appelle vitesse.f90:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
program vitesse
 
integer :: m,i,taille,j,tailleb,w,sup,inf,y,k
 character(99) :: inputfile
real, dimension(:,:), allocatable :: a,b
real            :: ld,lf,lambda,lambdap
double precision :: c=299792.458,lambda0
 
type *,'longueur d'' onde du laboratoire: '
read (*,'(f8.3)') lambda0
type *,'Quelle domaine pour lambda? '
read (*,'(f8.3)') ld
read (*,'(f8.3)') lf
 
print '(f10.3)',c
print *,lambda0
 
type *,'inputfile :'
read (*,'(a30)') inputfile
inputfile='/home3/fabas/Fortran/'//inputfile
print *,'inputfile :',inputfile
 
OPEN  (UNIT =1,FILE =inputfile,form='formatted',status="old",action='read')
 
w=0
taille=0
tailleb=0
do i=1,300000
 
	read (1,'(f10.4)', end=100) lambda
	taille=taille+1
 
	if (lambda>ld) then
		if (lambda<lf) then
			tailleb=tailleb+1
			if (w==0) then
				inf=taille
			        print *,'***',taille
				w=1
			endif
		else
			if (w==1) then
				sup=taille
				w=2
			endif	
		endif
	else
 
		w=0
		tailleb=0
 
	endif
 
lambdap=lambda
 
enddo
100 continue
 
!/////////////////////////////////////////////////////////////////////////////////////////
 
allocate(a(6,taille))
allocate(b(7,tailleb))
 
!/////////////////////////////////////////////////////////////////////////////////////////
rewind 1
!/////////////////////////////////////////////////////////////////////////////////////////
 
y=0
do k=1,taille
	read (1,'(f10.4,5e12.4)') a(:,k)
	if (k>=inf) then
		if (k<=sup) then
			y=y+1
			b(1,y)=((a(1,k)-lambda0)/lambda0)*c
			b(2:7,y)=a(1:6,k)
		endif
	endif
enddo
 
 close (unit=1)
 
!/////////////////////////////////////////////////////////////////////////////////////////
 
OPEN  (UNIT=4,FILE ='resultat3',form='formatted',status="new",action="write")
 
write (4,'(f12.4,f10.4,5e12.4)') b
 
 close (unit=4)
 
end program vitesse
La question est donc tout simplement : mais d'où vient cette erreur?
Merci de votre aide et bonne soirée à tous !!