subroutine gca_init() use mod_global_parameters integer :: idir, nwx if (physics_type/='mhd') call mpistop(& "GCA particles need magnetic field!") if (ndir/=3) call mpistop("GCA particles need ndir=3!") nwx = 0 allocate(bp(ndir)) do idir = 1, ndir nwx = nwx + 1 bp(idir) = nwx end do allocate(ep(ndir)) do idir = 1, ndir nwx = nwx + 1 ep(idir) = nwx end do allocate(grad_kappa_B(ndir)) do idir = 1, ndir nwx = nwx + 1 grad_kappa_B(idir) = nwx end do allocate(b_dot_grad_b(ndir)) do idir = 1, ndir nwx = nwx + 1 b_dot_grad_b(idir) = nwx end do allocate(vE_dot_grad_b(ndir)) do idir = 1, ndir nwx = nwx + 1 vE_dot_grad_b(idir) = nwx end do allocate(b_dot_grad_vE(ndir)) do idir = 1, ndir nwx = nwx + 1 b_dot_grad_vE(idir) = nwx end do allocate(vE_dot_grad_vE(ndir)) do idir = 1, ndir nwx = nwx + 1 vE_dot_grad_vE(idir) = nwx end do allocate(vp(ndir)) do idir = 1, ndir nwx = nwx + 1 vp(idir) = nwx end do allocate(jp(ndir)) do idir = 1, ndir nwx = nwx + 1 jp(idir) = nwx end do nwx = nwx + 1 ! density rhop = nwx ngridvars=nwx particles_fill_gridvars => gca_fill_gridvars if (associated(particles_define_additional_gridvars)) then call particles_define_additional_gridvars(ngridvars) end if select case(integrator_type_particles) case('RK4','Rk4','rk4') integrator = RK4 case('ARK4','ARk4','Ark4','ark4') integrator = ARK4 case default integrator = ARK4 end select particles_integrate => gca_integrate_particles end subroutine gca_init