real-time average value from fix ave/time

Dear LAMMPS users,
I employed the fix ave/time (with fix ID of, say avetemp) to average temperature every, say 10000 steps, to get the real-time average temperature to use in the current “in file” for the next thermostat process, but the temperatuer from f_avetemp was not “real-time”, and after several loop of run, I got a vibrated dependence of temperature on time (or step) (see the attached picture), it must be the result of a wrong average temperature than expected from f_avetemp. Who can help me to solve the problem? (see my “in file” in the attached file).
Bo Shen (43.3 KB)

time dependence of temperature.jpg

If you print out the instantaneous temperature
on the steps that fix ave/time uses it to compute
its averages, you can verify that fix ave/time is
calculating precisely what the doc page says that it is.

In other words you can verify the output of fix ave/time
yourself using a set of instantaneous temperatures.
I.e. you can debug this yourself.

If you do that and see a difference that you think
is an error in fix ave/time, then you can post a Q
about that.