- #1
SheldonM
- 1
- 0
Good day,
I'm modifying a Monte Carlo program (MCCCS Towhee) using Fortran and am having trouble passing an argument (a 2x1 array) from a subroutine withing one file (the existing main loop that 'drives' the code) to another subroutine written in another file (an energy calculation, also part of the existing program package). I've written another subroutine (call it 'AAA') in the main loop that receives the array, assigns it to another variable name (same type, size); then, in the other file, I call AAA to receive the array. The code compiles and runs fine until the call to the subroutine is made, and then it exits with a segmentation fault error (which is strange because I've checked and rechecked the type declarations - they seem fine). I'm a newbie to Fortran, so I'm probably not seeing a very simple solution. Since this program has a sophisticated configure and Makefile setup, and if the solution to my problem means that I must create a new *.F file, what changes (if any) must be be made to the files associated with configure and make?
Many thanks,
Sheldon
I'm modifying a Monte Carlo program (MCCCS Towhee) using Fortran and am having trouble passing an argument (a 2x1 array) from a subroutine withing one file (the existing main loop that 'drives' the code) to another subroutine written in another file (an energy calculation, also part of the existing program package). I've written another subroutine (call it 'AAA') in the main loop that receives the array, assigns it to another variable name (same type, size); then, in the other file, I call AAA to receive the array. The code compiles and runs fine until the call to the subroutine is made, and then it exits with a segmentation fault error (which is strange because I've checked and rechecked the type declarations - they seem fine). I'm a newbie to Fortran, so I'm probably not seeing a very simple solution. Since this program has a sophisticated configure and Makefile setup, and if the solution to my problem means that I must create a new *.F file, what changes (if any) must be be made to the files associated with configure and make?
Many thanks,
Sheldon