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 transfer function

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



Joined: 21 Nov 2005
Posts: 5

PostPosted: Mon Dec 05, 2005 7:48 am    Post subject: Problem with transfer function Reply with quote

I am experiencing crashes and strange results when using the transfer function.
I have reduced my program to a small test case:
[pre]
module trf

integer,parameter:: rkind=selected_real_kind(p=5)
integer,parameter:: msize=10

real(kind=rkind), dimension(:,Smile, allocatable:: mat

contains

subroutine test_transfer()
implicit none
real(kind=rkind), allocatable :: vec(Smile
integer :: i, j, err

print *, "Allocate mat"
allocate(mat(msize,msize))

print *, "Fill mat"
do i = 1,msize
do j=1,msize
mat(i,j) = real(i+j)
end do
end do

print *, "Allocate vec, size=",size(mat)
allocate(vec(size(mat)), stat=err)

print *, "Transfer mat => vec"
vec = transfer(mat,vec)

print *,"Vec(1):",vec(1)
print *,"Vec(last):",vec(size(mat))

end subroutine test_transfer
end module trf

program main
use trf

call test_transfer

end program main
[/pre]

* when I run the program as shown, it works, but for the last element of vec it prints 0.000 while it should be 20.0
* when I increase the size of the arrays either the program does never terminate (actually I killed it after 5 minutes) or I get the following message:
[pre]
Runtime error from program:c:tempdevf95bugstransfer_3.exe
Access Violation
The instruction at address 004014bc attempted to read from location 0383e000 in file transfer_3.f90 at line 29

TRF!TEST_TRANSFER - in file transfer_3.f90 at line 29 [+04bc]

main - in file transfer_3.f90 at line 40 [+0031]


eax=000f4240 ebx=003d0900 ecx=001a2548
edx=00000001 esi=0383e000 edi=0a64ecc8
ebp=0360fcf8 esp=02e6ea10 IOPL=1
ds=0023 es=0023 fs=003b
gs=0000 cs=001b ss=0023
flgs=00010206 [NC EP NZ SN DN NV]

004014bc rep
004014bd movsb
004014be mov eax,[ebp-0x9c]
[/pre]
This is with a size of 1000 and /CHECKMATE

The message changes slightly with different options ( i tried /DEBUG and /UNDEF and /OPTIMISE)



Johny
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 05, 2005 2:06 pm    Post subject: Problem with transfer function Reply with quote

Johny

We will look into this for you as soon as possible.

Paul
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Apr 20, 2006 1:38 am    Post subject: Problem with transfer function Reply with quote

This bug has now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
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