replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Assigning a 4 byte real to a 8 byte real
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 

Assigning a 4 byte real to a 8 byte real

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



Joined: 08 Apr 2011
Posts: 155

PostPosted: Wed Jan 22, 2014 10:25 am    Post subject: Assigning a 4 byte real to a 8 byte real Reply with quote

Is it possible to assign a 4 byte real to a 8 byte real.

That is:

Code:
subroutine x (my_array_4)

real*4 my_array_4(512)
real*8 my_array_8(512)

do i =1,512

my_array_8(i)=my_array_4(i)

enddo


Is the above correct?
Christy
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Thu Jan 23, 2014 2:07 am    Post subject: Reply with quote

Yes, as long as my_array_4 and my_array_8 use different memory addresses.
my_array_4 is 2048 bytes long, while
my_array_8 id 4096 bytes long.

How do you return my_array_8 ?

John
Back to top
View user's profile Send private message
christyleomin



Joined: 08 Apr 2011
Posts: 155

PostPosted: Thu Jan 23, 2014 5:11 pm    Post subject: Reply with quote

Thanks John

I will pass it as an argument-I missed showing this in the dummy code.

Thanks again..
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 -> General 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