- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it more efficient to use Read() below to obtain JI rounded to same value asrepresented by string cJI, or is it better to use the intrinsic function ANINT()? Thanks for any information.
Write(cJI, '(F5.3)', IOSTAT=iErr) JI
! convert back so that values used in program execution are the same as
! displayed in string cJI, for example JI = 0.9867, cJI = '0.987', and after Read() below JI = 0.987
Read(cJI, '(F5.3)', IOSTAT=iErr) JI
Or is it more efficient to use the followingcode in place of
Read() above?
JI = ANINT(JI*1000.0)/1000.0
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This would depend on lot on your compiler, but my guess would be that the ANINT would be faster.
The one concrete example I know about was a situation using CVF in which in one
of the deepest layers of a numerical model there was an internal write statement which
by itself accounted for about 10% of the execution time of the model. I was shocked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the replies.
tim 18wrote:
"Then, the ANINT method has to be far faster, even though it has to distinguish between the IEEE "banker's" rounding directly supported in hardware, and the Fortran method of rounding half-way values away from 0."
I understand what "banker's"and Fortran rounding are, butdo not understand why ANINT() has to distinguish between the two methods. I assume that ANINT() uses the Fortran method of rounding. Is the "banker's" rounding associated with multiplying and dividing by 1000.0?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page