- #1
avikarto
- 56
- 9
I learned Fortran from ancient people who disregard modern standards. As such, my code consists mainly of that older syntax. I am wondering how well this meshes with current Fortran environments, specifically regarding double precision calculations. This comes up mainly because I have been told that real*8 and similar declarations should be abandoned in favor of KIND.
For example, in the following code section
will y maintain full double precision, or will a statement like z be required?
Similarly, if the fractional nature of the initial variable is defined only implicitly,
does this change the nature of y or z?
Or, for that matter, does pi maintain an appropriate value here instead of being declared as pi=4.d0*atan(1.d0)?
Thanks.
For example, in the following code section
Fortran:
real*8 x,y,z
x=12.3456
y=2*x
z=2.d0*x
will y maintain full double precision, or will a statement like z be required?
Similarly, if the fractional nature of the initial variable is defined only implicitly,
Fortran:
real*8 pi,y,z
pi=4*atan(1)
y=2*pi
z=2.d0*pi
does this change the nature of y or z?
Or, for that matter, does pi maintain an appropriate value here instead of being declared as pi=4.d0*atan(1.d0)?
Thanks.