Thermal desorption, photodesorption, and photodissociation of water on amorphous ice and lunar surfaces