- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code gives output:
1.000000
2.000000
3.000000
4.000000
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
module
subs implicit none type defType real, allocatable :: a(:), b(:,:) end type containssubroutine
sub1(myElem, i, n) type(defType), intent(inout) :: myElem integer, intent(in) :: i, n integer status allocate(myElem%a(n), myElem%b(n,n), stat = status) if (status == 0) thenmyElem%a =
float(i) else continue end ifend subroutine
end module
program
BugTest use subs implicit none integer , parameter :: sz1 = 20, sz2 = 10000 type(defType) :: myArray(sz1) integer ido i = 1, sz1
call sub1(myArray(i),i,sz2)
end do
open(10, file = 'Vals.txt') do i = 1, sz1 write(10, *) myArray(i)%a(1) end do close(10)end
programUsing VS2005 SP1, IVF 10.1.024, Vista64 SP1
Run in debug mode with deafult project settings.
if I reduce sz2 to 1000 I get sequential number output as I expect.
If I use OpenMP for the first loop using 4 cores I get:
1.000000
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
6.000000
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
11.00000
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
16.00000
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
-4.3160208E+08
Regards Andrew
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

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