Commit 2eed3ebd authored by Victor Yu's avatar Victor Yu

Update NTPoly to v2.5.0

parent b69c4463
......@@ -15,6 +15,7 @@ LIST(APPEND ntpoly_src
src/LinearSolversModule.f90
src/LoadBalancerModule.f90
src/LoggingModule.f90
src/MatrixConversionModule.f90
src/MatrixMapsModule.f90
src/MatrixMarketModule.f90
src/MatrixMemoryPoolModule.f90
......
......@@ -34,19 +34,19 @@ MODULE ChebyshevSolversModule
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTERFACE ConstructPolynomial
MODULE PROCEDURE ConstructPolynomial_cheby
END INTERFACE
END INTERFACE ConstructPolynomial
INTERFACE DestructPolynomial
MODULE PROCEDURE DestructPolynomial_cheby
END INTERFACE
END INTERFACE DestructPolynomial
INTERFACE SetCoefficient
MODULE PROCEDURE SetCoefficient_cheby
END INTERFACE
END INTERFACE SetCoefficient
INTERFACE Compute
MODULE PROCEDURE Compute_cheby
END INTERFACE
END INTERFACE Compute
INTERFACE FactorizedCompute
MODULE PROCEDURE FactorizedCompute_cheby
END INTERFACE
END INTERFACE FactorizedCompute
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Construct a Chebyshev polynomial object.
PURE SUBROUTINE ConstructPolynomial_cheby(this, degree)
......@@ -56,7 +56,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTEGER, INTENT(IN) :: degree
ALLOCATE(this%coefficients(degree))
this%coefficients = 0
this%coefficients = 0_NTREAL
END SUBROUTINE ConstructPolynomial_cheby
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Destruct a polynomial object.
......@@ -116,8 +116,8 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Chebyshev Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Standard")
CALL WriteElement(key="Degree", value=degree-1)
CALL WriteElement(key="Method", VALUE="Standard")
CALL WriteElement(key="Degree", VALUE=degree-1)
CALL PrintParameters(solver_parameters)
END IF
......@@ -227,8 +227,8 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Chebyshev Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Recursive")
CALL WriteElement(key="Degree", value=degree-1)
CALL WriteElement(key="Method", VALUE="Recursive")
CALL WriteElement(key="Degree", VALUE=degree-1)
CALL PrintParameters(solver_parameters)
END IF
......
This diff is collapsed.
......@@ -53,19 +53,19 @@ CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
per_column_max = 0
CALL GetMatrixTripletList(this, triplet_list_c)
DO counter = 1, triplet_list_c%CurrentSize
local_column = triplet_list_c%data(counter)%index_column - &
local_column = triplet_list_c%DATA(counter)%index_column - &
& this%start_column + 1
IF (triplet_list_c%data(counter)%index_row .EQ. &
& triplet_list_c%data(counter)%index_column) THEN
IF (triplet_list_c%DATA(counter)%index_row .EQ. &
& triplet_list_c%DATA(counter)%index_column) THEN
per_column_min(local_column) = per_column_min(local_column) + &
& REAL(triplet_list_c%data(counter)%point_value,KIND=NTREAL)
& REAL(triplet_list_c%DATA(counter)%point_value,KIND=NTREAL)
per_column_max(local_column) = per_column_max(local_column) + &
& REAL(triplet_list_c%data(counter)%point_value,KIND=NTREAL)
& REAL(triplet_list_c%DATA(counter)%point_value,KIND=NTREAL)
ELSE
per_column_min(local_column) = per_column_min(local_column) - &
& ABS(triplet_list_c%data(counter)%point_value)
& ABS(triplet_list_c%DATA(counter)%point_value)
per_column_max(local_column) = per_column_max(local_column) + &
& ABS(triplet_list_c%data(counter)%point_value)
& ABS(triplet_list_c%DATA(counter)%point_value)
END IF
END DO
......@@ -96,19 +96,19 @@ CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
per_column_max = 0
CALL GetMatrixTripletList(this, triplet_list_r)
DO counter = 1, triplet_list_r%CurrentSize
local_column = triplet_list_r%data(counter)%index_column - &
local_column = triplet_list_r%DATA(counter)%index_column - &
& this%start_column + 1
IF (triplet_list_r%data(counter)%index_row .EQ. &
& triplet_list_r%data(counter)%index_column) THEN
IF (triplet_list_r%DATA(counter)%index_row .EQ. &
& triplet_list_r%DATA(counter)%index_column) THEN
per_column_min(local_column) = per_column_min(local_column) + &
& REAL(triplet_list_r%data(counter)%point_value,KIND=NTREAL)
& REAL(triplet_list_r%DATA(counter)%point_value,KIND=NTREAL)
per_column_max(local_column) = per_column_max(local_column) + &
& REAL(triplet_list_r%data(counter)%point_value,KIND=NTREAL)
& REAL(triplet_list_r%DATA(counter)%point_value,KIND=NTREAL)
ELSE
per_column_min(local_column) = per_column_min(local_column) - &
& ABS(triplet_list_r%data(counter)%point_value)
& ABS(triplet_list_r%DATA(counter)%point_value)
per_column_max(local_column) = per_column_max(local_column) + &
& ABS(triplet_list_r%data(counter)%point_value)
& ABS(triplet_list_r%DATA(counter)%point_value)
END IF
END DO
......@@ -189,9 +189,9 @@ CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
norm_value = solver_parameters%converge_diff + 1.0_NTREAL
DO outer_counter = 1,solver_parameters%max_iterations
IF (solver_parameters%be_verbose .AND. outer_counter .GT. 1) THEN
CALL WriteListElement(key="Round", value=outer_counter-1)
CALL WriteListElement(key="Round", VALUE=outer_counter-1)
CALL EnterSubLog
CALL WriteElement(key="Convergence", value=norm_value)
CALL WriteElement(key="Convergence", VALUE=norm_value)
CALL ExitSubLog
END IF
......@@ -214,7 +214,7 @@ CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END DO
IF (solver_parameters%be_verbose) THEN
CALL ExitSubLog
CALL WriteElement(key="Total_Iterations",value=outer_counter-1)
CALL WriteElement(key="Total_Iterations",VALUE=outer_counter-1)
END IF
!! Compute The Largest Eigenvalue
......@@ -225,7 +225,7 @@ CONTAINS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
max_value = max_value / scale_value
IF (solver_parameters%be_verbose) THEN
CALL WriteElement(key="Max_Eigen_Value",value=max_value)
CALL WriteElement(key="Max_Eigen_Value",VALUE=max_value)
CALL ExitSubLog
END IF
......
......@@ -70,7 +70,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Exponential Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Chebyshev")
CALL WriteElement(key="Method", VALUE="Chebyshev")
CALL PrintParameters(solver_parameters)
END IF
......@@ -89,7 +89,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sub_solver_parameters%threshold = sub_solver_parameters%threshold/sigma_val
IF (solver_parameters%be_verbose) THEN
CALL WriteElement(key="Sigma", value=sigma_val)
CALL WriteElement(key="Sigma", VALUE=sigma_val)
END IF
!! Expand Chebyshev Series
......@@ -184,7 +184,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Exponential Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Pade")
CALL WriteElement(key="Method", VALUE="Pade")
CALL PrintParameters(solver_parameters)
END IF
......@@ -203,8 +203,8 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CALL CopyMatrix(InputMat, ScaledMat)
CALL ScaleMatrix(ScaledMat,1.0/sigma_val)
IF (solver_parameters%be_verbose) THEN
CALL WriteElement(key="Sigma", value=sigma_val)
CALL WriteElement(key="Scaling_Steps", value=sigma_counter)
CALL WriteElement(key="Sigma", VALUE=sigma_val)
CALL WriteElement(key="Scaling_Steps", VALUE=sigma_counter)
END IF
!! Sub Solver Parameters
......@@ -308,7 +308,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Exponential Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Taylor")
CALL WriteElement(key="Method", VALUE="Taylor")
CALL PrintParameters(solver_parameters)
END IF
......@@ -409,7 +409,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Logarithm Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Chebyshev")
CALL WriteElement(key="Method", VALUE="Chebyshev")
CALL PrintParameters(solver_parameters)
END IF
......@@ -430,7 +430,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sigma_counter = sigma_counter + 1
END DO
IF (solver_parameters%be_verbose) THEN
CALL WriteElement(key="Sigma", value=sigma_val)
CALL WriteElement(key="Sigma", VALUE=sigma_val)
END IF
f_sub_solver_parameters%threshold = &
& f_sub_solver_parameters%threshold/REAL(2**(sigma_counter-1),NTREAL)
......@@ -529,7 +529,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Logarithm Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Taylor")
CALL WriteElement(key="Method", VALUE="Taylor")
CALL PrintParameters(solver_parameters)
END IF
......
......@@ -6,74 +6,74 @@ MODULE GemmTasksModule
IMPLICIT NONE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ENUM, BIND(c)
!> Something is in progress
ENUMERATOR :: TaskRunningA
!> First we gather the blocks of A and send the size.
ENUMERATOR :: LocalGatherA
!> After the local gather, we then send the size to the other tasks.
ENUMERATOR :: SendSizeA
!> Next we compose those blocks of A into one big send buffer and send.
ENUMERATOR :: ComposeA
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterA
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerA
!> Wait for the data values to be gathered,
ENUMERATOR :: WaitDataA
!> Need to adjusts indices, transpose the values of A.
ENUMERATOR :: AdjustIndicesA
!> Just waiting on that last task.
ENUMERATOR :: CleanupA
!> No more work to do.
ENUMERATOR :: FinishedA
!> Something is in progress
ENUMERATOR :: TaskRunningA
!> First we gather the blocks of A and send the size.
ENUMERATOR :: LocalGatherA
!> After the local gather, we then send the size to the other tasks.
ENUMERATOR :: SendSizeA
!> Next we compose those blocks of A into one big send buffer and send.
ENUMERATOR :: ComposeA
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterA
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerA
!> Wait for the data values to be gathered,
ENUMERATOR :: WaitDataA
!> Need to adjusts indices, transpose the values of A.
ENUMERATOR :: AdjustIndicesA
!> Just waiting on that last task.
ENUMERATOR :: CleanupA
!> No more work to do.
ENUMERATOR :: FinishedA
END ENUM
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ENUM, BIND(c)
!> Something is in progress
ENUMERATOR :: TaskRunningB
!> First we gather the blocks of B and send the size.
ENUMERATOR :: LocalGatherB
!> Next we compose those blocks of B into one big send buffer and send.
ENUMERATOR :: LocalComposeB
!> After the local gather, we then send the size to the other tasks.
ENUMERATOR :: SendSizeB
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterB
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerB
!> Wait for the data values to be gathered, and then adjusts the indices.
ENUMERATOR :: WaitDataB
!> Need to adjusts indices of B.
ENUMERATOR :: AdjustIndicesB
!> Just waiting on that last task.
ENUMERATOR :: CleanupB
!> No more work to do.
ENUMERATOR :: FinishedB
!> Something is in progress
ENUMERATOR :: TaskRunningB
!> First we gather the blocks of B and send the size.
ENUMERATOR :: LocalGatherB
!> Next we compose those blocks of B into one big send buffer and send.
ENUMERATOR :: LocalComposeB
!> After the local gather, we then send the size to the other tasks.
ENUMERATOR :: SendSizeB
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterB
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerB
!> Wait for the data values to be gathered, and then adjusts the indices.
ENUMERATOR :: WaitDataB
!> Need to adjusts indices of B.
ENUMERATOR :: AdjustIndicesB
!> Just waiting on that last task.
ENUMERATOR :: CleanupB
!> No more work to do.
ENUMERATOR :: FinishedB
END ENUM
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ENUM, BIND(c)
!> Something is in progress.
ENUMERATOR :: TaskRunningAB
!> A and B matrix both missing, so it cannot do gemm.
ENUMERATOR :: AwaitingAB
!> Actually call gemm and compute a block, and send its size.
ENUMERATOR :: GemmAB
!> After the local Gemm, we then send the size to the other tasks.
ENUMERATOR :: SendSizeAB
!> Start sending the data for summing.
ENUMERATOR :: GatherAndSumAB
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterAB
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerAB
!> Wait for the data values to be gathered. Once receive, we increment.
ENUMERATOR :: WaitDataAB
!> Sum up the gathered matrices.
ENUMERATOR :: LocalSumAB
!> Just waiting on that last task.
ENUMERATOR :: CleanupAB
!> No more work to do.
enumerator :: FinishedAB
!> Something is in progress.
ENUMERATOR :: TaskRunningAB
!> A and B matrix both missing, so it cannot do gemm.
ENUMERATOR :: AwaitingAB
!> Actually call gemm and compute a block, and send its size.
ENUMERATOR :: GemmAB
!> After the local Gemm, we then send the size to the other tasks.
ENUMERATOR :: SendSizeAB
!> Start sending the data for summing.
ENUMERATOR :: GatherAndSumAB
!> Wait for the outer index values to be gathered.
ENUMERATOR :: WaitOuterAB
!> Wait for the inner index values to be gathered.
ENUMERATOR :: WaitInnerAB
!> Wait for the data values to be gathered. Once receive, we increment.
ENUMERATOR :: WaitDataAB
!> Sum up the gathered matrices.
ENUMERATOR :: LocalSumAB
!> Just waiting on that last task.
ENUMERATOR :: CleanupAB
!> No more work to do.
ENUMERATOR :: FinishedAB
END ENUM
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END MODULE GemmTasksModule
......@@ -60,7 +60,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Density Matrix Extrapolator")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Purification")
CALL WriteElement(key="Method", VALUE="Purification")
CALL WriteCitation("niklasson2010trace")
CALL PrintParameters(solver_parameters)
END IF
......@@ -109,10 +109,10 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
norm_value = MatrixNorm(WorkingDensity)
IF (solver_parameters%be_verbose) THEN
CALL WriteListElement(key="Round", value=outer_counter)
CALL WriteListElement(key="Round", VALUE=outer_counter)
CALL EnterSubLog
CALL WriteElement(key="Convergence", value=norm_value)
CALL WriteElement(key="Trace", value=trace_value)
CALL WriteElement(key="Convergence", VALUE=norm_value)
CALL WriteElement(key="Trace", VALUE=trace_value)
CALL ExitSubLog
END IF
......@@ -125,7 +125,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END DO
IF (solver_parameters%be_verbose) THEN
CALL ExitSubLog
CALL WriteElement(key="Total_Iterations", value=outer_counter)
CALL WriteElement(key="Total_Iterations", VALUE=outer_counter)
CALL PrintMatrixInformation(NewDensity)
END IF
......@@ -181,7 +181,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Density Matrix Extrapolator")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Lowdin")
CALL WriteElement(key="Method", VALUE="Lowdin")
CALL WriteCitation("exner2002comparison")
CALL PrintParameters(solver_parameters)
END IF
......
......@@ -33,16 +33,16 @@ MODULE HermiteSolversModule
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTERFACE ConstructPolynomial
MODULE PROCEDURE ConstructPolynomial_horner
END INTERFACE
END INTERFACE ConstructPolynomial
INTERFACE DestructPolynomial
MODULE PROCEDURE DestructPolynomial_horner
END INTERFACE
END INTERFACE DestructPolynomial
INTERFACE SetCoefficient
MODULE PROCEDURE SetCoefficient_horner
END INTERFACE
END INTERFACE SetCoefficient
INTERFACE Compute
MODULE PROCEDURE Compute_horner
END INTERFACE
END INTERFACE Compute
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Construct a Hermite polynomial object.
PURE SUBROUTINE ConstructPolynomial_horner(this, degree)
......@@ -52,7 +52,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTEGER, INTENT(in) :: degree
ALLOCATE(this%coefficients(degree))
this%coefficients = 0
this%coefficients = 0.0_NTREAL
END SUBROUTINE ConstructPolynomial_horner
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Destruct a Hermite polynomial object.
......@@ -114,8 +114,8 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Hermite Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="Standard")
CALL WriteElement(key="Degree", value=degree-1)
CALL WriteElement(key="Method", VALUE="Standard")
CALL WriteElement(key="Degree", VALUE=degree-1)
CALL PrintParameters(solver_parameters)
END IF
......
......@@ -90,9 +90,9 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
norm_value = solver_parameters%converge_diff + 1.0_NTREAL
DO outer_counter = 1,solver_parameters%max_iterations
IF (solver_parameters%be_verbose .AND. outer_counter .GT. 1) THEN
CALL WriteListElement(key="Round", value=outer_counter-1)
CALL WriteListElement(key="Round", VALUE=outer_counter-1)
CALL EnterSubLog
CALL WriteListElement(key="Convergence", value=norm_value)
CALL WriteListElement(key="Convergence", VALUE=norm_value)
CALL ExitSubLog
END IF
......@@ -122,7 +122,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END DO
IF (solver_parameters%be_verbose) THEN
CALL ExitSubLog
CALL WriteElement(key="Total_Iterations", value=outer_counter-1)
CALL WriteElement(key="Total_Iterations", VALUE=outer_counter-1)
CALL PrintMatrixInformation(InverseMat)
END IF
......@@ -212,9 +212,9 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
norm_value = solver_parameters%converge_diff + 1.0_NTREAL
DO outer_counter = 1,solver_parameters%max_iterations
IF (solver_parameters%be_verbose .AND. outer_counter .GT. 1) THEN
CALL WriteListElement(key="Round", value=outer_counter-1)
CALL WriteListElement(key="Round", VALUE=outer_counter-1)
CALL EnterSubLog
CALL WriteListElement(key="Convergence", value=norm_value)
CALL WriteListElement(key="Convergence", VALUE=norm_value)
CALL ExitSubLog
END IF
......@@ -243,7 +243,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END DO
IF (solver_parameters%be_verbose) THEN
CALL ExitSubLog
CALL WriteElement(key="Total_Iterations", value=outer_counter-1)
CALL WriteElement(key="Total_Iterations", VALUE=outer_counter-1)
CALL PrintMatrixInformation(InverseMat)
END IF
......
......@@ -58,7 +58,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IF (solver_parameters%be_verbose) THEN
CALL WriteHeader("Linear Solver")
CALL EnterSubLog
CALL WriteElement(key="Method", value="CG")
CALL WriteElement(key="Method", VALUE="CG")
CALL PrintParameters(solver_parameters)
END IF
......@@ -102,9 +102,9 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
norm_value = solver_parameters%converge_diff + 1.0_NTREAL
DO outer_counter = 1,solver_parameters%max_iterations
IF (solver_parameters%be_verbose .AND. outer_counter .GT. 1) THEN
CALL WriteListElement(key="Round", value=outer_counter-1)
CALL WriteListElement(key="Round", VALUE=outer_counter-1)
CALL EnterSubLog
CALL WriteListElement(key="Convergence", value=norm_value)
CALL WriteListElement(key="Convergence", VALUE=norm_value)
CALL ExitSubLog
END IF
IF (norm_value .LE. solver_parameters%converge_diff) THEN
......@@ -151,7 +151,7 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END DO
IF (solver_parameters%be_verbose) THEN
CALL ExitSubLog
CALL WriteElement(key="Total_Iterations", value=outer_counter-1)
CALL WriteElement(key="Total_Iterations", VALUE=outer_counter-1)
CALL PrintMatrixInformation(XMat)
END IF
......
......@@ -24,13 +24,13 @@ MODULE LoggingModule
MODULE PROCEDURE WriteListElement_float
MODULE PROCEDURE WriteListElement_int
MODULE PROCEDURE WriteListElement_string
END INTERFACE
END INTERFACE WriteListElement
INTERFACE WriteElement
MODULE PROCEDURE WriteElement_bool
MODULE PROCEDURE WriteElement_float
MODULE PROCEDURE WriteElement_int
MODULE PROCEDURE WriteElement_string
END INTERFACE
END INTERFACE WriteElement
CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Activate the logger.
SUBROUTINE ActivateLogger
......@@ -65,17 +65,17 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END SUBROUTINE WriteHeader
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Write out a element.
SUBROUTINE WriteElement_bool(key, value)
SUBROUTINE WriteElement_bool(key, VALUE)
!> Some text to write.
CHARACTER(LEN=*), INTENT(IN) :: key
!> An integer value to write.
LOGICAL, INTENT(IN) :: value
LOGICAL, INTENT(IN) :: VALUE
IF (IsActive) THEN
CALL WriteIndent
WRITE(*,'(A)',ADVANCE='no') key
IF (value) THEN
IF (VALUE) THEN
WRITE(*,'(A)',ADVANCE='no') ": True"
ELSE
WRITE(*,'(A)',ADVANCE='no') ": False"
......@@ -86,72 +86,72 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END SUBROUTINE WriteElement_bool
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Write out a element.
SUBROUTINE WriteElement_float(key, value)
SUBROUTINE WriteElement_float(key, VALUE)
!> Some text to write.
CHARACTER(LEN=*), INTENT(IN) :: key
!> A float value to write.
REAL(NTReal), INTENT(IN) :: value
REAL(NTReal), INTENT(IN) :: VALUE
IF (IsActive) THEN
CALL WriteIndent
WRITE(*,'(A)',ADVANCE='no') key
WRITE(*,'(A)',ADVANCE='no') ": "
WRITE(*,'(ES22.14)',ADVANCE='no') value
WRITE(*,'(ES22.14)',ADVANCE='no') VALUE
WRITE(*,*)
END IF
END SUBROUTINE WriteElement_float
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Write out a element.
SUBROUTINE WriteElement_int(key, value)
SUBROUTINE WriteElement_int(key, VALUE)
!> Some text to write.
CHARACTER(LEN=*), INTENT(IN) :: key
!> An integer value to write.
INTEGER, INTENT(IN) :: value
INTEGER, INTENT(IN) :: VALUE
IF (IsActive) THEN
CALL WriteIndent
WRITE(*,'(A)',ADVANCE='no') key
WRITE(*,'(A)',ADVANCE='no') ": "
WRITE(*,'(I10)',ADVANCE='no') value
WRITE(*,'(I10)',ADVANCE='no') VALUE
WRITE(*,*)
END IF
END SUBROUTINE WriteElement_int
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Write out a element.
SUBROUTINE WriteElement_string(key, value)
SUBROUTINE WriteElement_string(key, VALUE)
!> Some text to write.
CHARACTER(LEN=*), INTENT(IN) :: key
!> A text value to write.
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: value
CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: VALUE
IF (IsActive) THEN
CALL WriteIndent
WRITE(*,'(A)',ADVANCE='no') key
WRITE(*,'(A)',ADVANCE='no') ": "
WRITE(*,'(A)',ADVANCE='no') value
WRITE(*,'(A)',ADVANCE='no') VALUE
WRITE(*,*)
END IF
END SUBROUTINE WriteElement_string
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!> Write out a list element.
SUBROUTINE WriteListElement_bool(key, value)
SUBROUTINE WriteListElement_bool(key, VALUE)
!> Some text to write.
CHARACTER(LEN=*), INTENT(IN) :: key
!> A bool value to write.
LOGICAL, INTENT(IN) :: value
LOGICAL, INTENT(IN) :: VALUE
IF (IsActive) THEN
CALL WriteIndent
WRITE(*,'(A)',ADVANCE='no') "- "
WRITE(*,'(A)',ADVANCE='no') key
IF (value) THEN
IF (VALUE) THEN
WRITE(*,'(A)',ADVANCE='no') ": True"
ELSE
WRITE(*,'(A)',ADVANCE='no') ": False"
......@@ -162,11 +162,11 @@ CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END SUBROUTINE WriteListElement_bool
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!