Divide by zero at compilation time

Alberto Luaces aluaces@udc.es
Fri Jun 22 14:45:00 GMT 2007


Hello,

I am trying to compile a program made of several files, most of them modules. 
All the files were succesfully built on the Windows Compaq compiler before. I 
am in the process of getting the code to compile in Linux gfortran, fixing 
some non-standard features that the original code had. So far, so good.

However, the compilation of a few files is giving a weird error. It is using 
two modules previously built:

gfortran -c jacob_log_pos.f90
 In file jacob_log_pos.f90:3

 USE CONSTANTES
              1
Error: Division by zero at (1)
make: *** [all] Error 1

That module, 'CONSTANTES', is being succesfully used on other files. If I 
comment that line, the same error is issued on the next reference to a 
module.

I am attaching the only 3 files that reflect the problem, 2 modules and the 
file that is giving the error. I am also sending a Makefile to facilitate the 
compilation. If you want to give it a try, you have only to 'make':

> make
gfortran -c constantes.F90
gfortran -c jacob_log_MOD.f90
gfortran -c jacob_log_pos.f90
 In file jacob_log_pos.f90:3

 USE CONSTANTES
              1
Error: Division by zero at (1)
make: *** [all] Error 1

I am using gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4), 64bit (amd64). I have 
also tried with gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21), 
this time 32bit and also got the same error.

What do you think about this?

Thank you very much,

Alberto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zero.tar.gz
Type: application/x-tgz
Size: 6244 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070622/ea3ea1b9/attachment.bin>


More information about the Fortran mailing list