*表示子程序中的参数是什么意思?它是否意味着标签并返回主程序?它与return
,return 1
,ERR
还是ERROR
有关?我不知道为什么我们有这些,但我认为星号与它们有关。
!>Start the creation of boundary conditions for the equation set.
SUBROUTINE BOUNDARY_CONDITIONS_CREATE_START(SOLVER_EQUATIONS,BOUNDARY_CONDITIONS,ERR,ERROR,*)
!Argument variables
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(VARYING_STRING) :: LOCAL_ERROR
ENTERS("BOUNDARY_CONDITIONS_CREATE_START",ERR,ERROR,*999)
IF(ASSOCIATED(BOUNDARY_CONDITIONS)) THEN
CALL FlagError("Boundary conditions is already associated.",ERR,ERROR,*999)
ELSE
IF(ASSOCIATED(SOLVER_EQUATIONS%SOLVER_MAPPING)) THEN
!Initialise the boundary conditions
CALL BOUNDARY_CONDITIONS_INITIALISE(SOLVER_EQUATIONS,ERR,ERROR,*999)
ELSE
LOCAL_ERROR="Solver equations solver mapping is not associated."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
ENDIF
ENDIF
ENDIF
EXITS("BOUNDARY_CONDITIONS_CREATE_START")
RETURN
999 ERRORSEXITS("BOUNDARY_CONDITIONS_CREATE_START",ERR,ERROR)
RETURN 1
END SUBROUTINE BOUNDARY_CONDITIONS_CREATE_START
答案 0 :(得分:4)
这是该函数的备用返回的标签。它是使用
时函数最终可以返回的标签 return 1
而不是
return
返回调用子例程的位置。
强烈建议不要使用此新功能,但我已经看到了如何将此代码用于某种异常的建议。
非常相关的问题,几乎是重复的(要求返回声明):Fortran return statement