Energy dependence of the ionic charge state distribution during the November 1997 solar energetic particle event