Intel Fortran Attribute

My apologies if this is a very stupid question; my Fortran is small. I am porting some old Fortran code and found this subroutine definition:

SUBROUTINE SET_HYDROMODULE(HYDROMODULE)
IMPLICIT NONE
INTEGER*4 HYDROMODULE [VALUE]
...
END

      

Intel Fortran communicates this without blinking an eye, although with warnings for non-standard language features, it does give this warning:

warning #7009: Attribute syntax is not standard F95

      

gfortran assumes this is an attempt at the coarray specification, although it is not valid.

Can anyone tell me what the sentence means [VALUE]

?

Edit Is this a non-standard way of specifying a pass-by-value? This is equivalent to this:

INTEGER*4, VALUE :: HYDROMODULE

      

I seem to see a lot in the c-compatibility code that would suggest this.

+3


source to share


1 answer


The attribute VALUE

was added in Fortran 2003, so it should come as no surprise that it does not work with Fortran 95. The Fortran standard (2008) specifies the "VALUE attribute" in section 5.3.18. From what I read there it needs to be specified as

INTEGER*4, VALUE :: HYDROMODULE

      

Section 5.4.16 in the Standard defines a second form, operator VALUE

:

INTEGER*4 :: HYDROMODULE
VALUE     :: HYDROMODULE

      



The other form you gave seems to be an Intel extension. gfortran supports the attributeVALUE

(at least in version 4.9).

A quick search showed that apart from being compatible, the attribute VALUE

can indeed be used to force some kind of call by value, from here :

When this attribute is specified, the effect appears as if the actual argument is assigned to the temporary, and the temporary is the argument associated with the dummy argument. The actual mechanism by which this happens is determined by the processor.

+1


source







All Articles