From b1ee01a2fd71d87b507a20e1fd6bef576cd66309 Mon Sep 17 00:00:00 2001
From: Antoine Hoffmann <antoine.hoffmann@epfl.ch>
Date: Tue, 7 Feb 2023 19:03:58 +0100
Subject: [PATCH] s-alpha correction of dBdx term

---
 src/geometry_mod.F90 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/geometry_mod.F90 b/src/geometry_mod.F90
index 7b41ffbf..3ee87a0d 100644
--- a/src/geometry_mod.F90
+++ b/src/geometry_mod.F90
@@ -152,9 +152,9 @@ CONTAINS
       ENDDO
       ! Curvature operator (Frei et al. 2022 eq 2.15)
       DO iz = izgs,izge
-        G1 = gxy(iz,eo)*gxy(iz,eo)-gxx(iz,eo)*gyy(iz,eo)
-        G2 = gxy(iz,eo)*gxz(iz,eo)-gxx(iz,eo)*gyz(iz,eo)
-        G3 = gyy(iz,eo)*gxz(iz,eo)-gxy(iz,eo)*gyz(iz,eo)
+        G1 = gxx(iz,eo)*gyy(iz,eo)-gxy(iz,eo)*gxy(iz,eo)
+        G2 = gxx(iz,eo)*gyz(iz,eo)-gxy(iz,eo)*gxz(iz,eo)
+        G3 = gxy(iz,eo)*gyz(iz,eo)-gyy(iz,eo)*gxz(iz,eo)
         ! Here we divide by hatB because our equation is formulated with grad(lnB) terms (not gradB like in GENE)
         Cx =-(dBdy(iz,eo) + G2/G1*dBdz(iz,eo))/hatB(iz,eo)
         Cy = (dBdx(iz,eo) - G3/G1*dBdz(iz,eo))/hatB(iz,eo)
@@ -170,9 +170,9 @@ CONTAINS
         gradz_coeff(iz,eo) = 1._dp /(jacobian(iz,eo)*hatB(iz,eo))
 
         ! Nonlinear term prefactor
-        Gamma_NL(iz,eo)    = 1._dp ! = G1
+        Gamma_NL(iz,eo)    = G1 !=1._dp
         ! Geometric factor in front to the maxwellian dzphi term (not implemented)
-        ! Gamma_phipar(iz,eo) = -G2/G1
+        ! Gamma_phipar(iz,eo) = G2/G1
       ENDDO
     ENDDO
 
@@ -227,7 +227,7 @@ CONTAINS
       Jacobian(iz,eo) = q0/hatB(iz,eo)
 
     ! Derivative of the magnetic field strenght
-      dBdx(iz,eo) = -COS(z)*hatB(iz,eo) ! LB = 1
+      dBdx(iz,eo) = -COS(z)*hatB(iz,eo)**2 ! LB = 1
       dBdy(iz,eo) =  0._dp
       dBdz(iz,eo) =  eps*SIN(z)*hatB(iz,eo)**2
 
-- 
GitLab