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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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


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
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Meshing & Mesh Conversion 14 December 12, 2018 08:07
Standard k-eps with UDF/UDS andreas_haakansson FLUENT 0 November 26, 2010 09:08
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03: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 12:58.