With coulomb-type = pme-user, the Ewald mesh energy was not subtracted
leading to (very) incorrect Coulomb energies and forces.
Fixes #2286
Change-Id: Idfef9896d484e254264150e718c5516a832a2ad4
for (int k = 0; (k < etiNR); k++)
{
- /* Now fill data for tables that should not be read (perhaps
- overwriting data that was read but should not be used) */
- if (!ETAB_USER(tabsel[k]))
+ /* Now fill data for tables that have not been read
+ * or add the Ewald long-range correction for Ewald user tables.
+ */
+ if (tabsel[k] != etabUSER)
{
real scale = table->scale;
if (fr->bBHAM && (fr->bham_b_max != 0) && tabsel[k] == etabEXPMIN)