forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with log and allocatable arrays?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
brucebowler
Guest





PostPosted: Fri May 19, 2006 7:48 am    Post subject: Problem with log and allocatable arrays? Reply with quote

Simple example...

real x(2),y(2)
real s,i

interface
subroutine exponentialFit(x,y,slope,intercept)
implicit none
real,intent(in),dimension(Smile :: x
real,intent(in),dimension(Smile :: y
real,intent(out) :: slope
real,intent(out) :: intercept
end subroutine
end interface

x(1) = 310.35417
x(2) = 317.3125
y(1) = 0.0108
y(2) = 0.7
call exponentialFit(x,y,s,i)
stop
end
subroutine exponentialFit(x,y,slope,intercept)
implicit none
real,intent(in),dimension(Smile :: x
real,intent(in),dimension(Smile :: y
real,intent(out) :: slope
real,intent(out) :: intercept

real, dimension(Smile, allocatable :: logy

allocate (logy(size(y)))

logy=log(y)
return
end

in wsdbg, after the logy=log(y)
logy(1) = -1064245481
logy(2) = -1095328230

If I fix the dimension of logy to 2 (ie don't deal with the allocate, allocatable etc), the values in logy are the correct ones.

What am I doing wrong?
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Fri May 19, 2006 9:50 am    Post subject: Problem with log and allocatable arrays? Reply with quote

Bruce

The results are OK for me when using SDBG.
I do not know why WSDBG should be different.
Back to top
View user's profile Send private message AIM Address
brucebowler
Guest





PostPosted: Fri May 19, 2006 11:45 am    Post subject: Problem with log and allocatable arrays? Reply with quote

I hate problems like this... It works for me now too... The only thing I did was exit plato and restart and it started working...

Arghhhhh!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group