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:
Program Test_Module
Use CFB_Interface
Implicit None
call InitCombustionData()
call WriteCFBData()
End Program Test_Module
Second source file:
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.