35 CHARACTER(*),
PARAMETER,
DIMENSION( 0:MAX_N_STATES ) :: &
51 CHARACTER(*),
INTENT(IN) :: name
52 CHARACTER(*),
INTENT(IN) :: description
53 CHARACTER(*),
INTENT(IN) :: revision
55 CHARACTER(*),
PARAMETER :: program_header = &
56 '**********************************************************' 57 CHARACTER(*),
PARAMETER :: space =
' ' 60 CHARACTER(80) :: pn_fmt
66 pn_pos = ( len(program_header) / 2 ) - ( len_trim(adjustl(name)) / 2 )
67 pn_pos =
max( pn_pos, 0 ) + 5
68 WRITE( pn_fmt,
'( "( ",i2,"x, a, / )" )' ) pn_pos
71 WRITE(*,
'(/5x, a )' ) program_header
72 WRITE(*,fmt=trim(pn_fmt)) trim(adjustl(name))
75 phlen = len(program_header)-1
76 dlen = len_trim(description)
81 IF ( dlen > phlen )
THEN 82 IF ( description(i2:i2) /= space .AND. i2 /= dlen)
THEN 84 i = index( description(i1:i2), space, back=.true. )
96 WRITE(*,
'(6x, a )' ) description(i1:i2)
98 i2 =
min(i1+phlen-1,dlen)
103 WRITE(*,
'(/6x, a )' ) trim(revision)
104 WRITE(*,
'(5x, a, / )' ) program_header
119 CHARACTER(*),
INTENT(IN) :: routine_name
120 CHARACTER(*),
INTENT(IN) :: message
121 INTEGER,
INTENT(IN) :: error_state
122 CHARACTER(*),
INTENT(IN),
OPTIONAL :: message_log
124 CHARACTER(*),
PARAMETER :: this_routine_name =
'Display_Message' 125 CHARACTER(*),
PARAMETER :: fmt_string =
'( 1x, a, "(", a, ") : ", a )' 127 INTEGER :: error_state_to_use
128 LOGICAL :: log_to_stdout
130 INTEGER :: error_status
133 error_state_to_use = error_state
134 IF ( error_state < 0 .OR. error_state >
max_n_states )
THEN 139 log_to_stdout = .true.
140 IF (
PRESENT( message_log ) )
THEN 141 log_to_stdout = .false.
143 IF ( error_status /= 0 )
THEN 145 'Error opening message log file', &
147 log_to_stdout = .true.
152 IF ( log_to_stdout )
THEN 153 WRITE( *, fmt = fmt_string ) &
154 trim( routine_name ), &
158 WRITE( file_id, fmt = fmt_string ) &
159 trim( routine_name ), &
179 CHARACTER(*),
INTENT(IN) :: message_log
180 INTEGER,
INTENT(OUT) :: file_id
182 INTEGER :: error_status
198 OPEN( lun, file = trim( message_log ), &
199 access =
'SEQUENTIAL', &
200 form =
'FORMATTED', &
201 status =
'UNKNOWN', &
202 position =
'APPEND', &
203 action =
'READWRITE', &
205 IF ( io_status /= 0 )
THEN integer, parameter, public failure
integer function, public open_message_log(Message_Log, File_ID)
integer, parameter, public warning
integer, parameter max_n_states
integer function, public get_lun()
subroutine, public program_message(Name, Description, Revision)
integer, parameter, public undefined
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
character(*), dimension(0:max_n_states), parameter state_descriptor
integer, parameter, public success
integer, parameter, public information