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)//'">'// &
33 trim(file_str)// &
34 '</a> LINE: '//trim(line_str))
35 else
36 call wrf_message('WARNING FROM FILE: '//trim(file_str)// &
37 ' LINE: '//trim(line_str))
38 end if
39 end if
40 do i=1,size(warnings)
41 call wrf_message(warnings(i))
42 end do
43 call wrf_message( &
44 '---------------------------------------------------------------')
45 #else
46 call wrf_message2( &
47 '---------------------------- WARNING --------------------------')
48 ! only print file and line if line is positive
49 if (line > 0) then
50 if (use_html) then
51 call wrf_message2('WARNING FROM FILE: <A HREF="'// &
52 trim(documentation_url)//'/'//trim(html_file)//'">'// &
53 trim(file_str)//'</a> LINE: '//trim(line_str))
54 else
55 call wrf_message2('WARNING FROM FILE: '//trim(file_str)// &
56 ' LINE: '//trim(line_str))
57 end if
58 end if
59 call da_message2(warnings)
60 call wrf_message2( &
61 '---------------------------------------------------------------')
62 #endif
63 end if
64
65 end subroutine da_warning
66
67