This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Problem with zeros.
- From: Éric Depagne <edepagne at lcogt dot net>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 19 Jul 2007 09:37:38 -0700
- Subject: Problem with zeros.
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:reply-to:organization:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=k6+9gv4xU2MujMKWOl0o5GDh3hMkbXWGwQi7A7ZlzabM/WpM6Db/kadiIMfihgbM1+DdGUyzzF52k7IZbpPBcwPlMC5IdxMZomD9bNx4cwihuM24EtocgBZtbjssYQGDkgjQfoXEfuibnYJuWLENxVowcrLZUZHG7MxG94Ut0Z0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:reply-to:organization:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=tPyRX4XaWey2TjqPsmm6A9zFljrWQFgod6XBDg8vqjyfMRYWXcFtjdvIIYk9UoXrftqznwI9vxEdhsdH+1kAFRIh9k+1iSKqO5+CaNGkX1XnQ5LFJCNej/CYL2S4O9dso1VH/QPapsf/vDlcLgupw4t1kuzX/NyukEpeWR5wCMQ=
- Organization: Las Cumbres Observatory
- Reply-to: edepagne at lcogt dot net
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
----------------------------------------------------------