Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number next to a variable - allowed? 1

Status
Not open for further replies.

philrosenberg

Technical User
Dec 3, 2003
15
GB
Hi I'm trying to find a bug in a FORTRAN program my office has purchased, but as a person who has not used fortran before I'm hoping someone may be able to give me a couple of hints.

One line of the code is

Code:
TRM1 = 1.0D0 - DFXDT * (2.0D0 - DFXDT)

where TRM1, D0 and DFXDT are all variables. The problem is that noone in our office has seen the notation 1.0D0 before, does anyone know what it does?

Thanks for any help

Phil
 
1.0D0 is scientific notation "one times ten to the power of zero" which computes to be just one. It is usually written that way to emphasise the fact that it is a double precision value. D0 is not a variable.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
thanks for the reply CaKiwi. At first I thought something similar but this line was just above it

BETA0 = D0 * DPDD / P0

which made me think D0 was a variable, any idea what this then means if D0 is not a variable?

Thanks again

Phil
 
Just to confuse you, if D0 is used by itself and not preceeded by a number, it is a variable.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Thank you very much, you've been extremely helpful and patient.

Thanks again

Phil
 
1.0D0 is for double precision
1.0E0 is for real

The meaning of double precision has changed a lot since my student days. It can mean

o more significant digits
o a larger range of numbers than reals
o both of the above
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top