-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put stress calc in separate subroutine and make GPU compatible
- Loading branch information
1 parent
933ddb3
commit 8e37236
Showing
7 changed files
with
85 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
!--------------------------------------------------------------------------- | ||
! cgyro_stress.f90 | ||
! | ||
! PURPOSE: | ||
! Compute Reynolds/Maxwell stresses from the fields as a | ||
! function of (kx,theta,species,ky,field). | ||
! | ||
! NOTES: | ||
! | ||
! The stress terms are just the nonlinear term evaluated for each | ||
! field individually | ||
! | ||
! To trigger output of the stresses | ||
! set STRESS_PRINT_FLAG=1 | ||
|
||
!--------------------------------------------------------------------------- | ||
|
||
subroutine cgyro_stress | ||
|
||
use timer_lib | ||
use mpi | ||
use cgyro_globals | ||
use cgyro_nl_comm | ||
|
||
implicit none | ||
|
||
integer :: i_field | ||
|
||
! Set up stress for each field | ||
! Not sure if this can be with async given the NL calc set up | ||
do i_field=1, n_field | ||
! Set up first half h_x | ||
call cgyro_nl_fftw_comm1_async | ||
|
||
! Set up fields | ||
call cgyro_nl_fftw_comm2_async_stress(i_field) | ||
|
||
! Set up second half h_x (if split) | ||
call cgyro_nl_fftw_comm3_async | ||
|
||
! Calculate nonlinear term | ||
call cgyro_nl_fftw | ||
call cgyro_nl_fftw_comm_test | ||
|
||
! Set stress array from nonlinear output | ||
call cgyro_nl_fftw_comm1_r_stress(i_field) | ||
call cgyro_nl_fftw_comm_test | ||
end do | ||
#if defined(OMPGPU) | ||
!$omp target update from(stress) | ||
#elif defined(_OPENACC) | ||
!$acc update host(stress) | ||
#endif | ||
|
||
end subroutine cgyro_stress |