SCALE-RM
Functions/Subroutines | Variables
dc_log Module Reference

module DC_Log More...

Functions/Subroutines

subroutine, public loginit (fid_conf, fid_log, master)
 
subroutine, public logfinalize
 
subroutine, public log (type, message)
 

Variables

integer, parameter, public log_lmsg = 4096
 
integer, public log_fid = STDOUT
 

Detailed Description

module DC_Log

Description
Handring Log
Author
Team SCALE
History
  • 2012-07-12 (S.Nishizawa) [new]

Function/Subroutine Documentation

◆ loginit()

subroutine, public dc_log::loginit ( integer, intent(in)  fid_conf,
integer, intent(in), optional  fid_log,
logical, intent(in), optional  master 
)

Definition at line 66 of file dc_log.f90.

References log(), and log_fid.

Referenced by mod_rm_driver::scalerm(), scalerm_launcher(), and mod_rm_prep::scalerm_prep().

66  implicit none
67  integer, intent(in) :: fid_conf
68  integer, intent(in), optional :: fid_log
69  logical, intent(in), optional :: master
70 
71  character(len=5) :: log_level = 'I'
72  character(len=100) :: log_file = "LOG_"
73 
74  integer :: ierr
75 
76  namelist / param_dc_log / &
77  log_level, &
78  log_file
79  !-----------------------------------------------------------------------------
80 
81  if ( present(master) ) log_master = master
82 
83  call date_and_time(log_file(4:11), log_file(12:21))
84 
85  !--- read PARAM
86  rewind(fid_conf)
87  read(fid_conf,nml=param_dc_log,iostat=ierr)
88 
89  if ( ierr > 0 ) then
90  call log('E', 'xxx Not appropriate names in namelist PARAM_DC_LOG. Check!')
91  end if
92 
93  if ( present(fid_log) ) then
94  log_fid = fid_log
95  else
96  open( log_fid, & ! (out)
97  file = trim(log_file), & ! (in)
98  form = 'formatted', & ! (in)
99  iostat = ierr ) ! (in)
100  if ( ierr /= 0 ) then
101  call log('E', 'xxx File open error! :' // trim(log_file))
102  end if
103  log_opened = .true.
104  end if
105 
106  select case (trim(log_level))
107  case ('E', 'e', 'ERROR', 'error')
108  log_ilevel = log_error
109  case ('W', 'w', 'WARN', 'warn')
110  log_ilevel = log_warn
111  case ('I', 'i', 'INFO', 'info')
112  log_ilevel = log_info
113  case ('D', 'd', 'DEBUG', 'debug')
114  log_ilevel = log_debug
115  case default
116  call log('E', 'xxx LOG_LEVEL is invalid. Check!')
117  end select
118 
119  return
subroutine, public log(type, message)
Definition: dc_log.f90:133
Here is the call graph for this function:
Here is the caller graph for this function:

◆ logfinalize()

subroutine, public dc_log::logfinalize ( )

Definition at line 123 of file dc_log.f90.

References log_fid.

123 
124  if ( log_opened ) close(log_fid)
125  log_opened = .false.
126 

◆ log()

subroutine, public dc_log::log ( character(len=*), intent(in)  type,
character(len=*), intent(in)  message 
)

Definition at line 133 of file dc_log.f90.

References log_fid.

Referenced by mod_mkinit::aerosol_activation_kajino13(), scale_atmos_phy_ae_kajino13::aerosol_nucleation(), scale_atmos_adiabat::atmos_adiabat_liftparcel(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_setup(), scale_atmos_phy_mp_convert::atmos_phy_mp_bulk2bin(), scale_atmos_phy_mp_sn14::atmos_phy_mp_sn14(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_setup(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08(), scale_atmos_phy_rd_profile::atmos_phy_rd_profile_setup(), scale_atmos_phy_rd_profile::atmos_phy_rd_profile_setup_zgrid(), scale_atmos_phy_sf_bulk::atmos_phy_sf_bulk(), scale_atmos_phy_sf_bulkcoef::atmos_phy_sf_bulkcoef_setup(), scale_atmos_thermodyn::atmos_thermodyn_qd_0d(), scale_bulkflux::bulkflux_setup(), dc_calendar::calendarinit(), scale_atmos_phy_cp_kf::cp_kf_main(), mod_mkinit::diag_ds(), gtool_file::fileclose(), gtool_file::filecreate(), gtool_file::filedefassociatedcoordinates(), gtool_file::filedefaxis(), gtool_file::filedefinevariable(), gtool_file::fileenddef(), gtool_file::filegetalldatainfo(), gtool_file::filegetdatainfo(), gtool_file::filegetshape(), gtool_file::filemakefname(), gtool_file::fileopen(), gtool_file::filesetoption(), gtool_file::filesettattr(), scale_atmos_phy_mp_sn14::freezing_water_kij(), gtool_history::historyaddvariable(), gtool_history::historyinit(), gtool_history::historyoutputlist(), gtool_history::historyput1dassociatedcoordinatesdp(), gtool_history::historyput1dassociatedcoordinatessp(), gtool_history::historyput2dassociatedcoordinatesdp(), gtool_history::historyput2dassociatedcoordinatessp(), gtool_history::historyput3dassociatedcoordinatesdp(), gtool_history::historyput3dassociatedcoordinatessp(), gtool_history::historyput4dassociatedcoordinatesdp(), gtool_history::historyput4dassociatedcoordinatessp(), gtool_history::historyputaxisdp(), gtool_history::historyputaxissp(), gtool_history::historyquery(), gtool_history::historywrite(), scale_atmos_phy_mp_sn14::ice_multiplication_kij(), scale_atmos_phy_cp_kf::kf_lutab(), scale_land_sfc_slab::land_sfc_slab(), loginit(), scale_atmos_phy_mp_suzuki10::mkpara(), scale_atmos_phy_mp_suzuki10::mp_suzuki10(), scale_mapproj::mprj_rotcoef_2d(), scale_grid_nest::nest_comm_intercomm_nestdown_3d(), scale_ocean_sfc_slab::ocean_sfc_slab(), mod_realinput_grads::parentatominputgrads(), mod_realinput::parentatomsetup(), scale_atmos_phy_mp_suzuki10::r_collcoag(), mod_mkinit::read_sounding(), mod_mkinit::rect_setup(), scale_roughness::roughness_setup(), scale_specfunc::sf_gamma(), scale_urban_phy_slc::urban_phy_slc(), and mod_realinput_wrfarw::wrf_arwpost_calc_uvmet().

133  implicit none
134  character(len=*), intent(in) :: type
135  character(len=*), intent(in) :: message
136 
137  select case (trim(type))
138  case ('E', 'e')
139  if ( log_ilevel >= log_error ) call logput(message)
140  write(stderr,*) trim(message)
141  call abort
142  case ('W', 'w')
143  if ( log_ilevel >= log_warn ) call logput(message)
144  case ('I', 'i')
145  if ( log_ilevel >= log_info ) call logput(message)
146  case ('D', 'd')
147  if ( log_ilevel >= log_debug ) call logput(message)
148  case default
149  write(stderr,*) 'BUG: wrong log level'
150  call abort
151  end select
152 
153  return

Variable Documentation

◆ log_lmsg

integer, parameter, public dc_log::log_lmsg = 4096

Definition at line 47 of file dc_log.f90.

47  integer, public, parameter :: log_lmsg = 4096

◆ log_fid

integer, public dc_log::log_fid = STDOUT

Definition at line 48 of file dc_log.f90.

Referenced by log(), logfinalize(), and loginit().

48  integer, public :: log_fid = stdout