Class dc_message
In: src/shared/nmlfile/dc_message.f90

Methods

Included Modules

dc_types dc_string dc_error

Public Instance methods

level :character(*), intent(in)
: begin
 Input
where :character(*), intent(in)
message :character(*), intent(in)
i(:) :integer , intent(in), optional
r(:) :real , intent(in), optional
d(:) :real(8) , intent(in), optional
L(:) :logical , intent(in), optional
n(:) :integer , intent(in), optional
c1 :character(*), intent(in), optional
c2 :character(*), intent(in), optional
c3 :character(*), intent(in), optional

文字型変数 level は出力するメッセージの種類を決める引数で、 ((*’W’*)) (または((*’Warning’*)) など ((*’W’*)) で始まる文字) を与える事で((*警告*))を、 ((*’E’*)) (または((*’Error’*)) など ((*’E’*)) で始まる文字) を与える事で ((*エラー (メッセージ出力後プログラムを終了) *))を、 それ以外の文字を与える事で((*通常のメッセージ*))を出力します。 なお、エラー出力する場合、エラーコード は USR_ECHAR となります。

[Source]

  subroutine MessageNotifyC(level, where, message,  i, r, d, L, n, c1, c2, c3)
  !
  !==== Dependency
  !

  !
  !=end
    implicit none

    !=begin
    !==== Input
    !
    character(*), intent(in)          :: level
    character(*), intent(in)          :: where
    character(*), intent(in)          :: message
    integer     , intent(in), optional:: i(:), n(:)
    real        , intent(in), optional:: r(:)
    real(8)     , intent(in), optional:: d(:)
    logical     , intent(in), optional:: L(:)
    character(*), intent(in), optional:: c1, c2, c3
    !=end

    character(string)        :: msg
  continue

    if (   StrHead(  'ERROR', trim( UChar(level) )  )   ) then
       msg = Cprintf(message,  i=i, r=r, d=d, L=L, n=n, c1=c1, c2=c2, c3=c3)
       call StoreError(USR_ECHAR, where, cause_c=msg)

    elseif (   StrHead(  'WARNING', trim( UChar(level) )  )   ) then
       msg = Cprintf(message,  i=i, r=r, d=d, L=L, n=n, c1=c1, c2=c2, c3=c3)
       msg=' *** WARNING [' // trim(where) // '] ***  '// trim(msg)
       call Printf(fmt='%c', c1=msg)

    else
       msg = Cprintf(message,  i=i, r=r, d=d, L=L, n=n, c1=c1, c2=c2, c3=c3)
       msg=' *** MESSAGE [' // trim(where) // '] ***  ' // trim(msg)
       call Printf(fmt='%c', c1=msg)

    endif

    return
  end subroutine MessageNotifyC
number :integer, intent(in)
: begin
 Input
where :character(*), intent(in)
message :character(*), intent(in), optional
i(:) :integer , intent(in), optional
r(:) :real , intent(in), optional
d(:) :real(8) , intent(in), optional
L(:) :logical , intent(in), optional
n(:) :integer , intent(in), optional
c1 :character(*), intent(in), optional
c2 :character(*), intent(in), optional
c3 :character(*), intent(in), optional

[Source]

  subroutine MessageNotifyI(number, where, message,  i, r, d, L, n, c1, c2, c3)
  !
  !==== Dependency
  !

  !
  !=end
    implicit none

    !=begin
    !==== Input
    !
    integer,      intent(in)          :: number
    character(*), intent(in)          :: where
    character(*), intent(in), optional:: message
    integer     , intent(in), optional:: i(:), n(:)
    real        , intent(in), optional:: r(:)
    real(8)     , intent(in), optional:: d(:)
    logical     , intent(in), optional:: L(:)
    character(*), intent(in), optional:: c1, c2, c3
    !=end
  continue

    if (.not. present(message)) then
       call StoreError(number, where)

    else
       call StoreError(number, where,   cause_c=CPrintf( message,  i=i, r=r, d=d, L=L, n=n, c1=c1, c2=c2, c3=c3 )  )
    endif

    return
  end subroutine MessageNotifyI

[Validate]