Skip to content

Commit

Permalink
Merge pull request firemodels#12274 from mcgratta/master
Browse files Browse the repository at this point in the history
FDS Source: Issue firemodels#12272. Fix bug related to PROFiles on particles
  • Loading branch information
mcgratta authored Dec 8, 2023
2 parents 46dc23e + cae2b39 commit fcb4fe1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
24 changes: 0 additions & 24 deletions Source/dump.f90
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)
REAL(FB), ALLOCATABLE, DIMENSION(:,:) :: Z_TERRAIN
LOGICAL, ALLOCATABLE, DIMENSION(:,:) :: OUT_OF_MESH
CHARACTER(LEN=1024) :: SLICEPARMS, SLICELABEL
CHARACTER(LABEL_LENGTH) :: HEADING
TYPE(PATCH_TYPE), POINTER :: PA
INTEGER :: CC_VAL,NSTEPS
INTEGER :: SMOKE3D_16_COMPRESS, SMOKE3D_16_VERSION
Expand Down Expand Up @@ -1344,29 +1343,6 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)
ENDIF APPEND_PARTICLE_FILE
ENDIF PARTICLE_IF

! Initialize PROFile data files (CHID_prof_nn.csv)

PROF_LOOP: DO N=1,N_PROF
IF (PROFILE(N)%ID/='null') THEN
HEADING = PROFILE(N)%ID
ELSE
HEADING = OUTPUT_QUANTITY(PROFILE(N)%QUANTITY_INDEX)%SHORT_NAME
ENDIF

IF (PROFILE(N)%MESH /= NM) CYCLE PROF_LOOP
IF (APPEND .AND. PROFILE(N)%FORMAT_INDEX==1) THEN
OPEN(LU_PROF(N),FILE=FN_PROF(N),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
ELSE
OPEN(LU_PROF(N),FILE=FN_PROF(N),FORM='FORMATTED',STATUS='REPLACE')
IF (PROFILE(N)%FORMAT_INDEX==1) THEN
WRITE(LU_PROF(N),'(A)') PROFILE(N)%ID
WRITE(LU_PROF(N),'(A,A)') "Time(s), Npoints, Npoints x Depth (m), Npoints x ",&
TRIM(HEADING)
WRITE(LU_PROF(N),*)
ENDIF
ENDIF
ENDDO PROF_LOOP

! Initialize radiation file (RADF)

DO N=1,M%N_RADF
Expand Down
20 changes: 20 additions & 0 deletions Source/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2604,12 +2604,32 @@ SUBROUTINE INITIALIZE_PROFILES(NM)
TYPE (MESH_TYPE), POINTER :: M
TYPE (SURFACE_TYPE), POINTER :: SF
TYPE (BOUNDARY_ONE_D_TYPE), POINTER :: ONE_D
CHARACTER(LABEL_LENGTH) :: HEADING

M => MESHES(NM)

PROF_LOOP: DO N=1,N_PROF

PF => PROFILE(N)

IF (PF%ID/='null') THEN
HEADING = PF%ID
ELSE
HEADING = OUTPUT_QUANTITY(PF%QUANTITY_INDEX)%SHORT_NAME
ENDIF

IF (PF%MESH/=NM) CYCLE PROF_LOOP
IF (APPEND .AND. PF%FORMAT_INDEX==1) THEN
OPEN(LU_PROF(N),FILE=FN_PROF(N),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
ELSE
OPEN(LU_PROF(N),FILE=FN_PROF(N),FORM='FORMATTED',STATUS='REPLACE')
IF (PF%FORMAT_INDEX==1) THEN
WRITE(LU_PROF(N),'(A)') PF%ID
WRITE(LU_PROF(N),'(A,A)') "Time(s), Npoints, Npoints x Depth (m), Npoints x ",TRIM(HEADING)
WRITE(LU_PROF(N),*)
ENDIF
ENDIF

IF (NM/=PF%MESH) CYCLE PROF_LOOP
II = INT(GINV(PF%X-M%XS,1,NM)*M%RDXI + 1._EB)
JJ = INT(GINV(PF%Y-M%YS,2,NM)*M%RDETA + 1._EB)
Expand Down

0 comments on commit fcb4fe1

Please sign in to comment.