I recently posted, then deleted, a question asking how Fortran goes about converting a real(8) into an integer. I realised as I was writing it that the most likely approach is the same as applying INT to the equation.
So, I did some checking and, yes, that seemed to be correct.
I went through my code, looking for all relevant warnings, and added INT at the correct locations.
Now the code breaks earlier.
However, could this be because the real value it is using exceeds the maximum/minimum value representable by the integer?
This is, again, where I am getting an error, suddenly, about a variable being out of bounds:
Fortran runtime error: Index '-2147483230' of dimension 1 of array 'iptr' below lower bound of 1
This particular subroutine is where I have used INT to resolve a warning of a Possible change of value from REAL(8) to INTEGER(4)
.
If I ignore the warning, the system continues on to another error (one I am still seeking to resolve). However, if I use INT
then it fails with the above index error.
I am wondering if the conversion through INT is causing the value to exceed the value limit of INTEGER?