From ce842a0b77661cd575c8f2151da265b1fa998e09 Mon Sep 17 00:00:00 2001 From: b12902136 Date: Tue, 25 Aug 2026 11:08:57 +0800 Subject: [PATCH] Open ib_data.dat with status='replace' s_write_serial_ib_data opens p_all/p/0/ib_data.dat with STATUS='new', so a second run of the simulation binary against the same pre_process output aborts inside s_initialize_modules, before the time loop: FIO-F-208/OPEN/unit=2/'NEW' specified for file which already exists. File name = ./p_all/p0/0/ib_data.dat In source file src/simulation/m_data_output.fpp, at line number 865 Its twin s_write_serial_ib_state, called on the next line of s_initialize_modules, already opens with status='replace'. This makes the two consistent. s_write_serial_ib_data is the sole producer of the file and always rewrites it in full, so there is nothing to preserve. Only the parallel_io = F path is affected; s_write_parallel_ib_data opens with ior(MPI_MODE_WRONLY, MPI_MODE_CREATE) and cannot raise this error. --- src/simulation/m_data_output.fpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 22bde22e1..6166ac71f 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -862,7 +862,7 @@ contains write (t_step_dir, '(a,i0,a,i0)') trim(case_dir) // '/p_all/p', proc_rank, '/', time_step write (file_path, '(A,I0,A)') trim(t_step_dir) // '/ib_data.dat' - open (2, FILE=trim(file_path), form='unformatted', STATUS='new') + open (2, FILE=trim(file_path), form='unformatted', STATUS='replace') $:GPU_UPDATE(host='[ib_markers%sf]') write (2) ib_markers%sf(0:m,0:n,0:p); close (2)