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

FORTRAN-90 problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 12, 2005, 04:54
Default FORTRAN-90 problem
  #1
Arnie
Guest
 
Posts: n/a
I seem to have got a silly problem. I have written a program in FORTRAN-90 with most of the quantities assigned type "real" and a few of them "double precision". The program gives reasonably good (physically possible) answers but when I convert all the "real" to "double precision", answers deviate a lot and represent unphysical situations. Though in both cases, answers after 1st itrn. are matching. If anyone has an experience with working in FORTRAN or knows about such problems, please let me know the way out. Thanks.
  Reply With Quote

Old   May 12, 2005, 08:59
Default Re: FORTRAN-90 problem
  #2
Guillaume
Guest
 
Posts: n/a
Try to see if you have simple precision strong typing for some of your variables like REAL*(4)
  Reply With Quote

Old   May 12, 2005, 14:53
Default Re: FORTRAN-90 problem
  #3
unknown2010
Guest
 
Posts: n/a
Which compiler & OS do you see this. Also does it show up with both debug and optimized code.
  Reply With Quote

Old   May 12, 2005, 15:08
Default Re: FORTRAN-90 problem
  #4
Márcio Ricardo
Guest
 
Posts: n/a
Have you declared all the variables as double precision and run a few iterations to test the code accuracy? Maybe the single precision is just "smoothing" some numerical noise that would be too small in the beginning of your simulation.
  Reply With Quote

Old   May 16, 2005, 04:37
Default Re: FORTRAN-90 problem
  #5
Arnie
Guest
 
Posts: n/a
hi, I have used COMPAQ visual fortran compiler version 6.5 and my system is windows 2000. Arnie
  Reply With Quote

Old   May 16, 2005, 04:49
Default Re: FORTRAN-90 problem
  #6
Arnie
Guest
 
Posts: n/a
Dear Marcio Actually, when I compile my programme with all the variables declared real (Let me call this program P1), I am getting answers which are physically realisable. But when I do the same with all variables declared as double precision(I call this P2), I am getting unphysical value at a specific node, though for other nodes P1 & P2 give reasonably nearby answers. My one itrn means solving once for the whole flow field. As I enter into next itrn. the newly calculated value at that specific node seems OK though its not matching with P1 results. What I mean to say is that oscillations are in one specific node. Please suggest something. Arnie
  Reply With Quote

Old   May 16, 2005, 08:28
Default Re: FORTRAN-90 problem
  #7
Márcio Ricardo
Guest
 
Posts: n/a
I would suggest you to change the domain size and see if this happens again. Where is this node located? If it is the last node in the array, it could be caused by an index error, or a vector smaller than it should be.
  Reply With Quote

Old   May 17, 2005, 04:47
Default Re: FORTRAN-90 problem
  #8
Arnie
Guest
 
Posts: n/a
the node is located in the beginning of the flow.
  Reply With Quote

Old   May 18, 2005, 15:47
Default Re: FORTRAN-90 problem
  #9
Frank Muldoon
Guest
 
Posts: n/a
If you have not done so then I strongly suggest compiling the code using a check bounds option (usally -C) and any other checking (such as unassigned variables, passing an array of size x to a routine expecting size x+1 etc.) Also many compilers have a quad precision option, which may be useful if there are actually no errors in the code.
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
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 CD-adapco 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 09:00.