Level density and thermal properties in rare earth nuclei