Files renamed and makefile make compatible with ifort.

This commit is contained in:
Jorge Gonzalez 2020-12-10 19:25:17 +01:00
commit af74205932
25 changed files with 5439 additions and 0 deletions

103
src/fpakc.f90 Normal file
View file

@ -0,0 +1,103 @@
! 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", "fpakc")
!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()
!Checks if a species needs to me moved in this iteration
CALL solver%updatePushSpecies(t)
tPush = omp_get_wtime()
!$OMP END SINGLE
!Injects new particles
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