Re: same function giving different results

From: Bart Vandewoestyne (MyFirstName.MyLastName_at_telenet.be)
Date: 01/06/05

  • Next message: Rich Townsend: "Re: Call subroutine based on character variables? Guru Required!"
    Date: Thu, 6 Jan 2005 14:35:05 +0000 (UTC)
    
    

    In article <1105021545.735158@seven.kulnet.kuleuven.ac.be>, Bart Vandewoestyne wrote:
    >
    > I have been looking over and over this again, and my guess would be that the problem is somewhere with the allocatable array I'm using inside my function, but
    > i cannot find the real problem and how to fix it.
    >
    > Can anybody tell me what I'm doing wrong?

    I've found out that the subroutine get_digits returns different results
    each time:

        subroutine get_digits(n, b, mydigits)

          integer, intent(in) :: n, b
          integer, intent(inout) :: mydigits(:)

          integer :: i = 1
          integer :: temp

          temp = n
          do while (temp /= 0)
            mydigits(i) = mod(temp,b)
            temp = floor(real(temp/b))
            i = i+1
          end do

        end subroutine get_digits

    Still, i cannot locate the exact problem...

    Regards,
    Bart

    -- 
    	"Share what you know.  Learn what you don't."
    

  • Next message: Rich Townsend: "Re: Call subroutine based on character variables? Guru Required!"