Numerical simulation of electromagnetic turbulence in tokamaks