Does anyone know why I’m getting this runtime error? I created a small test program based on a larger program but wasn’t able to recreate the error.
program test
character t*15
integer c
c = 1490000
write(t,'(I15)')c
print *,"test is ", t
End Program test
I did a search on the Internet for this error which said to upgrade your compiler.
I ran “yum update” to update all the packages on my RHEL 7 64 bit virtual machine, but I’m still getting the same runtime error on the “above” write statement.
You report an error when running a program different from the short codes that you included. I suspect that get_unit() is a function in your compiler’s support library, and the error message may be caused by an error in your larger code or a bug in the support library itself.
Mysterious errors in Fortran are often the result of assigning values out of bounds of an array, or mismatched subroutine arguments. The error message rarely points to the a location near the actual error or mentions the actual cause. The only practical debugging techniques are to turn on bounds checking, use valgrind with gcc or use the Silverfrost compiler that can check for these at runtime. The alternative is to desk-check the entire program, as the actual error could be anywhere in the code.
Fortran compiler writers have a deep predudice against runtime checks, but the performance hit is often much smaller than anticipated and checks can be turned off in production (if necessary).
But all compilers I know of allow for such runtime checking. Just use the correct options. And sometimes you can ask them to check the interfaces even if the implementation is in some other file.
According to the your earlier instructions, you managed to install something at /opt/libf2c at some point. So you could also just point your compiler to this directory -L/opt/libf2c. But giving the total path should also work.