Summary: Consider looking at compiler options.
It's been a l-o-n-g time since I've done FORTRAN, and I don't remember using HUGE(), but I looked at this a little. My Intel Linux machine has gfortran 4.1.2. I found I had to compile with the -fdefault-integer-8 option turned on to make it work for 64 bit integers. Specifically, with this code:
program inttest
print *, huge(1)
end program inttest
running
$ gfortran inttest.for
created an executable which printed:
2147483647
However, running:
$ gfortran -fdefault-integer-8 inttest.for
resulted in an executable which gave the output:
9223372036854775807
Also, when I declared a variable as integer*8 and compiled without the -fdefault-integer-8 option, I got an error. The code:
program inttest2
integer*8 test_int
test_int = 9223372036854775807
print *, test_int
end program inttest2
running
$ gfortran inttest2.for
resulted in
In file inttest.for:4
test_int = 9223372036854775807
1
Error: Integer too big for its kind at (1)
However, things worked fine when I compiled with the -fdefault-integer-8 option and I got an executable which printed
9223372036854775807
Maybe there are other gfortran options which would be useful, but I didn't investigate further.
Granted, this still doesn't get you 10^14, but it may help explain the results you saw.