View previous topic :: View next topic |
Author |
Message |
Thomas
Joined: 18 Feb 2005 Posts: 47 Location: Gummersbach, Germany
|
Posted: Fri Feb 19, 2021 7:39 pm Post subject: Incorrect assignment in case of /64 |
|
|
The following code is extracted from about 300,000 lines of Fortran code. It behaves differently if compiled with /64 and slink64 than for 32 bit. It took some effort to reduce the amount of code to a minimum, where the error can still be reproduced.
First source file:
Code: |
Program Test_Module
Use CFB_Interface
Implicit None
call InitCombustionData()
call WriteCFBData()
End Program Test_Module
|
Second source file:
Code: |
Module CFB_Interface
Implicit None
Type :: TCFB_O2Carrier
Integer :: iA, Anz
Integer, Dimension(8) :: iM, iT, Ana
Double Precision, Dimension(8) :: M, MSt, MU, XO2
End Type TCFB_O2Carrier
Type :: TCFB_InternalData
Type(TCFB_O2Carrier), Dimension(3) :: O2C
End Type TCFB_InternalData
Type(TCFB_InternalData) :: IntDat
CONTAINS
!========================================================================================================================
Subroutine InitCombustionData()
call GetO2CarrierData(1)
CONTAINS
Subroutine GetO2CarrierData(iIndex)
Integer, Intent(in) :: iIndex
IntDat%O2C(iIndex)%Anz = 1
End Subroutine GetO2CarrierData
End Subroutine InitCombustionData
!========================================================================================================================
Subroutine WriteCFBData()
Integer :: iAnz
! FTN95 Error with 64bit: The following assignment will not be executed correctly despite of "IntDat%O2C(iC)%Anz = 1"
iAnz = IntDat%O2C(1)%Anz
write (*,*) iAnz
End Subroutine WriteCFBData
!========================================================================================================================
End Module
|
In 32-bit case iAnz is correctly assigned to the value 1. In 64-bit case the assignment is 0 (normal execution) or -1163005939 (sdbg64).
We compiled with the following options:
/check
/intl
/logl
/save
For a longer period we were progressing successfully with 64-bit versions despite various obstacles, e.g. integer kind of handles. Now we are a litlle bit worried. _________________ Thomas |
|
Back to top |
|
 |
PaulLaidler Site Admin

Joined: 21 Feb 2005 Posts: 7774 Location: Salford, UK
|
Posted: Sat Feb 20, 2021 10:26 am Post subject: |
|
|
Thomas
Which version of FTN95 are you using. I get the result 1 for both Win32 and x64. |
|
Back to top |
|
 |
Thomas
Joined: 18 Feb 2005 Posts: 47 Location: Gummersbach, Germany
|
Posted: Sat Feb 20, 2021 10:58 am Post subject: |
|
|
My ftn95 environment:
ftn95.exe 8.70.220.0
salflibc.dll 23.1.4.9
salflibc64.dll 23.1.4.9
clearwin64.dll 23.1.4.9 _________________ Thomas |
|
Back to top |
|
 |
PaulLaidler Site Admin

Joined: 21 Feb 2005 Posts: 7774 Location: Salford, UK
|
Posted: Sat Feb 20, 2021 11:47 am Post subject: |
|
|
Thomas
I can confirm that the version you are using gives the incorrect result. I don't know offhand what has changed but I will send a link to a new version of FTN95 via a personal message once I have run a few tests. |
|
Back to top |
|
 |
Thomas
Joined: 18 Feb 2005 Posts: 47 Location: Gummersbach, Germany
|
Posted: Sat Feb 20, 2021 11:50 am Post subject: |
|
|
Paul,
Once again many thanks for extraordinary good support. _________________ Thomas |
|
Back to top |
|
 |
|