diff --git a/engines/fortran/main.f90 b/engines/fortran/main.f90 index 0dcaef4..c6c1f46 100644 --- a/engines/fortran/main.f90 +++ b/engines/fortran/main.f90 @@ -334,7 +334,13 @@ subroutine read_coord(input_dir, n_atoms, atom_ids, masses, radii, pos_0, vel_0, read(u, '(a)', iostat=ios) line ncols = 0 do i = 1, len_trim(line) - if (line(i:i) /= ' ' .and. (i == 1 .or. line(i-1:i-1) == ' ')) ncols = ncols + 1 + if (line(i:i) /= ' ') then + if (i == 1) then + ncols = ncols + 1 + else if (line(i-1:i-1) == ' ') then + ncols = ncols + 1 + end if + end if end do do diff --git a/examples/case06/input/input.txt b/examples/case06/input/input.txt index df99e09..a65582a 100644 --- a/examples/case06/input/input.txt +++ b/examples/case06/input/input.txt @@ -16,7 +16,7 @@ plot_wave_save_mp4: 1 # 输出波形 MP4(需 step_plot_wave=1) # ── 计算引擎 ────────────────────────────────── # 可选: python, c, cpp, fortran, java -engine: python # 默认使用 python 引擎 +engine: fortran # 默认使用 python 引擎 # ── 盒子 ────────────────────────────────────── box_a: 80.0 # 立方体半边长,粒子被限制在 [-box_a, box_a]³ 内 @@ -63,7 +63,7 @@ warmup_steps: 0 # 默认 0(立即开始记录) # 总模拟时间(秒),程序自动计算 NT = T_total / DT # 如果同时指定了 NT,以 NT 为准 -T_total: 4.0 +T_total: 10.0 # 抽帧间隔(每 NSTEP 步取一帧用于动画) NSTEP: 100