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
a4da873e
Commit
a4da873e
authored
2 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
clearer implementation of bracket and sum fonction
parent
07d95da8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fourier_mod.F90
+5
-4
5 additions, 4 deletions
src/fourier_mod.F90
src/nonlinear_mod.F90
+5
-5
5 additions, 5 deletions
src/nonlinear_mod.F90
with
10 additions
and
9 deletions
src/fourier_mod.F90
+
5
−
4
View file @
a4da873e
...
...
@@ -76,10 +76,11 @@ MODULE fourier
!!! Compute the poisson bracket of [F,G] to real space
! - Compute the convolution using the convolution theorem
SUBROUTINE
poisson_bracket_and_sum
(
F_
,
G_
)
SUBROUTINE
poisson_bracket_and_sum
(
F_
,
G_
,
sum_real_
)
IMPLICIT
NONE
COMPLEX
(
C_DOUBLE_COMPLEX
),
DIMENSION
(
ikys
:
ikye
,
ikxs
:
ikxe
),&
INTENT
(
IN
)
::
F_
,
G_
! input fields
INTENT
(
IN
)
::
F_
,
G_
! input fields
real
(
C_DOUBLE
),
pointer
,
INTENT
(
INOUT
)
::
sum_real_
(:,:)
! First term df/dx x dg/dy
DO
ikx
=
ikxs
,
ikxe
DO
iky
=
ikys
,
ikye
...
...
@@ -91,7 +92,7 @@ MODULE fourier
ENDDO
call
fftw_mpi_execute_dft_c2r
(
planb
,
cmpx_data_f
,
real_data_f
)
call
fftw_mpi_execute_dft_c2r
(
planb
,
cmpx_data_g
,
real_data_g
)
bracket_sum_r
=
bracket_
sum_r
+
real_data_f
*
real_data_g
*
inv_Ny
*
inv_Nx
sum_real_
=
sum_r
eal_
+
real_data_f
*
real_data_g
*
inv_Ny
*
inv_Nx
! Second term -df/dy x dg/dx
DO
ikx
=
ikxs
,
ikxe
DO
iky
=
ikys
,
ikye
...
...
@@ -103,7 +104,7 @@ MODULE fourier
ENDDO
call
fftw_mpi_execute_dft_c2r
(
planb
,
cmpx_data_f
,
real_data_f
)
call
fftw_mpi_execute_dft_c2r
(
planb
,
cmpx_data_g
,
real_data_g
)
bracket_sum_r
=
bracket_
sum_r
-
real_data_f
*
real_data_g
*
inv_Ny
*
inv_Nx
sum_real_
=
sum_r
eal_
-
real_data_f
*
real_data_g
*
inv_Ny
*
inv_Nx
END
SUBROUTINE
poisson_bracket_and_sum
!!! Compute the poisson bracket of [F,G] to real space
...
...
This diff is collapsed.
Click to expand it.
src/nonlinear_mod.F90
+
5
−
5
View file @
a4da873e
...
...
@@ -98,8 +98,8 @@ SUBROUTINE compute_nonlinear
G_cmpx
(
ikys
:
ikye
,
ikxs
:
ikxe
)
=
G_cmpx
(
ikys
:
ikye
,
ikxs
:
ikxe
)
+
&
dnjs
(
in
,
ij
,
is
)
*
moments_e
(
ip
,
is
,
ikys
:
ikye
,
ikxs
:
ikxe
,
iz
,
updatetlevel
)
ENDDO
!/!\ this function add its result to bracket_sum_r
(hard to read sorry)
/!\
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
)
!/!\ this function add its result to bracket_sum_r /!\
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
,
bracket_sum_r
)
!-----------!! ELECTROMAGNETIC CONTRIBUTION -sqrt(tau)/sigma*{Sum_s dnjs [sqrt(p+1)Nap+1s + sqrt(p)Nap-1s], Kernel psi}
IF
(
EM
)
THEN
...
...
@@ -114,7 +114,7 @@ SUBROUTINE compute_nonlinear
+
sqrt_p
*
moments_e
(
ip
-1
,
is
,
ikys
:
ikye
,
ikxs
:
ikxe
,
iz
,
updatetlevel
))
ENDDO
!/!\ this function add its result to bracket_sum_r (hard to read sorry) /!\
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
)
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
,
bracket_sum_r
)
ENDIF
ENDDO
nloope
...
...
@@ -162,7 +162,7 @@ ENDIF
dnjs
(
in
,
ij
,
is
)
*
moments_i
(
ip
,
is
,
ikys
:
ikye
,
ikxs
:
ikxe
,
iz
,
updatetlevel
)
ENDDO
!/!\ this function add its result to bracket_sum_r (hard to read sorry) /!\
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
)
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
,
bracket_sum_r
)
!-----------!! ELECTROMAGNETIC CONTRIBUTION -sqrt(tau)/sigma*{Sum_s dnjs [sqrt(p+1)Nap+1s + sqrt(p)Nap-1s], Kernel psi}
IF
(
EM
)
THEN
! First convolution terms
...
...
@@ -176,7 +176,7 @@ ENDIF
+
sqrt_p
*
moments_i
(
ip
-1
,
is
,
ikys
:
ikye
,
ikxs
:
ikxe
,
iz
,
updatetlevel
))
ENDDO
!/!\ this function add its result to bracket_sum_r (hard to read sorry) /!\
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
)
CALL
poisson_bracket_and_sum
(
F_cmpx
,
G_cmpx
,
bracket_sum_r
)
ENDIF
ENDDO
nloopi
! Put the real nonlinear product into k-space
...
...
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