Skip to content

Commit

Permalink
Added constant source option
Browse files Browse the repository at this point in the history
  • Loading branch information
jcandy committed Dec 5, 2024
1 parent a50f602 commit 5088beb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 1 addition & 2 deletions cgyro/src/cgyro_init_arrays.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ subroutine cgyro_init_arrays
integer :: ir,it,is,ie,ix
integer :: itm,itl,itor,mytor,itf
integer :: it_loc
integer :: jr,jt,id
integer :: i_field
integer :: jt
integer :: l,ll
integer :: iltheta_min
complex :: carg
Expand Down
15 changes: 6 additions & 9 deletions cgyro/src/cgyro_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ subroutine cgyro_write_restart_one
integer(KIND=8) :: start_time,cp_time
integer(KIND=8) :: count_rate, count_max
real :: cp_dt
integer :: j,ic0,statusfd
integer :: ierr
integer :: statusfd
integer :: ierr,ic0,j

! use system_clock to be consistent with cgyro_kernel
call system_clock(start_time,count_rate,count_max)
Expand Down Expand Up @@ -341,10 +341,8 @@ subroutine cgyro_read_restart

implicit none

integer :: igk
integer :: j,ic0


integer :: igk,ic0,j

!---------------------------------------------------------
! Read restart parameters from ASCII tag file.
!
Expand Down Expand Up @@ -389,7 +387,6 @@ subroutine cgyro_read_restart
enddo
endif


end subroutine cgyro_read_restart


Expand Down Expand Up @@ -517,7 +514,7 @@ subroutine cgyro_read_restart_one
integer(KIND=8) :: count_rate, count_max
real :: cp_dt
integer, dimension(3) :: mpibuf
integer :: ic0,j,statusfd
integer :: statusfd

! use system_clock to be consistent with cgyro_kernel
call system_clock(start_time,count_rate,count_max)
Expand Down Expand Up @@ -645,7 +642,7 @@ subroutine cgyro_read_restart_slow
integer(KIND=8) :: start_time,cp_time
integer(KIND=8) :: count_rate, count_max
real :: cp_dt
integer :: ic0,j,statusfd
integer :: statusfd
integer :: ie,ix,is,itor
integer :: t_iv

Expand Down
10 changes: 6 additions & 4 deletions cgyro/src/cgyro_source.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ subroutine cgyro_source

call timer_lib_in('shear')

nu_eff = nu_global*(abs(gamma_e)+ &
maxval(abs(sdlnndr(:)))+ &
maxval(abs(sdlntdr(:)))+ &
maxval(abs( sbeta(:))))
if (nu_global > 0.0) then
nu_eff = nu_global*(abs(gamma_e)+maxval(abs(sdlnndr(:)))+maxval(abs(sdlntdr(:)))+maxval(abs(sbeta(:))))
else
nu_eff = abs(nu_global)
endif

sa = 1.0+exp(-delta_t/tau_ave)*sa

! Time-delay source
Expand Down
8 changes: 6 additions & 2 deletions f2py/pygacode/cgyro/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,13 @@ def getnorm(self,norm):
self.tnorm = self.t
self.tstr = TIME

self.fnorm = self.freq
self.fstr = [r'$(a/c_s)\, \omega$',r'$(a/c_s)\, \gamma$']
try:
self.fnorm = self.freq
self.fstr = [r'$(a/c_s)\, \omega$',r'$(a/c_s)\, \gamma$']
except:
pass


self.rhonorm = self.rho
self.rhoi = r'\rho_s'

Expand Down

0 comments on commit 5088beb

Please sign in to comment.