From 6747c30adba55ca6b7bfc03b9cf56bc52f198c33 Mon Sep 17 00:00:00 2001
From: Antoine Hoffmann <antoine.hoffmann@epfl.ch>
Date: Thu, 30 Jun 2022 18:05:16 +0200
Subject: [PATCH] small update

---
 matlab/plot/plot_ballooning.m | 5 +++--
 src/diagnose.F90              | 2 --
 src/geometry_mod.F90          | 5 -----
 wk/analysis_HeLaZ.m           | 8 ++++----
 wk/analysis_gene.m            | 7 ++++---
 wk/header_3D_results.m        | 4 +++-
 wk/quick_run.m                | 5 ++---
 7 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/matlab/plot/plot_ballooning.m b/matlab/plot/plot_ballooning.m
index 435573a6..b34731e2 100644
--- a/matlab/plot/plot_ballooning.m
+++ b/matlab/plot/plot_ballooning.m
@@ -5,12 +5,13 @@ function [FIG] = plot_ballooning(data,options)
     [~,ikyarray] = min(abs(data.ky - options.kymodes));
     phi_real=mean(real(data.PHI(:,:,:,it0:it1)),4);
     phi_imag=mean(imag(data.PHI(:,:,:,it0:it1)),4);
+    
     % Apply baollooning tranform
     for iky=ikyarray
         dims = size(phi_real);
 
-        if options.sheared
-            idx = -Nkx:1:Nkx;
+        if data.SHEAR > 0
+            idx=[0:data.Nkx/2 -(data.Nkx/2-1):-1];
             ikxlim = dims(2);
         else
             idx = 0;
diff --git a/src/diagnose.F90 b/src/diagnose.F90
index 56afa412..50a0042b 100644
--- a/src/diagnose.F90
+++ b/src/diagnose.F90
@@ -179,11 +179,9 @@ SUBROUTINE diagnose_full(kstep)
        ENDIF
      ENDIF
      IF (write_hf) THEN
-       CALL creatd(fidres, rank, dims, "/data/var0d/hflux_xi", "Radial part ion heat flux")
        CALL creatd(fidres, rank, dims, "/data/var0d/hflux_xi", "Radial part ion heat flux")
        IF(KIN_E) THEN
        CALL creatd(fidres, rank, dims, "/data/var0d/hflux_xe", "Radial part electron heat flux")
-       CALL creatd(fidres, rank, dims, "/data/var0d/hflux_xe", "Radial part electron heat flux")
        ENDIF
      ENDIF
      IF (cstep==0) THEN
diff --git a/src/geometry_mod.F90 b/src/geometry_mod.F90
index ad36cc5c..f2765097 100644
--- a/src/geometry_mod.F90
+++ b/src/geometry_mod.F90
@@ -284,11 +284,6 @@ CONTAINS
    !2   ky       | 8    1    2    3    4    5   -1   -1|
    !1   A        | 7    8    1    2    3    4    5   -1|
    !0   | -> kx  | 6____7____8____1____2____3____4____5|
-   ! map for periodic BC
-   !3            | 1    2    3    4    5   -1   -1   -1|
-   !2   ky       | 8    1    2    3    4    5   -1   -1|
-   !1   A        | 7    8    1    2    3    4    5   -1|
-   !0   | -> kx  | 6____7____8____1____2____3____4____5|
    ALLOCATE(ikx_zBC_map(ikys:ikye,ikxs:ikxe))
    ikx_zBC_map(ikys:ikye,ikxs:ikxe) = -1
    DO iky = ikys,ikye
diff --git a/wk/analysis_HeLaZ.m b/wk/analysis_HeLaZ.m
index 6e3e6ef0..942bd849 100644
--- a/wk/analysis_HeLaZ.m
+++ b/wk/analysis_HeLaZ.m
@@ -50,12 +50,12 @@ options.NAME      = '\phi';
 % options.NAME      = 'n_i^{NZ}';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'n_i';
-options.PLAN      = 'xz';
+options.PLAN      = 'xy';
 % options.NAME      = 'f_i';
 % options.PLAN      = 'sx';
 options.COMP      = 1;
 % options.TIME      = data.Ts5D(end-30:end);
-options.TIME      = data.Ts3D;
+options.TIME      = [0:500];
 % options.TIME      = [350:600];
 data.EPS          = 0.1;
 data.a = data.EPS * 2000;
@@ -74,10 +74,10 @@ options.NAME      = '\phi';
 % options.NAME      = 'T_i';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'k^2n_e';
-options.PLAN      = 'kxky';
+options.PLAN      = 'xy';
 % options.NAME      'f_i';
 % options.PLAN      = 'sx';
-options.COMP      = 33;
+options.COMP      = 1;
 options.TIME      = [40 80 100 200];
 data.a = data.EPS * 2e3;
 fig = photomaton(data,options);
