Skip to content

Commit 48399d9

Browse files
committed
FDS Source: Fix realizability error with misplaced logical initialization.
1 parent 4f5b4a5 commit 48399d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Source/mass.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ SUBROUTINE CHECK_MASS_DENSITY
630630
REAL(EB) :: MASS_N(-3:3),CONST,MASS_C,RHO_ZZ_CUT,RHO_CUT,VC(-3:3),SIGN_FACTOR,SUM_MASS_N,VC1(-3:3),&
631631
RHO_ZZ_MIN,RHO_ZZ_MAX,SUM_RHO_ZZ,RHO_ZZ_TEST
632632
INTEGER :: IC
633-
LOGICAL :: CLIP_RHO_ZZ
633+
LOGICAL :: CLIP_RHO_ZZ(N_TRACKED_SPECIES)
634634
REAL(EB), POINTER, DIMENSION(:,:,:) :: DELTA_RHO,DELTA_RHO_ZZ,RHOP
635635
REAL(EB), POINTER, DIMENSION(:,:,:,:) :: RHO_ZZ
636636

@@ -716,12 +716,12 @@ SUBROUTINE CHECK_MASS_DENSITY
716716
! Correct species mass density
717717

718718
RHO_ZZ_MIN = 0._EB
719+
CLIP_RHO_ZZ = .FALSE.
719720

720721
SPECIES_LOOP: DO N=1,N_TRACKED_SPECIES
721722

722723
DELTA_RHO_ZZ => WORK5
723724
DELTA_RHO_ZZ = 0._EB
724-
CLIP_RHO_ZZ = .FALSE.
725725

726726
DO K=1,KBAR
727727
DO J=1,JBAR
@@ -739,7 +739,7 @@ SUBROUTINE CHECK_MASS_DENSITY
739739

740740
RHO_ZZ_MAX = RHOP(I,J,K)
741741
IF (RHO_ZZ(I,J,K,N)>=RHO_ZZ_MIN .AND. RHO_ZZ(I,J,K,N)<=RHO_ZZ_MAX) CYCLE
742-
CLIP_RHO_ZZ = .TRUE.
742+
CLIP_RHO_ZZ(N) = .TRUE.
743743
IF (RHO_ZZ(I,J,K,N)<RHO_ZZ_MIN) THEN
744744
RHO_ZZ_CUT = RHO_ZZ_MIN
745745
SIGN_FACTOR = 1._EB
@@ -777,7 +777,7 @@ SUBROUTINE CHECK_MASS_DENSITY
777777
ENDDO
778778
ENDDO
779779

780-
IF (.NOT.CLIP_RHO_ZZ) CYCLE
780+
IF (.NOT.CLIP_RHO_ZZ(N)) CYCLE
781781

782782
! Assign excess/deficit RHO_ZZ neighboring cells
783783

@@ -793,7 +793,7 @@ SUBROUTINE CHECK_MASS_DENSITY
793793

794794
! If nothing has been clipped, return
795795

796-
IF (.NOT.CLIP_RHOMIN .AND. .NOT.CLIP_RHOMAX .AND. .NOT.CLIP_RHO_ZZ) RETURN
796+
IF (.NOT.CLIP_RHOMIN .AND. .NOT.CLIP_RHOMAX .AND. .NOT. ANY(CLIP_RHO_ZZ)) RETURN
797797

798798
! Final check of RHO_ZZ to ensure that ZZ(:,:,:,1:N_TRACKED_SPECIES) sums to 1
799799

0 commit comments

Comments
 (0)