Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gyacomo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Cyril David Hoffmann
Gyacomo
Commits
06b78cf3
Commit
06b78cf3
authored
4 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
put kz > 0 instead of kr > 0
parent
01095795
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
matlab/create_gif.m
+2
-1
2 additions, 1 deletion
matlab/create_gif.m
src/grid_mod.F90
+11
-6
11 additions, 6 deletions
src/grid_mod.F90
wk/analysis.m
+13
-9
13 additions, 9 deletions
wk/analysis.m
wk/fort.90
+14
-14
14 additions, 14 deletions
wk/fort.90
wk/setup.m
+8
-8
8 additions, 8 deletions
wk/setup.m
with
48 additions
and
38 deletions
matlab/create_gif.m
+
2
−
1
View file @
06b78cf3
...
...
@@ -21,10 +21,11 @@ fig = figure;
colorbar
axis
tight
manual
% this ensures that getframe() returns a consistent size
shading
interp
;
xlabel
(
XNAME
);
ylabel
(
YNAME
);
hold
on
in
=
1
;
nbytes
=
fprintf
(
2
,
'frame %d/%d'
,
n
,
numel
(
FIELD
(
1
,
1
,:)));
nbytes
=
fprintf
(
2
,
'frame %d/%d'
,
i
n
,
numel
(
FIELD
(
1
,
1
,:)));
for
n
=
FRAMES
% loop over selected frames
pclr
=
pcolor
(
X
,
Y
,
FIELD
(:,:,
n
));
shading
interp
;
% frame plot
set
(
pclr
,
'edgecolor'
,
'none'
);
...
...
This diff is collapsed.
Click to expand it.
src/grid_mod.F90
+
11
−
6
View file @
06b78cf3
...
...
@@ -128,7 +128,8 @@ CONTAINS
IMPLICIT
NONE
INTEGER
::
ikr
Nkr
=
Nr
/
2+1
! Defined only on positive kr since fields are real
! Nkr = Nr/2+1 ! Defined only on positive kr since fields are real
Nkr
=
Nr
! Start and END indices of grid
ikrs
=
1
ikre
=
Nkr
...
...
@@ -138,11 +139,13 @@ CONTAINS
! Discretized kr positions ordered as dk*(0 1 2)
ALLOCATE
(
krarray
(
ikrs
:
ikre
))
DO
ikr
=
ikrs
,
ikre
krarray
(
ikr
)
=
REAL
(
ikr
-1
,
dp
)
*
deltakr
! krarray(ikr) = REAL(ikr-1,dp) * deltakr
krarray
(
ikr
)
=
deltakr
*
(
MODULO
(
ikr
-1
,
Nkr
/
2
)
-
Nkr
/
2
*
FLOOR
(
2.
*
real
(
ikr
-1
)/
real
(
Nkr
)))
if
(
krarray
(
ikr
)
.EQ.
0
)
THEN
ikr_0
=
ikr
ENDIF
END
DO
krarray
(
Nr
/
2+1
)
=
-
krarray
(
Nr
/
2+1
)
! Orszag 2/3 filter
two_third_krmax
=
2._dp
/
3._dp
*
deltakr
*
Nkr
...
...
@@ -160,22 +163,24 @@ CONTAINS
USE
prec_const
IMPLICIT
NONE
Nkz
=
Nz
;
! Nkz = Nz;
Nkz
=
Nz
/
2
+
1
;
! Defined only on positive kz since fields are real
! Start and END indices of grid
ikzs
=
1
ikze
=
Nkz
! Grid spacings
deltakz
=
2._dp
*
PI
/
N
k
z
/
deltaz
deltakz
=
2._dp
*
PI
/
Nz
/
deltaz
! Discretized kz positions ordered as dk*(0 1 2 -3 -2 -1)
ALLOCATE
(
kzarray
(
ikzs
:
ikze
))
DO
ikz
=
ikzs
,
ikze
kzarray
(
ikz
)
=
deltakz
*
(
MODULO
(
ikz
-1
,
Nkz
/
2
)
-
Nkz
/
2
*
FLOOR
(
2.
*
real
(
ikz
-1
)/
real
(
Nkz
)))
! kzarray(ikz) = deltakz*(MODULO(ikz-1,Nkz/2)-Nkz/2*FLOOR(2.*real(ikz-1)/real(Nkz)))
kzarray
(
ikz
)
=
REAL
(
ikz
-1
,
dp
)
*
deltakz
if
(
kzarray
(
ikz
)
.EQ.
0
)
THEN
ikz_0
=
ikz
ENDIF
END
DO
kzarray
(
Nz
/
2+1
)
=
-
kzarray
(
Nz
/
2+1
)
!
kzarray(Nz/2+1) = -kzarray(Nz/2+1)
! Orszag 2/3 filter
two_third_kzmax
=
2._dp
/
3._dp
*
deltakz
*
(
Nkz
/
2
);
...
...
This diff is collapsed.
Click to expand it.
wk/analysis.m
+
13
−
9
View file @
06b78cf3
...
...
@@ -206,7 +206,7 @@ FMT = '.fig'; save_figure
if
0
%% Show frame
it
=
min
(
5
0
,
numel
(
Ts
));
it
=
min
(
7
0
,
numel
(
Ts
));
fig
=
figure
;
FIGNAME
=
[
'frame'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
subplot
(
221
);
plt
=
@
(
x
)
fftshift
((
real
(
x
)));
pclr
=
pcolor
(
fftshift
(
KR
),
fftshift
(
KZ
),
plt
(
PH
(:,:,
it
)));
set
(
pclr
,
'edgecolor'
,
'none'
);
colorbar
;
...
...
@@ -225,24 +225,28 @@ end
FMT
=
'.fig'
;
save_figure
end
%%
DELAY
=
0.07
;
skip_
=
1
;
FRAMES
=
200
:
skip_
:
numel
(
Ts
);
if
1
DELAY
=
0.07
;
skip_
=
1
0
;
FRAMES
=
1
:
skip_
:
numel
(
Ts
);
if
0
%% GIFS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Density electron
GIFNAME
=
[
'ne'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELDNAME
=
'$n_e^{00}$'
;
GIFNAME
=
[
'ne'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELD
=
real
(
ne
);
X
=
XX
;
Y
=
YY
;
T
=
Ts
;
FIELDNAME
=
'$n_e^{00}$'
;
XNAME
=
'$r$'
;
YNAME
=
'$z$'
;
create_gif
%% Density ion
GIFNAME
=
[
'ni'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELDNAME
=
'$n_i^{00}$'
;
GIFNAME
=
[
'ni'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELD
=
real
(
ni
);
X
=
XX
;
Y
=
YY
;
T
=
Ts
;
FIELDNAME
=
'$n_i^{00}$'
;
XNAME
=
'$r$'
;
YNAME
=
'$z$'
;
create_gif
%% Phi
GIFNAME
=
[
'phi'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELDNAME
=
'$\phi$'
;
GIFNAME
=
[
'phi'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELD
=
real
(
phi
);
X
=
XX
;
Y
=
YY
;
T
=
Ts
;
FIELDNAME
=
'$\phi$'
;
XNAME
=
'$r$'
;
YNAME
=
'$z$'
;
create_gif
%% Density electron frequency
GIFNAME
=
[
'Ni'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELDNAME
=
'$N_i^{00}$'
;
FIELD
=
real
(
Ni
);
X
=
KR
;
Y
=
KZ
;
T
=
Ts
;
GIFNAME
=
[
'Ni'
,
sprintf
(
'_%.2d'
,
JOBNUM
)];
FIELD
=
fftshift
(
real
(
Ni
));
X
=
fftshift
(
KR
);
Y
=
fftshift
(
KZ
);
T
=
Ts
;
FIELDNAME
=
'$N_i^{00}$'
;
XNAME
=
'$k_r$'
;
YNAME
=
'$k_z$'
;
create_gif
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
wk/fort.90
+
14
−
14
View file @
06b78cf3
&BASIC
nrun = 100000000
dt = 0.
00
01
tmax = 10
0
RESTART = .
tru
e.
dt = 0.01
tmax = 10
RESTART = .
fals
e.
/
&GRID
pmaxe =
5
jmaxe =
2
pmaxi =
5
jmaxi =
2
pmaxe =
1
jmaxe =
0
pmaxi =
1
jmaxi =
0
Nr = 64
Lr = 10
Nz = 64
...
...
@@ -18,15 +18,15 @@
&OUTPUT_PAR
nsave_0d = 0
nsave_1d = 0
nsave_2d = 10
00
nsave_5d = 10
00
nsave_2d = 10
nsave_5d = 10
write_Ni00 = .true.
write_moments = .true.
write_phi = .true.
write_non_lin = .false.
write_doubleprecision = .true.
resfile0 = '
gvskr
_32x64_L_10_lin_P_
5
_J_
2
_nB_0.1_nN_1_mu_1e-02_'
rstfile0 = '../checkpoint/cp_
gvskr
_32x64_L_10_lin_P_
5
_J_
2
_nB_0.1_nN_1_mu_1e-02_'
resfile0 = '
test_kzpos
_32x64_L_10_lin_P_
1
_J_
0
_nB_0.1_nN_1_mu_1e-02_'
rstfile0 = '../checkpoint/cp_
test_kzpos
_32x64_L_10_lin_P_
1
_J_
0
_nB_0.1_nN_1_mu_1e-02_'
job2load = 0
/
&MODEL_PAR
...
...
@@ -52,9 +52,9 @@
initback_moments =0.0001
initnoise_moments =5e-05
iseed =42
selfmat_file ='../iCa/self_Coll_GKE_0_GKI_0_ESELF_1_ISELF_1_Pmaxe_
5
_Jmaxe_
2
_Pmaxi_
5
_Jmaxi_
2
_pamaxx_10.h5'
eimat_file ='../iCa/ei_Coll_GKE_0_GKI_0_ETEST_1_EBACK_1_Pmaxe_
5
_Jmaxe_
2
_Pmaxi_
5
_Jmaxi_
2
_pamaxx_10_tau_1.0000_mu_0.0233.h5'
iemat_file ='../iCa/ie_Coll_GKE_0_GKI_0_ITEST_1_IBACK_1_Pmaxe_
5
_Jmaxe_
2
_Pmaxi_
5
_Jmaxi_
2
_pamaxx_10_tau_1.0000_mu_0.0233.h5'
selfmat_file ='../iCa/self_Coll_GKE_0_GKI_0_ESELF_1_ISELF_1_Pmaxe_
1
_Jmaxe_
0
_Pmaxi_
1
_Jmaxi_
0
_pamaxx_10.h5'
eimat_file ='../iCa/ei_Coll_GKE_0_GKI_0_ETEST_1_EBACK_1_Pmaxe_
1
_Jmaxe_
0
_Pmaxi_
1
_Jmaxi_
0
_pamaxx_10_tau_1.0000_mu_0.0233.h5'
iemat_file ='../iCa/ie_Coll_GKE_0_GKI_0_ITEST_1_IBACK_1_Pmaxe_
1
_Jmaxe_
0
_Pmaxi_
1
_Jmaxi_
0
_pamaxx_10_tau_1.0000_mu_0.0233.h5'
/
&TIME_INTEGRATION_PAR
numerical_scheme='RK4'
...
...
This diff is collapsed.
Click to expand it.
wk/setup.m
+
8
−
8
View file @
06b78cf3
...
...
@@ -15,19 +15,19 @@ LAMBDAD = 0.0;
%% GRID PARAMETERS
N
=
64
;
% Frequency gridpoints (Nkr = N/2)
L
=
10
;
% Size of the squared frequency domain
PMAXE
=
0
5
;
% Highest electron Hermite polynomial degree
JMAXE
=
0
2
;
% Highest '' Laguerre ''
PMAXI
=
0
5
;
% Highest ion Hermite polynomial degree
JMAXI
=
0
2
;
% Highest '' Laguerre ''
PMAXE
=
0
1
;
% Highest electron Hermite polynomial degree
JMAXE
=
0
0
;
% Highest '' Laguerre ''
PMAXI
=
0
1
;
% Highest ion Hermite polynomial degree
JMAXI
=
0
0
;
% Highest '' Laguerre ''
KPAR
=
0.0
;
% Parellel wave vector component
%% TIME PARAMETERS
TMAX
=
10
0
.0
;
% Maximal time unit
DT
=
1e-
4
;
% Time step
TMAX
=
10.0
;
% Maximal time unit
DT
=
1e-
2
;
% Time step
SPS
=
10
;
% Sampling per time unit
RESTART
=
1
;
% To restart from last checkpoint
RESTART
=
0
;
% To restart from last checkpoint
JOB2LOAD
=
0
;
%% OPTIONS
SIMID
=
'
gvskr
'
;
% Name of the simulation
SIMID
=
'
test_kzpos
'
;
% Name of the simulation
NON_LIN
=
0
;
% activate non-linearity (is cancelled if KREQ0 = 1)
CO
=
-
2
;
% Collision operator (0 : L.Bernstein, -1 : Full Coulomb, -2 : Dougherty)
DK
=
0
;
% Drift kinetic model (put every kernel to 1)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment