Nonnegative width required字节宽度问题
问题描述
编译时出现如下报错。
star2doc.f:358.39:
READ(CTOKEN(1:NCHAR),'(I)') IDLIST
1
Error: Nonnegative width required in format string at (1)
make: *** [spider_linux_gfort.a(star2doc.o)] Error 1
问题原因
标准Fortran中要求字符指定非负的位宽,未指定情况下使用GFortran编译会报错。在Intel Fortran扩展中支持不会报错。
详情请参考:
https://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap05/format.html
处理步骤
将“READ(CTOKEN(1:NCHAR),'(I)') IDLIST”修改为“READ(CTOKEN(1:NCHAR),'(I5)') IDLIST”。