From cae2b39ad068a1ac0f5b264481c2608dcdd377fe Mon Sep 17 00:00:00 2001 From: mcgratta Date: Fri, 8 Dec 2023 17:01:50 -0500 Subject: [PATCH] FDS Source: Issue #12272. Fix bug related to PROFiles on particles --- Source/dump.f90 | 24 ------------------------ Source/init.f90 | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 2c8954f1724..1d800955ddf 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -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 @@ -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 diff --git a/Source/init.f90 b/Source/init.f90 index b3f89aee8f9..17a9c3c411e 100644 --- a/Source/init.f90 +++ b/Source/init.f90 @@ -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)