|
[Sponsors] |
April 20, 2007, 15:21 |
Fortran problem
|
#1 |
Guest
Posts: n/a
|
Hi everyone, I have a fortran code with several subroutines in different .f files and an include file with all common variables. This code is in single precision. What is the easiest way to make it double precision.
Thanks MM |
|
April 20, 2007, 16:15 |
Re: Fortran problem
|
#2 |
Guest
Posts: n/a
|
Through compiler options (e.g., -r8). No change to code needed, assuming everything is defined as "real" and not "real*4".
If things are specifically declared single precision, you'll have to edit every routine. |
|
April 20, 2007, 20:09 |
Re: Fortran problem
|
#3 |
Guest
Posts: n/a
|
i think in that case, maybe a "search n replace" should do the job, although one has to be careful.
|
|
April 21, 2007, 20:03 |
Re: Fortran problem
|
#4 |
Guest
Posts: n/a
|
hi MM:
can you pls advise on how you compile the fortran program, in the case of you have different subroutines in different .f files?? So far, I inhclude all the subroutines (and mother program) in 1 single file, which is difficult for one to read through... I am using the microsft visual fortran currently.. |
|
April 21, 2007, 20:55 |
Re: Fortran problem
|
#5 |
Guest
Posts: n/a
|
Hi kc That's easy, 1)Put each sub in a different .f file. 2)Open the mother file. 3)Compile mother file 4)Go to Project/Add to project/Files 5)Select all your subroutines files and click ok
Now you have all Subs and you can run your mother file |
|
April 21, 2007, 21:00 |
Re: Fortran problem
|
#6 |
Guest
Posts: n/a
|
HI pc,
I didn't get you, There is no option to select in the time of compiling. Could you explain it more. Thanks mm |
|
April 21, 2007, 21:02 |
Re: Fortran problem
|
#7 |
Guest
Posts: n/a
|
Hi Pc, I didn't get you, there is no option to select in time of compiling. Could you explain more.
Thanks MM |
|
April 23, 2007, 04:48 |
Re: Fortran problem
|
#8 |
Guest
Posts: n/a
|
What operating system and compiler are you using. I've found the relevant switches in all the mainstream UNIX compilers, plus Absoft (for Linux) and DVF (for Windows).
|
|
April 26, 2007, 13:40 |
Re: Fortran problem
|
#9 |
Guest
Posts: n/a
|
Nearly every Fortran compiler I've used (Linux/Unix systems) has an option to make all variables defined as "real" to be interpreted as "real*8" or "real*4" globally. It could be something like -r8 or -realsize=8, or something similar. Your compiler help should list such an option.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User fortran error when running CFX-10 in parallel | CFDworker | CFX | 3 | September 22, 2015 08:59 |
Fortran compiler problem | Luke | Siemens | 2 | September 18, 2008 03:43 |
Problem with Fortran installation. | skarp | CFX | 0 | August 4, 2007 07:09 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 06:29 |
'C' or FORTRAN or 'C++' | Yogesh Talekar | Main CFD Forum | 20 | October 21, 1999 04:00 |