I am working on compiling an old piece of Fortran code written sometime in the early 2000s. In this code base there are functions designed to interface with C code and have the following structure:
SUBROUTINE F_LIB_FOO(MY_VAR)
!DEC$ ATTRIBUTES DLLEXPORT,STDCALL :: F_LIB_FOO
REAL(8), INTENT(IN) :: MY_VAR [REFERENCE]
LIB_FOO(MY_VAR) !This calls the function implemented internally
However, when I try to compile it using gfortran 4.4.7
I get the following error
REAL(8), INTENT(IN) :: MY_VAR [REFERENCE]
1
Error: Syntax error in data declaration at (1)
My belief is that REFERENCE
indicates that the MY_VAR
is passed by reference. However, I can't find any examples that use this sort of syntax.
According to this answer, this syntax is supported in Visual Studios. I want to know if there is a similar way to do this in a Linux machine and if there isn't, how can I change the code to compile with gfortran
and have the same functionality.