CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Fortran problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2007, 15:21
Default Fortran problem
  #1
MM
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
  Reply With Quote

Old   April 20, 2007, 16:15
Default Re: Fortran problem
  #2
pc
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.
  Reply With Quote

Old   April 20, 2007, 20:09
Default Re: Fortran problem
  #3
Ben
Guest
 
Posts: n/a
i think in that case, maybe a "search n replace" should do the job, although one has to be careful.
  Reply With Quote

Old   April 21, 2007, 20:03
Default Re: Fortran problem
  #4
kc
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..
  Reply With Quote

Old   April 21, 2007, 20:55
Default Re: Fortran problem
  #5
MM
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
  Reply With Quote

Old   April 21, 2007, 21:00
Default Re: Fortran problem
  #6
MM
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
  Reply With Quote

Old   April 21, 2007, 21:02
Default Re: Fortran problem
  #7
MM
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
  Reply With Quote

Old   April 23, 2007, 04:48
Default Re: Fortran problem
  #8
Steve
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).
  Reply With Quote

Old   April 26, 2007, 13:40
Default Re: Fortran problem
  #9
pc
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.

  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:32.