A three-dimensional, time-dependent simulation of the global dynamical response of the thermosphere to a geomagnetic substorm