From b6e617857e33b550cbedc158e4f4fce08e08ac19 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Oct 2023 13:42:00 -0400 Subject: [PATCH 1/9] FDS source: for each slice file compute min/max over beginning to current time and output that. .sf.bnd files will now only contain 1 row --- Source/dump.f90 | 11 +++++++++-- Source/type.f90 | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 5ec8157ed26..ecabbf10e3d 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -5977,8 +5977,15 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) ENDIF IQ2 = IQ + N_SLCF_MAX - OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND') - WRITE(LU_SLCF(IQ2,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SLICE_MIN, SLICE_MAX + IF (SL%VAL_MIN < SL%VAL_MAX) THEN + SL%VAL_MIN = MIN(SL%VAL_MIN, SLICE_MIN) + SL%VAL_MAX = MAX(SL%VAL_MAX, SLICE_MAX) + ELSE + SL%VAL_MIN = SLICE_MIN + SL%VAL_MAX = SLICE_MAX + ENDIF + OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_SLCF(IQ2,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SL%VAL_MIN, SL%VAL_MAX CLOSE(LU_SLCF(IQ2,NM)) ELSE STIME = REAL(T_BEGIN + (T-T_BEGIN)*TIME_SHRINK_FACTOR,FB) diff --git a/Source/type.f90 b/Source/type.f90 index d51cf4bd7fd..dc16ca456e5 100644 --- a/Source/type.f90 +++ b/Source/type.f90 @@ -1430,7 +1430,7 @@ MODULE TYPES INTEGER :: I1,I2,J1,J2,K1,K2,GEOM_INDEX=-1,INDEX,INDEX2=0,Z_INDEX=-999,Y_INDEX=-999,MATL_INDEX=-999,& PART_INDEX=0,VELO_INDEX=0,PROP_INDEX=0,REAC_INDEX=0,SLCF_INDEX REAL(FB), DIMENSION(2) :: MINMAX - REAL(FB) :: RLE_MIN, RLE_MAX + REAL(FB) :: RLE_MIN, RLE_MAX, VAL_MIN=1.0, VAL_MAX=0.0 REAL(EB):: AGL_SLICE LOGICAL :: TERRAIN_SLICE=.FALSE.,CELL_CENTERED=.FALSE.,RLE=.FALSE.,DEBUG=.FALSE.,THREE_D=.FALSE. CHARACTER(LABEL_LENGTH) :: SLICETYPE='STRUCTURED',SMOKEVIEW_LABEL From 64d55d5513c35e4c73341a9285bd775c06bbec54 Mon Sep 17 00:00:00 2001 From: gforney Date: Mon, 30 Oct 2023 14:41:36 -0400 Subject: [PATCH 2/9] FDS source: for each boundary file compute min/max over beginning to current time and output that. boundary .bnd files will now only contain 1 row --- Source/dump.f90 | 43 ++++++++++++++++++++++++++++++++----------- Source/type.f90 | 1 + 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index ecabbf10e3d..8ed605a5a92 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -1272,7 +1272,6 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM) RESTART: IF (APPEND) THEN OPEN(LU_BNDF(NF,NM),FILE=FN_BNDF(NF,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND') - OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND') ELSE RESTART IF (M%N_STRINGS+5>M%N_STRINGS_MAX) CALL RE_ALLOCATE_STRINGS(NM) M%N_STRINGS = M%N_STRINGS + 1 @@ -1290,7 +1289,6 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM) M%N_STRINGS = M%N_STRINGS + 1 WRITE(M%STRING(M%N_STRINGS),'(1X,A)') TRIM(BF%UNITS) OPEN(LU_BNDF(NF,NM),FILE=FN_BNDF(NF,NM),FORM='UNFORMATTED',STATUS='REPLACE') - OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='REPLACE') WRITE(LU_BNDF(NF,NM)) BF%SMOKEVIEW_LABEL(1:30) WRITE(LU_BNDF(NF,NM)) BF%SMOKEVIEW_BAR_LABEL(1:30) WRITE(LU_BNDF(NF,NM)) BF%UNITS(1:30) @@ -5280,13 +5278,15 @@ END SUBROUTINE DUMP_CFACES_GEOM SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,FUNIT_BOUNDS,CC_INTERP2FACES,CC_CELL_CENTERED,SLICETYPE, & HEADER,STIME,I1,I2,J1,J2,K1,K2,DEBUG,& - IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM) + IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & + SLICE_MIN, SLICE_MAX) REAL(EB), INTENT(IN) :: T,DT CHARACTER(*), INTENT(IN) :: SLICETYPE INTEGER, INTENT(IN) :: FUNIT_DATA,FUNIT_BOUNDS,HEADER,I1,I2,J1,J2,K1,K2,DEBUG, & IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,NM REAL(FB), INTENT(IN):: STIME LOGICAL, INTENT(IN) :: CC_INTERP2FACES,CC_CELL_CENTERED +REAL(FB), INTENT(INOUT) :: SLICE_MIN, SLICE_MAX INTEGER, PARAMETER :: VERSION=2 INTEGER :: NVERTS,NVERTS_CUTCELLS,NFACES,NFACES_CUTCELLS @@ -5364,7 +5364,15 @@ SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,FUNIT_BOUNDS,CC_INTERP2FACES,CC_CELL_ VAL_MIN = REAL(100*NM,FB) VAL_MAX = REAL(100*NM,FB) ENDIF - WRITE(FUNIT_BOUNDS,'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, VAL_MIN, VAL_MAX + IF (SLICE_MIN < SLICE_MAX) THEN + SLICE_MIN = MIN(SLICE_MIN, VAL_MIN) + SLICE_MAX = MAX(SLICE_MAX, VAL_MAX) + ELSE + SLICE_MIN = VAL_MIN + SLICE_MAX = VAL_MAX + ENDIF + WRITE(FUNIT_BOUNDS,'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SLICE_MIN, SLICE_MAX + DEALLOCATE(VALS) ENDIF @@ -6000,14 +6008,16 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) OPEN(LU_SLCF(IQ+N_SLCF_MAX,NM),FILE=FN_SLCF(IQ+N_SLCF_MAX,NM),FORM='FORMATTED',STATUS='REPLACE') CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),LU_SLCF(IQ+N_SLCF_MAX,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & 1,STIME,I1,I2,J1,J2,K1,K2,0,& - IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM) + IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & + SL%VAL_MIN, SL%VAL_MAX) ELSE ! data file at subsequent time steps OPEN(LU_SLCF(IQ,NM),FILE=FN_SLCF(IQ,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND') - OPEN(LU_SLCF(IQ+N_SLCF_MAX,NM),FILE=FN_SLCF(IQ+N_SLCF_MAX,NM),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND') + OPEN(LU_SLCF(IQ+N_SLCF_MAX,NM),FILE=FN_SLCF(IQ+N_SLCF_MAX,NM),FORM='FORMATTED',STATUS='REPLACE') CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),LU_SLCF(IQ+N_SLCF_MAX,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & 0,STIME,I1,I2,J1,J2,K1,K2,0,& - IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM) + IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & + SL%VAL_MIN, SL%VAL_MAX) ENDIF CLOSE(LU_SLCF(IQ,NM)) CLOSE(LU_SLCF(IQ+N_SLCF_MAX,NM)) @@ -10436,7 +10446,16 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) ENDIF ENDDO PATCH_LOOP - WRITE(LU_BNDF(NF+N_BNDF,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)')STIME,BOUND_MIN,BOUND_MAX + IF (BF%VAL_MIN < BF%VAL_MAX) THEN + BF%VAL_MIN = MIN(BF%VAL_MIN, BOUND_MIN) + BF%VAL_MAX = MAX(BF%VAL_MAX, BOUND_MAX) + ELSE + BF%VAL_MIN = BOUND_MIN + BF%VAL_MAX = BOUND_MAX + ENDIF + OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_BNDF(NF+N_BNDF,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)')STIME,BF%VAL_MIN,BF%VAL_MAX + CLOSE(LU_BNDF(NF+N_BNDF,NM)) ENDDO FILE_LOOP @@ -10453,15 +10472,17 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) OPEN(LU_BNDG(NF+N_BNDF,NM),FILE=FN_BNDG(NF+N_BNDF,NM),FORM='FORMATTED', STATUS='REPLACE') CALL DUMP_SLICE_GEOM_DATA(LU_BNDG(NF,NM),LU_BNDG(NF+N_BNDF,NM), & .FALSE.,.TRUE.,"INBOUND_FACES",1,STIME,I1,I2,J1,J2,K1,K2,BF%DEBUG, & - IND,0,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,0,0,BF%PROP_INDEX,0,0,T,DT,NM) + IND,0,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,0,0,BF%PROP_INDEX,0,0,T,DT,NM, & + BF%VAL_MIN, BF%VAL_MAX) !IND,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,T,DT,NM) ELSE ! data file at subsequent time steps OPEN(LU_BNDG(NF,NM), FILE=FN_BNDG(NF,NM), FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND') - OPEN(LU_BNDG(NF+N_BNDF,NM),FILE=FN_BNDG(NF+N_BNDF,NM),FORM='FORMATTED', STATUS='OLD',POSITION='APPEND') + OPEN(LU_BNDG(NF+N_BNDF,NM),FILE=FN_BNDG(NF+N_BNDF,NM),FORM='FORMATTED', STATUS='REPLACE') CALL DUMP_SLICE_GEOM_DATA(LU_BNDG(NF,NM),LU_BNDG(NF+N_BNDF,NM), & .FALSE.,.TRUE.,"INBOUND_FACES",0,STIME,I1,I2,J1,J2,K1,K2,BF%DEBUG, & - IND,0,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,0,0,BF%PROP_INDEX,0,0,T,DT,NM) + IND,0,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,0,0,BF%PROP_INDEX,0,0,T,DT,NM, & + BF%VAL_MIN, BF%VAL_MAX) !IND,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,T,DT,NM) ENDIF CLOSE(LU_BNDG(NF,NM)) diff --git a/Source/type.f90 b/Source/type.f90 index dc16ca456e5..f0ca4a2cc50 100644 --- a/Source/type.f90 +++ b/Source/type.f90 @@ -1451,6 +1451,7 @@ MODULE TYPES CHARACTER(LABEL_LENGTH) :: SMOKEVIEW_LABEL CHARACTER(LABEL_LENGTH) :: SMOKEVIEW_BAR_LABEL,UNITS,MATL_ID='null' LOGICAL :: CELL_CENTERED=.FALSE. + REAL(FB) :: VAL_MIN=1.0, VAL_MAX=0.0 END TYPE BOUNDARY_FILE_TYPE TYPE (BOUNDARY_FILE_TYPE), DIMENSION(:), ALLOCATABLE, TARGET :: BOUNDARY_FILE From eeb9a73b7a95811fa6f41115587477de8bc3efc8 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Oct 2023 13:20:11 -0400 Subject: [PATCH 3/9] FDS source: update .bnd file bound using previous values storeed in the .bnd file (rather than storing values within FDS) --- Source/dump.f90 | 147 +++++++++++++++++++++++++++++++++--------------- Source/type.f90 | 3 +- 2 files changed, 102 insertions(+), 48 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 8ed605a5a92..ba2e010fa39 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -5276,17 +5276,17 @@ SUBROUTINE DUMP_CFACES_GEOM(FUNIT,STIME) END SUBROUTINE DUMP_CFACES_GEOM -SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,FUNIT_BOUNDS,CC_INTERP2FACES,CC_CELL_CENTERED,SLICETYPE, & +SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,CC_INTERP2FACES,CC_CELL_CENTERED,SLICETYPE, & HEADER,STIME,I1,I2,J1,J2,K1,K2,DEBUG,& IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & SLICE_MIN, SLICE_MAX) REAL(EB), INTENT(IN) :: T,DT CHARACTER(*), INTENT(IN) :: SLICETYPE -INTEGER, INTENT(IN) :: FUNIT_DATA,FUNIT_BOUNDS,HEADER,I1,I2,J1,J2,K1,K2,DEBUG, & +INTEGER, INTENT(IN) :: FUNIT_DATA,HEADER,I1,I2,J1,J2,K1,K2,DEBUG, & IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,NM REAL(FB), INTENT(IN):: STIME LOGICAL, INTENT(IN) :: CC_INTERP2FACES,CC_CELL_CENTERED -REAL(FB), INTENT(INOUT) :: SLICE_MIN, SLICE_MAX +REAL(FB), INTENT(OUT) :: SLICE_MIN, SLICE_MAX INTEGER, PARAMETER :: VERSION=2 INTEGER :: NVERTS,NVERTS_CUTCELLS,NFACES,NFACES_CUTCELLS @@ -5364,16 +5364,12 @@ SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,FUNIT_BOUNDS,CC_INTERP2FACES,CC_CELL_ VAL_MIN = REAL(100*NM,FB) VAL_MAX = REAL(100*NM,FB) ENDIF - IF (SLICE_MIN < SLICE_MAX) THEN - SLICE_MIN = MIN(SLICE_MIN, VAL_MIN) - SLICE_MAX = MAX(SLICE_MAX, VAL_MAX) - ELSE - SLICE_MIN = VAL_MIN - SLICE_MAX = VAL_MAX - ENDIF - WRITE(FUNIT_BOUNDS,'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SLICE_MIN, SLICE_MAX - + SLICE_MIN = VAL_MIN + SLICE_MAX = VAL_MAX DEALLOCATE(VALS) +ELSE + SLICE_MIN = 1.0 + SLICE_MAX = 0.0 ENDIF END SUBROUTINE DUMP_SLICE_GEOM_DATA @@ -5642,6 +5638,8 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) INTEGER, INTENT(IN) :: NM,IFRMT REAL(EB), INTENT(IN) :: T,DT REAL(EB) :: BSUM,TT +REAL(FB) :: T_BOUND, SLICE_MIN_BOUND, SLICE_MAX_BOUND +INTEGER :: CHANGE_BOUND INTEGER :: I,J,K,NQT,I1,I2,J1,J2,K1,K2,ITM,ITM1,IQ,IQ2,IQ3,IQQ,IND,IND2,II1,II2,JJ1,JJ2,KK1,KK2, & IC,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,NOM,IIO,JJO,KKO,I_INC,J_INC INTEGER :: KTS,NTSL @@ -5985,16 +5983,29 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) ENDIF IQ2 = IQ + N_SLCF_MAX - IF (SL%VAL_MIN < SL%VAL_MAX) THEN - SL%VAL_MIN = MIN(SL%VAL_MIN, SLICE_MIN) - SL%VAL_MAX = MAX(SL%VAL_MAX, SLICE_MAX) + CHANGE_BOUND = 0 + IF (ABS(STIME-T_BEGIN) SLICE_MAX_BOUND) THEN + SLICE_MAX_BOUND = SLICE_MAX + CHANGE_BOUND = 1 + ENDIF + ENDIF + IF (CHANGE_BOUND == 1) THEN + OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_SLCF(IQ2,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SLICE_MIN_BOUND, SLICE_MAX_BOUND + CLOSE(LU_SLCF(IQ2,NM)) + ENDIF ELSE STIME = REAL(T_BEGIN + (T-T_BEGIN)*TIME_SHRINK_FACTOR,FB) ! write geometry for slice file @@ -6005,19 +6016,36 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) CLOSE(LU_SLCF_GEOM(IQ,NM)) OPEN(LU_SLCF(IQ,NM),FILE=FN_SLCF(IQ,NM),FORM='UNFORMATTED',STATUS='REPLACE') - OPEN(LU_SLCF(IQ+N_SLCF_MAX,NM),FILE=FN_SLCF(IQ+N_SLCF_MAX,NM),FORM='FORMATTED',STATUS='REPLACE') - CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),LU_SLCF(IQ+N_SLCF_MAX,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & + CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & 1,STIME,I1,I2,J1,J2,K1,K2,0,& IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & - SL%VAL_MIN, SL%VAL_MAX) + SLICE_MIN, SLICE_MAX) + SLICE_MIN_BOUND = SLICE_MIN + SLICE_MAX_BOUND = SLICE_MAX + CHANGE_BOUND = 1 ELSE ! data file at subsequent time steps OPEN(LU_SLCF(IQ,NM),FILE=FN_SLCF(IQ,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND') - OPEN(LU_SLCF(IQ+N_SLCF_MAX,NM),FILE=FN_SLCF(IQ+N_SLCF_MAX,NM),FORM='FORMATTED',STATUS='REPLACE') - CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),LU_SLCF(IQ+N_SLCF_MAX,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & + CALL DUMP_SLICE_GEOM_DATA(LU_SLCF(IQ,NM),CC_INTERP2FACES,SL%CELL_CENTERED,SL%SLICETYPE, & 0,STIME,I1,I2,J1,J2,K1,K2,0,& IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,0,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & - SL%VAL_MIN, SL%VAL_MAX) + SLICE_MIN, SLICE_MAX) + OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),ACTION='READ') + READ(LU_SLCF(IQ2,NM),*)T_BOUND, SLICE_MIN_BOUND, SLICE_MAX_BOUND + CLOSE(LU_SLCF(IQ2,NM)) + IF (SLICE_MIN < SLICE_MIN_BOUND) THEN + SLICE_MIN_BOUND = SLICE_MIN + CHANGE_BOUND = 1 + ENDIF + IF (SLICE_MAX > SLICE_MAX_BOUND) THEN + SLICE_MAX_BOUND = SLICE_MAX + CHANGE_BOUND = 1 + ENDIF + ENDIF + IF (CHANGE_BOUND == 1) THEN + OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_SLCF(IQ2,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, SLICE_MIN_BOUND, SLICE_MAX_BOUND + CLOSE(LU_SLCF(IQ2,NM)) ENDIF CLOSE(LU_SLCF(IQ,NM)) CLOSE(LU_SLCF(IQ+N_SLCF_MAX,NM)) @@ -10321,6 +10349,8 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) INTEGER :: NBF_DEBUG INTEGER, INTENT(IN) :: NM TYPE(PATCH_TYPE), POINTER :: PA +REAL(FB) BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX +INTEGER :: CHANGE_BOUND IF (MESHES(NM)%N_PATCH==0 .AND. MESHES(NM)%N_INTERNAL_CFACE_CELLS==0) RETURN @@ -10446,16 +10476,26 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) ENDIF ENDDO PATCH_LOOP - IF (BF%VAL_MIN < BF%VAL_MAX) THEN - BF%VAL_MIN = MIN(BF%VAL_MIN, BOUND_MIN) - BF%VAL_MAX = MAX(BF%VAL_MAX, BOUND_MAX) + CHANGE_BOUND = 0 + IF (REAL(T-T_BEGIN,FB) BNDF_VAL_MAX) THEN + BNDF_VAL_MAX = BOUND_MAX + CHANGE_BOUND = 1 + ENDIF + ENDIF + IF (CHANGE_BOUND == 1) THEN + OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_BNDF(NF+N_BNDF,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)')STIME, BNDF_VAL_MIN, BNDF_VAL_MAX + CLOSE(LU_BNDF(NF+N_BNDF,NM)) ENDIF - OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='REPLACE') - WRITE(LU_BNDF(NF+N_BNDF,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)')STIME,BF%VAL_MIN,BF%VAL_MAX - CLOSE(LU_BNDF(NF+N_BNDF,NM)) ENDDO FILE_LOOP @@ -10467,26 +10507,41 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) NC = 0 I1=0; I2=-1; J1=0; J2=-1; K1=0; K2=-1; ! Just dummy numbers, not needed for INBOUND_FACES ! write geometry for slice file + CHANGE_BOUND = 0 IF (REAL(T-T_BEGIN,FB) Date: Tue, 31 Oct 2023 13:38:53 -0400 Subject: [PATCH 4/9] Revert "FDS source: update .bnd file bound using previous values storeed in the .bnd file (rather than storing values within FDS)" This reverts commit eeb9a73b7a95811fa6f41115587477de8bc3efc8. --- Source/dump.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index ba2e010fa39..ca4e411e603 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -10531,7 +10531,7 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) BNDF_VAL_MIN = BOUND_MIN CHANGE_BOUND = 1 ENDIF - IF (BOUND_MAX < BNDF_VAL_MAX) THEN + IF (BOUND_MAX > BNDF_VAL_MAX) THEN BNDF_VAL_MAX = BOUND_MAX CHANGE_BOUND = 1 ENDIF From 6264933c5a102494bda533015f74fd96e1fb2532 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Oct 2023 14:16:54 -0400 Subject: [PATCH 5/9] FDS source: add missing .bnd file read --- Source/dump.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/dump.f90 b/Source/dump.f90 index ca4e411e603..94e3d2d7493 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -10482,6 +10482,9 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) BNDF_VAL_MAX = BOUND_MAX CHANGE_BOUND = 1 ELSE + OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),ACTION='READ') + READ(LU_BNDF(NF+N_BNDF,NM),*)BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX + CLOSE(LU_BNDF(NF+N_BNDF,NM)) IF( BOUND_MIN < BNDF_VAL_MIN) THEN BNDF_VAL_MIN = BOUND_MIN CHANGE_BOUND = 1 From 2ef74248cb0d7e4bcd5cb94b8575702920cbc0f7 Mon Sep 17 00:00:00 2001 From: gforney Date: Tue, 31 Oct 2023 15:38:34 -0400 Subject: [PATCH 6/9] FDS source: define unit number for boundary file bnd file --- Source/dump.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/dump.f90 b/Source/dump.f90 index 94e3d2d7493..45ed5b80daf 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -6007,6 +6007,7 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) CLOSE(LU_SLCF(IQ2,NM)) ENDIF ELSE + IQ2 = IQ + N_SLCF_MAX STIME = REAL(T_BEGIN + (T-T_BEGIN)*TIME_SHRINK_FACTOR,FB) ! write geometry for slice file IF (ABS(STIME-T_BEGIN) Date: Wed, 1 Nov 2023 13:10:18 -0400 Subject: [PATCH 7/9] FDS source: remove CLOSE of slice file bounds file put in wrong place --- Source/dump.f90 | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 45ed5b80daf..2cf728ddafc 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -6049,7 +6049,6 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) CLOSE(LU_SLCF(IQ2,NM)) ENDIF CLOSE(LU_SLCF(IQ,NM)) - CLOSE(LU_SLCF(IQ+N_SLCF_MAX,NM)) ENDIF ENDIF From 98b07eea21fbd6633fe645206e001a7b75fb0d6e Mon Sep 17 00:00:00 2001 From: gforney Date: Wed, 1 Nov 2023 22:01:52 -0400 Subject: [PATCH 8/9] FDS source: add some error checking the .bnd file reads --- Source/dump.f90 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 2cf728ddafc..52a7d65b3fe 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -5652,6 +5652,7 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) INTEGER :: IFACT, JFACT, KFACT REAL(FB), ALLOCATABLE, DIMENSION(:) :: QQ_PACK REAL(FB) :: UVEL, VVEL, WVEL, VEL, PLOT3D_MIN, PLOT3D_MAX +INTEGER :: IERROR ! Return if there are no slices to process and this is not a Plot3D dump @@ -5990,13 +5991,13 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) CHANGE_BOUND = 1 ELSE OPEN(LU_SLCF(IQ2,NM),FILE=FN_SLCF(IQ2,NM),ACTION='READ') - READ(LU_SLCF(IQ2,NM),*)T_BOUND, SLICE_MIN_BOUND, SLICE_MAX_BOUND + READ(LU_SLCF(IQ2,NM),FMT=*,IOSTAT=IERROR)T_BOUND, SLICE_MIN_BOUND, SLICE_MAX_BOUND CLOSE(LU_SLCF(IQ2,NM)) - IF (SLICE_MIN < SLICE_MIN_BOUND) THEN + IF (IERROR /= 0 .OR. SLICE_MIN < SLICE_MIN_BOUND) THEN SLICE_MIN_BOUND = SLICE_MIN CHANGE_BOUND = 1 ENDIF - IF (SLICE_MAX > SLICE_MAX_BOUND) THEN + IF (IERROR /= 0 .OR. SLICE_MAX > SLICE_MAX_BOUND) THEN SLICE_MAX_BOUND = SLICE_MAX CHANGE_BOUND = 1 ENDIF @@ -6010,6 +6011,7 @@ SUBROUTINE DUMP_SLCF(T,DT,NM,IFRMT) IQ2 = IQ + N_SLCF_MAX STIME = REAL(T_BEGIN + (T-T_BEGIN)*TIME_SHRINK_FACTOR,FB) ! write geometry for slice file + CHANGE_BOUND = 0 IF (ABS(STIME-T_BEGIN) SLICE_MAX_BOUND) THEN + IF (IERROR /= 0 .OR. SLICE_MAX > SLICE_MAX_BOUND) THEN SLICE_MAX_BOUND = SLICE_MAX CHANGE_BOUND = 1 ENDIF @@ -10350,7 +10352,7 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) INTEGER, INTENT(IN) :: NM TYPE(PATCH_TYPE), POINTER :: PA REAL(FB) BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX -INTEGER :: CHANGE_BOUND +INTEGER :: CHANGE_BOUND, IERROR IF (MESHES(NM)%N_PATCH==0 .AND. MESHES(NM)%N_INTERNAL_CFACE_CELLS==0) RETURN @@ -10483,13 +10485,13 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) CHANGE_BOUND = 1 ELSE OPEN(LU_BNDF(NF+N_BNDF,NM),FILE=FN_BNDF(NF+N_BNDF,NM),ACTION='READ') - READ(LU_BNDF(NF+N_BNDF,NM),*)BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX + READ(LU_BNDF(NF+N_BNDF,NM),FMT=*,IOSTAT=IERROR)BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX CLOSE(LU_BNDF(NF+N_BNDF,NM)) - IF( BOUND_MIN < BNDF_VAL_MIN) THEN + IF( IERROR /= 0 .OR. BOUND_MIN < BNDF_VAL_MIN) THEN BNDF_VAL_MIN = BOUND_MIN CHANGE_BOUND = 1 ENDIF - IF( BOUND_MAX > BNDF_VAL_MAX) THEN + IF( IERROR /= 0 .OR. BOUND_MAX > BNDF_VAL_MAX) THEN BNDF_VAL_MAX = BOUND_MAX CHANGE_BOUND = 1 ENDIF @@ -10528,13 +10530,13 @@ SUBROUTINE DUMP_BNDF(T,DT,NM) IND,0,BF%Y_INDEX,BF%Z_INDEX,BF%PART_INDEX,0,0,BF%PROP_INDEX,0,0,T,DT,NM, & BOUND_MIN, BOUND_MAX) OPEN(LU_BNDG(NF+N_BNDF,NM),FILE=FN_BNDG(NF+N_BNDF,NM), ACTION='READ') - READ(LU_BNDG(NF+N_BNDF,NM),*)BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX + READ(LU_BNDG(NF+N_BNDF,NM),FMT=*,IOSTAT=IERROR)BNDF_TIME, BNDF_VAL_MIN, BNDF_VAL_MAX CLOSE(LU_BNDG(NF+N_BNDF,NM)) - IF (BOUND_MIN < BNDF_VAL_MIN) THEN + IF (IERROR /= 0 .OR. BOUND_MIN < BNDF_VAL_MIN) THEN BNDF_VAL_MIN = BOUND_MIN CHANGE_BOUND = 1 ENDIF - IF (BOUND_MAX > BNDF_VAL_MAX) THEN + IF (IERROR /= 0 .OR. BOUND_MAX > BNDF_VAL_MAX) THEN BNDF_VAL_MAX = BOUND_MAX CHANGE_BOUND = 1 ENDIF From 9de5b24b5d9eadba7795bb38a94178d12ecf0e68 Mon Sep 17 00:00:00 2001 From: gforney Date: Thu, 2 Nov 2023 09:55:37 -0400 Subject: [PATCH 9/9] FDS source: shorten line that was too long --- Source/dump.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 52a7d65b3fe..56b06dad36d 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -5278,8 +5278,8 @@ END SUBROUTINE DUMP_CFACES_GEOM SUBROUTINE DUMP_SLICE_GEOM_DATA(FUNIT_DATA,CC_INTERP2FACES,CC_CELL_CENTERED,SLICETYPE, & HEADER,STIME,I1,I2,J1,J2,K1,K2,DEBUG,& - IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,T,DT,NM, & - SLICE_MIN, SLICE_MAX) + IND,IND2,Y_INDEX,Z_INDEX,PART_INDEX,VELO_INDEX,PIPE_INDEX,PROP_INDEX,REAC_INDEX,MATL_INDEX,T, & + DT,NM,SLICE_MIN, SLICE_MAX) REAL(EB), INTENT(IN) :: T,DT CHARACTER(*), INTENT(IN) :: SLICETYPE INTEGER, INTENT(IN) :: FUNIT_DATA,HEADER,I1,I2,J1,J2,K1,K2,DEBUG, &