简体   繁体   English

Fortran运行时错误:整数读取期间值错误

[英]Fortran runtime error: Bad value during integer read

I'm running some molecular dynamics simulations using CHARMM and I keep running into the same error 我正在使用CHARMM运行一些分子动力学模拟,但始终遇到相同的错误

At line 631 of file /cygdrive/c/CHARMM/source/io/psfres.src (unit = 90, file ='tdskr2v5_min_CHARMM.psf')
Fortran runtime error: Bad value during integer read

So I don't know Fortran, just a warning. 所以我不知道Fortran,只是一个警告。 But I get the error; 但是我得到了错误; it's expecting an integer and getting something else. 它期待一个整数并得到其他东西。 Line 631 is: 631行是:

 #if KEY_LONEPAIR==1
    ! Read lone pair stuff
    numlp=0
    numlph=0
    read(u,fmt05,end=45) numlpx,numlphx

My problem is I can't figure out where the "Lone pair" section of my file is. 我的问题是我不知道文件的“孤对”部分在哪里。 So I can't pinpoint where in my input file the bad integer read is. 因此,我无法确定读取的错误整数在输入文件中的位置。 I was curious if anyone had some suggestions for testing, etc. to try to figure out where my error is. 我很想知道是否有人对测试提出了一些建议,等等,以便弄清楚我的错误在哪里。 I've tried replacing any characters with integers and that didn't fix it, so it's gotta be a spacing error, I just don't know how to figure out where the spacing error is! 我试过用整数替换任何字符,但是并不能解决问题,所以它一定是一个空格错误,我只是不知道如何找出空格错误在哪里!

Edit: I've also been tracing back where those numplx and numphx variables come from and that isn't helping me. 编辑:我也一直在追溯那些numplx和numphx变量来自何处,这对我没有帮助。 Some suggestions for testing to try and find the error would be greatly appreciated! 一些测试建议,尝试找出错误,将不胜感激!

You need to provide more information to tackle the exact problem. 您需要提供更多信息来解决确切的问题。

With the info provided, you are reading from an input "u", somewhere in the code you open that input, if is an input file, probably is reading a line without the two variables: numlpx,numlphx 使用提供的信息,您正在从输入“ u”中读取内容,即在打开该输入的代码中的某个位置(如果是输入文件),可能正在读取没有两个变量的行:numlpx,numlphx

There is also a place where the format input "fmt05" is defined, those are the instruction of how to read these two variables, the format can said skip 3 lines and read one and the next line the other. 还有一个地方定义了格式输入“ fmt05”,它们是如何读取这两个变量的指令,该格式可以说跳过3行,而又读取另一行。

Also can said if are floating point, strings, etc. 也可以说是否是浮点数,字符串等。

The error you have is that you are reading an integer variable, and following the format instructions, found something else that can not be interpreted as an integer. 您遇到的错误是您正在读取一个整数变量,并按照格式说明,发现了其他无法解释为整数的内容。

Hope this help you to check your input values and placement. 希望这可以帮助您检查输入值和位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM