by **Juha** » 06 Feb 2018, 11:15

Hi

The patch below fixes the case. There seems to have been a misunderstaning of the role of the variable initialization statement

in Fortran, which is very different from c/c++. Fortran initializes the variable only once (not at each re-entry) and so the initialization

also implies saving of the variable between calls.

I'll apply this to 'devel' shortly.

BR, Juha

diff --git a/fem/src/MeshUtils.F90 b/fem/src/MeshUtils.F90

index f7dfa3f..85d8efa 100644

--- a/fem/src/MeshUtils.F90

+++ b/fem/src/MeshUtils.F90

@@ -2852,13 +2852,13 @@ END SUBROUTINE GetMaxDefs

!------------------------------------------------------------------------------

INTEGER :: i,j,el_id

TYPE(Element_t), POINTER :: Element, Edge, Face

- LOGICAL :: AssignEdges=.FALSE.

+ LOGICAL :: AssignEdges

!------------------------------------------------------------------------------

CALL FindMeshEdges(Mesh)

- IF (PRESENT(NeedEdges)) &

- AssignEdges = NeedEdges

+ AssignEdges = .FALSE.

+ IF (PRESENT(NeedEdges)) AssignEdges = NeedEdges

! Set edge and face polynomial degree and degrees of freedom for

! all elements

@@ -15487,10 +15487,10 @@ CONTAINS

INTEGER i,j,n,edgeNumber, numEdges, bMap(4)

TYPE(Element_t), POINTER :: Edge

- LOGICAL :: EvalPE=.TRUE.

+ LOGICAL :: EvalPE

- IF(PRESENT(NoPE)) &

- EvalPE = .NOT.NoPE

+ EvalPE = .TRUE.

+ IF(PRESENT(NoPE)) EvalPE = .NOT.NoPE

! Get number of points, edges or faces

numEdges = 0