I use fortran very rarely, but I have been instructed to translate the old code, rewriting it so that it works in parallel. I use gfortran for my choice of compiler. I found some great resources at https://computing.llnl.gov/tutorials/openMP/ , as well as several others.
My problem is that before adding any OpenMP directives, if I just compile the legacy program:
gfortran Example1.F90 -o Example1
everything works, but turning on the openmp compiler option even without adding directives:
gfortran -openmp Example1.F90 -o Example1
ends with a segmentation error when I run an outdated program. Using the small test programs that I wrote, I successfully compiled other programs with -openmp that run on multiple threads, but I don’t quite understand why including this option alone and no directives leads to a seg error.
Sorry if my question is pretty simple. I could send the code, but it's quite long. It causes errors when assigning initial values:
REAL, DIMENSION(da,da) :: uconsold REAL, DIMENSION(da,da,dr,dk) :: uconsolde ... uconsold=0.0 uconsolde=0.0
The first assignment of “uconsold” works fine, the second seems to be the source of the error, because when I comment out a line, the next few lines are fun until “uconsolde” is used again.
Thanks for any help in this matter.