View previous topic :: View next topic |
Author |
Message |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Wed Jan 22, 2014 10:25 am Post subject: Assigning a 4 byte real to a 8 byte real |
|
|
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 |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Thu Jan 23, 2014 2:07 am Post subject: |
|
|
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 |
|
 |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Thu Jan 23, 2014 5:11 pm Post subject: |
|
|
Thanks John
I will pass it as an argument-I missed showing this in the dummy code.
Thanks again.. |
|
Back to top |
|
 |
|