This routine fills the particle grid variables with the default for mhd, i.e. only E and B
subroutine fill_gridvars_default use mod_global_parameters use mod_usr_methods, only: usr_particle_fields integer :: igrid, iigrid double precision :: E(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3, ndir) double precision :: B(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3, ndir) do iigrid=1,igridstail; igrid=igrids(iigrid); if (associated(usr_particle_fields)) then ! FILL ONLY E AND B call usr_particle_fields(ps(igrid)%w, ps(igrid)%x, E, B) gridvars(igrid)%w(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,ep(:)) = E gridvars(igrid)%w(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,bp(:)) = B else call fields_from_mhd(igrid, ps(igrid)%w, gridvars(igrid)%w) end if end do end subroutine fill_gridvars_default