particle_get_current Subroutine

public subroutine particle_get_current(w, ixImin1, ixImin2, ixImin3, ixImax1, ixImax2, ixImax3, ixOmin1, ixOmin2, ixOmin3, ixOmax1, ixOmax2, ixOmax3, idirmin, current)

Uses

  • proc~~particle_get_current~~UsesGraph proc~particle_get_current particle_get_current module~mod_geometry mod_geometry proc~particle_get_current->module~mod_geometry module~mod_global_parameters mod_global_parameters proc~particle_get_current->module~mod_global_parameters module~mod_comm_lib mod_comm_lib module~mod_geometry->module~mod_comm_lib module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

Calculate idirmin and the idirmin:3 components of the common current array make sure that dxlevel(^D) is set correctly.

Arguments

Type IntentOptional Attributes Name
double precision :: w(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,1:nw)
integer :: ixImin1
integer :: ixImin2
integer :: ixImin3
integer :: ixImax1
integer :: ixImax2
integer :: ixImax3
integer :: ixOmin1
integer :: ixOmin2
integer :: ixOmin3
integer :: ixOmax1
integer :: ixOmax2
integer :: ixOmax3
integer :: idirmin
double precision :: current(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,7-2*ndir:3)

Calls

proc~~particle_get_current~~CallsGraph proc~particle_get_current particle_get_current proc~curlvector curlvector proc~particle_get_current->proc~curlvector dcos dcos proc~curlvector->dcos dsin dsin proc~curlvector->dsin proc~mpistop mpistop proc~curlvector->proc~mpistop mpi_abort mpi_abort proc~mpistop->mpi_abort

Called by

proc~~particle_get_current~~CalledByGraph proc~particle_get_current particle_get_current proc~fields_from_mhd fields_from_mhd proc~fields_from_mhd->proc~particle_get_current proc~fill_gridvars_default fill_gridvars_default proc~fill_gridvars_default->proc~fields_from_mhd proc~gca_fill_gridvars gca_fill_gridvars proc~gca_fill_gridvars->proc~fill_gridvars_default proc~lorentz_fill_gridvars lorentz_fill_gridvars proc~lorentz_fill_gridvars->proc~fill_gridvars_default

Source Code

  subroutine particle_get_current(w,ixImin1,ixImin2,ixImin3,ixImax1,ixImax2,&
     ixImax3,ixOmin1,ixOmin2,ixOmin3,ixOmax1,ixOmax2,ixOmax3,idirmin,current)
    use mod_global_parameters
    use mod_geometry

    integer :: idirmin0
    integer :: ixOmin1,ixOmin2,ixOmin3,ixOmax1,ixOmax2,ixOmax3, idirmin,&
        ixImin1,ixImin2,ixImin3,ixImax1,ixImax2,ixImax3
    double precision :: w(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,&
       1:nw)
    integer :: idir
    ! For ndir=2 only 3rd component of J can exist, ndir=1 is impossible for MHD
    double precision :: current(ixImin1:ixImax1,ixImin2:ixImax2,&
       ixImin3:ixImax3,7-2*ndir:3),bvec(ixImin1:ixImax1,ixImin2:ixImax2,&
       ixImin3:ixImax3,1:ndir)

    idirmin0 = 7-2*ndir

    if (B0field) then
      do idir = 1, ndir
        bvec(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,&
           idir)=w(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,&
           iw_mag(idir))+block%B0(ixImin1:ixImax1,ixImin2:ixImax2,&
           ixImin3:ixImax3,idir,0)
      end do
    else
      do idir = 1, ndir
        bvec(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,&
           idir)=w(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,&
           iw_mag(idir))
      end do
    end if

    call curlvector(bvec,ixImin1,ixImin2,ixImin3,ixImax1,ixImax2,ixImax3,&
       ixOmin1,ixOmin2,ixOmin3,ixOmax1,ixOmax2,ixOmax3,current,idirmin,&
       idirmin0,ndir)

  end subroutine particle_get_current