mfm_error.f
来自「CCSM Research Tools: Community Atmospher」· F 代码 · 共 85 行
F
85 行
!===============================================================================! MFM_Error Class!===============================================================================!! Simple error handling routines for setting the type of handler, and! retrieving error messages.!! Public Member Functions:! ------------------------! MFM_ErrHandlerSetType ! MFM_GetErrString! MFM_ErrorTest!!===============================================================================!BOP!! !IROUTINE: MFM_ErrHandlerSetType!! !INTERFACE: subroutine MFM_ErrHandlerSetType(type) ! !PARAMETERS: integer, intent(in) :: type ! Type of error handling desired ! !DESCRIPTION:! Sets the type of error handling to either {\tt MFM\_ERR\_RETURN} or! {\tt MFM\_ERR\_EXIT}. The type of error handling is independent of ! whether the optional return code is included in a the argument list ! of a procedure call.!!EOP!------------------------------------------------------------------------------- call MF_ErrHandlerSetType(type) end subroutine MFM_ErrHandlerSetType!===============================================================================!BOP!! !IROUTINE: MFM_ErrPrint!! !INTERFACE: subroutine MFM_ErrPrint(rc) ! !PARAMETERS: integer, intent(in) :: rc ! Return code to be translated ! !DESCRIPTION:! Prints an error message corresponding to an integer return code.!!EOP!------------------------------------------------------------------------------- call MF_ErrPrint(rc) end subroutine MFM_ErrPrint!===============================================================================!BOP!! !IROUTINE: MFM_ErrorTest!! !INTERFACE: subroutine MFM_ErrorTest(test, str) ! !PARAMETERS: logical, intent(in) :: test ! evaluated expression character(60), intent(in) :: str ! string description of test! !DESCRIPTION:! Prints a {\tt PASS TEST} message to stdout if {\tt test} is {\tt .TRUE.}, ! and a {\tt FAIL TEST} message if {\tt test} is false. !!EOP!------------------------------------------------------------------------------- if(test) then print *, "PASS TEST: ", str else print *, "FAIL TEST: ", str end if end subroutine MFM_ErrorTest!===============================================================================
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?