MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
errorutilmodule Module Reference

Data Types

interface  pstop_iface
 

Functions/Subroutines

subroutine pstop (status, message)
 Stop the program, optionally specifying an error status code. More...
 

Variables

procedure(pstop_iface), pointer pstop_alternative => null()
 

Function/Subroutine Documentation

◆ pstop()

subroutine errorutilmodule::pstop ( integer(i4b), intent(in), optional  status,
character(len=*), intent(in), optional  message 
)

If a non-zero status is specified, the program is terminated with the error status code. If no status is specified or status=0, the program stops with code 0. A message may be provided to print before exiting, useful e.g. for "contact developer" messages upon programming errors.

Parameters
[in]statusoptional error code to return (default=0)
[in]messageoptional message to print before stopping

Definition at line 23 of file ErrorUtil.f90.

24  integer(I4B), intent(in), optional :: status !< optional error code to return (default=0)
25  character(len=*), intent(in), optional :: message !< optional message to print before stopping
26 
27  if (associated(pstop_alternative)) then
28  if (present(message)) print *, message
29  if (present(status)) then
30  call pstop_alternative(status)
31  else
32  call pstop_alternative(0)
33  end if
34  end if
35 
36  if (present(message)) print *, message
37  if (present(status)) then
38  if (status == 0) stop
39  call exit(status)
40  else
41  stop
42  end if
Here is the caller graph for this function:

Variable Documentation

◆ pstop_alternative

procedure(pstop_iface), pointer errorutilmodule::pstop_alternative => null()

Definition at line 5 of file ErrorUtil.f90.

5  procedure(pstop_iface), pointer :: pstop_alternative => null()