From 3854d511ccaca74f5c70fb76c57cb4e86fe7a35e Mon Sep 17 00:00:00 2001 From: Jeff Candy Date: Thu, 17 Oct 2024 20:44:18 -0700 Subject: [PATCH] Conversion seems to be working --- cgyro/bin/cgyro_json | 11 ++++++++--- cgyro/src/cgyro_globalshear.F90 | 10 +++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cgyro/bin/cgyro_json b/cgyro/bin/cgyro_json index 3ee904e33..5f4f97815 100755 --- a/cgyro/bin/cgyro_json +++ b/cgyro/bin/cgyro_json @@ -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 @@ -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() @@ -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') #================================================================== diff --git a/cgyro/src/cgyro_globalshear.F90 b/cgyro/src/cgyro_globalshear.F90 index f443d2c6d..632d0317e 100644 --- a/cgyro/src/cgyro_globalshear.F90 +++ b/cgyro/src/cgyro_globalshear.F90 @@ -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