FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(inout), | dimension (-ntgrid:,:,g_lo%llim_proc:) | :: | g1 | ||
complex, | intent(in), | dimension (-ntgrid:,:,:) | :: | phi |
subroutine load_kx_phi(g1, phi)
use theta_grid, only: ntgrid
use gs2_layouts, only: g_lo, ik_idx, it_idx
use dist_fn_arrays, only: aj0
use run_parameters, only: has_phi, fphi
use kt_grids, only: akx
use constants, only: zi
use array_utils, only: zero_array
implicit none
complex, dimension (-ntgrid:,:,g_lo%llim_proc:), intent (in out) :: g1
complex, dimension (-ntgrid:,:,:), intent (in) :: phi
complex, dimension(-ntgrid:ntgrid) :: fac
integer :: iglo, it, ik
if (has_phi .and. include_phi) then
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP PRIVATE(iglo, it, ik, fac) &
!$OMP SHARED(g_lo, g1, akx, aj0, phi, fphi) &
!$OMP SCHEDULE(static)
do iglo = g_lo%llim_proc, g_lo%ulim_proc
it = it_idx(g_lo,iglo)
ik = ik_idx(g_lo,iglo)
fac = zi*akx(it)*aj0(:,iglo)*phi(:,it,ik)*fphi
g1(:,1,iglo) = fac
g1(:,2,iglo) = fac
end do
!$OMP END PARALLEL DO
else
call zero_array(g1)
endif
end subroutine load_kx_phi