Skip to content

Commit f94f8b7

Browse files
haocheysbryngelson
andauthored
Enable Restart Probe Files (#690)
Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: Spencer Bryngelson <[email protected]>
1 parent aab3c22 commit f94f8b7

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/simulation/m_data_output.fpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ contains
175175
!! Relative path to the probe data file in the case directory
176176

177177
integer :: i !< Generic loop iterator
178+
logical :: file_exist
178179

179180
do i = 1, num_probes
180181
! Generating the relative path to the data file
@@ -183,23 +184,18 @@ contains
183184

184185
! Creating the formatted data file and setting up its
185186
! structure
186-
open (i + 30, FILE=trim(file_path), &
187-
FORM='formatted', &
188-
STATUS='unknown')
189-
! POSITION = 'append', &
190-
!WRITE(i+30,'(A,I0,A)') 'Probe ',i, ' located at:'
191-
!WRITE(i+30,'(A,F10.6)') 'x = ',probe(i)%x
192-
!WRITE(i+30,'(A,F10.6)') 'y = ',probe(i)%y
193-
!WRITE(i+30,'(A,F10.6)') 'z = ',probe(i)%z
194-
!WRITE(i+30, *)
195-
!WRITE(i+30,'(A)') '=== Non-Dimensional Time ' // &
196-
! '=== Density ' // &
197-
! '=== Velocity ' // &
198-
! '=== Pressure ' // &
199-
! '=== Gamma ' // &
200-
! '=== Stiffness ' // &
201-
! '=== Sound Speed ' // &
202-
! '=== Acceleration ==='
187+
inquire (file=trim(file_path), exist=file_exist)
188+
189+
if (file_exist) then
190+
open (i + 30, FILE=trim(file_path), &
191+
FORM='formatted', &
192+
STATUS='old', &
193+
POSITION='append')
194+
else
195+
open (i + 30, FILE=trim(file_path), &
196+
FORM='formatted', &
197+
STATUS='unknown')
198+
end if
203199
end do
204200

205201
if (integral_wrt) then

0 commit comments

Comments
 (0)