We present a general procedure to solve numerically the general relativistic
magnetohydrodynamics (GRMHD) equations within the framework of the 3+1
formalism. The work reported here extends our previous investigation in general
relativistic hydrodynamics (Banyuls et al. 1997) where magnetic fields were not
considered. The GRMHD equations are written in conservative form to exploit
their hyperbolic character in the solution procedure. All theoretical
ingredients necessary to build up high-resolution shock-capturing schemes based
on the solution of local Riemann problems (i.e. Godunov-type schemes) are
described. In particular, we use a renormalized set of regular eigenvectors of
the flux Jacobians of the relativistic magnetohydrodynamics equations. In
addition, the paper describes a procedure based on the equivalence principle of
general relativity that allows the use of Riemann solvers designed for special
relativistic magnetohydrodynamics in GRMHD. Our formulation and numerical
methodology are assessed by performing various test simulations recently
considered by different authors. These include magnetized shock tubes,
spherical accretion onto a Schwarzschild black hole, equatorial accretion onto
a Kerr black hole, and magnetized thick accretion disks around a black hole
prone to the magnetorotational instability.Comment: 18 pages, 8 figures, submitted to Ap