subroutine loade
    use system_env, only: MPI_COMM_WORLD
    use precision, only: lk
    use read_in_parameters, only: track_particles
    use particle_array, only: mEmax, zelectron, zelectron0, wzelectron, wpelectron, jtelectron0, jtelectron1, &
        wtelectron0, wtelectron1, jpelectron, markere, pmarke, nonunie, marknume, mecore, mesol, zonale, zonalce,&
        densitye, densitye0, flowe, pressureepara, pressureeperp, zelectron1, rhogyroelectron, rhogyroelectron0,&
        pfluxe, rdteme,data1de, mpdata1d
    use grids_eqdata, only: meshne, meshte1d
    use grids_setup, only: mpsi, mgrid
    use equilibrium, only: te_Eq
    use read_in_parameters, only: aelectron, qelectron, ngyroe, irun
    use global_parameters, only: me, nparame
    implicit none
    integer mtest, mype, gtcout, ierror
interface
    subroutine gkload(mp, mpmax, zpart, zpart0, wzpart, wppart, jtpart0, jtpart1,&
    wtpart0, wtpart1, jppart, rhogyropart, t_Eq, apart, qpart, marker,&
    pmark, meshn, mesht1d, nonuni, marknum, mpcore, mpsol, ngyro)
    use precision
    ! dummy parameters
    real(lk), dimension(:,:,:) :: t_Eq
    real(lk), dimension(:,:) ::zpart, zpart0, wppart, wtpart0, wtpart1,rhogyropart
    integer, dimension(:,:) :: jtpart0, jtpart1, jppart
    real(lk), dimension(:) :: wzpart
    real(lk), dimension(:) :: marker, meshn, mesht1d, nonuni, pmark
    integer, dimension(:) :: marknum
    integer mp, mpmax, mpcore, mpsol, ngyro
    real(lk) apart, qpart
    end subroutine gkload

    subroutine particle_grid_array_alloc(nparam, ngyro, mp, mpmax, marknum, jtpart0, jtpart1, jppart,&
        wzpart, pmark, zonal, zonalc, marker, nonuni, zpart, zpart0, wppart, wtpart0, wtpart1, density,density0,&
        flow, pressurepara, pressureperp, rhogyropart,rhogyropart0, pfluxpart, rdtempart, data1dpart)
        use precision
        implicit none
        !dummy parameters
        integer :: nparam, ngyro, mp, mpmax
        integer, dimension(:),allocatable :: marknum
        integer,dimension(:,:),allocatable :: jtpart0,jtpart1,jppart
        real(lk),dimension(:),allocatable :: wzpart,pmark,zonal,zonalc,marker,nonuni
        real(lk),dimension(:,:),allocatable :: zpart,zpart0,wppart,wtpart0,wtpart1,&
            density,density0,flow,pressurepara,pressureperp,rhogyropart,rhogyropart0,&
            data1dpart
        real(lk),dimension(:),allocatable :: pfluxpart, rdtempart
    end subroutine particle_grid_array_alloc
end interface


    allocate(pmarke(mpsi),markere(mgrid),densitye(0:1,mgrid),densitye0(0:1,mgrid),flowe(0:1,mgrid),&
             pressureepara(0:1,mgrid),pressureeperp(0:1,mgrid),zonale(mpsi),zonalce(mpsi),&
             nonunie(mgrid),marknume(mgrid),pfluxe(mpsi),rdteme(mpsi),data1de(mpsi,mpdata1d),&
             STAT=mtest)
    if(mtest /= 0) then
       write(0,*)mype,'*** Cannot allocate electron field array: mtest=',mtest
       call MPI_ABORT(MPI_COMM_WORLD,1,ierror)
    endif

    memax=me+1000*ceiling(sqrt(real(me))) !ions array upper bound
    allocate(zelectron(1:nparame,memax),zelectron0(nparame,memax),wzelectron(memax),&
             wpelectron(ngyroe,memax),jtelectron0(ngyroe,memax),jtelectron1(ngyroe,memax),&
             wtelectron0(ngyroe,memax),wtelectron1(ngyroe,memax),jpelectron(ngyroe,memax),&
             rhogyroelectron(ngyroe,memax),rhogyroelectron0(ngyroe,memax),&
             STAT=mtest)

    if(mtest /= 0) then
       write(0,*)mype,'*** Cannot allocate electron: mtest=',mtest
       call MPI_ABORT(MPI_COMM_WORLD,1,ierror)
    endif
    pmarke=0.0_lk
    markere=0.0_lk
    densitye=0.0_lk
    flowe=0.0_lk
    pressureepara=0.0_lk
    pressureeperp=0.0_lk
    zonale=0.0_lk
    zonalce=0.0_lk
    nonunie=0.0_lk
    marknume=0
    rhogyroelectron=1.0_lk
    rhogyroelectron0=1.0_lk
    pfluxe=0.0_lk
    rdteme=0.0_lk
    data1de=0.0_lk
#ifndef GPU_UM
    !$acc update device(rhogyroelectron,rhogyroelectron0)
#endif

    allocate(zelectron1(nparame+1,memax),STAT=mtest)
    zelectron1=0.0_lk
    call gkload(me, memax, zelectron, zelectron0, wzelectron, wpelectron, jtelectron0, jtelectron1, &
        wtelectron0, wtelectron1, jpelectron, rhogyroelectron, te_Eq, aelectron, qelectron, markere, pmarke, meshne,&
        meshte1d, nonunie, marknume, mecore, mesol, ngyroe)
    !zelectron(5,:)=0.0_lk
    if(irun==0)then
#ifndef GPU_UM
    !$acc update device(zelectron,zelectron0)
#endif
    endif

end subroutine loade
