Skip to content

Commit

Permalink
changes to fix simulations with analytical profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeidler3 committed May 24, 2024
1 parent 43e018c commit 019e896
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/korc_hpc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ function get_num_threads()

integer :: get_num_threads
#if defined(_OPENMP)
!$acc PARALLEL
!$omp PARALLEL
get_num_threads = OMP_GET_NUM_THREADS()
!$acc END PARALLEL
!$omp END PARALLEL
#else
get_num_threads = 1
#endif
Expand All @@ -367,7 +367,7 @@ function get_max_threads()
implicit none

integer :: get_max_threads
#if defined(_OPENACC)
#if defined(_OPENMP)
get_max_threads = OMP_GET_MAX_THREADS()
#else
get_max_threads = 1
Expand All @@ -383,7 +383,7 @@ function get_thread_number()

integer :: get_thread_number

#if defined(_OPENACC)
#if defined(_OPENMP)
get_thread_number = OMP_GET_THREAD_NUM()
#else
get_thread_number = 0
Expand Down
9 changes: 7 additions & 2 deletions src/korc_ppusher.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4245,8 +4245,12 @@ subroutine GC_init_ACC(params,F,P,spp)

if (params%collisions) then

call interp_Hcollision_p_ACC(params,Y_R,Y_PHI,Y_Z,ne,Te,Zeff, &
nAr0,nAr1,nAr2,nAr3,nAr4,nD,nD1,flagCon)
if (params%profile_model(1:10).eq.'ANALYTICAL') then
call analytical_profiles_p_ACC(0._rp,params,Y_R,Y_Z, &
P,F,ne,Te,Zeff,PSIp)
else if (params%profile_model(10:10).eq.'H') then
call interp_Hcollision_p_ACC(params,Y_R,Y_PHI,Y_Z,ne,Te,Zeff, &
nAr0,nAr1,nAr2,nAr3,nAr4,nD,nD1,flagCon)

spp(ii)%vars%ne(pp) = ne
spp(ii)%vars%Te(pp) = Te
Expand All @@ -4258,6 +4262,7 @@ subroutine GC_init_ACC(params,F,P,spp)
spp(ii)%vars%nimp(pp,1) = nAr4
spp(ii)%vars%nimp(pp,1) = nD
spp(ii)%vars%nimp(pp,1) = nD1
endif

end if

Expand Down
3 changes: 1 addition & 2 deletions src/korc_spatial_distribution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1590,11 +1590,10 @@ subroutine MH_psi(params,spp,F)

! write(output_unit_write,'("sample:",I15)') ii

#if DBG_CHECK
if (modulo(ii,nsamples/10).eq.0) then
write(output_unit_write,'("Sample: ",I10)') ii
end if
#endif


!R_test = R_buffer + random_norm(0.0_rp,spp%dR)
!R_test = R_buffer + get_random_mkl_N(0.0_rp,spp%dR)
Expand Down

0 comments on commit 019e896

Please sign in to comment.