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
5636a3ee
Commit
5636a3ee
authored
2 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
explicit modules requirement writing and bug in checkfield
parent
c082a7a6
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/stepon.F90
+35
-19
35 additions, 19 deletions
src/stepon.F90
src/utility_mod.F90
+13
-18
13 additions, 18 deletions
src/utility_mod.F90
with
48 additions
and
37 deletions
src/stepon.F90
+
35
−
19
View file @
5636a3ee
SUBROUTINE
stepon
! Advance one time step, (num_step=4 for Runge Kutta 4 scheme)
USE
advance_field_routine
,
ONLY
:
advance_time_level
,
advance_field
,
advance_moments
USE
basic
USE
closure
USE
ghosts
,
ONLY
:
update_ghosts_moments
,
update_ghosts_EM
USE
grid
USE
model
,
ONLY
:
LINEARITY
,
KIN_E
use
prec_const
USE
time_integration
USE
utility
,
ONLY
:
checkfield
USE
advance_field_routine
,
ONLY
:
advance_time_level
,
advance_moments
USE
basic
,
ONLY
:
nlend
,
ierr
USE
closure
,
ONLY
:
apply_closure_model
USE
ghosts
,
ONLY
:
update_ghosts_moments
,
update_ghosts_EM
use
mpi
,
ONLY
:
MPI_COMM_WORLD
USE
time_integration
,
ONLY
:
ntimelevel
IMPLICIT
NONE
INTEGER
::
num_step
...
...
@@ -64,8 +61,16 @@ SUBROUTINE stepon
END
SUBROUTINE
assemble_RHS
SUBROUTINE
checkfield_all
! Check all the fields for inf or nan
USE
utility
,
ONLY
:
checkfield
USE
basic
,
ONLY
:
t0_checkfield
,
t1_checkfield
,
tc_checkfield
USE
fields
,
ONLY
:
phi
,
moments_e
,
moments_i
USE
grid
,
ONLY
:
ipgs_e
,
ipge_e
,
ijgs_e
,
ijge_e
,
ipgs_i
,
ipge_i
,
ijgs_i
,
ijge_i
,&
ikys
,
ikye
,
ikxs
,
ikxe
,
izgs
,
izge
,
ij
,
ip
USE
MPI
USE
time_integration
,
ONLY
:
updatetlevel
USE
model
,
ONLY
:
LINEARITY
,
KIN_E
IMPLICIT
NONE
LOGICAL
::
checkf_
! Execution time start
CALL
cpu_time
(
t0_checkfield
)
...
...
@@ -74,17 +79,22 @@ SUBROUTINE stepon
mlend
=
.FALSE.
IF
(
.NOT.
nlend
)
THEN
mlend
=
mlend
.or.
checkfield
(
phi
,
' phi'
)
checkf_
=
checkfield
(
phi
,
' phi'
)
mlend
=
(
mlend
.or.
checkf_
)
IF
(
KIN_E
)
THEN
DO
ij
=
ijgs_e
,
ijge_e
DO
ip
=
ipgs_e
,
ipge_e
mlend
=
mlend
.or.
checkfield
(
moments_e
(
ip
,
ij
,:,:,:,
updatetlevel
),
' moments_e'
)
checkf_
=
checkfield
(
moments_e
(
ip
,
ij
,
ikys
:
ikye
,
ikxs
:
ikxe
,
izgs
:
izge
,
updatetlevel
),
' moments_e'
)
mlend
=
(
mlend
.or.
checkf_
)
ENDDO
ENDDO
ENDIF
DO
ij
=
ijgs_i
,
ijge_i
DO
ip
=
ipgs_i
,
ipge_i
mlend
=
mlend
.or.
checkfield
(
moments_i
(
ip
,
ij
,:,:,:,
updatetlevel
),
' moments_i'
)
checkf_
=
checkfield
(
moments_i
(
ip
,
ij
,
ikys
:
ikye
,
ikxs
:
ikxe
,
izgs
:
izge
,
updatetlevel
),
' moments_i'
)
mlend
=
(
mlend
.or.
checkf_
)
! print*, 'should be an error'
! stop
ENDDO
ENDDO
CALL
MPI_ALLREDUCE
(
mlend
,
nlend
,
1
,
MPI_LOGICAL
,
MPI_LOR
,
MPI_COMM_WORLD
,
ierr
)
...
...
@@ -97,6 +107,9 @@ SUBROUTINE stepon
SUBROUTINE
anti_aliasing
USE
fields
,
ONLY
:
moments_e
,
moments_i
USE
grid
,
ONLY
:
ipgs_i
,
ipge_i
,
ijgs_i
,
ijge_i
,
ipgs_e
,
ipge_e
,
ijgs_e
,
ijge_e
,&
ikys
,
ikye
,
ikxs
,
ikxe
,
izgs
,
izge
,
AA_x
,
AA_y
,
iz
,
ikx
,
iky
,
ij
,
ip
USE
model
,
ONLY
:
KIN_E
IMPLICIT
NONE
IF
(
KIN_E
)
THEN
DO
iz
=
izgs
,
izge
...
...
@@ -114,7 +127,7 @@ SUBROUTINE stepon
DO
iz
=
izgs
,
izge
DO
ikx
=
ikxs
,
ikxe
DO
iky
=
ikys
,
ikye
DO
ij
=
ijs_i
,
ije_i
DO
ij
=
ij
g
s_i
,
ij
g
e_i
DO
ip
=
ipgs_i
,
ipge_i
moments_i
(
ip
,
ij
,
iky
,
ikx
,
iz
,:)
=
AA_x
(
ikx
)
*
AA_y
(
iky
)
*
moments_i
(
ip
,
ij
,
iky
,
ikx
,
iz
,:)
END
DO
...
...
@@ -126,11 +139,14 @@ SUBROUTINE stepon
SUBROUTINE
enforce_symmetry
! Force X(k) = X(N-k)* complex conjugate symmetry
USE
fields
,
ONLY
:
phi
,
psi
,
moments_e
,
moments_i
USE
grid
,
ONLY
:
ipgs_i
,
ipge_i
,
ijgs_i
,
ijge_i
,
ipgs_e
,
ipge_e
,
ijgs_e
,
ijge_e
,&
izgs
,
izge
,
iz
,
ikx
,
ij
,
ip
,
Nkx
,
iky_0
,
ikx_0
,
contains_ky0
USE
model
,
ONLY
:
KIN_E
IMPLICIT
NONE
IF
(
contains_ky0
)
THEN
! Electron moments
IF
(
KIN_E
)
THEN
DO
iz
=
izs
,
ize
DO
iz
=
iz
g
s
,
iz
g
e
DO
ij
=
ijgs_e
,
ijge_e
DO
ip
=
ipgs_e
,
ipge_e
DO
ikx
=
2
,
Nkx
/
2
!symmetry at ky = 0
...
...
@@ -143,7 +159,7 @@ SUBROUTINE stepon
END
DO
ENDIF
! Ion moments
DO
iz
=
izs
,
ize
DO
iz
=
iz
g
s
,
iz
g
e
DO
ij
=
ijgs_i
,
ijge_i
DO
ip
=
ipgs_i
,
ipge_i
DO
ikx
=
2
,
Nkx
/
2
!symmetry at ky = 0
...
...
@@ -156,16 +172,16 @@ SUBROUTINE stepon
END
DO
! Phi
DO
ikx
=
2
,
Nkx
/
2
!symmetry at ky = 0
phi
(
iky_0
,
ikx
,
izs
:
ize
)
=
phi
(
iky_0
,
Nkx
+2
-
ikx
,
izs
:
ize
)
phi
(
iky_0
,
ikx
,
iz
g
s
:
iz
g
e
)
=
phi
(
iky_0
,
Nkx
+2
-
ikx
,
iz
g
s
:
iz
g
e
)
END
DO
! must be real at origin
phi
(
iky_0
,
ikx_0
,
izs
:
ize
)
=
REAL
(
phi
(
iky_0
,
ikx_0
,
izs
:
ize
))
phi
(
iky_0
,
ikx_0
,
iz
g
s
:
iz
g
e
)
=
REAL
(
phi
(
iky_0
,
ikx_0
,
iz
g
s
:
iz
g
e
))
! Psi
DO
ikx
=
2
,
Nkx
/
2
!symmetry at ky = 0
psi
(
iky_0
,
ikx
,
izs
:
ize
)
=
psi
(
iky_0
,
Nkx
+2
-
ikx
,
izs
:
ize
)
psi
(
iky_0
,
ikx
,
iz
g
s
:
iz
g
e
)
=
psi
(
iky_0
,
Nkx
+2
-
ikx
,
iz
g
s
:
iz
g
e
)
END
DO
! must be real at origin
psi
(
iky_0
,
ikx_0
,
izs
:
ize
)
=
REAL
(
psi
(
iky_0
,
ikx_0
,
izs
:
ize
))
psi
(
iky_0
,
ikx_0
,
iz
g
s
:
iz
g
e
)
=
REAL
(
psi
(
iky_0
,
ikx_0
,
iz
g
s
:
iz
g
e
))
ENDIF
END
SUBROUTINE
enforce_symmetry
...
...
This diff is collapsed.
Click to expand it.
src/utility_mod.F90
+
13
−
18
View file @
5636a3ee
MODULE
utility
USE
basic
USE
grid
,
ONLY
:
Nkx
,
Nky
,
Nz
,
ikys
,
ikye
,
izs
,
ize
,
local_nky
,
local_nz
use
prec_const
IMPLICIT
NONE
PUBLIC
::
checkfield
CONTAINS
FUNCTION
is_nan
(
x
,
str
)
RESULT
(
isn
)
USE
time_integration
use
prec_const
USE
basic
,
ONLY
:
cstep
,
stdout
USE
time_integration
,
ONLY
:
updatetlevel
USE
prec_const
,
ONLY
:
dp
IMPLICIT
NONE
real
(
dp
),
INTENT
(
IN
)
::
x
...
...
@@ -29,10 +25,8 @@ CONTAINS
FUNCTION
is_inf
(
x
,
str
)
RESULT
(
isi
)
USE
time_integration
use
prec_const
USE
basic
,
ONLY
:
stdout
USE
prec_const
,
ONLY
:
dp
IMPLICIT
NONE
real
(
dp
),
INTENT
(
IN
)
::
x
...
...
@@ -51,13 +45,14 @@ CONTAINS
END
FUNCTION
is_inf
FUNCTION
checkfield
(
field
,
str
)
RESULT
(
mlend
)
USE
grid
use
prec_const
USE
grid
,
ONLY
:
ikys
,
ikye
,
ikxs
,
ikxe
,
izgs
,
izge
use
prec_const
,
ONLY
:
dp
IMPLICIT
NONE
COMPLEX
(
dp
),
DIMENSION
(
ikys
:
ikye
,
ikxs
:
ikxe
),
INTENT
(
IN
)
::
field
!! BUG found (or feature?)
! if one put the commented first line (commented) instead of the second one,
! no error will be risen by the compiler even if the rank of the array is not matching (should be 3D!)
! COMPLEX(dp), DIMENSION(ikys:ikye,ikxs:ikxe), INTENT(IN) :: field
COMPLEX
(
dp
),
DIMENSION
(
ikys
:
ikye
,
ikxs
:
ikxe
,
izgs
:
izge
),
INTENT
(
IN
)
::
field
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
str
LOGICAL
::
mlend
COMPLEX
(
dp
)
::
sumfield
...
...
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