TinkerTools / tinker

Tinker: Software Tools for Molecular Design
https://dasher.wustl.edu/tinker/
Other
130 stars 61 forks source link

Error met using potential.f executable #83

Closed DanieleLoco closed 3 years ago

DanieleLoco commented 3 years ago

Dear,

I'm using the Tinker program potential.f to fit initial multipoles to a grid defining the ESP potential. To do so I downloaded and compiled the last (I think) available version of Tinker. Unfortunately in a test calculation I encountered the following error:

######################################################################

#########################################################################

Tinker --- Software Tools for Molecular Design

Version 8.9.1 February 2021

Copyright (c) Jay William Ponder 1990-2021

All Rights Reserved

######################################################################### ######################################################################

Additional Atom Definition Parameters :

 Type  Class  Symbol  Description               Atomic    Mass   Valence

  401   401     C     ethene                       6     12.011     3
  402   402     H     ethene                       1      1.008     1

Electrostatic Potential Grid Points : 5983

Electrostatic Parameter Restraint Value : 1.0000

Additional Atom Definition Parameters :

 Type  Class  Symbol  Description               Atomic    Mass   Valence

  401   401     C     ethene                       6     12.011     3
  402   402     H     ethene                       1      1.008     1

Additional Atomic Multipole Parameters :

 Atom Type     Coordinate Frame Definition         Multipole Moments

     401      401    402      0   Z-then-X    -0.05342
                                               0.00000  0.00000 -0.07548
                                               0.10870
                                               0.00000 -0.04845
                                               0.00000  0.00000 -0.06026

     402      401    401      0   Z-then-X     0.02671
                                              -0.01212  0.00000 -0.17162
                                               0.01222
                                               0.00000 -0.00292
                                              -0.01278  0.00000 -0.00930

Additional Atomic Dipole Polarizability Parameters :

 Atom Type           Alpha       Thole     Group Atom Types

     401             1.750       0.390         401  402
     402             0.696       0.390         401

Average Electrostatic Potential over Atoms : (Kcal/mole per unit charge)

Structure Atom Points Potential Target RMS Diff

    1        1        1165        -2.3205        -2.1166         0.3083
    1        2        1157        -2.2966        -2.0937         0.3125
    1        3         919         1.1629         1.1446         0.3222
    1        4         915         1.1640         1.1462         0.3141
    1        5         912         1.1654         1.1396         0.3120
    1        6         915         1.1630         1.1391         0.3131

Electrostatic Potential over all Grid Points :

Average Potential Value for Model : -0.1838 Average Potential Magnitude for Model : 1.8035 Average Potential Value for Target : -0.1180 Average Potential Magnitude for Target : 1.7183

Average Signed Potential Difference : -0.0658 Average Unsigned Potential Difference : 0.2200 Root Mean Square Potential Difference : 0.3135

At line 1605 of file potential.f

Fortran runtime error: Index '0' of dimension 1 of array 'type' below lower bound of 1###

Error termination. Backtrace:

0 0x7f9dff4fdd3a

1 0x7f9dff4fe849

2 0x7f9dff4feec6

3 0x5580763dca48

4 0x5580763e9d25

5 0x5580763eaebb

6 0x7f9dff1790b2

7 0x5580763d136d

8 0xffffffffffffffff

So I checked the code, and it seems to me that the following loop, including line 1605, in potential.f might generate the problem: ... do i = 1, npole it = type(ii) equiv(it) = equiv(it) + 1 sum = sum + pole(1,i) end do ...

I might be written instead as: ... do i = 1, npole ii = ipole(i) it = type(ii) equiv(it) = equiv(it) + 1 sum = sum + pole(1,i) end do ...

Best regards,

Daniele Loco

jayponder commented 3 years ago

Hi Daniele, That exact part of the POTENTIAL code was very recently rewritten to make the charge normalization more general. Obviously, I missed a redirection between the "natom" arrays and the "npole" arrays. It is now fixed. Thanks, Jay