Big one...

I should've commited before, but I wanted to make things compile.

The big change is that I've added a global time step so the parameter
does not need to be passed in each function. This is useful as we are
moving towards using time profiles for boundary conditions and injection
of particles (not in this branch, but in the future and the procedure
will be quite similar)
This commit is contained in:
Jorge Gonzalez 2024-07-12 23:08:19 +02:00
commit ac27725940
14 changed files with 340 additions and 220 deletions

View file

@ -11,12 +11,12 @@ PROGRAM fpakc
USE OMP_LIB
IMPLICIT NONE
! t = time step
INTEGER:: t
! arg1 = Input argument 1 (input file)
CHARACTER(200):: arg1
! inputFile = path+name of input file
CHARACTER(:), ALLOCATABLE:: inputFile
! generic integer for time step
INTEGER:: t
tStep = omp_get_wtime()
!Gets the input file
@ -32,10 +32,13 @@ PROGRAM fpakc
CALL initOutput(inputFile)
!Do '0' iteration
t = tInitial
timeStep = tInitial
!$OMP PARALLEL DEFAULT(SHARED)
!$OMP SINGLE
! Initial reset of probes
CALL resetProbes()
CALL verboseError("Initial scatter of particles...")
!$OMP END SINGLE
CALL doScatter()
@ -49,19 +52,21 @@ PROGRAM fpakc
tStep = omp_get_wtime() - tStep
!Output initial state
CALL doOutput(t)
CALL doOutput()
CALL verboseError('Starting main loop...')
!$OMP PARALLEL DEFAULT(SHARED)
DO t = tInitial + 1, tFinal
!Insert new particles and push them
!$OMP SINGLE
tStep = omp_get_wtime()
! Update global time step index
timeStep = t
!Checks if a species needs to me moved in this iteration
CALL solver%updatePushSpecies(t)
CALL solver%updatePushSpecies()
!Checks if probes need to be calculated this iteration
CALL resetProbes(t)
CALL resetProbes()
tPush = omp_get_wtime()
!$OMP END SINGLE
@ -79,7 +84,7 @@ PROGRAM fpakc
!$OMP END SINGLE
IF (doMCCollisions) THEN
CALL meshForMCC%doCollisions(t)
CALL meshForMCC%doCollisions()
END IF
@ -124,12 +129,12 @@ PROGRAM fpakc
!$OMP SINGLE
tEMField = omp_get_wtime() - tEMField
CALL doAverage(t)
CALL doAverage()
tStep = omp_get_wtime() - tStep
!Output data
CALL doOutput(t)
CALL doOutput()
!$OMP END SINGLE
END DO