da_warning.inc
References to this file elsewhere.
1 subroutine da_warning(file_str, line, warnings)
2
3 !--------------------------------------------------------------------
4 ! Purpose: Standard interface for warning messages
5 !--------------------------------------------------------------------
6
7 implicit none
8
9 character(len=*), intent(in) :: file_str
10 integer, intent(in) :: line
11 character(len=*), intent(in) :: warnings(:)
12 character*256 :: line_str
13 character*256 :: html_file
14 #if defined(DM_PARALLEL) && ! defined(STUBMPI)
15 integer :: i
16 #endif
17
18 if (warnings_are_fatal) then
19 call da_error(file_str, line, warnings)
20 else
21 write(line_str,'(i6)') line
22
23 html_file=file_str(1:LEN_trim(file_str)-4)//'.html'
24
25 #if defined(DM_PARALLEL) && ! defined(STUBMPI)
26 call wrf_message( &
27 '--------------------------- WARNING ---------------------------')
28 ! only print file and line if line is positive
29 if (line > 0) then
30 if (use_html) then
31 call wrf_message('WARNING FROM FILE: <A HREF="'// &
32 trim(documentation_url)//'/'//trim(html_file)//'">'//trim(file_str)// &
33 '</a> LINE: '//trim(line_str))
34 else
35 call wrf_message('WARNING FROM FILE: '//trim(file_str)// &
36 ' LINE: '//trim(line_str))
37 end if
38 end if
39 do i=1,size(warnings)
40 call wrf_message(warnings(i))
41 end do
42 call wrf_message( &
43 '---------------------------------------------------------------')
44 #else
45 call wrf_message2( &
46 '---------------------------- WARNING --------------------------')
47 ! only print file and line if line is positive
48 if (line > 0) then
49 if (use_html) then
50 call wrf_message2('WARNING FROM FILE: <A HREF="'// &
51 trim(documentation_url)//'/'//trim(html_file)//'">'// &
52 trim(file_str)//'</a> LINE: '//trim(line_str))
53 else
54 call wrf_message2('WARNING FROM FILE: '//trim(file_str)// &
55 ' LINE: '//trim(line_str))
56 end if
57 end if
58 call da_message2(warnings)
59 call wrf_message2( &
60 '---------------------------------------------------------------')
61 #endif
62 end if
63
64 end subroutine da_warning
65
66