I have not been able to reproduce your failure mode so far. Perhaps if you generated a log of the
commands you entered it would be useful as a reproducer for others. As mentioned above, I think some of the debug compiler flags and valgrind output are a valuable way to go. Some of the warnings can be deceptive, as I can
see you skip the conditions the compiler is warning about in some of these loops, but I did not determine that for all of them. The valgrind(1) output looks promising. At its simplest, just run
script output.log
valgrind $EXECUTABLE
# enter input until failure
exit
and look in the output file. There are more sophisticated ways to run valgrind but if you just look for lines in the output file that start with “==” you can see traces for several warnings about uninitialized variables that could well be the root of your problem
some array bound warnings that should be verified are OK:
././src/minimizer/matsmin.F90:820:34: Warning: Array reference at (1) out of bounds (0 < 1) in loop
806 | do icc=1,mostcon
820 | mostconph(1,icc-1)=nvf
././src/minimizer/matsmin.F90:821:34: Warning: Array reference at (1) out of bounds (0 < 1) in loop
806 | do icc=1,mostcon
821 | mostconph(2,icc-1)=iph
././src/models/gtp3B.FINC:7313:42: Warning: Array reference at (1) out of bounds (10 > 9) in loop
7311 | do kp=1,ncol
7312 | if(colvar(dcom,kp)%column.eq.0) then
7313 | if(kp.lt.ncol) colvar(dcom,kp+1)%column=0
././src/models/gtp3B.FINC:6486:40: Warning: Array reference at (1) out of bounds (8 > 4)
6482 | do ls=1,8
6486 | intlinks(1,incperm)=prmint4(ls,lq)
././src/models/gtp3B.FINC:6500:47: Warning: Array reference at (1) out of bounds (8 > 4) in loop
6497 | do ls=1,8
6500 | call findconst(lokph,prmint4(ls,lq),jord(2,1),cix)
././src/models/gtp3B.FINC:6503:46: Warning: Array reference at (1) out of bounds (8 > 4) in loop
6497 | do ls=1,8
6503 | intlinks(1,incperm)=prmint4(ls,lq)
././src/numlib/oclablas.F90:14455:28: Warning: Array reference at (1) out of bounds (0 < 1) in loop
14450 | DO 70 I = 0, SPM1
14455 | SUBMAT = IWORK( I ) + 1
././src/numlib/oclablas.F90:14456:43: Warning: Array reference at (1) out of bounds (0 < 1) in loop
14450 | DO 70 I = 0, SPM1
14456 | MATSIZ = IWORK( I+1 ) - IWORK( I )
././src/numlib/oclablas.F90:14498:31: Warning: Array reference at (1) out of bounds (0 < 1) in loop
14491 | DO 90 I = 0, SPM2, 2
14498 | SUBMAT = IWORK( I ) + 1
././src/numlib/oclablas.F90:14499:46: Warning: Array reference at (1) out of bounds (0 < 1) in loop
14491 | DO 90 I = 0, SPM2, 2
14499 | MATSIZ = IWORK( I+2 ) - IWORK( I )
Note the installation PDF says to install ochelp.txt but it looks like it intends ochelp.htm
It looks harmless, but why is lph being set in this routine? It looks like a no-op but perhaps some variable with scope outside the procedure is supposed to be set?
src/models/gtp3EY.FINC
@@ -3282,10 +3282,11 @@
bigloop: do while(.true.)
lpp=lpp+1
if(lpp.gt.lenph) then
-! this is lenght of provide phase and we have match up to this position, accept
+! this is length of provide phase and we have match up to this position, accept
! normally a phase name ends with a space but with allocated characters ...
! write(*,*)'Is "',phasename,'" same as "',selph(lp)%phasename,'"?'
- lph=lp; goto 1000
+ !APPEARS TO BE NOOP IF LPH NOT SOMETHING GLOBAL! lph=lp;
+ goto 1000
endif
chp=phasename(lpp:lpp)
lpx=lpx+1
I would not shortshift valgrind and the compiler warnings. They look like they would be fruitful to wade through given the description of the error you are experiencing. How reproducable is it? Does it occur at the same place every time given the same input?