DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Mon Apr 01, 2019 1:23 pm Post subject: ftn95 problem concatenating substrings of a string constant? |
|
|
I am trying to concatenate 2 substrings of a string constant using ftn95, version 8.30. For the ftn95 source file following, I created a 32 bit executable and a 64 bit executable. I am astonished that the results of the concatenation are different for the 32 bit and the 64 bit executable.
Code: |
CHARACTER*10 mystring10
character*5 concatenate_string
PARAMETER (mystring10='abcdefghij')
concatenate_string=mystring10(1:2)//mystring10(5:7) !+ bad
write(*,*) 'mystring10(1:2)=',mystring10(1:2)
write(*,*) 'mystring10(5:7)=',mystring10(5:7)
write(*,*) 'concatenate_string=',concatenate_string
concatenate_string(1:2)=mystring10(1:2) !+ works
concatenate_string(3:5)=mystring10(5:7) !+ works
write(*,*) 'concatenate_string=',concatenate_string
end
|
Output of the 32 bit version:
Code: |
mystring10(1:2)=ab
mystring10(5:7)=efg
concatenate_string=ab ab
concatenate_string=abefg
|
output of the 64 bit version:
Code: |
mystring10(1:2)=ab
mystring10(5:7)=efg
concatenate_string=abefg
concatenate_string=abefg
|
I wonder if the 32 bit result is correct, because the result expected and produced by the 64 bit version (concatenate_string=abefg) is generated, as well, when compiling the source with INTEL 32 bit and INTEL 64 bit compiler.
Regards,
Dietmar |
|