Programmable shaping of a subterawatt, femtosecond laser pulse by modulating the spectral phase of the preamplified pulse