Asterisks in Fortran: Syntax error in argument lis

2019-01-29 02:55发布

问题:

In the following fortran77 code, there is this subroutine definition

  SUBROUTINE MSIRNS ( D , NOBST , N , X , R , RR , SURFT ,
 ,                    INOBSI , ISUR , IDELTS , IRELPS ,
 ,                    RNOBSI , RSUR , RDELTS , RRELPS ,
 ,                    OBSD , * , * )

what is the meaning of the two last arguments, asterisks?

and how can I therefore call the function?

I tried all these variants

RES = CALL MSIRNS (D, NOBST, N, X, R, RR, SURFT, INOBSI, ISUR, IDELTS, IRELPS, RNOBSI, RSUR, RDELTS, RRELPS, OBSD, *, *)
    CALL MSIRNS (D, NOBST, N, X, R, RR, SURFT, INOBSI, ISUR, IDELTS, IRELPS, RNOBSI, RSUR, RDELTS, RRELPS, OBSD, *, *)
    RES = CALL MSIRNS (D, NOBST, N, X, R, RR, SURFT, INOBSI, ISUR, IDELTS, IRELPS, RNOBSI, RSUR, RDELTS, RRELPS, OBSD)

but always get

Error: Syntax error in argument list at (1)

回答1:

It's an alternate return specifier:

http://www.fortran.com/F77_std/rjcnf0001-sh-15.html#sh-15.8.3

In the code that calls MSIRNS(), you need to replace the asterisks with "*N", where N is the label of the alternate return line.