- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ran function is not working with "Intel Fortran Compiler Integration for Microsoft Visual Studio 2008, 10.1.3440.2008, Copyright (C) 2002-2008 Intel Corporation"
The code not working is below with line numbers at the start of each line. At line 6 when I call RAN(IFF), the value of IFF is still the same after line 6 is excuted. I would expect the value of IFF change after line 6. But this is not the case. Please help with the issue. Thanks in advance.
1. program
seven_112. USE IFPORT, ONLY: SRAND,RAN, RAND
3. integer*4 IFF
4. real*4 RAN2
5. DATA IFF /3333337/
6. RAN2=RAN(IFF)
7. IFF = 357
8. RAN2=RAN(IFF)
9. end program seven_11
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Curious. I can reproduce this. I suggest using the standard intrinsic RANDOM_NUMBER instead, I'll report this to the developers.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've tried the following with 10.1.021 and get results as advertised...
[cpp]program main
integer seed/3/ write (*,*) ran(seed)
write (*,*) ran(seed)
end[/cpp]
...which outputs...
[cpp]4.8220158E-05 0.3321905[/cpp]
Brian.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If Brians program is modified slightly as shown:
[cpp]program main use ifport integer iseed /3/ write (*,*) ran(iseed) write (*,*) ran(iseed) end[/cpp]
Then it prints:
6.7433808E-05
6.7433808E-05
If line 2 is removed, then it prints:
4.8220158E-05
0.3321905
I reported this to the Fortran Front-end team and will follow-up when I know more. (Internal ref. CQ- 50312)
- 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 issue is fixed in the latest IVF 11.0 update, 11.0.072 (Windows).

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