From 8b0e1eed463e121200e46b01612a47f946787317 Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Fri, 12 Feb 2021 16:00:40 +0100
Subject: [PATCH] typo

---
 matlab/create_gif_5D.m | 66 +++++++++++++++++++++++++++++++++++++++++
 matlab/write_sbash.m   |  3 +-
 src/closure_mod.F90    | 67 +++++++++++++++++++++++++++++-------------
 src/grid_mod.F90       | 12 +++++---
 src/inital.F90         | 10 +++----
 src/memory.F90         | 11 +++----
 src/stepon.F90         |  7 +++--
 wk/analysis_2D.m       | 50 ++++---------------------------
 wk/local_run.m         | 10 +++----
 wk/marconi_run.m       | 11 +++----
 10 files changed, 153 insertions(+), 94 deletions(-)
 create mode 100644 matlab/create_gif_5D.m

diff --git a/matlab/create_gif_5D.m b/matlab/create_gif_5D.m
new file mode 100644
index 00000000..c8646c7a
--- /dev/null
+++ b/matlab/create_gif_5D.m
@@ -0,0 +1,66 @@
+
+GIFNAME = ['Nipj_kr',sprintf('_%.2d',JOBNUM)]; INTERP = 0;
+plt = @(x) squeeze(max((abs(x)),[],4));
+FIELD = plt(Nipj); X = kr'; Y = Pi'; T = Ts5D; FRAMES = FRAMES_5D;
+FIELDNAME = 'N_i'; XNAME = '$k_{max}\rho_s$'; YNAME = '$P$';
+
+title1 = GIFNAME;
+FIGDIR = BASIC.RESDIR;
+GIFNAME = [FIGDIR, GIFNAME,'.gif'];
+
+sz = size(FIELD);
+
+% Setup figure frame
+fig  = figure('Color','white','Position', [100, 100, sz(2)*400, 400]);
+    for ij_ = 1:sz(2)
+    subplot(100+sz(2)*10+ij_)
+        pclr = imagesc(X,Y,squeeze(FIELD(:,ij_,:,1)));
+        xlabel('$k_r$');
+        if ij_ == 1
+            ylabel('$P$(max o. $k_z$)');
+        else
+            yticks([])
+        end
+        LEGEND = ['$|',FIELDNAME,'^{p',num2str(ij_-1),'}|$']; title(LEGEND);
+    end
+    colormap gray
+    axis tight manual % this ensures that getframe() returns a consistent size
+    in      = 1;
+    nbytes = fprintf(2,'frame %d/%d',in,numel(FIELD(1,1,1,:)));
+    for n = FRAMES % loop over selected frames
+        scale = max(max(max(abs(FIELD(:,:,:,n)))));
+        for ij_ = 1:sz(2)
+            subplot(100+sz(2)*10+ij_)
+            pclr = imagesc(X,Y,squeeze(FIELD(:,ij_,:,n))/scale);
+            xlabel(XNAME);
+            if ij_ == 1
+                ylabel(YNAME);
+            else
+                yticks([])
+            end
+            LEGEND = ['$|',FIELDNAME,'^{p',num2str(ij_-1),'}|$']; title(LEGEND);
+        end
+        suptitle(['$t \approx$', sprintf('%.3d',ceil(T(n)))...
+            ,', scaling = ',sprintf('%.1e',scale)]);
+        drawnow 
+        % Capture the plot as an image 
+        frame = getframe(fig); 
+        im = frame2im(frame); 
+        [imind,cm] = rgb2ind(im,32); 
+        % Write to the GIF File 
+        if in == 1 
+          imwrite(imind,cm,GIFNAME,'gif', 'Loopcount',inf); 
+        else 
+          imwrite(imind,cm,GIFNAME,'gif','WriteMode','append', 'DelayTime',DELAY); 
+        end 
+        % terminal info
+        while nbytes > 0
+          fprintf('\b')
+          nbytes = nbytes - 1;
+        end
+        nbytes = fprintf(2,'frame %d/%d',n,numel(FIELD(1,1,1,:)));
+        in = in + 1;
+    end
+    disp(' ')
+    disp(['Gif saved @ : ',GIFNAME])
+
diff --git a/matlab/write_sbash.m b/matlab/write_sbash.m
index 69556df6..14505251 100644
--- a/matlab/write_sbash.m
+++ b/matlab/write_sbash.m
@@ -34,7 +34,8 @@ fprintf(fid,[...
 '#SBATCH --error=err.txt\n',...
 '#SBATCH --output=out.txt\n',...
 '#SBATCH --account=FUA34_GBSedge\n',...
-'#SBATCH --partition=skl_fua_',CLUSTER.PART,'\n\n',...
+'#SBATCH --partition=skl_fua_',CLUSTER.PART,'\n',...
+'#SBATCH --qos=skl_qos_fualowprio\n\n',...
 ...% '#SBATCH --job-name=',PARAMS,'\n\n',...
 'module load intel\n',...
 'module load intelmpi\n',...
diff --git a/src/closure_mod.F90 b/src/closure_mod.F90
index f5dcc433..9c1ddef5 100644
--- a/src/closure_mod.F90
+++ b/src/closure_mod.F90
@@ -15,31 +15,56 @@ CONTAINS
   SUBROUTINE apply_closure_model
     IMPLICIT NONE
 
-
     ! Negative out of bounds indices are put to zero (analytically correct)
-    moments_e(ips_e-1,:,:,:,:) = 0._dp
-    moments_e(ips_e-2,:,:,:,:) = 0._dp
-    moments_e(:,ijs_e-1,:,:,:) = 0._dp
-    kernel_e(ijs_e-1,:,:)      = 0._dp
-
-    moments_i(ips_i-1,:,:,:,:) = 0._dp
-    moments_i(ips_i-2,:,:,:,:) = 0._dp
-    moments_i(:,ijs_i-1,:,:,:) = 0._dp
-    kernel_i(ijs_i-1,:,:)      = 0._dp
-
+    DO ikr = ikrs,ikre
+      DO ikz = ikzs,ikze
+
+        DO ip = ipsg_e,ipeg_e
+          moments_e(ip,ijs_e-1,ikr,ikz,:) = 0._dp
+        ENDDO
+        DO ij = ijsg_e,ijeg_e
+          moments_e(ips_e-1,ij,ikr,ikz,:) = 0._dp
+          moments_e(ips_e-2,ij,ikr,ikz,:) = 0._dp
+        ENDDO
+        kernel_e(ijs_e-1,ikr,ikz)      = 0._dp
+
+        DO ip = ipsg_i,ipeg_i
+          moments_i(ip,ijs_i-1,ikr,ikz,:) = 0._dp
+        ENDDO
+        DO ij = ijsg_i,ijeg_i
+          moments_i(ips_i-1,ij,ikr,ikz,:) = 0._dp
+          moments_i(ips_i-2,ij,ikr,ikz,:) = 0._dp
+        ENDDO
+        kernel_i(ijs_i-1,ikr,ikz)      = 0._dp
+
+      ENDDO
+    ENDDO
     ! Positive Oob indices are approximated with a model
     IF (CLOS .EQ. 0) THEN
       ! zero truncation, An+1=0 for n+1>nmax
-      moments_e(ipe_e+1,:,:,:,:) = 0._dp
-      moments_e(ipe_e+2,:,:,:,:) = 0._dp
-      moments_e(:,ije_e+1,:,:,:) = 0._dp
-      kernel_e(ije_e+1,:,:)      = 0._dp
-
-      moments_i(ipe_i+1,:,:,:,:) = 0._dp
-      moments_i(ipe_i+2,:,:,:,:) = 0._dp
-      moments_i(:,ije_i+1,:,:,:) = 0._dp
-      kernel_i(ije_i+1,:,:)      = 0._dp
-
+      DO ikr = ikrs,ikre
+        DO ikz = ikzs,ikze
+
+          DO ip = ipsg_e,ipeg_e
+            moments_e(ip,ije_e+1,ikr,ikz,:) = 0._dp
+          ENDDO
+          DO ij = ijsg_e,ijeg_e
+            moments_e(ipe_e+1,ij,ikr,ikz,:) = 0._dp
+            moments_e(ipe_e+2,ij,ikr,ikz,:) = 0._dp
+          ENDDO
+          kernel_e(ije_e+1,ikr,ikz)      = 0._dp
+
+          DO ip = ipsg_i,ipeg_i
+            moments_i(ip,ije_i+1,ikr,ikz,:) = 0._dp
+          ENDDO
+          DO ij = ijsg_i,ijeg_i
+            moments_i(ipe_i+1,ij,ikr,ikz,:) = 0._dp
+            moments_i(ipe_i+2,ij,ikr,ikz,:) = 0._dp
+          ENDDO
+          kernel_i(ije_i+1,ikr,ikz)      = 0._dp
+          
+        ENDDO
+      ENDDO
 
     ELSEIF (CLOS .EQ. 1) THEN
       ! Copy truncation with n+1 = min(nmax,n+1)
diff --git a/src/grid_mod.F90 b/src/grid_mod.F90
index 1bf34538..78f88e22 100644
--- a/src/grid_mod.F90
+++ b/src/grid_mod.F90
@@ -52,7 +52,7 @@ MODULE grid
   INTEGER,  DIMENSION(:), ALLOCATABLE, PUBLIC :: jarray_i
   INTEGER, PUBLIC, PROTECTED ::  ips_e,ipe_e, ijs_e,ije_e ! Start and end indices for pol. deg.
   INTEGER, PUBLIC, PROTECTED ::  ips_i,ipe_i, ijs_i,ije_i
-  INTEGER, PUBLIC, PROTECTED ::  ipsg_e,ipeg_e, ijsg_e,ijeg_e ! Ghosts start and end
+  INTEGER, PUBLIC, PROTECTED ::  ipsg_e,ipeg_e, ijsg_e,ijeg_e ! Ghosts start and end indices
   INTEGER, PUBLIC, PROTECTED ::  ipsg_i,ipeg_i, ijsg_i,ijeg_i
   ! Public Functions
   PUBLIC :: init_1Dgrid_distr
@@ -85,11 +85,10 @@ CONTAINS
     DO ip = ips_e,ipe_e; parray_e(ip) = (ip-1); END DO
     DO ip = ips_i,ipe_i; parray_i(ip) = (ip-1); END DO
       
-    ! Ghosts indices
+    ! Ghosts boundaries
     ipsg_e = ips_e - 2; ipeg_e = ipe_e + 2;
-    ijsg_e = ijs_e - 1; ijeg_e = ije_e + 1;
     ipsg_i = ips_i - 2; ipeg_i = ipe_i + 2;
-    ijsg_i = ijs_i - 1; ijeg_i = ije_i + 1;
+    
   END SUBROUTINE set_pgrid
 
   SUBROUTINE set_jgrid
@@ -103,8 +102,13 @@ CONTAINS
     ALLOCATE(jarray_i(ijs_i:ije_i))
     DO ij = ijs_e,ije_e; jarray_e(ij) = ij-1; END DO
     DO ij = ijs_i,ije_i; jarray_i(ij) = ij-1; END DO
+
     maxj  = MAX(jmaxi, jmaxe)
 
+    ! Ghosts boundaries
+    ijsg_e = ijs_e - 1; ijeg_e = ije_e + 1;
+    ijsg_i = ijs_i - 1; ijeg_i = ije_i + 1;
+    
   END SUBROUTINE set_jgrid
 
 
diff --git a/src/inital.F90 b/src/inital.F90
index c1f376af..d3ad1c45 100644
--- a/src/inital.F90
+++ b/src/inital.F90
@@ -46,9 +46,9 @@ SUBROUTINE inital
     IF (my_id .EQ. 0) WRITE(*,*) '..done'
   ENDIF
 
-  IF (my_id .EQ. 0) WRITE(*,*) 'Set closure model..'
-  CALL apply_closure_model
-  IF (my_id .EQ. 0) WRITE(*,*) '..done'
+  ! IF (my_id .EQ. 0) WRITE(*,*) 'Set closure model..'
+  ! CALL apply_closure_model
+  ! IF (my_id .EQ. 0) WRITE(*,*) '..done'
 
 END SUBROUTINE inital
 !******************************************************************************!
@@ -81,7 +81,7 @@ SUBROUTINE init_moments
         DO ikr=ikrs,ikre
           DO ikz=ikzs,ikze
             CALL RANDOM_NUMBER(noise)
-            moments_e( ip,ij,     ikr,    ikz, :) = (initback_moments + initnoise_moments*(noise-0.5_dp))
+            moments_e( ip,ij, ikr,ikz, :) = (initback_moments + initnoise_moments*(noise-0.5_dp))
           END DO
         END DO
 
@@ -100,7 +100,7 @@ SUBROUTINE init_moments
         DO ikr=ikrs,ikre
           DO ikz=ikzs,ikze
             CALL RANDOM_NUMBER(noise)
-            moments_i( ip,ij,ikr,ikz, :) = (initback_moments + initnoise_moments*(noise-0.5_dp))
+            moments_i( ip,ij, ikr,ikz, :) = (initback_moments + initnoise_moments*(noise-0.5_dp))
           END DO
         END DO
 
diff --git a/src/memory.F90 b/src/memory.F90
index 9b8f8d8c..cf51beaa 100644
--- a/src/memory.F90
+++ b/src/memory.F90
@@ -11,19 +11,20 @@ SUBROUTINE memory
   USE prec_const
   IMPLICIT NONE
 
-  ! Moments and moments rhs
+  ! Moments with ghost degrees for p+2 p-2, j+1, j-1 truncations
   CALL allocate_array(     moments_e, ipsg_e,ipeg_e, ijsg_e,ijeg_e, ikrs,ikre, ikzs,ikze, 1,ntimelevel )
   CALL allocate_array(     moments_i, ipsg_i,ipeg_i, ijsg_i,ijeg_i, ikrs,ikre, ikzs,ikze, 1,ntimelevel )
+
+  ! Moments right-hand-side (contains linear part of hierarchy)
   CALL allocate_array( moments_rhs_e, ips_e,ipe_e, ijs_e,ije_e, ikrs,ikre, ikzs,ikze, 1,ntimelevel )
   CALL allocate_array( moments_rhs_i, ips_i,ipe_i, ijs_i,ije_i, ikrs,ikre, ikzs,ikze, 1,ntimelevel )
 
   ! Electrostatic potential
   CALL allocate_array(phi, ikrs,ikre, ikzs,ikze)
 
-  ! Electron kernel evaluation from ij=0 to jmax+1 for truncation
-  CALL allocate_array(Kernel_e, ijs_e-1,ije_e+1, ikrs,ikre, ikzs,ikze)
-  ! Ion kernel evaluation
-  CALL allocate_array(Kernel_i, ijs_i-1,ije_i+1, ikrs,ikre, ikzs,ikze)
+  ! Kernel evaluation from j= -1 to jmax+1 for truncation
+  CALL allocate_array(Kernel_e, ijsg_e,ijeg_e, ikrs,ikre, ikzs,ikze)
+  CALL allocate_array(Kernel_i, ijsg_i,ijeg_i, ikrs,ikre, ikzs,ikze)
 
   ! Collision matrix
   IF (CO .EQ. -1) THEN
diff --git a/src/stepon.F90 b/src/stepon.F90
index 2cfecf37..ac3110d4 100644
--- a/src/stepon.F90
+++ b/src/stepon.F90
@@ -17,6 +17,10 @@ SUBROUTINE stepon
   LOGICAL :: mlend
 
    DO num_step=1,ntimelevel ! eg RK4 compute successively k1, k2, k3, k4
+  
+      ! Closure enforcement
+      CALL apply_closure_model
+      
       ! Compute right hand side of moments hierarchy equation
       CALL moments_eq_rhs_e
       CALL moments_eq_rhs_i
@@ -39,9 +43,6 @@ SUBROUTINE stepon
         ENDDO
       ENDDO
 
-      ! Closure enforcement
-      CALL apply_closure_model
-
       ! Execution time end
       CALL cpu_time(t1_adv_field)
       tc_adv_field = tc_adv_field + (t1_adv_field - t0_adv_field)
diff --git a/wk/analysis_2D.m b/wk/analysis_2D.m
index 0997be50..825ade8c 100644
--- a/wk/analysis_2D.m
+++ b/wk/analysis_2D.m
@@ -2,39 +2,7 @@
 if 0
     %%
     outfile ='';
-% nu = 0.5
-    %   Eta = 0.5
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_2_J_1_eta_0.5_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_4_J_2_eta_0.5_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_6_J_3_eta_0.5_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-    %   Eta = 0.6
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_2_J_1_eta_0.6_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_4_J_2_eta_0.6_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_6_J_3_eta_0.6_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_5e-01/150x75_L_100_P_8_J_4_eta_0.6_nu_5e-01_DGGK_CLOS_0_mu_3e-03/out.txt';
-
-% nu = 1.0
-    %   Eta = 0.5
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/150x75_L_100_P_2_J_1_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/150x75_L_100_P_4_J_2_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/150x75_L_100_P_6_J_3_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/200x100_L_100_P_2_J_1_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/200x100_L_100_P_4_J_2_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/200x100_L_100_P_6_J_3_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/200x100_L_100_P_8_J_4_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/300x150_L_100_P_2_J_1_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_2e-04/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/300x150_L_100_P_4_J_2_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_2e-04/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.5_nu_1e+00/300x150_L_100_P_6_J_3_eta_0.5_nu_1e+00_DGGK_CLOS_0_mu_2e-04/out.txt';
-
-    %   Eta = 0.6
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.6_nu_1e+00/200x100_L_100_P_2_J_1_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/200x100_L_100_P_4_J_2_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_eta_0.6_nu_1e+00/200x100_L_100_P_6_J_3_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_1e-03/out.txt'; %     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/150x75_L_100_P_8_J_4_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/150x75_L_100_P_8_J_4_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-%     outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/150x75_L_100_P_8_J_5_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
-    outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_DGGK_nu_1e+00/150x75_L_100_P_10_J_5_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_3e-03/out.txt';
+    outfile ='/marconi_scratch/userexternal/ahoffman/HeLaZ/results/Marconi_restart/150x75_L_70_P_2_J_1_eta_0.6_nu_1e+00_DGGK_CLOS_0_mu_8e-04/out.txt';
 
     BASIC.RESDIR = load_marconi(outfile);
 end
@@ -281,7 +249,7 @@ save_figure
 end
 
 %%
-if 1
+if 0
 %% Show frame in kspace
 tf = 0; [~,it2] = min(abs(Ts2D-tf)); [~,it5] = min(abs(Ts5D-tf));
 fig = figure; FIGNAME = ['krkz_',sprintf('t=%.0f',Ts2D(it2))];set(gcf, 'Position',  [100, 100, 700, 600])
@@ -291,9 +259,9 @@ fig = figure; FIGNAME = ['krkz_',sprintf('t=%.0f',Ts2D(it2))];set(gcf, 'Position
     subplot(222); plt = @(x) fftshift(abs(x),2);
         pclr = pcolor(fftshift(KR,2),fftshift(KZ,2),plt(Ni00(:,:,it2))); set(pclr, 'edgecolor','none'); colorbar;
         xlabel('$k_r$'); ylabel('$k_z$'); legend('$|\hat n_i^{00}|$');
-    subplot(223); plt = @(x) fftshift((abs(x)),2); FIELD = squeeze(Nipj(1,1,:,:,:));
+    subplot(223); plt = @(x) fftshift((abs(x)),2); FIELD = squeeze(Nipj(1,2,:,:,:));
         pclr = pcolor(fftshift(KR,2),fftshift(KZ,2),plt(FIELD(:,:,it5))); set(pclr, 'edgecolor','none'); colorbar;
-        xlabel('$k_r$'); ylabel('$k_z$'); legend('$|\hat n_i^{pj=00}|$');
+        xlabel('$k_r$'); ylabel('$k_z$'); legend('$|\hat n_i^{pj=01}|$');
     subplot(224); plt = @(x) fftshift((abs(x)),2);
         pclr = pcolor(fftshift(KR,2),fftshift(KZ,2),plt(Si00(:,:,it5))); set(pclr, 'edgecolor','none'); colorbar;
         xlabel('$k_r$'); ylabel('$k_z$');legend('$\hat S_i^{00}$');
@@ -304,7 +272,7 @@ end
 if 1
 %% Ion moments max mode vs pj
 % tf = Ts2D(end-3); 
-for tf = [0]
+for tf = [0,1]
 [~,it2] = min(abs(Ts2D-tf)); [~,it5] = min(abs(Ts5D-tf));
 % it2 = it2 + 1;
 fig = figure; FIGNAME = ['kmaxp_Nipj_',sprintf('t=%.2f',Ts2D(it2))];set(gcf, 'Position',  [100, 100, 700, 600])
@@ -386,14 +354,6 @@ X = (kz); T = Ts2D; YMIN = -.1; YMAX = 1.1; XMIN = min(kz); XMAX = max(kz);
 FIELDNAME = '$N_i^{00}(kr=0)$'; XNAME = '$k_r\rho_s$';
 create_gif_1D
 end
-if 1
-%% kr vs P Ni
-GIFNAME = ['Nip0_kr',sprintf('_%.2d',JOBNUM)]; INTERP = 0;
-plt = @(x) squeeze(max((abs(x)),[],4));
-FIELD =plt(Nipj(:,1,:,:,:)); X = kr'; Y = Pi'; T = Ts5D; FRAMES = FRAMES_5D;
-FIELDNAME = '$N_i^{p0}$'; XNAME = '$k_{max}\rho_s$'; YNAME = '$P$';
-create_gif_imagesc
-end
 if 0
 %% kr vs P Si
 GIFNAME = ['Sip0_kr',sprintf('_%.2d',JOBNUM)]; INTERP = 0;
diff --git a/wk/local_run.m b/wk/local_run.m
index 333f9d01..377fd3ec 100644
--- a/wk/local_run.m
+++ b/wk/local_run.m
@@ -4,7 +4,7 @@ addpath(genpath('../matlab')) % ... add
 CLUSTER.TIME  = '99:00:00'; % allocation time hh:mm:ss
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% PHYSICAL PARAMETERS
-NU      = 0.0;   % Collision frequency
+NU      = 1.0;   % Collision frequency
 TAU     = 1.0;    % e/i temperature ratio
 ETAB    = 0.6;    % Magnetic gradient
 ETAN    = 1.0;    % Density gradient
@@ -19,14 +19,14 @@ JMAXE   = 1;     % Highest ''       Laguerre ''
 PMAXI   = 2;     % Highest ion      Hermite polynomial degree
 JMAXI   = 1;     % Highest ''       Laguerre ''
 %% TIME PARAMETERS
-TMAX    = 60;  % Maximal time unit
+TMAX    = 50;  % Maximal time unit
 DT      = 1e-2;   % Time step
 SPS0D   = 1;    % Sampling per time unit for profiler
 SPS2D   = 1;      % Sampling per time unit for 2D arrays
 SPS5D   = 1;    % Sampling per time unit for 5D arrays
-SPSCP   = 1;    % Sampling per time unit for checkpoints/10
-RESTART = 1;      % To restart from last checkpoint
-JOB2LOAD= 1;
+SPSCP   = 1/10;    % Sampling per time unit for checkpoints/10
+RESTART = 0;      % To restart from last checkpoint
+JOB2LOAD= 0;
 %% OPTIONS
 % SIMID   = 'local_nu_%0.0e';  % Name of the simulation
 % SIMID   = sprintf(SIMID,NU);
diff --git a/wk/marconi_run.m b/wk/marconi_run.m
index 60c4d176..394387bc 100644
--- a/wk/marconi_run.m
+++ b/wk/marconi_run.m
@@ -8,7 +8,7 @@ CLUSTER.TIME  = '01:00:00'; % allocation time hh:mm:ss
 CLUSTER.NODES = '1';        % MPI process
 CLUSTER.CPUPT = '1';        % CPU per task
 CLUSTER.NTPN  = '8';       % N tasks per node
-CLUSTER.PART  = 'dbg';     % dbg or prod
+CLUSTER.PART  = 'prod';     % dbg or prod
 CLUSTER.MEM   = '16GB';     % Memory
 CLUSTER.JNAME = 'gamma_inf';% Job name
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -19,8 +19,8 @@ NU_HYP  = 0.1;   % Hyperdiffusivity coefficient
 %% GRID PARAMETERS
 N       = 150;     % Frequency gridpoints (Nkr = N/2)
 L       = 70;     % Size of the squared frequency domain
-P       = 4;       % Electron and Ion highest Hermite polynomial degree
-J       = 2;       % Electron and Ion highest Laguerre polynomial degree
+P       = 2;       % Electron and Ion highest Hermite polynomial degree
+J       = 1;       % Electron and Ion highest Laguerre polynomial degree
 %% TIME PARAMETERS
 TMAX    = 500;  % Maximal time unit
 DT      = 2e-2;  % Time step
@@ -29,9 +29,10 @@ SPS2D   = 1/2;   % Sampling per time unit for 2D arrays
 SPS5D   = 1/10;  % Sampling per time unit for 5D arrays
 SPSCP   = 1/10;  % Sampling per time unit for checkpoints
 RESTART = 0;     % To restart from last checkpoint
-JOB2LOAD= 1;
+JOB2LOAD= 0;
 %% OPTIONS
-SIMID   = 'Marconi_DGGK_nu_%0.0e';  % Name of the simulation
+% SIMID   = 'Marconi_DGGK_nu_%0.0e';  % Name of the simulation
+SIMID   = 'Marconi_restart';  % Name of the simulation
 SIMID   = sprintf(SIMID,NU);
 CO      = -3;  % Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty, -3 : GK Dougherty)
 CLOS    = 0;   % Closure model (0 : =0 truncation, 1 : n+j = min(nmax,n+j), 2: odd/even adapted)
-- 
GitLab