  We describe in detail the method for Particle-in cell/Monte-Carlo simulation
of electron cyclotron resonance (ECR) discharges. In the simulation, electric
and magnetic fields are obtained by solving Maxwell equations, and electrons
and ions are accelerated by solving equations of motion. We consider two
different cases: (i) propagation of electromagnetic wave in the presence of a
constant external magnetic field; (ii) propagation of electromagnetic wave in
the presence of a linearly decreasing magnetic field which corresponds to a
realistic ECR discharge. The simulation results indicate that at the resonance
layer, the electrons are heated by the electromagnetic wave, and the incoming
wave amplitude is pronouncedly damped, with the wave hardly propagating through
the ECR layer.
