02.07.2014 Views

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

Intel(R) Fortran Compiler for Linux* Systems User's Guide Volume I ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Intel</strong>® <strong>Fortran</strong> <strong>Compiler</strong> <strong>for</strong> <strong>Linux*</strong> <strong>Systems</strong> <strong>User's</strong> <strong>Guide</strong>, <strong>Volume</strong> I: Building<br />

Applications<br />

!DEC$ ATTRIBUTES C, ALIAS:'My_Sub_' :: MY_SUB ! ia32 systems<br />

INTEGER I<br />

END SUBROUTINE MY_SUB<br />

END INTERFACE<br />

This code declares a subroutine named MY_SUB with the C property and the<br />

external name My_Sub_ set with the ALIAS property.<br />

For another example, the following declaration assumes the subroutine is called<br />

with the C calling convention:<br />

SUBROUTINE CALLED_FROM_C (A)<br />

!DEC$ ATTRIBUTES C :: CALLED_FROM_C<br />

INTEGER A<br />

The following table summarizes the effect of the most common <strong>Fortran</strong> callingconvention<br />

directives:<br />

Calling Conventions <strong>for</strong> ATTRIBUTES Properties<br />

Argument Default C C, REFERENCE<br />

Scalar Reference Value Reference<br />

Scalar [value] Value Value Value<br />

Scalar<br />

[reference]<br />

String<br />

Reference Reference Reference<br />

Reference, either<br />

Len:End or<br />

Len:Mixed<br />

String(1:1)<br />

String [value] Error String(1:1) String(1:1)<br />

String<br />

[reference]<br />

Reference, either No<br />

Len or Len:Mixed<br />

Reference, No<br />

Len<br />

Reference, either<br />

Len:End or Len:Mixed<br />

Reference, No Len<br />

Array Reference Reference Reference<br />

Array [value] Error Error Error<br />

Array<br />

Reference Reference Reference<br />

[reference]<br />

Derived Type Reference Value, size<br />

dependent<br />

Reference<br />

Derived Type<br />

[value]<br />

Value, size<br />

dependent<br />

Value, size<br />

dependent<br />

Value, size dependent<br />

183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!