level : | character(*), intent(in)
|
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 となります。
subroutine MessageNotifyC(level, where, message, i, r, d, L, n, c1, c2, c3)
!
!==== Dependency
!
!
!=end
implicit none
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
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