I was debugging my Fortran code with some compiler options and, during runtime, the following error came up:
forrtl: severe (194): Run-Time Check Failure. The variable 'readinputfiles_$I3' is being used in 'main.F90(796,10)' without being defined
I changed the compiler options to
-O0 -g -debug all -ftrapuv -check bounds -check all -traceback -i8
But I can't get the same error (the code was not changed). In addition, I know for sure that one array is being accessed with an out of bounds index, but I also don't get any runtime error. I am wondering whether the order of the compiler options matters? Or maybe I am doing something wrong in my makefile?
Here is my makefile:
debugFFLAGS = -O0 -g -debug all -ftrapuv -check bounds -check all -traceback -i8 debugEXE = debug.exe # local installation of PETSc PETSC_DIR=~/software/petsc-3.7.6 include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules OBJS = main.o modGlobal.o # object dependencies modGlobal.o : modGlobal.F90 main.o : main.F90 modGlobal.o debug: ${OBJS} -${FLINKER} ${debugFFLAGS} ${OBJS} -o ${debugEXE} ${PETSC_LIB} ${LDLIBS}