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 

ftn95 5.20.1 -zero size array of derived type

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



Joined: 10 May 2006
Posts: 18
Location: Darlington

PostPosted: Thu Apr 17, 2008 11:51 am    Post subject: ftn95 5.20.1 -zero size array of derived type Reply with quote

in ftn95 5.20.1, the third call with zero-size array of derived type appears as length 1 in the subroutine body. I really want size to tell me 0. This feature works for simple variables.

module testmod
type boxp
integer p
character(1) c
end type
contains
subroutine testsub(p)
type(boxp),intent(in) :: p(Smile
integer l

l = size(p)
print *,l
end subroutine
end module

program main
use testmod

type(boxp) :: x(2)=(/boxp(1,'#'),boxp(5,'#')/)


call testsub(x)
call testsub(x(1:1))
call testsub(x(1:0)) ! this is the problem call
end program
Back to top
View user's profile Send private message
JohnMansell



Joined: 10 May 2006
Posts: 18
Location: Darlington

PostPosted: Thu Apr 17, 2008 11:57 am    Post subject: Reply with quote

FWIW, the problem is present with ftn95 5.10, so not a regression.
Back to top
View user's profile Send private message
JohnMansell



Joined: 10 May 2006
Posts: 18
Location: Darlington

PostPosted: Thu Apr 17, 2008 12:16 pm    Post subject: Reply with quote

Also, this call provides the expected result

call testsub((/(boxp(0,'*'),i=1,0)/))

as does this

type(boxp) z(1:0)
call testsub(z)

So I have a work around
Back to top
View user's profile Send private message
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