| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ix(ndir) |
Indices in gridvars |
||
| integer, | intent(in) | :: | igrid | |||
| double precision, | intent(in), | dimension(3) | :: | x | ||
| double precision, | intent(in) | :: | tloc | |||
| double precision, | intent(out), | dimension(ndir) | :: | vec |
subroutine get_vec(ix,igrid,x,tloc,vec) use mod_global_parameters use mod_usr_methods, only: usr_particle_analytic integer,intent(in) :: ix(ndir) !< Indices in gridvars integer,intent(in) :: igrid double precision,dimension(3), intent(in) :: x double precision, intent(in) :: tloc double precision,dimension(ndir), intent(out) :: vec double precision,dimension(ndir) :: vec1, vec2 double precision :: td integer :: ic1,ic2,ic3,idir if (associated(usr_particle_analytic)) then call usr_particle_analytic(ix, x, tloc, vec) else do idir=1,ndir call interpolate_var(igrid,ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,& ixMlo1,ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,& gridvars(igrid)%w(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,& ix(idir)), ps(igrid)%x(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,& 1:ndim),x,vec(idir)) end do if (time_advance) then do idir=1,ndir call interpolate_var(igrid,ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,& ixMlo1,ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,& gridvars(igrid)%wold(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,& ix(idir)), ps(igrid)%x(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,& 1:ndim),x,vec2(idir)) end do td = (tloc - global_time) / dt vec(:) = vec(:) * (1.0d0 - td) + vec2(:) * td end if end if end subroutine get_vec