Skip to content

Commit

Permalink
LE3: fixing Btor and adding to output
Browse files Browse the repository at this point in the history
  • Loading branch information
bellie committed Jan 10, 2025
1 parent 8a2358b commit 3aeb188
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 37 deletions.
2 changes: 1 addition & 1 deletion le3/src/le3_geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
10 changes: 4 additions & 6 deletions le3/src/le3_geometry_matrix.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(:,:)

Expand All @@ -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)
Expand Down
56 changes: 26 additions & 30 deletions le3/src/le3_geometry_rho.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3aeb188

Please sign in to comment.