The value of the number of degrees of freedom in a group is a real,
but it was being truncated to an integer before promoting it back to a
real. This is wrong, whether or not the number can reasonably be
non-integral. This only affected the conserved energy quantity,
not the kinetic or total energy used for coupling and output.
Change-Id: I5fcb6428dc0e333cabd79262cc2a9cffa5fec03a
real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
{
real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
{
- int i, j, nd, ndj, bmass, qmass, ngtcall;
+ int i, j, bmass, qmass, ngtcall;
+ real nd, ndj;
real ener_npt, reft, eta, kT, tau;
double *ivxi, *ixi;
double *iQinv;
real ener_npt, reft, eta, kT, tau;
double *ivxi, *ixi;
double *iQinv;
reft = max(ir->opts.ref_t[i], 0);
kT = BOLTZ * reft;
reft = max(ir->opts.ref_t[i], 0);
kT = BOLTZ * reft;
{
if (IR_NVT_TROTTER(ir))
{
{
if (IR_NVT_TROTTER(ir))
{
}
ener_npt += ndj*ixi[j]*kT;
}
}
ener_npt += ndj*ixi[j]*kT;
}