Desorption of gases from graphitic and porous carbon surfaces