Set status flag and message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nlesolver_type), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | istat |
status code |
||
character(len=*), | intent(in) | :: | string |
status message |
||
integer, | intent(in), | optional | :: | i |
an integer value to append |
|
real(kind=wp), | intent(in), | optional | :: | r |
a real value to append |
subroutine set_status(me,istat,string,i,r) implicit none class(nlesolver_type),intent(inout) :: me integer,intent(in) :: istat !! status code character(len=*),intent(in) :: string !! status message integer,intent(in),optional :: i !! an integer value to append real(wp),intent(in),optional :: r !! a real value to append character(len=256) :: numstr !! for number fo string conversion character(len=:),allocatable :: message !! the full message to log integer :: iostat !! write `iostat` code message = trim(string) if (present(i)) then numstr = '' write(numstr,fmt=*,iostat=iostat) i if (iostat/=0) numstr = '****' message = message//' '//trim(adjustl(numstr)) end if if (present(r)) then numstr = '' write(numstr,fmt=*,iostat=iostat) r if (iostat/=0) numstr = '****' message = message//' '//trim(adjustl(numstr)) end if if (me%verbose) then write(me%iunit,'(A)',iostat=iostat) message end if ! store in the class: me%istat = istat me%message = message end subroutine set_status