Skip to content

Commit

Permalink
Use correct size for BGField that is allocated with size 1:BGDataSize
Browse files Browse the repository at this point in the history
  • Loading branch information
scopplestone committed Mar 7, 2022
1 parent 865c5cc commit 3c911f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/particles/pic/interpolation/pic_interpolation_tools.f90
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ PPURE FUNCTION GetEMFieldDW(ElemID, PartPos_loc)
! Evaluate the electro-(magnetic) field using the reference position and return the field
!===================================================================================================================================
! MODULES
USE MOD_Mesh_Vars ,ONLY: Elem_xGP
USE MOD_Mesh_Vars ,ONLY: Elem_xGP
USE MOD_PICInterpolation_Vars ,ONLY: useBGField
USE MOD_Interpolation_Vars ,ONLY: BGField,BGType
USE MOD_Interpolation_Vars ,ONLY: BGField,BGType,BGDataSize
USE MOD_Globals
USE MOD_PreProc
#if ! (USE_HDG)
Expand Down Expand Up @@ -384,7 +384,7 @@ PPURE FUNCTION GetEMFieldDW(ElemID, PartPos_loc)
END SELECT
! Add contribution of the magnetic field
DO k = 0, PP_N; DO l=0, PP_N; DO m=0, PP_N
GetEMFieldDW(ind1:ind2) = GetEMFieldDW(ind1:ind2) + PartDistDepo(k,l,m)/DistSum*BGField(ind1:ind2,k,l,m,ElemID)
GetEMFieldDW(ind1:ind2) = GetEMFieldDW(ind1:ind2) + PartDistDepo(k,l,m)/DistSum*BGField(1:BGDataSize,k,l,m,ElemID)
END DO; END DO; END DO
END IF ! useBGField

Expand Down

0 comments on commit 3c911f0

Please sign in to comment.