How can I find what is the variable 'var$149'?
The option to make the load module is
ifort -o molyx.x -V -g -debug extended -save-temps -traceback -warn all -warn nointerfaces -I/opt/intel/compilers_and_librar\
ies/mac/mkl/include/intel64/lp64 -I/opt/intel/compilers_and_libraries/mac/mkl/include -extend-source 132 -\
zero -qopt-report=5 -qopt-report-phase=all -Wl,-stack_size -Wl,0x40000000 -check stack -check uninit -check pointe\
rs -check contiguous -check bounds -check nobounds \
var$149 is a temporary variable created by the compiler. I think the message suggests that something wrote into stack storage before or after where var$149 was allocated due to an error. This check doesn't get made until after a procedure return, I think. A traceback will at least tell you the approximate location of the call that triggered the check, but it will be more work to take it from there.
Thank you for answering to my question. Unfortunately there were no traceback messages for this error, even though all codes were compiled with option "traceback" . For the other errors, I do have traceback messages, but not for this case.
I have located where the job stopped. The variable is a local allocatable array "ch".
I inserted "deallocate (ch), then the job stopped without any messages.
I inserted a write sentence to examine the parameters for "ch".
The code (main_basis_inp.f90) and output file (0214waterSTO-6G.txt) are attached.
Lines 103-105 in main_basis_inp.f90 are where the job stopped.
Lines 264-265 in 0214waterSTO-6G.txt are the output for Lines 103-104 in the code.
In all subroutines having "ch" in the argment, "Intent(in):: ch" is declared.
Any suggestion is welcome !
Thank you for your concern.
It seems I fixed the problem.
I added "intent(out)" in the subroutines, redbas, and read_basis_files, which are called before ending the current subroutine, where the job stops.
The part of source is,
allocate (ch(mapdat)) ! local
! Examine whether $jpbfile.BASIS exists.
inquire (file=bssfile, EXIST=Lexist)
if (Lexist) then
write(iwrit2, '(/,3x, A, A, A)') 'The basis set ', trim(bssfile), &
& ' is already created but is not reused.'
! 03 feb. 2014 only warining
! for general basis sets on the diretory
! close the input text data file
text_data = trim(jobname)//'.'//trim(task_dat)
! --- test of read
if (Ltest1.ge.1.or.lucard(cprint).eq.'YES') then
call red_bas_f(bssfile, .true.)
call wrt_bas(iwrit2,nbasis, nshell, nprimit, &
katom, kng,kstart,ktype,kloc,kmin,kmax, &
ex, cs, cp, cd, cf, cg, .true.)
!xw if (trim(smash).ne.''.or.trim(smash).ne.'NO') then
if (trim(smash).ne.'') then
!xw if (trim(gaussian).ne.''.or.trim(smash).ne.'NO') then
if (trim(gaussian).ne.'') then
if (trim(molden).ne.'') then
write (iwrit2,'(/,3X,A, A)' ) &
'The basis set file for MOLDEN is output on. ', &
if (lucard(molpro).eq.'YES') then
write (iwrit2,'(/,3X,A)' ) &
'The file for MOLPRO is created. '
if (idcard('MOLP_MEM', nnd, ch).eq.0) then
molp_mem = 8000
write (iwrit2, '(/, 3x, A, I0)') 'Memory for molpro is the default value, ', molp_mem
molp_mem = icard('MOLP_MEM', nnd, ch)
write (iwrit2,'(/,3x, A, I0)') 'Memory for molpro is the input value, ', molp_mem
call wrt_molproin(jobname, molp_mem, nshell, &
katom, kng, kstart, &
ex, cs, cp, cd, cf, cg)
write(6,'(3x, A)') 'A local array ch is deallocated'
write(6,'(3x, 2(A, I0, 3x))') 'MxLen = ', MxLen, ' mapdat = ', mapdat
! for ending
! the above call caused "Boundary Run-Time Check Failure for variable 'var$138'"
! No !!
write(6,*) 'in main_basis_inp'
end subroutine main_basis_inp