Just for the record: Problems in compilation are usually written in the .log-file.
On topic: You could add something like "write(6,*) FLUX(1)" to your subroutine. By doing that, the value of FLUX(1) for each increment will be written into the .dat-file. If the values there are zero, you know...