Hello,
This has had me stumped for a while but I am now fairly certain it is either a problem with the compiler itself or the way I have configured my FORTRAN project.
But basically I have an array of .NET bools, I then pass them into the FORTRAN code where it seems to simply interpret them incorrectly when reading them from the .NET array.
I believe this has something to do with the varying number of bytes a bool will use when in an array as opposed to where a bool represents a single member. This StackOverflow question delves into it a bit: Why in .NET System.Boolean takes 4 byte?
Anyway I have done up a sample application to demonstrate what I am talking about which you can download from here: [LINK REMOVED - SEE POST FURTHER DOWN FOR UPDATED VERSION]
Here is the FORTRAN code:
SUBROUTINE MapData(inputData, outputData)
IMPLICIT NONE
ASSEMBLY_INTERFACE(NAME='MapData')
! Declare params
INTEGER :: i
LOGICAL, DIMENSION(1:12) :: logicalData
OBJECT('DataLibrary.FortranData'), INTENT(IN) :: inputData
OBJECT('DataLibrary.FortranData'), INTENT(OUT) :: outputData
! Perform input mapping
logicalData = .FALSE.
DO i = 1, 12
logicalData = inputData%MonthlyValues(i-1)
END DO
! Perform output mapping
outputData = NEW@('DataLibrary.FortranData')
DO i = 1, 12
outputData%MonthlyValues(i-1) = logicalData(i)
END DO
END SUBROUTINE MapData
So basically the input array MonthlyValues should end up being exactly the same as the output array MonthlyValues. However this is not the case as logicalData will be filled with an odd mutation of values which can actually change between application runs and even adding break points seem to affect this behaviour...
However here is a screenshot of some sample output:

This is kind of causing me headaches with a bit of a schedule to keep so if anyone could suggest a work around that would be awesome, are there some settings I should try changing in my project configuration.
Thanks, Alex.
