From b77508edb4348c1d63a2d6d91aaf0175a52bb260 Mon Sep 17 00:00:00 2001 From: Juha Ruokolainen Date: Tue, 6 Aug 2024 10:01:48 +0300 Subject: [PATCH] Initialize array after allocation. --- fem/src/SolverUtils.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fem/src/SolverUtils.F90 b/fem/src/SolverUtils.F90 index ce3b908232..27b7c8e45d 100644 --- a/fem/src/SolverUtils.F90 +++ b/fem/src/SolverUtils.F90 @@ -142,6 +142,7 @@ SUBROUTINE InitializeToZero( A, ForceVector ) NT => CurrentModel % Solver % NormalTangential NT % NormalTangentialNOFNodes = 0 NT % NormalTangentialName = TRIM(str) + CALL CheckNormalTangentialBoundary( CurrentModel, NT % NormalTangentialName, & NT % NormalTangentialNOFNodes, NT % BoundaryReorder, & NT % BoundaryNormals, NT % BoundaryTangent1, NT % BoundaryTangent2, dim ) @@ -756,12 +757,11 @@ SUBROUTINE UpdateGlobalEquations( StiffMatrix, LocalStiffMatrix, & Rotate = ( NT % NormalTangentialNOFNodes > 0 ) END IF - IF ( Rotate ) THEN NormalIndexes = 0 np = mGetElementDOFs(pIndexes,Element) - np = MIN(np,n) + np = MIN(np, n) NormalIndexes(1:np) = NT % BoundaryReorder(pIndexes(1:np)) CALL RotateMatrix( LocalStiffMatrix, LocalForce, n, dim, NDOFs, & @@ -846,7 +846,7 @@ SUBROUTINE UpdateGlobalEquationsVec( Gmtr, Lmtr, Gvec, Lvec, n, & NT => CurrentModel % Solver % NormalTangential Rotate = ( NT % NormalTangentialNOFNodes > 0 ) END IF - + IF ( Rotate ) THEN Ind = 0 @@ -17850,6 +17850,7 @@ SUBROUTINE MergeRhsAndSolutions() IF(.NOT. ASSOCIATED(A % rhs)) THEN ALLOCATE(A % rhs(A % NumberOfRows)) + A % RHS = 0._dp END IF IF(ASSOCIATED(betaVar)) THEN