type_error Subroutine

public subroutine type_error(var, type, intent, module, procedure)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: var

Name of the variable

character(len=*), intent(in) :: type

Required type of the variable

character(len=*), intent(in) :: intent

Intent of the argument within the caller

character(len=*), intent(in), optional :: module

The name of the module in which the call happens

character(len=*), intent(in), optional :: procedure

The name of the procedure in which the call happens


Source Code

   subroutine type_error(var, type, intent, module, procedure)
      character(len=*), intent(in)  :: var
      !! Name of the variable
      character(len=*), intent(in)  :: type
      !! Required type of the variable
      character(len=*), intent(in)  :: intent
      !! Intent of the argument within the caller
      character(len=*), optional, intent(in)  :: module
      !! The name of the module in which the call happens
      character(len=*), optional, intent(in)  :: procedure
      !! The name of the procedure in which the call happens
      character(len=128) :: msg
      msg = "The intent ["//trim(intent)//"] argument '"//trim(var)//"' must be of type '"//trim(type)//"'"
      call stop_error(msg, module=module, procedure=procedure)
      return
   end subroutine type_error