Fortran runtime error: Bad value during integer read
<p>I'm running some molecular dynamics simulations using CHARMM and I keep running into the same error </p>

<pre><code>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
</code></pre>

<p>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:</p>

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

<p>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!</p>

<p>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!</p>