I entered this code right after I declared all of my variables and arrays:
Do n = 1, ndet
Do i = 1, ngroups
Do j = 1, nbins
Err_total(n,i,j) = 0.0
Count_total(n,i,j) = 0.0
Err_totalsq(n,i,j) = 0.0
Err_new(n,i,j) = 0.0
End do
End do
End do
And when...