K-shell ionization of Al and Cu for 0.5-40-MeV-proton bombardment