From b33a417fe2ce3f4cd7ab69ac5eac12cad818b7f9 Mon Sep 17 00:00:00 2001
From: Antoine Cyril David Hoffmann <ahoffman@spcpc606.epfl.ch>
Date: Mon, 2 Nov 2020 15:55:11 +0100
Subject: [PATCH] No more r,z grid bluiding since not used

---
 src/auxval.F90     |  2 --
 src/grid_mod.F90   | 53 ++--------------------------------------------
 wk/parameters_ZP.m | 14 ++++++------
 3 files changed, 9 insertions(+), 60 deletions(-)

diff --git a/src/auxval.F90 b/src/auxval.F90
index c0cb1b6d..e3cfe315 100644
--- a/src/auxval.F90
+++ b/src/auxval.F90
@@ -11,8 +11,6 @@ subroutine auxval
   INTEGER :: irows,irowe, irow, icol
   WRITE(*,*) '=== Set auxiliary values ==='
 
-  CALL set_rgrid
-  CALL set_zgrid
   CALL set_krgrid
   CALL set_kzgrid
   CALL set_pj
diff --git a/src/grid_mod.F90 b/src/grid_mod.F90
index 9c98a1a7..1f9686ee 100644
--- a/src/grid_mod.F90
+++ b/src/grid_mod.F90
@@ -53,7 +53,6 @@ MODULE grid
 
   ! Public Functions
   PUBLIC :: set_pj
-  PUBLIC :: set_rgrid,  set_zgrid
   PUBLIC :: set_krgrid, set_kzgrid
   PUBLIC :: grid_readinputs, grid_outputinputs
   PUBLIC :: bare, bari
@@ -79,54 +78,6 @@ CONTAINS
     maxj  = MAX(jmaxi, jmaxe)
   END SUBROUTINE set_pj
 
-  SUBROUTINE set_rgrid
-    USE prec_const
-    IMPLICIT NONE
-    INTEGER :: ir
-    ! Start and END indices of grid
-    irs = 1
-    ire = Nr
-    ! Grid spacing
-    IF ( Nr .GT. 1 ) THEN ! To avoid case with 0 intervals
-      deltar = Lr / REAL(Nr-1,dp)
-    ELSE
-      deltar = 1;
-    ENDIF
-    ! Discretized r positions ordered as dx*(0 1 2 -3 -2 -1)
-    ALLOCATE(rarray(irs:ire))
-    IF (NR .GT. 1) THEN
-      DO ir = irs,ire
-        rarray(ir) = deltar*(MODULO(ir-1,Nr/2)-Nr/2*FLOOR(2.*real(ir-1)/real(Nr)))
-      END DO
-      rarray(Nr/2+1) = -rarray(Nr/2+1)
-    ELSE
-      rarray(1) = 0._dp
-    ENDIF
-
-  END SUBROUTINE set_rgrid
-
-  SUBROUTINE set_zgrid
-    USE prec_const
-    IMPLICIT NONE
-    INTEGER :: iz
-    ! Start and END indices of grid
-    izs = 1
-    ize = Nr
-    ! Grid spacing
-    IF ( Nz .GT. 1 ) THEN ! To avoid case with 0 intervals
-      deltaz = Lz / REAL(Nz-1,dp)
-    ELSE
-      deltaz = 1;
-    ENDIF
-    ! Discretized r positions ordered as dx*(0 1 2 -3 -2 -1)
-    ALLOCATE(zarray(irs:ire))
-    DO iz = izs,ize
-      zarray(iz) = deltaz*(MODULO(iz-1,Nz/2)-Nz/2*FLOOR(2.*real(iz-1)/real(Nz)))
-    END DO
-    zarray(Nz/2+1) = -zarray(Nz/2+1)
-
-  END SUBROUTINE set_zgrid
-
   SUBROUTINE set_krgrid
     USE prec_const
     IMPLICIT NONE
@@ -137,7 +88,7 @@ CONTAINS
     ikrs = 1
     ikre = Nkr
     ! Grid spacings
-    deltakr = 2._dp*PI/Nr/deltar
+    deltakr = 2._dp*PI/Lr
 
     ! Discretized kr positions ordered as dk*(0 1 2)
     ALLOCATE(krarray(ikrs:ikre))
@@ -170,7 +121,7 @@ CONTAINS
     ikzs = 1
     ikze = Nkz
     ! Grid spacings
-    deltakz = 2._dp*PI/Nkz/deltaz
+    deltakz = 2._dp*PI/Lz
 
     ! Discretized kz positions ordered as dk*(0 1 2 -3 -2 -1)
     ALLOCATE(kzarray(ikzs:ikze))
diff --git a/wk/parameters_ZP.m b/wk/parameters_ZP.m
index 4339223c..cdb5180e 100644
--- a/wk/parameters_ZP.m
+++ b/wk/parameters_ZP.m
@@ -6,27 +6,27 @@ addpath(genpath('../matlab')) % ... add
 %% PHYSICAL PARAMETERS
 NU      = 1e-2;   % Collision frequency
 TAU     = 1.0;    % e/i temperature ratio
-ETAB    = 0.4;    % Magnetic gradient
+ETAB    = 0.5;    % Magnetic gradient
 ETAN    = 1.0;    % Density gradient
 ETAT    = 0.0;    % Temperature gradient
-MU      = 5e-4;   % Hyper diffusivity coefficient
+MU      = 5e-6;   % Hyper diffusivity coefficient
 NOISE0  = 1.0e-5;
 %% GRID PARAMETERS
-N       = 256;     % Frequency gridpoints (Nkr = N/2)
-L       = 66;     % Size of the squared frequency domain
+N       = 32;     % Frequency gridpoints (Nkr = N/2)
+L       = 10;     % Size of the squared frequency domain
 PMAXE   = 2;     % Highest electron Hermite polynomial degree
 JMAXE   = 1;     % Highest ''       Laguerre ''
 PMAXI   = 2;     % Highest ion      Hermite polynomial degree
 JMAXI   = 1;     % Highest ''       Laguerre ''
 %% TIME PARAMETERS 
-TMAX    = 300;  % Maximal time unit
+TMAX    = 30;  % Maximal time unit
 DT      = 1e-2;   % Time step
 SPS2D   = 2;      % Sampling per time unit for 2D arrays
 SPS5D   = 0.1;    % Sampling per time unit for 5D arrays
 RESTART = 0;      % To restart from last checkpoint
 JOB2LOAD= 0;
 %% OPTIONS
-SIMID   = 'ZP';  % Name of the simulation
+SIMID   = 'test_parallel_lin';  % Name of the simulation
 CO      = -2;  % Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -37,6 +37,6 @@ NO_E    = 0;  % Remove electrons dynamic
 KREQ0   = 0;      % put kr = 0
 KPAR    = 0.0;    % Parellel wave vector component
 LAMBDAD = 0.0; 
-NON_LIN = 1 *(1-KREQ0);   % activate non-linearity (is cancelled if KREQ0 = 1)
+NON_LIN = 0 *(1-KREQ0);   % activate non-linearity (is cancelled if KREQ0 = 1)
 
 setup
-- 
GitLab