2 module module_mosaic_support
3 !Purpose: This module contains subroutines which have codes which depend upon
4 ! the host code (CAM, WRF etc.). #defines are used to seprate codes
5 ! which depends on the host code
8 use cam_logfile, only: iulog
9 use abortutils, only: endrun
12 use module_data_mosaic_asecthp, only: lunerr
13 use module_peg_util, only: peg_error_fatal, peg_message
19 public:: mosaic_warn_mess
20 public:: mosaic_err_mess
25 subroutine mosaic_warn_mess(message)
26 !Purpose: Print out the warning messages from Mosaic code
28 character(len=*), intent(in) :: message
31 character(len=16), parameter :: warn_str = 'MOSAIC WARNING: '
32 character(len=500) :: str_to_prnt
35 write(iulog,*)warn_str,message
39 ! write(*,*)warn_str,message
40 str_to_prnt = warn_str // message
41 call peg_message( lunerr, trim(str_to_prnt) )
46 end subroutine mosaic_warn_mess
49 subroutine mosaic_err_mess(message)
51 character(len=*), intent(in) :: message
54 character(len=14), parameter :: err_str = 'MOSAIC ERROR: '
55 character(len=500) :: str_to_prnt
57 write(str_to_prnt,*)err_str,message
60 call endrun(trim(adjustl(str_to_prnt)))
64 ! write(*,*)(trim(adjustl(str_to_prnt)))
66 str_to_prnt = err_str // message
67 call peg_error_fatal( lunerr, trim(str_to_prnt) )
69 end subroutine mosaic_err_mess
73 end module module_mosaic_support