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