Bonjour
Une incompréhension totale de l'exécution de mon programme. Il y a un problème de gestion de la mémoire que je ne comprend pas.
voilà la subroutine en question
et voici ce que ça sort quand je l'exécute :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 Subroutine histogramme(ntot,x,xmin,xmax,ndim,h,npas) Implicit None integer,intent(in)::ntot,npas,ndim double precision,dimension(ntot),intent(in)::x double precision,dimension(ndim,3),intent(out)::h double precision,intent(in)::xmin,xmax integer::i,j double precision::vali,valf,val0,val,pas pas = (xmax - xmin) / dble(npas) val0 = xmin + pas/2.d0 write(*,*)npas,pas h(:,:)=0.d0 write(*,*)npas,pas .... ....
J'ai l'impression qu'il écrase la variable npas quand j'écris dans h mais je ne vois pas pourquoi !Citation:
2 6.38616156578064
0 6.38616156578064
*** glibc detected *** exe: free(): invalid pointer: 0xbfade728 ***
======= Backtrace: =========
/lib/libc.so.6[0x6e7f5d]
/lib/libc.so.6(cfree+0x90)[0x6eb5b0]
/usr/lib/libgfortran.so.1(_gfortran_internal_free+0x21)[0x937181]
exe[0x804afbf]
[0x0]
======= Memory map: ========
00660000-00679000 r-xp 00000000 fd:00 493741 /lib/ld-2.5.so
00679000-0067a000 r-xp 00018000 fd:00 493741 /lib/ld-2.5.so
0067a000-0067b000 rwxp 00019000 fd:00 493741 /lib/ld-2.5.so
00682000-007b9000 r-xp 00000000 fd:00 493742 /lib/libc-2.5.so
007b9000-007bb000 r-xp 00137000 fd:00 493742 /lib/libc-2.5.so
007bb000-007bc000 rwxp 00139000 fd:00 493742 /lib/libc-2.5.so
007bc000-007bf000 rwxp 007bc000 00:00 0
007c1000-007e6000 r-xp 00000000 fd:00 493749 /lib/libm-2.5.so
007e6000-007e7000 r-xp 00024000 fd:00 493749 /lib/libm-2.5.so
007e7000-007e8000 rwxp 00025000 fd:00 493749 /lib/libm-2.5.so
0092b000-009a9000 r-xp 00000000 fd:00 1140496 /usr/lib/libgfortran.so.1.0.0
009a9000-009aa000 rwxp 0007e000 fd:00 1140496 /usr/lib/libgfortran.so.1.0.0
00a6f000-00a7a000 r-xp 00000000 fd:00 493762 /lib/libgcc_s-4.1.1-20070105.so.1
00a7a000-00a7b000 rwxp 0000a000 fd:00 493762 /lib/libgcc_s-4.1.1-20070105.so.1
00d59000-00d5a000 r-xp 00d59000 00:00 0 [vdso]
08048000-0804d000 r-xp 00000000 fd:00 2131940 /home/Ger/program/exe
0804d000-0804e000 rw-p 00004000 fd:00 2131940 /home/Ger/program/exe
090ec000-0910d000 rw-p 090ec000 00:00 0
b7e00000-b7e21000 rw-p b7e00000 00:00 0
b7e21000-b7f00000 ---p b7e21000 00:00 0
b7f1c000-b7f1e000 rw-p b7f1c000 00:00 0
b7f33000-b7f34000 rw-p b7f33000 00:00 0
bfacc000-bfae1000 rw-p bfacc000 00:00 0 [stack]
Abandon
Merci pour votre aide !