The effect of dissipation on the vertical propagation of planetary waves in the vicinity of critical levels