Responses of a nonlinearly stratified fluid to vertical harmonic forcing