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

[Fortran] (-real number)**(- or + real number)

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 13, 2007, 15:17
Default [Fortran] (-real number)**(- or + real number)
  #1
jinwon
Guest
 
Posts: n/a
I am computing a switch to choose a criteria depending on a value. In doing it, I need to compute a value like below

(-real number)**(- or + real number)..

so I used the usual syntax "**" to consider the power as the pow in c++.

But it gave me a NaN value. Please let me know how to treat such a power in fortran.

Thanks in advance.
  Reply With Quote

Old   June 13, 2007, 15:46
Default Re: [Fortran] (-real number)**(- or + real number)
  #2
jinwon
Guest
 
Posts: n/a
The problem is occurred when I tried to compute following

-0.24987**0.3846 --> it's okay but when I tried to use

r**GammaK --> it cause NaN

Of course, r is a value containing -0.24978 and Gammak has something.

  Reply With Quote

Old   June 14, 2007, 02:27
Default Re: [Fortran] (-real number)**(- or + real number)
  #3
Markus Lummer
Guest
 
Posts: n/a
1) -0.24987**0.3846 is evaluated as -(0.24987**0.3846) because of the operator precedence in Fortran

2) r**GammaK is not a real number for r<0 and GammaK real. Check your formulas!
  Reply With Quote

Old   June 14, 2007, 14:50
Default Re: [Fortran] (-real number)**(- or + real number)
  #4
jinwon
Guest
 
Posts: n/a
Thanks. You're right. It's a complex number.
  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
Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Native Meshers: snappyHexMesh and Others 11 January 13, 2015 12:47
Standard k-eps with UDF/UDS andreas_haakansson FLUENT 0 November 26, 2010 10:08
snappyHexMesh aborting Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 0 November 10, 2010 04:23
UDF for Heat Exchanger model francois louw FLUENT 2 July 16, 2010 02:21
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37


All times are GMT -4. The time now is 17:05.