Re: Real and complex arrays



Hi

i believe you are right. Since I posted I have gotten a little further.
REAL(cmplxNo) does indeed return a real number (i can see that by
printing it to the screen), but when I try to assign it to a place in a
real array, I only see a 0 in the array. So the assignment somehow
fails..? This is the code snippet:

real rTst
complex magSignalComplex(512)
dimension magSignalReal(512)

do i=1,512
magSignalComplex(i) = abs(signalPartFreq(i))
rTst = real(magSignalComplex(i))
magSignalReal(i) = rTst
enddo

So, the magSignalReal array only contains zeros. If I print rTst to the
screen before the assignment, it looks fine - like a real number.. What
could be the matter?

thanks!!

M.L.

.



Relevant Pages

  • Re: Real and complex arrays
    ... real array, I only see a 0 in the array. ... This is the code snippet: ... rTst = real) ... Thus, it doesn't accomplish the primary purposes of producing a sample program -- namely, ensuring that the problem is in fact in the part of the code that you think it's in, and allowing us to try it out on our computers to see if we can reproduce the problem. ...
    (comp.lang.fortran)
  • Re: Real and complex arrays
    ... real array, I only see a 0 in the array. ... rTst = real) ... screen before the assignment, it looks fine - like a real number.. ... You might fine an IMPLICIT statement such as IMPLICIT NONE, ...
    (comp.lang.fortran)