tags:

views:

130

answers:

1

Hi,

I am using the Fortran 11 compiler in Visual Studio from Windows. How can I set real values to double precision from project properties? For example, in Fortran Powerstation (4.0) we have the menu option settings->code generation->default real kind (here we can set the type of the real data type). Similarly, how can we set double precision to the real variable in the Fortran 11 compiler?

Thanks in advance.

+1  A: 

Unless you are looking to maintain the code under both compilers, perhaps you would be better off just changing the source code to use real*8's. That would get it behaving consistently when you do ports in the future too.

T.E.D.
Much better to use Fortran properly and specify the kind of your variables as TED suggests. Even better than REAL*8 would be a standard-compliant way of declaring this, REAL(KIND=KIND(1d0)), or, for extra portability and future proofness REAL(KIND=SELECTED_REAL_KIND(x,y)) -- but you have to figure out x and y for your program.
High Performance Mark
I agree. REAL*8 isn't portable, but processor and compiler dependent. Using KIND is the way it should be done if portability is needed.
ldigas