I have been getting runtime errors when running a program in 64-bit. The following example has taken me about 40 hours to reduce to something that will hopefully be manageable. I believe that the modules and the program may need to be in separate files, so I am displaying them individually.
Module m1
Type, Public :: t1_t
Integer :: iyr
End Type t1_t
Character, Public :: c
Type(t1_t), Public :: at1
End Module m1
Module m2
Implicit None
!
Contains
!
Subroutine s1 ( )
Use m1, Only: c, at1
Character :: c2
Logical :: l
l = .false.
Call s2 ( l, at1, c, c2 )
Return
End Subroutine s1
!
Subroutine s2 ( l, at1, c, c2 )
Use m1, Only: t1_t
Logical, Intent(In) :: l
Type(t1_t), Intent(InOut) :: at1
Character(Len=*), Intent(Out) :: c, c2
Integer :: ifail
c = 'C'
Call s21 ( 1, l, ifail, c, c2 )
ifail = 0
Return
!
Contains
!
Subroutine s21 ( kl, l, ifail, c, c2 )
Integer, Intent(In) :: kl
Logical, Intent(In) :: l
Integer, Intent(Out) :: ifail
Character(Len=*), Intent(Out) :: c, c2
Character(Len=4) :: ctag
c2 = ' '
ctag = 'ABC'
Call s3 ( ctag//' ', [ 'a' ] )
c = 'F'
If ( .not.l ) Then
Continue
End If
Return
End Subroutine s21
End Subroutine s2
!
Subroutine s3 ( c, cs )
Character(Len=*), Intent(In) :: c
Character(Len=*), Dimension(:), Intent(In) :: cs
Return
!
Contains
!
Subroutine s31 ( j )
Integer, Intent(Out) :: j
j = 1
Return
End Subroutine s31
End Subroutine s3
End Module m2
Program cpt
Use m2, Only: s1
Call s1 ( )
End Program cpt