0
votes

I'm running some molecular dynamics simulations using CHARMM and I keep running into the same error

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. But I get the error; it's expecting an integer and getting something else. Line 631 is:

 #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. Some suggestions for testing to try and find the error would be greatly appreciated!

1
what is the value of fmt05? How does the data look like? It sounds like a mismatch between the format you imposed and the actual content. - innoSPG
Data is a text file with columns of integers, so I'm guessing my columns might be off by a space. I'm just at a loss as to how to pinpoint where the error is - Monica
So simply do not use the format if the file contains only numbers that you are reading. - innoSPG
#if I think is a precompiler directive. Which means that this if will be evaluated only during compile time, not run time. Either it has been compiled with -DKEY_LONEPAIR=1 or the whole block until either #else or #endif will never be executed. - chw21

1 Answers

0
votes

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

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.

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.