diff --git a/Source/dump.f90 b/Source/dump.f90 index 5ec8157ed26..56b06dad36d 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) @@ -5278,15 +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) + 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(OUT) :: SLICE_MIN, SLICE_MAX INTEGER, PARAMETER :: VERSION=2 INTEGER :: NVERTS,NVERTS_CUTCELLS,NFACES,NFACES_CUTCELLS @@ -5364,8 +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 - WRITE(FUNIT_BOUNDS,'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, VAL_MIN, VAL_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 @@ -5634,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 @@ -5646,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 @@ -5977,12 +5984,34 @@ 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 - CLOSE(LU_SLCF(IQ2,NM)) + 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 + 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 + 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)) ENDIF ENDIF @@ -10304,6 +10351,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, IERROR IF (MESHES(NM)%N_PATCH==0 .AND. MESHES(NM)%N_INTERNAL_CFACE_CELLS==0) RETURN @@ -10429,7 +10478,29 @@ 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 + 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 ENDDO FILE_LOOP @@ -10441,24 +10512,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) BNDF_VAL_MAX) THEN + BNDF_VAL_MAX = BOUND_MAX + CHANGE_BOUND = 1 + ENDIF + ENDIF + IF (CHANGE_BOUND == 1) THEN + OPEN(LU_BNDG(NF+N_BNDF,NM),FILE=FN_BNDG(NF+N_BNDF,NM),FORM='FORMATTED',STATUS='REPLACE') + WRITE(LU_BNDG(NF+N_BNDF,NM),'(ES13.6,1X,ES13.6,1X,ES13.6)') STIME, BNDF_VAL_MIN, BNDF_VAL_MAX + CLOSE(LU_BNDG(NF+N_BNDF,NM)) ENDIF CLOSE(LU_BNDG(NF,NM)) - CLOSE(LU_BNDG(NF+N_BNDF,NM)) ENDDO FILE_LOOP2 ENDIF