If i'd live 100+ years i'd probably know all the tricks of the devil. He is not that original, repeating and repeating himself. How many Saturdays i lost completely searching for some particularly stupid and difficult big? Such cases were documented even on this forum 😃 This was another one.
The code was supercrazy by doing totally absurd things until before pulling my last hair i discovered that i used common block in module and subroutine and in the subroutine also used the same module. Compiler did not complain but probably should.
I tried to reproduce this in small code but small code does not produce me crazy results. And of course does not complain :
module aaa
common /bbb/ccc
end module
!-------------
Program ddd
use aaa
ccc = 21
print*, ccc
call SSS
end
!---------------
subroutine SSS
use aaa
common /bbb/ccc
print*, ccc
end
Well, devil escaped but if Silverfrost fix the redundant common blocks he will have less chances