A rotating magnetic island is imposed in the gyrokinetic code GKW, when finite differences are used for the radial direction, in order to develop the predictions of analytic tearing mode theory and understand its limitations. The implementation is verified against analytics in sheared slab geometry with three numerical tests that are suggested as benchmark cases for every code that imposes a magnetic island. The convergence requirements to properly resolve physics around the island separatrix are investigated. In the slab geometry, at low magnetic shear, binormal flows inside the island can drive Kelvin-Helmholtz instabilities which prevent the formation of the steady state for which the analytic theory is formulated. V C 2015 AIP Publishing LLC.In a tokamak, a magnetic equilibrium consisting of nested non-axisymmetric flux surfaces exhibits a current singularity layer where the safety factor is rational, i.e., where q ¼ m/n, with m and n two integers, respectively, the poloidal and toroidal mode numbers of a radial magnetic perturbation dB r ðh; uÞ, called tearing mode. 1-3 The surfaces given by the relation q ¼ m/n are called resonant surfaces. This singularity in the parallel current is clearly nonphysical and must be regularized by non-ideal, typically collisional, effects leading to magnetic re-connection, 4 which represents the destruction of the resonant surfaces into island chains. The formation of magnetic islands represents a change in the magnetic topology. These resistive instabilities are found in both astrophysical and laboratory plasmas. 5 In the case of laboratory plasmas and in particular, in the case of tokamaks, the presence of magnetic islands can have strong consequences for the core confinement, 6 due to the fact that particles can travel across the island following the perturbed field lines which connect one side of the island with the other. This mechanism is usually referred to as parallel streaming and is the term we use in the following. This increase of the (radial) transport leads to the flattening of the radial profiles and therefore to a loss of energy which eventually represents a loss of core confinement.Because of the impact that magnetic islands have on confinement, it is essential to analyse their stability. The nonlinear evolution of the perturbation leading to the formation of magnetic islands is given by the generalized Rutherford equations 6where r s is the radial position of the resonant surface, s R is the characteristic resistive time, D 0 is the matching parameter from the external solution, f 0 is the position of the island in the binormal direction rf and the functions D and F t represent, respectively, the free energy available for reconnection and the acceleration in the binormal direction of the island. In these equations, we have introduced also the radial halfwidth w and the rotation frequency x of the island in the binormal direction. The functions D and F t can be written in terms of the non inductive parallel current J n:i: k as follows:where X is a flux label...