Asterisks in Fortran: Syntax error in argument list at (1)

回眸只為那壹抹淺笑 提交于 2019-11-28 11:33:00

问题


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.



来源:https://stackoverflow.com/questions/7835270/asterisks-in-fortran-syntax-error-in-argument-list-at-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!