aoterodelaroza / critic2

Analysis of quantum chemical interactions in molecules and solids.
Other
97 stars 35 forks source link

INTEGRALS subscript error #39

Closed ecbrown closed 3 years ago

ecbrown commented 3 years ago

Trying to track down a bug in benzene.wfx, I am trying to perform basin integration on a simple molecule like dihydrogen STO-3G. My input files: h2.cri.txt h2.cro.txt h2.wfn.txt

Although critic2 is able to integrate if I call INTEGRALS .... CP 1 explicitly, I expected that omitting the CP would simply integrate the nuclear attractors in a sequence. Although I don't know exactly what is going on, it may appear that the routine is trying to print info for the bond critical point as well! (and not ending so well.)

Although I usually use gfortran, I used ifort's -check bounds -traceback to reveal:

07:07:18 ecbrown@vader h2 → ~/opt/critic2-intel/bin/critic2 h2.cri h2.cro forrtl: severe (408): fort: (2): Subscript #1 of the array CPCEL has value 1380402516 which is greater than the upper bound of 3:

Image PC Routine Line Source critic2 000000000124581F Unknown Unknown Unknown critic2 0000000000870C12 integration.proc_ 2808 integration@proc.f90 critic2 00000000008516AE integration_mp_in 629 integration@proc.f90 critic2 00000000004D6B52 bisect_mp_integra 1008 bisect@proc.f90 critic2 00000000010A7C9F MAIN 380 critic2.F90 critic2 0000000000406C22 Unknown Unknown Unknown libc-2.31.so 00007FEBDFE130B3 libc_start_main Unknown Unknown critic2 0000000000406B2E Unknown Unknown Unknown

Line 2808 of integration.proc.f90 does have: idx = sy%f(sy%iref)%cpcel(icp)%idx

and I confirmed that cpcel(1) = 1, cpcel(2) = 2, and cpcel(3)= 1380402516

I hope this is enough information to track down this bug!

(In gfortran, the output hangs after the NCP printouts and before BCP's, etc. These latter print in ifort, but their coordinates are NaN.)

aoterodelaroza commented 3 years ago

That's odd. What version of critic2 are you using? This input works for me in the development version. Output: h2.cro.new.txt

ecbrown commented 3 years ago

I am on HEAD of master. I looked at your output, and the coordinates of the BCP are garbled. I think this is where my runs were crashing out.

List of attractors integrated Id cp ncp Name Z mult Position (ang_) 1 1 1 H 1 1 0.0000000 0.0000000 0.3561149 2 2 2 H 1 1 0.0000000 0.0000000 -0.3561149 3 -- -- ?? -- 1 104325630126397488773017878152158945049037985362878157171060836276487785665147945915228047086424358034198034854900875312361579554001635240564872194941539686152685820910856249176907877728094821337700045917519872.0000000 1703766835463810377313339952612375263561168837174116036816938537437629760694992291909402599309232961869460355553147441205461911394826115873017655000428975674900728780917331260867619803348943510444671320505292059946407159660544.0000000 -10.3561149

aoterodelaroza commented 3 years ago

Ooops, I see that. Let me take a look.

aoterodelaroza commented 3 years ago

It's fixed now, I think. It was a reporting problem. The extra CP was not calculated but the routine that writes the results thought it was there. New output: h2.cro.new.txt. Can you please pull and try again?

ecbrown commented 3 years ago

This works on h2 and now benzene.wfx. (Also working on my new MacBook Pro M1 with gfortran-mp-dev. It is looking like an integration-beast that rivals my 8-core i9!). Thanks for the fix!

aoterodelaroza commented 3 years ago

Sounds good! :)