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
f47e0a7f
Commit
f47e0a7f
authored
1 year ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
Not tested but everything is there
parent
9890ac61
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ExB_shear_flow_mod.F90
+36
-11
36 additions, 11 deletions
src/ExB_shear_flow_mod.F90
with
36 additions
and
11 deletions
src/ExB_shear_flow_mod.F90
+
36
−
11
View file @
f47e0a7f
...
...
@@ -20,7 +20,7 @@ CONTAINS
! Setup the variables for the ExB shear
SUBROUTINE
Setup_ExB_shear_flow
USE
grid
,
ONLY
:
tot
al_nk
x
,
local_n
k
y
,
deltakx
,
deltaky
USE
grid
,
ONLY
:
Nx
,
loc
al_nk
y
,
local_n
x
,
N
y
,
deltakx
,
deltaky
USE
model
,
ONLY
:
ExBrate
IMPLICIT
NONE
...
...
@@ -35,8 +35,8 @@ CONTAINS
shiftnow_ExB
=
.FALSE.
! Setup nonlinear factor
ALLOCATE
(
ExB_NL_factor
(
total_nk
x
,
local_nky
))
ALLOCATE
(
inv_ExB_NL_factor
(
total_nkx
,
local_n
ky
))
ALLOCATE
(
ExB_NL_factor
(
N
x
,
local_nky
))
ALLOCATE
(
inv_ExB_NL_factor
(
Ny
/
2+1
,
local_n
x
))
ExB_NL_factor
=
1._xp
inv_ExB_NL_factor
=
1._xp
IF
(
ExBrate
.NE.
0
)
THEN
...
...
@@ -127,13 +127,14 @@ CONTAINS
! update the ExB shear value for the next time step
SUBROUTINE
Update_ExB_shear_flow
USE
basic
,
ONLY
:
dt
,
time
,
chrono_ExBs
,
start_chrono
,
stop_chrono
USE
grid
,
ONLY
:
local_nky
,
kyarray
,
inv_dkx
,
xarray
,&
local_nkx
,
ikyarray
,
inv_ikyarray
,
deltakx
,
deltaky
,
deltax
USE
grid
,
ONLY
:
local_nky
,
local_nky_offset
,
kyarray
,
kyarray_full
,
inv_dkx
,
xarray
,
Nx
,
Ny
,
&
local_nx
,
local_nx_offset
,
deltax
,
&
ikyarray
,
inv_ikyarray
,
deltakx
,
deltaky
USE
model
,
ONLY
:
ExBrate
IMPLICIT
NONE
! local var
INTEGER
::
iky
,
ix
REAL
(
xp
)::
dtExBshear
REAL
(
xp
)::
dtExBshear
,
ky
,
kx
,
J_dp
,
inv_J
,
x
CALL
start_chrono
(
chrono_ExBs
)
! update the ExB shift, jumps and flags
shiftnow_ExB
=
.FALSE.
...
...
@@ -144,11 +145,35 @@ CONTAINS
! in shiftnow_ExB and will use it in Shift_fields to avoid
! zero-shiftings that may be majoritary.
shiftnow_ExB
(
iky
)
=
(
abs
(
jump_ExB
(
iky
))
.GT.
0
)
! Update the ExB nonlinear factor
dtExBshear
=
time
-
t0
*
inv_ikyarray
(
iky
)
*
ANINT
(
ikyarray
(
iky
)
*
time
*
inv_t0
,
xp
)
DO
ix
=
1
,
local_nkx
ExB_NL_factor
(
ix
,
iky
)
=
EXP
(
-
imagu
*
xarray
(
ix
)
*
ExBrate
*
ikyarray
(
iky
)
*
dtExBshear
)
inv_ExB_NL_factor
(
ix
,
iky
)
=
1._xp
/
ExB_NL_factor
(
ix
,
iky
)
ENDDO
! Update the ExB nonlinear factor...
DO
iky
=
1
,
local_Nky
! for readability
ky
=
kyarray_full
(
iky
+
local_nky_offset
)
J_dp
=
ikyarray
(
iky
+
local_nky_offset
)
inv_J
=
inv_ikyarray
(
iky
+
local_nky_offset
)
! compute dt factor
dtExBshear
=
time
-
t0
*
inv_J
*
ANINT
(
J_dp
*
time
*
inv_t0
,
xp
)
DO
ix
=
1
,
Nx
x
=
xarray
(
ix
)
! assemble the ExB nonlin factor
ExB_NL_factor
(
ix
,
iky
)
=
EXP
(
-
imagu
*
x
*
ExBrate
*
ky
*
dtExBshear
)
ENDDO
ENDDO
! ... and the inverse
DO
iky
=
1
,
Ny
/
2+1
! for readability
ky
=
kyarray_full
(
iky
)
J_dp
=
ikyarray
(
iky
)
inv_J
=
inv_ikyarray
(
iky
)
! compute dt factor
dtExBshear
=
time
-
t0
*
inv_J
*
ANINT
(
J_dp
*
time
*
inv_t0
,
xp
)
ky
=
REAL
(
iky
-1
,
xp
)
*
deltaky
DO
ix
=
1
,
local_nx
x
=
xarray
(
ix
+
local_nx_offset
)
! assemble the inverse ExB nonlin factor
inv_ExB_NL_factor
(
iky
,
ix
)
=
EXP
(
imagu
*
x
*
ExBrate
*
ky
*
dtExBshear
)
ENDDO
ENDDO
CALL
stop_chrono
(
chrono_ExBs
)
...
...
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