comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Vectorization question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Vectorization question [message #21759 is a reply to message #21705] Thu, 14 September 2000 00:00 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
This will be my last post on this topic: please accept my apologies.

Liam Gumley <Liam.Gumley@ssec.wisc.edu> wrote in message
news:8prqam$e4o$1@news.doit.wisc.edu...
> I forgot FORTRAN uses 1-based indices by default. What I *meant* to say
was:
>
> subroutine vecadd1(a, na, x, nx, b)
> integer*4 na, nx
> real*4 a(0:na-1), b(0:nx-1)
> integer*4 x(0:nx-1), i
> do i = 0, nx - 1
> a(x(i)) = a(x(i)) + b(i)
> end do
> end

The SGI compiler doesn't like this code for some reason. So I switched back
to the original FORTRAN source, and changed the IDL wrapper function to
read:

x = ((long(index) > 0L) < (n_elements(a) - 1L)) + 1L

which converts the zero-based IDL indices to one-based FORTRAN indices. Then
everything works as advertised. This is a better approach anyway, because it
allows existing FORTRAN code to be used without modification.

Cheers,
Liam.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Spherical gridding at a pole
Next Topic: Re: CW_BGROUP

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:24:49 PDT 2025

Total time taken to generate the page: 0.00399 seconds