From 1fd87cc33be66900ddd224b2f1ec25139e2678bb Mon Sep 17 00:00:00 2001 From: Ying-Li Niu <64801511@qq.com> Date: Thu, 11 Jun 2026 19:14:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(fortran):=20=E4=BF=AE=E5=A4=8D=20JSON=20?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=BC=BA=E5=B0=91=E9=80=97=E5=8F=B7=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit write_json 中 bond_rest_lengths 后面缺少逗号, 导致 JSON 解码器在 driving_force 前报错: JSONDecodeError: Expecting ',' delimiter 将 has_next 从 .false. 改为 .true.,空数组版本也补上逗号。 --- engines/fortran/main.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/fortran/main.f90 b/engines/fortran/main.f90 index c6c1f46..0d9e909 100644 --- a/engines/fortran/main.f90 +++ b/engines/fortran/main.f90 @@ -1042,11 +1042,11 @@ subroutine write_json(outdir, tx, ty, tz, tvx, tvy, tvz, & if (nb > 0) then call write_int2_arr(u, 'bond_pairs', bp, nb, .true.) call write_dbl_arr(u, 'bond_stiffness', bk, nb, .true.) - call write_dbl_arr(u, 'bond_rest_lengths', br, nb, .false.) + call write_dbl_arr(u, 'bond_rest_lengths', br, nb, .true.) else write(u, '(a)') ' "bond_pairs": [],' write(u, '(a)') ' "bond_stiffness": [],' - write(u, '(a)') ' "bond_rest_lengths": []' + write(u, '(a)') ' "bond_rest_lengths": [],' end if write(buf, '(a, i0)') ' "driving_force": ', driving_force