diff --git a/wk/analysis_gene.m b/wk/analysis_gene.m
index ca1269d1..4f19bd12 100644
--- a/wk/analysis_gene.m
+++ b/wk/analysis_gene.m
@@ -1,6 +1,6 @@
 % folder = '/misc/gene_results/shearless_cyclone/miller_output_1.0/';
 % folder = '/misc/gene_results/shearless_cyclone/miller_output_0.8/';
-folder = '/misc/gene_results/shearless_cyclone/s_alpha_output_1.2/';
+% folder = '/misc/gene_results/shearless_cyclone/s_alpha_output_1.2/';
 % folder = '/misc/gene_results/shearless_cyclone/rm_corrections_HF/';
 % folder = '/misc/gene_results/shearless_cyclone/linear_s_alpha_CBC_100/';
 % folder = '/misc/gene_results/shearless_cyclone/s_alpha_output_0.5/';
@@ -9,6 +9,7 @@ folder = '/misc/gene_results/shearless_cyclone/s_alpha_output_1.2/';
 % folder = '/misc/gene_results/HP_fig_2b_mu_5e-2/';
 % folder = '/misc/gene_results/HP_fig_2c_mu_5e-2/';
 % folder = '/misc/gene_results/LD_zpinch_1.6/';
+folder = '/misc/gene_results/ZP_16x8_kn_1.6_00/';
 gene_data = load_gene_data(folder);
 gene_data = invert_kxky_to_kykx_gene_results(gene_data);
 if 1
@@ -40,7 +41,7 @@ options.NAME      = '\phi';
 % options.NAME      = 'T_i';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'k^2n_e';
-options.PLAN      = 'xz';
+options.PLAN      = 'xy';
 % options.NAME      ='f_e';
 % options.PLAN      = 'sx';
 options.COMP      = 'avg';
@@ -60,7 +61,7 @@ options.NAME      = '\phi';
 % options.NAME      = 'n_i^{NZ}';
 % options.NAME      = '\Gamma_x';
 % options.NAME      = 'n_i';
-options.PLAN      = 'xz';
+options.PLAN      = 'xy';
 % options.NAME      = 'f_e';
 % options.PLAN      = 'sx';
 options.COMP      = 'avg';
diff --git a/wk/header_3D_results.m b/wk/header_3D_results.m
index 07fbb41f..fda0a9d0 100644
--- a/wk/header_3D_results.m
+++ b/wk/header_3D_results.m
@@ -14,7 +14,7 @@ helazdir = '/home/ahoffman/HeLaZ/';
 % outfile = 'volcokas/64x32x16x5x3_kin_e_npol_1';
 % outfile = 'shearless_cyclone/64x32x80x5x3_CBC_Npol_5_kine';
 % outfile = 'shearless_cyclone/96x32x160x5x3_CBC_Npol_10_kine';
-outfile = 'shearless_cyclone/64x32x160x5x3_CBC_Npol_10_kine';
+% outfile = 'shearless_cyclone/64x32x160x5x3_CBC_Npol_10_kine';
 %% CBC
 % outfile ='shearless_cyclone/64x32x16x5x3_CBC_080';
 % outfile ='shearless_cyclone/64x32x16x5x3_CBC_scan/64x32x16x5x3_CBC_100';
@@ -25,5 +25,7 @@ outfile = 'shearless_cyclone/64x32x160x5x3_CBC_Npol_10_kine';
 % outfile ='shearless_cyclone/64x32x16x9x5_CBC_120';
 
 % outfile = 'shearless_cyclone/64x32x16x5x3_CBC_CO/64x32x16x5x3_CBC_LRGK';
+%% ZPINCH
+outfile ='Zpinch_rerun/Kn_2.0_200x48x5x3';
 
 run analysis_HeLaZ
diff --git a/wk/quick_run.m b/wk/quick_run.m
index efb966ed..4ae97e8a 100644
--- a/wk/quick_run.m
+++ b/wk/quick_run.m
@@ -28,7 +28,7 @@ JMAXI   = 2;     % "
 NX      = 20;    % real space x-gridpoints
 NY      = 2;     %     ''     y-gridpoints
 LX      = 100;   % Size of the squared frequency domain
-LY      = 20;     % Size of the squared frequency domain
+LY      = 62.8319;     % Size of the squared frequency domain
 NZ      = 32;     % number of perpendicular planes (parallel grid)
 NPOL    = 1;
 SG      = 0;     % Staggered z grids option
@@ -113,10 +113,9 @@ end
 
 if 0
 %% Ballooning plot
-options.time_2_plot = [0.9 1]*data.Ts3D(end);
+options.time_2_plot = [0.5 0.5]*data.Ts3D(end);
 options.kymodes     = [0.5];
 options.normalized  = 1;
-options.sheared     = 0;
 options.field       = 'phi';
 fig = plot_ballooning(data,options);
 end
-- 
GitLab