ywangd / mspms2

Automatically exported from code.google.com/p/mspms2
0 stars 1 forks source link

How to determine when averages are needed? #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the following code is used to decide if averages are needed:
if ((istep-nstep_eq)%nstep_ave==0)
    averages();

The code needs to check:
1. If istep is greater than nstep_eq
2. If the interval between steps has reached nstep_ave

The above code has a bug. When istep is smaller than nstep_eq, the negative
number can also have ZERO remainder by taking mod of nstep_ave.

Original issue reported on code.google.com by ywa...@gmail.com on 8 Dec 2007 at 7:26

GoogleCodeExporter commented 9 years ago
The check is actually done by another statement before it.

icounter[11] is a counter for equilibrium run steps. Only when it runs out, the 
check
of averages will be executed.

if (icounter[11]>=0)
{
    continue;
}

Original comment by ywa...@gmail.com on 8 Dec 2007 at 7:39