Silverfrost Forums

Welcome to our forums

Incorrect assignment in case of /64

19 Feb 2021 6:39 #27124

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.

20 Feb 2021 9:26 #27130

Thomas

Which version of FTN95 are you using. I get the result 1 for both Win32 and x64.

20 Feb 2021 9:58 #27131

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

20 Feb 2021 10:47 #27132

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.

20 Feb 2021 10:50 #27133

Paul,

Once again many thanks for extraordinary good support.

Please login to reply.