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 

Nested structures.

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



Joined: 15 Apr 2014
Posts: 2

PostPosted: Wed Apr 16, 2014 8:43 am    Post subject: Nested structures. Reply with quote

Hi.

In my code I am using nested structure:

TYPE SUBSTRUCTURE
INTEGER ::ii_Number
REAL ::rr_Number
CHARACTER(LEN=40)::TText
END TYPE SUBSTRUCTURE

TYPE SD_TYPE
INTEGER ::i_Number
REAL ::r_Number
CHARACTER(LEN=40)::Text
TYPE (SUBSTRUCTURE) :: subStructure
END TYPE SD_TYPE

TYPE(SD_TYPE), POINTER:: p_SD_TYPE

allocate(p_SD_TYPE, SHARENAME="CFDATA2")


Although the SUBSTRUCTURE is located at the end of structure SD_TYPE, in the allocated memory is at the beginning.
Can you explain me why?
And how can I achieve exact order in the memory?
Thank you very much.

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


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

PostPosted: Wed Apr 16, 2014 9:20 am    Post subject: Reply with quote

In Fortran, if you want a particular order, then you need to use the SEQUENCE statement.
Back to top
View user's profile Send private message AIM Address
Jan



Joined: 15 Apr 2014
Posts: 2

PostPosted: Wed Apr 16, 2014 9:43 am    Post subject: Reply with quote

Thank you.
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