diff --git a/profiles_gen/locpargen/locpargen_tglf.f90 b/profiles_gen/locpargen/locpargen_tglf.f90 index f45ab455b..ca012ba6c 100644 --- a/profiles_gen/locpargen/locpargen_tglf.f90 +++ b/profiles_gen/locpargen/locpargen_tglf.f90 @@ -22,6 +22,31 @@ subroutine locpargen_tglf write(1,10) 'S_DELTA_LOC=',s_delta_loc write(1,10) 'ZETA_LOC=',zeta_loc write(1,10) 'S_ZETA_LOC=',s_zeta_loc + write(1,*) + write(1,'(a)') '# Geometry (Advanced)' + write(1,10) 'SHAPE_SIN3=',shape_sin3_loc + write(1,10) 'SHAPE_S_SIN3=',shape_s_sin3_loc + write(1,10) 'SHAPE_SIN4=',shape_sin4_loc + write(1,10) 'SHAPE_S_SIN4=',shape_s_sin4_loc + write(1,10) 'SHAPE_SIN5=',shape_sin5_loc + write(1,10) 'SHAPE_S_SIN5=',shape_s_sin5_loc + write(1,10) 'SHAPE_SIN6=',shape_sin6_loc + write(1,10) 'SHAPE_S_SIN6=',shape_s_sin6_loc + write(1,10) 'SHAPE_COS0=',shape_cos0_loc + write(1,10) 'SHAPE_S_COS0=',shape_s_cos0_loc + write(1,10) 'SHAPE_COS1=',shape_cos1_loc + write(1,10) 'SHAPE_S_COS1=',shape_s_cos1_loc + write(1,10) 'SHAPE_COS2=',shape_cos2_loc + write(1,10) 'SHAPE_S_COS2=',shape_s_cos2_loc + write(1,10) 'SHAPE_COS3=',shape_cos3_loc + write(1,10) 'SHAPE_S_COS3=',shape_s_cos3_loc + write(1,10) 'SHAPE_COS4=',shape_cos4_loc + write(1,10) 'SHAPE_S_COS4=',shape_s_cos4_loc + write(1,10) 'SHAPE_COS5=',shape_cos5_loc + write(1,10) 'SHAPE_S_COS5=',shape_s_cos5_loc + write(1,10) 'SHAPE_COS6=',shape_cos6_loc + write(1,10) 'SHAPE_S_COS6=',shape_s_cos6_loc + write(1,*) write(1,10) 'SIGN_BT=',btccw write(1,10) 'SIGN_IT=',ipccw write(1,*) diff --git a/profiles_gen/locpargen/locpargen_tglf_stack.f90 b/profiles_gen/locpargen/locpargen_tglf_stack.f90 index 0366b26f6..11dd45dd8 100644 --- a/profiles_gen/locpargen/locpargen_tglf_stack.f90 +++ b/profiles_gen/locpargen/locpargen_tglf_stack.f90 @@ -17,7 +17,18 @@ subroutine locpargen_tglf_stack 'ZMAJ_LOC=',zmag_loc, 'DZMAJDX_LOC=',dzmag_loc, 'Q_LOC=',abs(q_loc), & 'Q_PRIME_LOC=',(q_loc/r0)**2*s_loc, 'KAPPA_LOC=',kappa_loc, 'S_KAPPA_LOC=',s_kappa_loc, & 'DELTA_LOC=',delta_loc, 'S_DELTA_LOC=',s_delta_loc, 'ZETA_LOC=',zeta_loc, & - 'S_ZETA_LOC=',s_zeta_loc, 'SIGN_BT=',btccw, 'SIGN_IT=',ipccw, & + 'S_ZETA_LOC=',s_zeta_loc, 'SHAPE_SIN3=',shape_sin3_loc, 'SHAPE_S_SIN3=',shape_s_sin3_loc, & + 'SHAPE_SIN4=' ,shape_sin4_loc, 'SHAPE_S_SIN4=' ,shape_s_sin4_loc, & + 'SHAPE_SIN5=' ,shape_sin5_loc, 'SHAPE_S_SIN5=' ,shape_s_sin5_loc, & + 'SHAPE_SIN6=' ,shape_sin6_loc, 'SHAPE_S_SIN6=' ,shape_s_sin6_loc, & + 'SHAPE_COS0=' ,shape_cos0_loc, 'SHAPE_S_COS0=' ,shape_s_cos0_loc, & + 'SHAPE_COS1=' ,shape_cos1_loc, 'SHAPE_S_COS1=' ,shape_s_cos1_loc, & + 'SHAPE_COS2=' ,shape_cos2_loc, 'SHAPE_S_COS2=' ,shape_s_cos2_loc, & + 'SHAPE_COS3=' ,shape_cos3_loc, 'SHAPE_S_COS3=' ,shape_s_cos3_loc, & + 'SHAPE_COS4=' ,shape_cos4_loc, 'SHAPE_S_COS4=' ,shape_s_cos4_loc, & + 'SHAPE_COS5=' ,shape_cos5_loc, 'SHAPE_S_COS5=' ,shape_s_cos5_loc, & + 'SHAPE_COS6=' ,shape_cos6_loc, 'SHAPE_S_COS6=' ,shape_s_cos6_loc, & + 'SIGN_BT=',btccw, 'SIGN_IT=',ipccw, & 'ZEFF=',z_eff_loc, 'XNUE=',nu_ee*a/cs_loc, & 'DEBYE=',7.43*sqrt(1e3*temp_loc(ise)/(1e13*dens_loc(ise)))/abs(rhos_loc), & 'BETAE=',betae_unit, 'P_PRIME_LOC=',(abs(q_loc)/r0)*(-beta_star_loc/(8*pi)), & diff --git a/tglf/bin/tglf_defaults.py b/tglf/bin/tglf_defaults.py index 03d3e6969..56136c7d8 100755 --- a/tglf/bin/tglf_defaults.py +++ b/tglf/bin/tglf_defaults.py @@ -162,6 +162,28 @@ def set_defaults() : t.add('S_DELTA_LOC','0.0') t.add('ZETA_LOC','0.0') t.add('S_ZETA_LOC','0.0') + t.add('SHAPE_COS0','0.0') + t.add('SHAPE_S_COS0','0.0') + t.add('SHAPE_COS1','0.0') + t.add('SHAPE_S_COS1','0.0') + t.add('SHAPE_COS2','0.0') + t.add('SHAPE_S_COS2','0.0') + t.add('SHAPE_COS3','0.0') + t.add('SHAPE_S_COS3','0.0') + t.add('SHAPE_COS4','0.0') + t.add('SHAPE_S_COS4','0.0') + t.add('SHAPE_COS5','0.0') + t.add('SHAPE_S_COS5','0.0') + t.add('SHAPE_COS6','0.0') + t.add('SHAPE_S_COS6','0.0') + t.add('SHAPE_SIN3','0.0') + t.add('SHAPE_S_SIN3','0.0') + t.add('SHAPE_SIN4','0.0') + t.add('SHAPE_S_SIN4','0.0') + t.add('SHAPE_SIN5','0.0') + t.add('SHAPE_S_SIN5','0.0') + t.add('SHAPE_SIN6','0.0') + t.add('SHAPE_S_SIN6','0.0') t.add('Q_LOC','2.0') t.add('Q_PRIME_LOC','16.0') t.add('P_PRIME_LOC','0.0') diff --git a/tglf/src/tglf_driver.f90 b/tglf/src/tglf_driver.f90 index f48457c44..1d816445c 100644 --- a/tglf/src/tglf_driver.f90 +++ b/tglf/src/tglf_driver.f90 @@ -48,7 +48,11 @@ PROGRAM tglf_driver elseif(igeo_tg.eq.1)then ! q_prime_tg = shat_tg*(q_tg/rmin_tg)**2 CALL put_Miller_geometry(rmin_tg,rmaj_tg,zmaj_tg,drmindx_tg,drmajdx_tg,dzmajdx_tg, & - kappa_tg,s_kappa_tg,delta_tg,s_delta_tg,zeta_tg,s_zeta_tg,q_tg,q_prime_tg,p_prime_tg,kx0_tg) + kappa_tg,s_kappa_tg,delta_tg,s_delta_tg,zeta_tg,s_zeta_tg,shape_sin3_tg,shape_s_sin3_tg,& + shape_sin4_tg,shape_s_sin4_tg,shape_sin5_tg,shape_s_sin5_tg,shape_sin6_tg,shape_s_sin6_tg,& + shape_cos0_tg,shape_s_cos0_tg,shape_cos1_tg,shape_s_cos1_tg,shape_cos2_tg,shape_s_cos2_tg,& + shape_cos3_tg,shape_s_cos3_tg,shape_cos4_tg,shape_s_cos4_tg,shape_cos5_tg,shape_s_cos5_tg,& + shape_cos6_tg,shape_s_cos6_tg,q_tg,q_prime_tg,p_prime_tg,kx0_tg) elseif(igeo_tg.eq.2)then CALL put_Fourier_geometry(q_tg,q_prime_tg,p_prime_tg,nfourier_tg,fourier_tg) elseif(igeo_tg.eq.3)then diff --git a/tglf/src/tglf_driver_mpi.f90 b/tglf/src/tglf_driver_mpi.f90 index 4728f2f82..e8b982a28 100644 --- a/tglf/src/tglf_driver_mpi.f90 +++ b/tglf/src/tglf_driver_mpi.f90 @@ -52,7 +52,11 @@ PROGRAM tglf_driver_mpi elseif(igeo_tg.eq.1)then ! q_prime_tg = shat_tg*(q_tg/rmin_tg)**2 CALL put_Miller_geometry(rmin_tg,rmaj_tg,zmaj_tg,drmindx_tg,drmajdx_tg,dzmajdx_tg, & - kappa_tg,s_kappa_tg,delta_tg,s_delta_tg,zeta_tg,s_zeta_tg,q_tg,q_prime_tg,p_prime_tg,kx0_tg) + kappa_tg,s_kappa_tg,delta_tg,s_delta_tg,zeta_tg,s_zeta_tg,shape_sin3_tg,shape_s_sin3_tg,& + shape_sin4_tg,shape_s_sin4_tg,shape_sin5_tg,shape_s_sin5_tg,shape_sin6_tg,shape_s_sin6_tg,& + shape_cos0_tg,shape_s_cos0_tg,shape_cos1_tg,shape_s_cos1_tg,shape_cos2_tg,shape_s_cos2_tg,& + shape_cos3_tg,shape_s_cos3_tg,shape_cos4_tg,shape_s_cos4_tg,shape_cos5_tg,shape_s_cos5_tg,& + shape_cos6_tg,shape_s_cos6_tg,q_tg,q_prime_tg,p_prime_tg,kx0_tg) elseif(igeo_tg.eq.2)then CALL put_Fourier_geometry(q_tg,q_prime_tg,p_prime_tg,nfourier_tg,fourier_tg) elseif(igeo_tg.eq.3)then diff --git a/tglf/src/tglf_geometry.f90 b/tglf/src/tglf_geometry.f90 index c89d79fd1..4c40fc3d0 100644 --- a/tglf/src/tglf_geometry.f90 +++ b/tglf/src/tglf_geometry.f90 @@ -1324,6 +1324,7 @@ END SUBROUTINE mercier_write ! squarness shear s_zeta_loc = rmin*d(zeta)/dx. Included elevation Zmaj_loc. ! Also changed definition of s_delta = rmin*d(delta)/dx from Waltz-Miller convention to GYRO's. ! July 26, 2021 set elevation Zmaj_loc =0.0 and DZMAJDX_LOC=0.0 since these break the up/down symmetry of Miller by contributing to Grad_r +! August 1, 2024 Sophia Guizzo(s.guizzo@columbia.edu) revised with MXH parameterization (Arbon et al PPCF 2020) !--------------------------------------------------------------- SUBROUTINE miller_geo @@ -1374,10 +1375,36 @@ SUBROUTINE miller_geo ! compute the arclength around the flux surface ! theta = 0.0 - arg_r = theta+x_delta*sin(theta) - darg_r = 1.0+x_delta*cos(theta) - arg_z = theta + zeta_loc*sin(2.0*theta) - darg_z = 1.0 + zeta_loc*2.0*cos(2.0*theta) + arg_r = theta + shape_cos0_loc + & + shape_cos1_loc*cos(theta) + & + shape_cos2_loc*cos(2*theta) + & + shape_cos3_loc*cos(3*theta) + & + shape_cos4_loc*cos(4*theta) + & + shape_cos5_loc*cos(5*theta) + & + shape_cos6_loc*cos(6*theta) + & + x_delta*sin(theta)- & + zeta_loc*sin(2*theta) + & + shape_sin3_loc*sin(3*theta) +& + shape_sin4_loc*sin(4*theta) + & + shape_sin5_loc*sin(5*theta) +& + shape_sin6_loc*sin(6*theta) + + darg_r = 1 - shape_cos1_loc*sin(theta) - & + 2*shape_cos2_loc*sin(2*theta) - & + 3*shape_cos3_loc*sin(3*theta) - & + 4*shape_cos4_loc*sin(4*theta) - & + 5*shape_cos5_loc*sin(5*theta) - & + 6*shape_cos6_loc*sin(6*theta) + & + x_delta*cos(theta)-& + 2*zeta_loc*cos(2*theta) + & + 3*shape_sin3_loc*cos(3*theta) + & + 4*shape_sin4_loc*cos(4*theta) + & + 5*shape_sin5_loc*cos(5*theta) + & + 6*shape_sin6_loc*cos(6*theta) + + arg_z = theta + darg_z = 1.0 + r_t = -rmin_loc*sin(arg_r)*darg_r z_t = kappa_loc*rmin_loc*cos(arg_z)*darg_z l_t = SQRT(r_t**2+z_t**2) @@ -1387,6 +1414,7 @@ SUBROUTINE miller_geo l_t1 = l_t scale_max=l_t arclength = 0.0 + do while(theta.lt.pi_2) theta = theta + dtheta if(theta.gt.pi_2)then @@ -1395,15 +1423,39 @@ SUBROUTINE miller_geo theta = pi_2 endif ! write(*,*)"theta = ",theta,"dtheta=",dtheta - arg_r = theta+x_delta*sin(theta) + arg_r = theta + shape_cos0_loc + & + shape_cos1_loc*cos(theta) + & + shape_cos2_loc*cos(2*theta) + & + shape_cos3_loc*cos(3*theta) + & + shape_cos4_loc*cos(4*theta) + & + shape_cos5_loc*cos(5*theta) + & + shape_cos6_loc*cos(6*theta) + & + x_delta*sin(theta)- & + zeta_loc*sin(2*theta) + & + shape_sin3_loc*sin(3*theta) +& + shape_sin4_loc*sin(4*theta) + & + shape_sin5_loc*sin(5*theta) +& + shape_sin6_loc*sin(6*theta) + ! d(arg_r)/dtheta - darg_r = 1.0+x_delta*cos(theta) + darg_r = 1 - shape_cos1_loc*sin(theta) - & + 2*shape_cos2_loc*sin(2*theta) - & + 3*shape_cos3_loc*sin(3*theta) - & + 4*shape_cos4_loc*sin(4*theta) - & + 5*shape_cos5_loc*sin(5*theta) - & + 6*shape_cos6_loc*sin(6*theta) + & + x_delta*cos(theta)-& + 2*zeta_loc*cos(2*theta) + & + 3*shape_sin3_loc*cos(3*theta) + & + 4*shape_sin4_loc*cos(4*theta) + & + 5*shape_sin5_loc*cos(5*theta) + & + 6*shape_sin6_loc*cos(6*theta) ! dR/dtheta r_t = -rmin_loc*sin(arg_r)*darg_r ! - arg_z = theta + zeta_loc*sin(2.0*theta) + arg_z = theta ! d(arg_z)/dtheta - darg_z = 1.0 + zeta_loc*2.0*cos(2.0*theta) + darg_z = 1.0 ! dZ/dtheta z_t = kappa_loc*rmin_loc*cos(arg_z)*darg_z ! dl/dtheta @@ -1431,10 +1483,33 @@ SUBROUTINE miller_geo t_s(ms)=-pi_2 ! make a first guess based on theta=0.0 theta=0.0 - arg_r = theta+x_delta*sin(theta) - darg_r = 1.0+x_delta*cos(theta) - arg_z = theta + zeta_loc*sin(2.0*theta) - darg_z = 1.0 + zeta_loc*2.0*cos(2.0*theta) + arg_r = theta + shape_cos0_loc + & + shape_cos1_loc*cos(theta) + & + shape_cos2_loc*cos(2*theta) + & + shape_cos3_loc*cos(3*theta) + & + shape_cos4_loc*cos(4*theta) + & + shape_cos5_loc*cos(5*theta) + & + shape_cos6_loc*cos(6*theta) + & + x_delta*sin(theta)- & + zeta_loc*sin(2*theta) + & + shape_sin3_loc*sin(3*theta) +& + shape_sin4_loc*sin(4*theta) + & + shape_sin5_loc*sin(5*theta) +& + shape_sin6_loc*sin(6*theta) + darg_r = 1 - shape_cos1_loc*sin(theta) - & + 2*shape_cos2_loc*sin(2*theta) - & + 3*shape_cos3_loc*sin(3*theta) - & + 4*shape_cos4_loc*sin(4*theta) - & + 5*shape_cos5_loc*sin(5*theta) - & + 6*shape_cos6_loc*sin(6*theta) + & + x_delta*cos(theta)-& + 2*zeta_loc*cos(2*theta) + & + 3*shape_sin3_loc*cos(3*theta) + & + 4*shape_sin4_loc*cos(4*theta) + & + 5*shape_sin5_loc*cos(5*theta) + & + 6*shape_sin6_loc*cos(6*theta) + arg_z = theta + darg_z = 1.0 r_t = -rmin_loc*sin(arg_r)*darg_r z_t = kappa_loc*rmin_loc*cos(arg_z)*darg_z l_t = SQRT(r_t**2+z_t**2) @@ -1442,11 +1517,34 @@ SUBROUTINE miller_geo theta=dtheta l_t1=l_t ! - do m=1,ms/2 - arg_r = theta+x_delta*sin(theta) - darg_r = 1.0+x_delta*cos(theta) - arg_z = theta + zeta_loc*sin(2.0*theta) - darg_z = 1.0 + zeta_loc*2.0*cos(2.0*theta) + do m=1,ms + arg_r = theta + shape_cos0_loc + & + shape_cos1_loc*cos(theta) + & + shape_cos2_loc*cos(2*theta) + & + shape_cos3_loc*cos(3*theta) + & + shape_cos4_loc*cos(4*theta) + & + shape_cos5_loc*cos(5*theta) + & + shape_cos6_loc*cos(6*theta) + & + x_delta*sin(theta)- & + zeta_loc*sin(2*theta) + & + shape_sin3_loc*sin(3*theta) +& + shape_sin4_loc*sin(4*theta) + & + shape_sin5_loc*sin(5*theta) +& + shape_sin6_loc*sin(6*theta) + darg_r = 1 - shape_cos1_loc*sin(theta) - & + 2*shape_cos2_loc*sin(2*theta) - & + 3*shape_cos3_loc*sin(3*theta) - & + 4*shape_cos4_loc*sin(4*theta) - & + 5*shape_cos5_loc*sin(5*theta) - & + 6*shape_cos6_loc*sin(6*theta) + & + x_delta*cos(theta)-& + 2*zeta_loc*cos(2*theta) + & + 3*shape_sin3_loc*cos(3*theta) + & + 4*shape_sin4_loc*cos(4*theta) + & + 5*shape_sin5_loc*cos(5*theta) + & + 6*shape_sin6_loc*cos(6*theta) + arg_z = theta + darg_z = 1.0 r_t = -rmin_loc*sin(arg_r)*darg_r z_t = kappa_loc*rmin_loc*cos(arg_z)*darg_z l_t = SQRT(r_t**2+z_t**2) @@ -1456,13 +1554,12 @@ SUBROUTINE miller_geo l_t1=l_t enddo ! distribute endpoint error over interior points - dtheta = (t_s(ms/2)-(-pi))/REAL(ms/2) + dtheta = (t_s(ms)-(-pi_2))/REAL(ms) ! write(*,*)"enpoint error =",dtheta ! dtheta=0.0 ! t_s(ms/2)=-pi - do m=1,ms/2 + do m=1,ms t_s(m) = t_s(m)-REAL(m)*dtheta - t_s(ms-m)=-pi_2 - t_s(m) enddo ! write(*,*)"t_s(ms/2)+pi=",t_s(ms/2)+pi ! @@ -1491,10 +1588,33 @@ SUBROUTINE miller_geo do m=0,ms theta = t_s(m) - arg_r = theta + x_delta*sin(theta) - darg_r = 1.0 + x_delta*cos(theta) - arg_z = theta + zeta_loc*sin(2.0*theta) - darg_z = 1.0 + zeta_loc*2.0*cos(2.0*theta) + arg_r = theta + shape_cos0_loc + & + shape_cos1_loc*cos(theta) + & + shape_cos2_loc*cos(2*theta) + & + shape_cos3_loc*cos(3*theta) + & + shape_cos4_loc*cos(4*theta) + & + shape_cos5_loc*cos(5*theta) + & + shape_cos6_loc*cos(6*theta) + & + x_delta*sin(theta)- & + zeta_loc*sin(2*theta) + & + shape_sin3_loc*sin(3*theta) +& + shape_sin4_loc*sin(4*theta) + & + shape_sin5_loc*sin(5*theta) +& + shape_sin6_loc*sin(6*theta) + darg_r = 1 - shape_cos1_loc*sin(theta) - & + 2*shape_cos2_loc*sin(2*theta) - & + 3*shape_cos3_loc*sin(3*theta) - & + 4*shape_cos4_loc*sin(4*theta) - & + 5*shape_cos5_loc*sin(5*theta) - & + 6*shape_cos6_loc*sin(6*theta) + & + x_delta*cos(theta)-& + 2*zeta_loc*cos(2*theta) + & + 3*shape_sin3_loc*cos(3*theta) + & + 4*shape_sin4_loc*cos(4*theta) + & + 5*shape_sin5_loc*cos(5*theta) + & + 6*shape_sin6_loc*cos(6*theta) + arg_z = theta + darg_z = 1.0 ! R(theta) ! Z(theta) @@ -1514,9 +1634,21 @@ SUBROUTINE miller_geo ! dR/dr ! dZ/dr R_r = drmajdx_loc + drmindx_loc*cos(arg_r) & - -sin(arg_r)*s_delta_loc*sin(theta)/sqrt(1.0 - delta_loc**2) - Z_r = dzmajdx_loc + kappa_loc*sin(arg_z)*(drmindx_loc +s_kappa_loc) & - +kappa_loc*cos(arg_z)*s_zeta_loc*sin(2.0*theta) + -sin(arg_r)*(shape_s_cos0_loc + & + shape_s_cos1_loc*cos(theta) + & + shape_s_cos2_loc*cos(2*theta) + & + shape_s_cos3_loc*cos(3*theta) + & + shape_s_cos4_loc*cos(4*theta) + & + shape_s_cos5_loc*cos(5*theta) + & + shape_s_cos6_loc*cos(6*theta) + & + s_delta_loc*sin(theta)/cos(x_delta) - & + s_zeta_loc*sin(2*theta) + & + shape_s_sin3_loc*sin(3*theta) + & + shape_s_sin4_loc*sin(4*theta) + & + shape_s_sin5_loc*sin(5*theta) + & + shape_s_sin6_loc*sin(6*theta)) + + Z_r = dzmajdx_loc + kappa_loc*sin(arg_z)*(drmindx_loc +s_kappa_loc) ! Jacobian det = R_r*z_t - R_t*Z_r ! grad_r diff --git a/tglf/src/tglf_inout.f90 b/tglf/src/tglf_inout.f90 index 0010011d0..86749ae72 100644 --- a/tglf/src/tglf_inout.f90 +++ b/tglf/src/tglf_inout.f90 @@ -454,7 +454,11 @@ END SUBROUTINE put_s_alpha_geometry ! SUBROUTINE put_Miller_geometry(rmin,rmaj,zmaj,drmindx,drmajdx,dzmajdx, & - kappa,s_kappa,delta,s_delta,zeta,s_zeta,q,q_prime,p_prime,beta,kx0_m) + kappa,s_kappa,delta,s_delta,zeta,s_zeta,shape_sin3, shape_s_sin3, shape_sin4, & + shape_s_sin4, shape_sin5, shape_s_sin5, shape_sin6, shape_s_sin6, shape_cos0, & + shape_s_cos0, shape_cos1, shape_s_cos1, shape_cos2, shape_s_cos2, shape_cos3, & + shape_s_cos3, shape_cos4, shape_s_cos4, shape_cos5, shape_s_cos5, shape_cos6, & + shape_s_cos6,q,q_prime,p_prime,beta,kx0_m) ! ! This routine eliminates the need for subroutine miller_init ! and the miller.dat input file. @@ -464,7 +468,11 @@ SUBROUTINE put_Miller_geometry(rmin,rmaj,zmaj,drmindx,drmajdx,dzmajdx, & IMPLICIT NONE REAL,INTENT(IN) :: rmin,rmaj,zmaj,q,q_prime,p_prime,kx0_m,beta REAL,INTENT(IN) :: drmindx,drmajdx,dzmajdx - REAL,INTENT(IN) :: kappa,s_kappa,delta,s_delta,zeta,s_zeta + REAL,INTENT(IN) :: kappa,s_kappa,delta,s_delta,zeta,s_zeta, shape_sin3, shape_s_sin3, shape_sin4, & + shape_s_sin4, shape_sin5, shape_s_sin5, shape_sin6, shape_s_sin6, shape_cos0, & + shape_s_cos0, shape_cos1, shape_s_cos1, shape_cos2, shape_s_cos2, shape_cos3, & + shape_s_cos3, shape_cos4, shape_s_cos4, shape_cos5, shape_s_cos5, shape_cos6, & + shape_s_cos6 if(tglf_isnan(rmin))call tglf_error(1,"input rmin_loc is NAN") if(tglf_isinf(rmin))call tglf_error(1,"input rmin_loc is INF") @@ -528,6 +536,28 @@ SUBROUTINE put_Miller_geometry(rmin,rmaj,zmaj,drmindx,drmajdx,dzmajdx, & s_zeta_loc = s_zeta beta_loc = beta kx0_loc = kx0_m + shape_sin3_loc = shape_sin3 + shape_s_sin3_loc = shape_s_sin3 + shape_sin4_loc = shape_sin4 + shape_s_sin4_loc = shape_s_sin4 + shape_sin5_loc = shape_sin5 + shape_s_sin5_loc = shape_s_sin5 + shape_sin6_loc = shape_sin6 + shape_s_sin6_loc = shape_s_sin6 + shape_cos0_loc = shape_cos0 + shape_s_cos0_loc = shape_s_cos0 + shape_cos1_loc = shape_cos1 + shape_s_cos1_loc = shape_s_cos1 + shape_cos2_loc = shape_cos2 + shape_s_cos2_loc = shape_s_cos2 + shape_cos3_loc = shape_cos3 + shape_s_cos3_loc = shape_s_cos3 + shape_cos4_loc = shape_cos4 + shape_s_cos4_loc = shape_s_cos4 + shape_cos5_loc = shape_cos5 + shape_s_cos5_loc = shape_s_cos5 + shape_cos6_loc = shape_cos6 + shape_s_cos6_loc = shape_s_cos6 ! ! validatiy checks ! @@ -1581,6 +1611,28 @@ SUBROUTINE write_tglf_input write(11,*)" s_delta_tg= ",s_delta_loc write(11,*)" zeta_tg= ",zeta_loc write(11,*)" s_zeta_tg= ",s_zeta_loc + write(11,*)" shape_sin3_tg= ", shape_sin3_loc + write(11,*)" shape_s_sin3_tg= ", shape_s_sin3_loc + write(11,*)" shape_sin4_tg= ", shape_sin4_loc + write(11,*)" shape_s_sin4_tg= ", shape_s_sin4_loc + write(11,*)" shape_sin5_tg= ", shape_sin5_loc + write(11,*)" shape_s_sin5_tg= ", shape_s_sin5_loc + write(11,*)" shape_sin6_tg= ", shape_sin6_loc + write(11,*)" shape_s_sin6_tg= ", shape_s_sin6_loc + write(11,*)" shape_cos0_tg= ", shape_cos0_loc + write(11,*)" shape_s_cos0_tg= ", shape_s_cos0_loc + write(11,*)" shape_cos1_tg= ", shape_cos1_loc + write(11,*)" shape_s_cos1_tg= ", shape_s_cos1_loc + write(11,*)" shape_cos2_tg= ", shape_cos2_loc + write(11,*)" shape_s_cos2_tg= ", shape_s_cos2_loc + write(11,*)" shape_cos3_tg= ", shape_cos3_loc + write(11,*)" shape_s_cos3_tg= ", shape_s_cos3_loc + write(11,*)" shape_cos4_tg= ", shape_cos4_loc + write(11,*)" shape_s_cos4_tg= ", shape_s_cos4_loc + write(11,*)" shape_cos5_tg= ", shape_cos5_loc + write(11,*)" shape_s_cos5_tg= ", shape_s_cos5_loc + write(11,*)" shape_cos6_tg= ", shape_cos6_loc + write(11,*)" shape_s_cos6_tg= ", shape_s_cos6_loc write(11,*)" q_tg= ",q_loc write(11,*)" p_prime_tg= ",p_prime_loc write(11,*)" q_prime_tg= ",q_prime_loc diff --git a/tglf/src/tglf_interface.f90 b/tglf/src/tglf_interface.f90 index a70bdeffd..f75cb3c8a 100644 --- a/tglf/src/tglf_interface.f90 +++ b/tglf/src/tglf_interface.f90 @@ -161,6 +161,28 @@ module tglf_interface real :: tglf_s_delta_loc_in = 0.0 real :: tglf_zeta_loc_in = 0.0 real :: tglf_s_zeta_loc_in = 0.0 + real :: tglf_shape_sin3_loc_in = 0.0 + real :: tglf_shape_s_sin3_loc_in = 0.0 + real :: tglf_shape_sin4_loc_in = 0.0 + real :: tglf_shape_s_sin4_loc_in = 0.0 + real :: tglf_shape_sin5_loc_in = 0.0 + real :: tglf_shape_s_sin5_loc_in = 0.0 + real :: tglf_shape_sin6_loc_in = 0.0 + real :: tglf_shape_s_sin6_loc_in = 0.0 + real :: tglf_shape_cos0_loc_in = 0.0 + real :: tglf_shape_s_cos0_loc_in = 0.0 + real :: tglf_shape_cos1_loc_in = 0.0 + real :: tglf_shape_s_cos1_loc_in = 0.0 + real :: tglf_shape_cos2_loc_in = 0.0 + real :: tglf_shape_s_cos2_loc_in = 0.0 + real :: tglf_shape_cos3_loc_in = 0.0 + real :: tglf_shape_s_cos3_loc_in = 0.0 + real :: tglf_shape_cos4_loc_in = 0.0 + real :: tglf_shape_s_cos4_loc_in = 0.0 + real :: tglf_shape_cos5_loc_in = 0.0 + real :: tglf_shape_s_cos5_loc_in = 0.0 + real :: tglf_shape_cos6_loc_in = 0.0 + real :: tglf_shape_s_cos6_loc_in = 0.0 real :: tglf_q_loc_in = 2.0 real :: tglf_q_prime_loc_in = 16.0 real :: tglf_p_prime_loc_in = 0.0 @@ -356,6 +378,28 @@ subroutine tglf_dump_local() write(1,30) 'S_DELTA_LOC',tglf_s_delta_loc_in write(1,30) 'ZETA_LOC',tglf_zeta_loc_in write(1,30) 'S_ZETA_LOC',tglf_s_zeta_loc_in + write(1,30) 'SHAPE_SIN3',tglf_shape_sin3_loc_in + write(1,30) 'SHAPE_S_SIN3',tglf_shape_s_sin3_loc_in + write(1,30) 'SHAPE_SIN4',tglf_shape_sin4_loc_in + write(1,30) 'SHAPE_S_SIN4',tglf_shape_s_sin4_loc_in + write(1,30) 'SHAPE_SIN5',tglf_shape_sin5_loc_in + write(1,30) 'SHAPE_S_SIN5',tglf_shape_s_sin5_loc_in + write(1,30) 'SHAPE_SIN6',tglf_shape_sin6_loc_in + write(1,30) 'SHAPE_S_SIN6',tglf_shape_s_sin6_loc_in + write(1,30) 'SHAPE_COS0',tglf_shape_cos0_loc_in + write(1,30) 'SHAPE_S_COS0',tglf_shape_s_cos0_loc_in + write(1,30) 'SHAPE_COS1',tglf_shape_cos1_loc_in + write(1,30) 'SHAPE_S_COS1',tglf_shape_cos1_loc_in + write(1,30) 'SHAPE_COS2',tglf_shape_cos2_loc_in + write(1,30) 'SHAPE_S_COS2',tglf_shape_cos2_loc_in + write(1,30) 'SHAPE_COS3',tglf_shape_cos3_loc_in + write(1,30) 'SHAPE_S_COS3',tglf_shape_cos3_loc_in + write(1,30) 'SHAPE_COS4',tglf_shape_cos4_loc_in + write(1,30) 'SHAPE_S_COS4',tglf_shape_s_cos4_loc_in + write(1,30) 'SHAPE_COS5',tglf_shape_cos5_loc_in + write(1,30) 'SHAPE_S_COS5',tglf_shape_cos5_loc_in + write(1,30) 'SHAPE_COS6',tglf_shape_cos6_loc_in + write(1,30) 'SHAPE_S_COS6',tglf_shape_cos6_loc_in write(1,30) 'P_PRIME_LOC',tglf_p_prime_loc_in write(1,30) 'Q_PRIME_LOC',tglf_q_prime_loc_in write(1,30) 'BETA_LOC',tglf_beta_loc_in diff --git a/tglf/src/tglf_modules.f90 b/tglf/src/tglf_modules.f90 index 4effd7f0b..12c6beba5 100644 --- a/tglf/src/tglf_modules.f90 +++ b/tglf/src/tglf_modules.f90 @@ -163,6 +163,28 @@ MODULE tglf_global REAL :: s_delta_loc=0.0 REAL :: zeta_loc=0.0 REAL :: s_zeta_loc=0.0 + REAL :: shape_sin3_loc=0.0 + REAL :: shape_s_sin3_loc=0.0 + REAL :: shape_sin4_loc=0.0 + REAL :: shape_s_sin4_loc=0.0 + REAL :: shape_sin5_loc=0.0 + REAL :: shape_s_sin5_loc=0.0 + REAL :: shape_sin6_loc=0.0 + REAL :: shape_s_sin6_loc=0.0 + REAL :: shape_cos0_loc=0.0 + REAL :: shape_s_cos0_loc=0.0 + REAL :: shape_cos1_loc=0.0 + REAL :: shape_s_cos1_loc=0.0 + REAL :: shape_cos2_loc=0.0 + REAL :: shape_s_cos2_loc=0.0 + REAL :: shape_cos3_loc=0.0 + REAL :: shape_s_cos3_loc=0.0 + REAL :: shape_cos4_loc=0.0 + REAL :: shape_s_cos4_loc=0.0 + REAL :: shape_cos5_loc=0.0 + REAL :: shape_s_cos5_loc=0.0 + REAL :: shape_cos6_loc=0.0 + REAL :: shape_s_cos6_loc=0.0 REAL :: p_prime_loc=0.0 REAL :: q_prime_loc=16.0 REAL :: beta_loc = 0.0 @@ -849,6 +871,28 @@ MODULE tglf_tg REAL :: s_delta_tg=0.0 REAL :: s_kappa_tg=0.0 REAL :: s_zeta_tg=0.0 + REAL :: shape_sin3_tg=0.0 + REAL :: shape_s_sin3_tg=0.0 + REAL :: shape_sin4_tg=0.0 + REAL :: shape_s_sin4_tg=0.0 + REAL :: shape_sin5_tg=0.0 + REAL :: shape_s_sin5_tg=0.0 + REAL :: shape_sin6_tg=0.0 + REAL :: shape_s_sin6_tg=0.0 + REAL :: shape_cos0_tg=0.0 + REAL :: shape_s_cos0_tg=0.0 + REAL :: shape_cos1_tg=0.0 + REAL :: shape_s_cos1_tg=0.0 + REAL :: shape_cos2_tg=0.0 + REAL :: shape_s_cos2_tg=0.0 + REAL :: shape_cos3_tg=0.0 + REAL :: shape_s_cos3_tg=0.0 + REAL :: shape_cos4_tg=0.0 + REAL :: shape_s_cos4_tg=0.0 + REAL :: shape_cos5_tg=0.0 + REAL :: shape_s_cos5_tg=0.0 + REAL :: shape_cos6_tg=0.0 + REAL :: shape_s_cos6_tg=0.0 REAL :: q_prime_tg=0.0 REAL :: p_prime_tg=0.0 REAL :: kx0_tg=0.0 @@ -873,6 +917,12 @@ MODULE tglf_tg rmin_tg, rmaj_tg, zmaj_tg,use_bisection_tg,vpar_tg, & q_tg, xnue_tg, wd_zero_tg, betae_tg, shat_tg, alpha_tg, & xwell_tg,kappa_tg,s_kappa_tg,delta_tg,s_delta_tg,zeta_tg,s_zeta_tg, & + shape_sin3_tg, shape_s_sin3_tg, shape_sin4_tg, shape_s_sin4_tg, & + shape_sin5_tg, shape_s_sin5_tg, shape_sin6_tg, shape_s_sin6_tg, & + shape_cos0_tg, shape_s_cos0_tg, shape_cos1_tg, shape_s_cos1_tg, & + shape_cos2_tg, shape_s_cos2_tg, shape_cos3_tg, shape_s_cos3_tg, & + shape_cos4_tg, shape_s_cos4_tg, shape_cos5_tg, shape_s_cos5_tg, & + shape_cos6_tg, shape_s_cos6_tg, & drmindx_tg,drmajdx_tg,dzmajdx_tg,zeff_tg, debye_tg, use_bper_tg, & use_bpar_tg,use_mhd_rule_tg,q_prime_tg,damp_psi_tg,damp_sig_tg, & p_prime_tg, filter_tg, Linsker_factor_tg, gradB_factor_tg, & diff --git a/tglf/src/tglf_read_input.f90 b/tglf/src/tglf_read_input.f90 index 679ffd9f2..c3a5d3515 100644 --- a/tglf/src/tglf_read_input.f90 +++ b/tglf/src/tglf_read_input.f90 @@ -190,6 +190,28 @@ subroutine tglf_read_input read(1,*) tglf_s_delta_loc_in read(1,*) tglf_zeta_loc_in read(1,*) tglf_s_zeta_loc_in + read(1,*) tglf_shape_cos0_loc_in + read(1,*) tglf_shape_s_cos0_loc_in + read(1,*) tglf_shape_cos1_loc_in + read(1,*) tglf_shape_s_cos1_loc_in + read(1,*) tglf_shape_cos2_loc_in + read(1,*) tglf_shape_s_cos2_loc_in + read(1,*) tglf_shape_cos3_loc_in + read(1,*) tglf_shape_s_cos3_loc_in + read(1,*) tglf_shape_cos4_loc_in + read(1,*) tglf_shape_s_cos4_loc_in + read(1,*) tglf_shape_cos5_loc_in + read(1,*) tglf_shape_s_cos5_loc_in + read(1,*) tglf_shape_cos6_loc_in + read(1,*) tglf_shape_s_cos6_loc_in + read(1,*) tglf_shape_sin3_loc_in + read(1,*) tglf_shape_s_sin3_loc_in + read(1,*) tglf_shape_sin4_loc_in + read(1,*) tglf_shape_s_sin4_loc_in + read(1,*) tglf_shape_sin5_loc_in + read(1,*) tglf_shape_s_sin5_loc_in + read(1,*) tglf_shape_sin6_loc_in + read(1,*) tglf_shape_s_sin6_loc_in read(1,*) tglf_q_loc_in read(1,*) tglf_q_prime_loc_in read(1,*) tglf_p_prime_loc_in diff --git a/tglf/src/tglf_run.F90 b/tglf/src/tglf_run.F90 index 6f3a64533..95e78afee 100644 --- a/tglf/src/tglf_run.F90 +++ b/tglf/src/tglf_run.F90 @@ -111,6 +111,28 @@ subroutine tglf_run() tglf_s_delta_loc_in, & tglf_zeta_loc_in, & tglf_s_zeta_loc_in, & + tglf_shape_sin3_loc_in, & + tglf_shape_s_sin3_loc_in, & + tglf_shape_sin4_loc_in, & + tglf_shape_s_sin4_loc_in, & + tglf_shape_sin5_loc_in, & + tglf_shape_s_sin5_loc_in, & + tglf_shape_sin6_loc_in, & + tglf_shape_s_sin6_loc_in, & + tglf_shape_cos0_loc_in, & + tglf_shape_s_cos0_loc_in, & + tglf_shape_cos1_loc_in, & + tglf_shape_s_cos1_loc_in, & + tglf_shape_cos2_loc_in, & + tglf_shape_s_cos2_loc_in, & + tglf_shape_cos3_loc_in, & + tglf_shape_s_cos3_loc_in, & + tglf_shape_cos4_loc_in, & + tglf_shape_s_cos4_loc_in, & + tglf_shape_cos5_loc_in, & + tglf_shape_s_cos5_loc_in, & + tglf_shape_cos6_loc_in, & + tglf_shape_s_cos6_loc_in, & tglf_q_loc_in, & tglf_q_prime_loc_in, & tglf_p_prime_loc_in, & diff --git a/tglf/tools/input/tglf02/out.tglf.prec b/tglf/tools/input/tglf02/out.tglf.prec index 727db957a..85deb3f69 100644 --- a/tglf/tools/input/tglf02/out.tglf.prec +++ b/tglf/tools/input/tglf02/out.tglf.prec @@ -1 +1 @@ - 71.623670671890324 + 70.851711653595530 diff --git a/tglf/tools/input/tglf02/out.tglf.run b/tglf/tools/input/tglf02/out.tglf.run index 3f8d1e37d..fb5f5b143 100644 --- a/tglf/tools/input/tglf02/out.tglf.run +++ b/tglf/tools/input/tglf02/out.tglf.run @@ -1,6 +1,7 @@ [Parsing data in input.tglf] no mpi D(R) = -0.0000E+00 D(I) = 0.0000E+00 + kinetic species = 2 non-kinetic species = 0 Gam/Gam_GB Q/Q_GB Q_low/Q_GB Pi/Pi_GB S/S_GB -elec -1.7988E+00 1.1609E+01 9.7591E+00 2.9572E-06 3.0467E+00 -ion1 -1.7988E+00 2.3297E+01 2.3361E+01 -1.3682E-04 -3.0467E+00 +elec -1.8002E+00 1.1546E+01 9.6965E+00 3.5870E-06 2.9850E+00 +ion1 -1.8002E+00 2.2973E+01 2.3036E+01 2.7380E-04 -2.9850E+00 diff --git a/tglf/tools/input/tglf02/out.tglf.version b/tglf/tools/input/tglf02/out.tglf.version index 8b16a48d8..954eb52b1 100644 --- a/tglf/tools/input/tglf02/out.tglf.version +++ b/tglf/tools/input/tglf02/out.tglf.version @@ -1,3 +1,3 @@ -53e1f02 -GFORTRAN_OSX_MACPORTS -Thu Jun 1 13:18:05 PDT 2017 +19387296 [2024-09-04] +OSX_MONTEREY +Mon Sep 16 16:37:05 EDT 2024