Skip to content

Commit

Permalink
Merge branch 'newglo' of github.com:gafusion/gacode into newglo
Browse files Browse the repository at this point in the history
  • Loading branch information
jcandy committed Oct 21, 2024
2 parents 4dcd6cc + 3854d51 commit bbb432c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions cgyro/bin/cgyro_json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ with open('input.cgyro.gen','r') as file:
u = line.split()
key = u[1]
value = u[0]
if key in default.keys():
if str(value) != str(default[key]):
if key in default.keys() and 'SHAPE' not in key:
if str(value) != str(default[key]):
d[key] = value

# Code-specific parameters
Expand Down Expand Up @@ -71,6 +71,8 @@ d['S_ZETA'] = sim.s_zeta

d['SHAPE_SIN'] = sim.shape_sin[:].tolist()
d['SHAPE_COS'] = sim.shape_cos[:].tolist()
d['SHAPE_S_SIN'] = sim.shape_s_sin[:].tolist()
d['SHAPE_S_COS'] = sim.shape_s_cos[:].tolist()

d['Z'] = sim.z[:].tolist()
d['MASS'] = sim.mass[:].tolist()
Expand All @@ -92,15 +94,18 @@ with open('out.cgyro.localdump','w') as f:
for key in d:
x = d[key]
if 'SHAPE' in key:
# shape parameter
for i in range(len(x)):
if not x[i] == 0.0:
f.write(key+'_'+str(i)+'='+str(x[i])+'\n')
f.write(key+str(i)+'='+str(x[i])+'\n')
if i > nmax:
nmax = i
elif isinstance(x,list):
# species parameter
for i in range(len(x)):
f.write(key+'_'+str(i+1)+'='+str(x[i])+'\n')
else:
# standard scalar parameter
f.write(key+'='+str(x)+'\n')

#==================================================================
Expand Down
10 changes: 5 additions & 5 deletions cgyro/src/cgyro_globalshear.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ subroutine cgyro_globalshear(ij)

#if defined(OMPGPU)
!$omp target teams distribute parallel do simd collapse(4) &
!$omp& private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2)
!$omp private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2)
#elif defined(_OPENACC)
!$acc parallel loop collapse(4) gang vector &
!$acc& private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2) &
!$acc& present(rhs(:,:,:,ij),omega_ss,omega_sbeta,field,cap_h_c,h_x,c_wave)
!$acc private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2) &
!$acc present(rhs(:,:,:,ij),omega_ss,omega_sbeta,field,cap_h_c,h_x,c_wave)
#else
!$omp parallel do collapse(3) private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2)
!$omp& firstprivate(shear_method)
!$omp parallel do collapse(3) private(ivc,ir,l,iccj,j,ll,rl,llnt,h1,h2) &
!$omp firstprivate(shear_method)
#endif
do itor=nt1,nt2
do ivc=1,nv_loc
Expand Down

0 comments on commit bbb432c

Please sign in to comment.