From 3aeb188ab5280891615045c4acc7a7385bcfae79 Mon Sep 17 00:00:00 2001 From: Emily Belli Date: Fri, 10 Jan 2025 13:11:32 -0800 Subject: [PATCH] LE3: fixing Btor and adding to output --- le3/src/le3_geometry.f90 | 2 +- le3/src/le3_geometry_matrix.f90 | 10 +++--- le3/src/le3_geometry_rho.f90 | 56 +++++++++++++++------------------ 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/le3/src/le3_geometry.f90 b/le3/src/le3_geometry.f90 index e6045975d..21a3296ac 100644 --- a/le3/src/le3_geometry.f90 +++ b/le3/src/le3_geometry.f90 @@ -126,7 +126,7 @@ subroutine le3_geometry ! cos(u) = Z_t/sqrt(g_tt) cosu(:,:) = dzdt/sqrt(gtt) - btor(:,:) = 1.0/(r*g) + btor(:,:) = 1.0/g*sqrt(gpp) bpol(:,:) = 1.0/g*(gpt/sqrt(gtt)+iota*sqrt(gtt)) diff --git a/le3/src/le3_geometry_matrix.f90 b/le3/src/le3_geometry_matrix.f90 index 15d612553..21a0d0eae 100644 --- a/le3/src/le3_geometry_matrix.f90 +++ b/le3/src/le3_geometry_matrix.f90 @@ -510,6 +510,10 @@ subroutine le3_geometry_matrix ! B/Bunit call remap_theta(bmag(:,:),xtemp(:,:),0.0) write (1,'(e16.8)') xtemp(:,:) + + ! Btor/Bunit + call remap_theta(btor(:,:),xtemp(:,:),0.0) + write (1,'(e16.8)') xtemp(:,:) ! anorm*(bhat dot grad) = bdotgrad * (iota d/dt + d/dp) = (1) d/dt + (2) d/dp call remap_theta(bdotgrad(:,:),xtemp(:,:),0.0) @@ -532,9 +536,6 @@ subroutine le3_geometry_matrix write (1,'(e16.8)') grad_perpsq_gk(:,:,2) write (1,'(e16.8)') grad_perpsq_gk(:,:,3) - call remap_theta(b1(:,:),xtemp(:,:),0.0) - write (1,'(e16.8)') xtemp(:,:) - call remap_theta(chi1(:,:),xtemp(:,:),0.0) write (1,'(e16.8)') xtemp(:,:) @@ -543,9 +544,6 @@ subroutine le3_geometry_matrix call remap_theta(dtheta(:,:),xtemp(:,:),0.0) write (1,'(e16.8)') xtemp(:,:) - - call remap_theta(dtheta_t(:,:),xtemp(:,:),0.0) - write (1,'(e16.8)') xtemp(:,:) close(1) deallocate(xtemp) diff --git a/le3/src/le3_geometry_rho.f90 b/le3/src/le3_geometry_rho.f90 index 87f6b044c..b46a078c3 100644 --- a/le3/src/le3_geometry_rho.f90 +++ b/le3/src/le3_geometry_rho.f90 @@ -15,7 +15,7 @@ subroutine le3_geometry_rho real :: up,pp,pt real :: d0, eta, d1, gpp_1, gtt_1, gpt_1 real :: sum1, sum2, sum3, sum4 - + real, dimension(:,:), allocatable :: s1a,s1b real, dimension(:,:), allocatable :: s2a,s2b real, dimension(:,:), allocatable :: a11a,a11b @@ -279,35 +279,31 @@ subroutine le3_geometry_rho !-------------------------------------------------------------------- ! Check with GEO result ! - if (equilibrium_model == 0) then - GEO_model_in = 0 - GEO_rmin_in = rmin - GEO_rmaj_in = rmaj - GEO_drmaj_in = shift - GEO_zmag_in = zmag - GEO_dzmag_in = dzmag - GEO_q_in = q - GEO_s_in = s - GEO_kappa_in = kappa - GEO_s_kappa_in = s_kappa - GEO_delta_in = delta - GEO_s_delta_in = s_delta - GEO_zeta_in = zeta - GEO_s_zeta_in = s_zeta - GEO_beta_star_in = beta_star - !call GEO_alloc(1) - !call GEO_do() - !open(unit=1,file='out.miller',status='replace') - !do i=1,n_theta - ! theta = (i-1)*2*pi/(n_theta-1)-pi - ! call GEO_interp(theta) - ! print '(2(1pe12.5,1x))', GEO_theta_s,GEO_chi2 - ! write(1,*) GEO_theta_s,GEO_chi2 - !enddo - !close(1) - !call GEO_alloc(0) - - endif + !if (equilibrium_model == 0) then + ! GEO_model_in = 0 + ! GEO_rmin_in = rmin + ! GEO_rmaj_in = rmaj + ! GEO_drmaj_in = shift + ! GEO_zmag_in = zmag + ! GEO_dzmag_in = dzmag + ! GEO_q_in = q + ! GEO_s_in = s + ! GEO_kappa_in = kappa + ! GEO_s_kappa_in = s_kappa + ! GEO_delta_in = delta + ! GEO_s_delta_in = s_delta + ! GEO_zeta_in = zeta + ! GEO_s_zeta_in = s_zeta + ! GEO_beta_star_in = beta_star + ! call GEO_alloc(1) + ! call GEO_do() + !call GEO_interp(nt,tb(:,1),.false.) + !do i=1,nt + ! print *, tb(i,1), btor(i,1), GEO_bt(i), bpol(i,1), GEO_bp(i) + !enddo + !close(1) + !call GEO_alloc(0) + !endif !-------------------------------------------------------------------- deallocate(sys_m)