fix(fortran): 修复 JSON 输出缺少逗号导致解析失败
write_json 中 bond_rest_lengths 后面缺少逗号, 导致 JSON 解码器在 driving_force 前报错: JSONDecodeError: Expecting ',' delimiter 将 has_next 从 .false. 改为 .true.,空数组版本也补上逗号。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user