I have a Fortran (F77) code which I used to use at my previous institution that I am having trouble with at my new job. I used to compile it with ifort on computers running Fedora (14 if I recall correctly). At my new job they don't have ifort so I have had to revert to the use of g77 (f77) on systems running Red Hat. It took awhile, and a little help, to figure out that one of my codes would compile but crash once executed because g77 didn't automatically initialize all variables to zero. Luckily switches do exist to make g77 do this and I thought I was home free. This week, I tried running what is essentially the same code, but I get an ''illegal unit number error" when opening a file. I have Googled extensively to both understand the problem and find a solution but have ultimately been unsuccessful. I know illegal unit numbers can come from choosing things out of the range of 0 to 99, but in this case the unit number in question is 87!! Furthermore, the other code I had trouble with previously includes the exact same subroutine where that file is opened and it doesn't cause a problem!!! Any and all suggestions are useful. Please let me know if I can supply any additional information that might help pinpoint the problem. Thanks.