开发者

What does the [REFERENCE] tag do in an argument declaration?

I am writing an custom callback function in Fortran for a piece of software (example here) that includes the following argument declaration

SUBROUTINE CONTACT_FORCE(TIME,UPAR,NPAR,PEN,RVEL,JFLAG,IFLAG,RESULT)
!DEC$ ATTRIBUTES DLLEXPORT,C::CONTACT_FORCE
...
DOUBLE PRECISION RESULT[REFERENCE](6)   !Compiles ok

Which compiles fine with Compaq Visual Fortran 6. So my question is what does the [REFERENCE] tag do? I thought that Fortran passes everything by reference (and not by value). Of course there nothing in the compiler help about this, and searching online is difficult because the word reference is used so much with respect to Fortran that I don't know how to narrow it down.

Edit the above must be identical to

SUBROUTINE CONTACT_FORCE(TIME,UPAR,NPAR,PEN,RVEL,JFLAG,IFLAG,RESULT)
!DEC$ ATTRIBUTES DLLEXPORT,C::CONTACT_FORCE
!DEC$ ATTRIBUTES REFERENCE::RESULT
开发者_高级运维...
DOUBLE PRECISION RESULT(6)   !Compiles ok


I'm assuming MS products here. Fortran can be made to pass by value or by reference if the C or STDCALL attribute is used. See here:

http://msdn.microsoft.com/en-us/library/aa294334(v=vs.60).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