JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Sun Feb 28, 2010 11:54 pm Post subject: option /RAGGED_ARRAYS |
|
|
Paul,
Is there any further explaination of what option /RAGGED_ARRAYS covers. Is this an allowance for FTN77 memory management arrays, or is it something more complex ?
I'm interested by a "non-rectangular array" and how it could be used.
I have a skyline equation solver which addesses a 2d matrix as a set of indexed vectors, with the index pointing to the diagonal of each column. This has always provided problems for /check.
I'd like to know more.
John |
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Mar 01, 2010 10:57 am Post subject: |
|
|
Looks like the new option will help you.
Here is the program in our test suite that fails with /check unless you use the new option.
Code: | program main
integer nmax
parameter (nmax = 5)
integer i, j, ncol, nstart
integer a(nmax,nmax), t
do j = 1, nmax
do i = 1, nmax
if (i.eq.j) then
a(i,j) = i
else
a(i,j) = 0
endif
enddo
enddo
ncol = nmax + 1
nstart = 0
isum = 0
do i = 1, nmax
nstart = nstart + 1
ncol = ncol - 1
call trace(ncol, nmax, a(nstart,nstart), t)
isum = isum + t
enddo
if(isum == 55) print*, "Success"
end
c
subroutine trace (ncol, nmax, a, t)
integer, intent (in) :: ncol, nmax
integer, intent (in) :: a(nmax,*)
integer, intent (out) :: t
integer i
t = 0
do i = 1, ncol
t = t + a(i,i)
enddo
end
|
|
|