This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with zeros.


Hi.

I'm new to the list, so sorry if this has already been asked.
I've dug the archive but could not find what I was looking for.

I am experiencing a problem with underflow and zeroes.

My code reads a file, and puts the content of this file into an array.
The array is defined like this:

DIMENSION X(40,30)

The content of the file  looks like this:

9.999e-46 9.999e-46 9.999e-46 9.999e-46 9.999e-46 2.944E-19 

Since X is implicitely defined ( I can't add implicit none neither, since I am 
compiling an old code, and it would be way too much effort to add this, 
unfortunately), it is a real, and thus, 9.999e-46 triggers an underflow.

I would like to know if there is a way to let gfortran know that when he 
encounters values that are too small, he shall convert them to zero ?

I know the DEC compiler does so, since the exact same code compiles and works 
flawlessly when run on a DEC machine.

I don't want to use the options -fdefault-double-8 -fdefault-real-8 that make 
the code work because I need these values to be set to 0.
And I cannot write directly 0 instead of 9.999e-46, since, I do not want to 
modify the files being read.

Thanks a lot.

Éric.
-- 
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne				edepagne@lcogt.net
Las Cumbres Observatory	
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]