00001 subroutine compute_shift_v2(Bfun,potx,poty,potz)
00002   use phys_constant, only : long
00003   use grid_parameter, only : nrg, ntg, npg
00004   use def_metric, only : bvxd, bvyd, bvzd
00005   use interface_grgrad_4th_gridpoint
00006   implicit none
00007   real(long) :: dBfundx, dBfundy, dBfundz 
00008   real(long), pointer :: Bfun(:,:,:), potx(:,:,:), poty(:,:,:), potz(:,:,:)
00009   integer :: irg, itg, ipg
00010 
00011   do ipg = 0, npg
00012     do itg = 0, ntg
00013       do irg = 0, nrg
00014         call grgrad_4th_gridpoint(Bfun,dBfundx,dBfundy,dBfundz,irg,itg,ipg)
00015         bvxd(irg,itg,ipg) = potx(irg,itg,ipg) - 0.25d0*dBfundx
00016         bvyd(irg,itg,ipg) = poty(irg,itg,ipg) - 0.25d0*dBfundy
00017         bvzd(irg,itg,ipg) = potz(irg,itg,ipg) - 0.25d0*dBfundz
00018       end do
00019     end do
00020   end do
00021 
00022 end subroutine compute_shift_v2