When working with some legacy code, I've found the following Fortran function declaration. The snippet below shows both the function declaration and the declaration of parameters. I believe that Fortran is a case-insensitive language.
SUBROUTINE CLIP2G (fcut,TIME,NUMS,NUMG,CLIPG,CLIPGL,CLIPGR,MODE,PHZ)
real fcut, TIME,
integer NUMS, NUMG
DIMENSION CLIPG(1)
REAL clipgr(1),clipgl(1)
INTEGER MODE
LOGICAL PHZ
What is the meaning of the DIMENSION CLIPG(1)
statement?
I found a link to a rather concise explanation of the statement, but primarily as a C/C++ programmer, I find the concept somewhat challenging to understand. Note how REAL clipgr(1), clipgl(1)
are followed by a bracket (1)
. Is this an array of length = 1 with type REAL
?
There are some other links on Stack Overflow, but even in the C-like syntax given in the posting linked below I am uncertain with respect to the meaning.
Perhaps DIMENSION CLIPG(1)
is equivalent to the REAL CLIPG
statement? What is the closest C-language equivalent?