Renaming of code. New name is FPAKC.

This commit is contained in:
Jorge Gonzalez 2020-11-16 18:25:42 +01:00
commit 7b707e7806
7 changed files with 1591 additions and 12 deletions

94
src/FPAKC.f95 Normal file
View file

@ -0,0 +1,94 @@
! FPAKC main program
PROGRAM FPAKC
USE moduleInput
USE moduleErrors
USE OMP_LIB
USE moduleInject
USE moduleSolver
USE moduleOutput
USE moduleCompTime
USE moduleMesh
IMPLICIT NONE
! t = time step
INTEGER:: t = 0
! arg1 = Input argument 1 (input file)
CHARACTER(200):: arg1
! inputFile = path+name of input file
CHARACTER(:), ALLOCATABLE:: inputFile
tStep = omp_get_wtime()
!Gets the input file
CALL getarg(1, arg1)
inputFile = TRIM(arg1)
!If no input file is declared, a critical error is called
IF (inputFile == "") CALL criticalError("No input file provided", "PPartiC")
!Reads the json configuration file
CALL readConfig(inputFile)
CALL verboseError("Calculating initial EM field...")
CALL doEMField()
tStep = omp_get_wtime() - tStep
!Output initial state
CALL doOutput(t)
CALL verboseError('Starting main loop...')
!$OMP PARALLEL DEFAULT(SHARED)
DO t = 1, tmax
!Insert new particles and push them
!$OMP SINGLE
tStep = omp_get_wtime()
tPush = omp_get_wtime()
!$OMP END SINGLE
CALL doInjects()
!Push old particles
CALL doPushes()
!$OMP SINGLE
tPush = omp_get_wtime() - tPush
!Collisions
tColl = omp_get_wtime()
!$OMP END SINGLE
CALL doCollisions()
!$OMP SINGLE
tColl = omp_get_wtime() - tColl
!Reset particles
tReset = omp_get_wtime()
!$OMP END SINGLE
CALL doReset()
!$OMP SINGLE
tReset = omp_get_wtime() - tReset
!Weight
tWeight = omp_get_wtime()
!$OMP END SINGLE
CALL doScatter()
!$OMP SINGLE
tWeight = omp_get_wtime() - tWeight
tEMField = omp_get_wtime()
!$OMP END SINGLE
CALL doEMField()
!$OMP SINGLE
tEMField = omp_get_wtime() - tEMField
tStep = omp_get_wtime() - tStep
!Output data
CALL doOutput(t)
!$OMP END SINGLE
END DO
!$OMP END PARALLEL
END PROGRAM FPAKC