JohannesRS
Programmer
Hi all!
Well, this is my first post in this forum, and I hope one of few related to "problems"...
I've tried this compilation already on ifort 8.1, compaq visual fortran 6.5 and pgf90 (unknown version). Each compiler is on a different machine. In all cases, it gives me:
or equivalent error messages. The above one is from ifort.
Traking down the code by using the old fashioned write(6,*) "variable" to find the mistake, I found that at a certain point the array "origem" had its values changed from 4 and 6 to 1034080485 and -1104470973...
Tracking this again, I found that it was changed during this (including the test writes):
So, the array was changed inside a subroutine that *hadn't* it passed to and hadn't any variable or array or whatever inside it with that name.
To track it deeper, I decided then to virtually pass this variable to the subroutine, and declare it as it should be, BUT with an "intent(in)" argument to make it unmodified. Didn't help. So I decided to find where it's being changed.
So, during the 63rd and 64th reading in the following looping, I found the array values changing:
So, after performing some "reads" to completelly non-related variables, I got my array values completelly modified. In a way that makes no sense for me.
I know I should give the files for testing, but as I see in here I can't just attach them to the thread. So, I put it on the internet in the following address:
This tgz file was created from the last trial, what means that it already passes the array to the subroutine with intent(in), instead of just not passing.
Files in it:
trj2grid8.f90: main program
mod_pbc.f90: module pbc_routines, with 2 suboutines.
mod_trj_read.f90: module read_trj, with 3 subroutines, including the read_config one, where seems that the problem happens.
teste.in: input for the program
teste.trj: file the program reads and deal with.
Anyway, sorry if this was too long, or if I posted in the wrong place. And thanks in advance for any help provided!
Thanks a lot,
Jones
Well, this is my first post in this forum, and I hope one of few related to "problems"...
I've tried this compilation already on ifort 8.1, compaq visual fortran 6.5 and pgf90 (unknown version). Each compiler is on a different machine. In all cases, it gives me:
Code:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Stack trace terminated abnormally.
or equivalent error messages. The above one is from ifort.
Traking down the code by using the old fashioned write(6,*) "variable" to find the mistake, I found that at a certain point the array "origem" had its values changed from 4 and 6 to 1034080485 and -1104470973...
Tracking this again, I found that it was changed during this (including the test writes):
Code:
write(6,*) 'TESTE ORIGEM:', origem
call read_config(natomtot, atomnames, xyz, carga, ntypes, boxtype, boxLx, boxLy, boxLz, nmol, natomos, vol)
write(6,*) 'origem:', origem
So, the array was changed inside a subroutine that *hadn't* it passed to and hadn't any variable or array or whatever inside it with that name.
To track it deeper, I decided then to virtually pass this variable to the subroutine, and declare it as it should be, BUT with an "intent(in)" argument to make it unmodified. Didn't help. So I decided to find where it's being changed.
So, during the 63rd and 64th reading in the following looping, I found the array values changing:
Code:
do iatom = 1, natomtot
write(6,*) 'teste origem M:', iatom, origem
read (79,*,end=66) atomnames(iatom), xyz(1, iatom), xyz(2, iatom), xyz(3, iatom), carga(iatom)
write(6,*) 'teste origem N:', iatom, origem
enddo !iatom
So, after performing some "reads" to completelly non-related variables, I got my array values completelly modified. In a way that makes no sense for me.
I know I should give the files for testing, but as I see in here I can't just attach them to the thread. So, I put it on the internet in the following address:
This tgz file was created from the last trial, what means that it already passes the array to the subroutine with intent(in), instead of just not passing.
Files in it:
trj2grid8.f90: main program
mod_pbc.f90: module pbc_routines, with 2 suboutines.
mod_trj_read.f90: module read_trj, with 3 subroutines, including the read_config one, where seems that the problem happens.
teste.in: input for the program
teste.trj: file the program reads and deal with.
Anyway, sorry if this was too long, or if I posted in the wrong place. And thanks in advance for any help provided!
Thanks a lot,
Jones