@@ -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