SCALE-RM
Data Types | Functions/Subroutines
scale_prof Module Reference

module profiler More...

Functions/Subroutines

subroutine, public prof_setup
 
subroutine, public prof_finalize
 
subroutine, public prof_setprefx (prefxname)
 
subroutine, public prof_rapstart (rapname_base, level, disable_barrier)
 Start raptime. More...
 
subroutine, public prof_rapend (rapname_base, level, disable_barrier)
 Save raptime. More...
 
subroutine, public prof_rapreport
 Report raptime. More...
 
integer function get_grpid (rapname)
 Get group ID. More...
 

Detailed Description

module profiler

Description
Time counter & FLOP counter(PAPI) toolbox
Author
Team SCALE
NAMELIST
  • PARAM_PROF
    nametypedefault valuecomment
    PROF_RAP_LEVEL integer 2
    PROF_MPI_BARRIER logical .false.

History Output
No history output

Function/Subroutine Documentation

◆ prof_setup()

subroutine, public scale_prof::prof_setup

Definition at line 107 of file scale_prof.F90.

107  use scale_prc, only: &
108  prc_abort
109  implicit none
110 
111  namelist / param_prof / &
112  prof_rap_level, &
113  prof_mpi_barrier
114 
115  integer :: ierr
116 
117  log_newline
118  log_info("PROF_setup",*) 'Setup'
119 
120  !--- read namelist
121  rewind(io_fid_conf)
122  read(io_fid_conf,nml=param_prof,iostat=ierr)
123  if( ierr < 0 ) then !--- missing
124  log_info("PROF_setup",*) 'Not found namelist. Default used.'
125  elseif( ierr > 0 ) then !--- fatal error
126  log_error("PROF_setup",*) 'Not appropriate names in namelist PARAM_PROF. Check!'
127  call prc_abort
128  endif
129  log_nml(param_prof)
130 
131  log_newline
132  log_info("PROF_setup",*) 'Rap output level = ', prof_rap_level
133  log_info("PROF_setup",*) 'Add MPI_barrier in every rap? = ', prof_mpi_barrier
134 
135  prof_prefix = ''
136 
137  return

References scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), and scale::scale_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prof_finalize()

subroutine, public scale_prof::prof_finalize

Definition at line 141 of file scale_prof.F90.

141 
142  prof_rap_level = 2
143  prof_mpi_barrier = .false.
144 #ifdef PAPI
145  prof_papi_flops = 0
146  prof_papi_real_time = 0.0
147  prof_papi_proc_time = 0.0
148  prof_papi_mflops = 0.0
149 #endif
150 
151  prof_rapnmax = 0
152  prof_grpnmax = 0
153 
154  return

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the caller graph for this function:

◆ prof_setprefx()

subroutine, public scale_prof::prof_setprefx ( character(len=*), intent(in)  prefxname)
Parameters
[in]prefxnameprefix

Definition at line 160 of file scale_prof.F90.

160  implicit none
161 
162  character(len=*), intent(in) :: prefxname
163 
164  !---------------------------------------------------------------------------
165 
166  prof_prefix = prefxname
167 
168  return

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the caller graph for this function:

◆ prof_rapstart()

subroutine, public scale_prof::prof_rapstart ( character(len=*), intent(in)  rapname_base,
integer, intent(in), optional  level,
logical, intent(in), optional  disable_barrier 
)

Start raptime.

Parameters
[in]rapname_basename of item
[in]levellevel of item
[in]disable_barrierdisable barrier if .true.

Definition at line 174 of file scale_prof.F90.

174  use scale_prc, only: &
175  prc_mpibarrier, &
177  implicit none
178 
179  character(len=*), intent(in) :: rapname_base
180  integer, intent(in), optional :: level
181  logical, intent(in), optional :: disable_barrier
182 
183  character(len=H_SHORT) :: rapname
184 
185  integer :: id
186  integer :: level_
187  integer :: tn
188  integer :: i
189  logical :: disable_barrier_
190  !$ integer :: omp_get_thread_num
191  !---------------------------------------------------------------------------
192 
193  tn = 0
194  !$ tn = omp_get_thread_num()
195  if ( tn > 0 ) return
196 
197  if ( present(level) ) then
198  level_ = level
199  else
200  level_ = prof_default_rap_level
201  endif
202 
203  if ( present(disable_barrier) ) then
204  disable_barrier_ = disable_barrier
205  else
206  disable_barrier_ = .false.
207  endif
208 
209  if( level_ > prof_rap_level ) return
210 
211  if ( len_trim(prof_prefix) > 0 ) then
212  rapname = trim(prof_prefix)//" "//trim(rapname_base)
213  else
214  rapname = rapname_base
215  end if
216 
217  id = get_rapid( rapname, level_ )
218 
219  prof_rapcnt(id) = prof_rapcnt(id) + 1
220 
221  if ( prof_rapcnt(id) > 1 ) return
222 
223  if ( ( .not. disable_barrier_ ) .and. prof_mpi_barrier ) call prc_mpibarrier
224 
225  prof_raptstr(id) = prc_mpitime()
226  prof_rapnstr(id) = prof_rapnstr(id) + 1
227 
228  !LOG_INFO("PROF_rapstart",'(1x,A,I8)') rapname, PROF_rapnstr(id)
229  !call flush(IO_FID_LOG)
230 
231 #ifdef FAPP
232  i = index(rapname," ")
233  if ( i == 0 .or. i > len_trim(rapname)) then
234  call fapp_start( rapname, id, level_ )
235  else
236  call fapp_start( rapname(1:i-1)//"_"//trim(rapname(i+1:)), id, level_ )
237  end if
238 #endif
239 
240  return

References scale_prc::prc_mpibarrier(), and scale_prc::prc_mpitime().

Referenced by mod_atmos_driver::atmos_driver_calc_tendency(), mod_atmos_driver::atmos_driver_calc_tendency_from_sflux(), mod_atmos_driver::atmos_driver_setup(), mod_atmos_driver::atmos_driver_update(), scale_atmos_dyn::atmos_dyn(), scale_atmos_dyn_common::atmos_dyn_divergence(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_apply_numfilter(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux_q(), scale_atmos_dyn_tinteg_large_rk3::atmos_dyn_tinteg_large_rk3(), scale_atmos_dyn_tinteg_short_rk11s8o::atmos_dyn_tinteg_short_rk11s8o(), scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3(), scale_atmos_dyn_tinteg_short_rk4::atmos_dyn_tinteg_short_rk4(), scale_atmos_dyn_tinteg_short_rk7s6o::atmos_dyn_tinteg_short_rk7s6o(), scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), scale_atmos_dyn_tstep_short_fvm_hevi::atmos_dyn_tstep_short_fvm_hevi(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_negative_fixer(), scale_atmos_phy_cp_kf::atmos_phy_cp_kf_tendency(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_electric_field(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_f2013(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_mg2001(), mod_atmos_phy_mp_driver::atmos_phy_mp_driver_calc_tendency(), scale_atmos_phy_mp_kessler::atmos_phy_mp_kessler_adjustment(), scale_atmos_phy_mp_common::atmos_phy_mp_negative_fixer(), scale_atmos_phy_mp_common::atmos_phy_mp_saturation_adjustment_3d(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_crg_qtrc2qhyd(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_tendency(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_adjustment(), scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx_flux(), mod_atmos_driver::atmos_surface_get(), mod_atmos_driver::atmos_surface_set(), mod_atmos_vars::atmos_vars_calc_diagnostics(), mod_atmos_vars::atmos_vars_history(), mod_atmos_vars::atmos_vars_history_setpres(), mod_atmos_vars::atmos_vars_restart_check(), mod_atmos_vars::atmos_vars_restart_close(), mod_atmos_vars::atmos_vars_restart_create(), mod_atmos_vars::atmos_vars_restart_def_var(), mod_atmos_vars::atmos_vars_restart_enddef(), mod_atmos_vars::atmos_vars_restart_open(), mod_atmos_vars::atmos_vars_restart_read(), mod_atmos_vars::atmos_vars_restart_write(), scale_debug::check(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_send(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_send(), scale_comm_cartesc_nest::comm_cartesc_nest_test_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_test_send(), scale_comm_icoa::comm_data_transfer_dp(), scale_comm_icoa::comm_data_transfer_nopl(), scale_comm_icoa::comm_data_transfer_sp(), scale_comm_icoa::comm_var_dp(), scale_comm_icoa::comm_var_sp(), mod_da_driver::da_driver_update(), scale_file::file_add_associatedvariable(), scale_file_cartesc::file_cartesc_close(), scale_file_cartesc::file_cartesc_create(), scale_file_cartesc::file_cartesc_def_var(), scale_file_cartesc::file_cartesc_enddef(), scale_file_cartesc::file_cartesc_flush(), scale_file_cartesc::file_cartesc_open(), scale_file_cartesc::file_cartesc_put_globalattributes(), scale_file_cartesc::file_cartesc_read_1d(), scale_file_cartesc::file_cartesc_read_auto_2d(), scale_file_cartesc::file_cartesc_read_auto_3d(), scale_file_cartesc::file_cartesc_read_var_2d(), scale_file_cartesc::file_cartesc_read_var_3d(), scale_file_cartesc::file_cartesc_read_var_4d(), scale_file_cartesc::file_cartesc_write_var_1d(), scale_file_cartesc::file_cartesc_write_var_2d(), scale_file_cartesc::file_cartesc_write_var_3d(), scale_file_cartesc::file_cartesc_write_var_3d_t(), scale_file_cartesc::file_cartesc_write_var_4d(), scale_file::file_create(), scale_file::file_def_axis(), scale_file::file_get_dimlength(), scale_file_history_cartesc::file_history_cartesc_truncate_3d(), scale_file_history::file_history_in_0d(), scale_file_history::file_history_in_1d(), scale_file_history::file_history_in_2d(), scale_file_history::file_history_in_3d(), scale_file_history::file_history_reg(), scale_file_history::file_history_write(), scale_file::file_set_option(), scale_interp::interp_factor2d_linear_latlon(), scale_interp::interp_factor2d_linear_xy(), scale_interp::interp_factor2d_weight(), scale_interp::interp_factor3d_linear_latlon(), scale_interp::interp_factor3d_linear_xy(), scale_interp::interp_factor3d_weight(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_interp_vert::interp_vert_z2xi(), mod_land_driver::land_driver_calc_tendency(), mod_land_driver::land_driver_update(), mod_land_driver::land_surface_get(), mod_land_driver::land_surface_set(), mod_land_vars::land_vars_history(), mod_land_vars::land_vars_restart_close(), mod_land_vars::land_vars_restart_create(), mod_land_vars::land_vars_restart_def_var(), mod_land_vars::land_vars_restart_enddef(), mod_land_vars::land_vars_restart_open(), mod_land_vars::land_vars_restart_read(), mod_land_vars::land_vars_restart_write(), mod_mkinit::mkinit(), scale_monitor::monitor_put_2d(), scale_monitor::monitor_put_3d(), scale_monitor::monitor_reg(), scale_monitor::monitor_write(), mod_ocean_driver::ocean_driver_calc_tendency(), mod_ocean_driver::ocean_driver_update(), mod_ocean_driver::ocean_surface_get(), mod_ocean_driver::ocean_surface_set(), mod_ocean_vars::ocean_vars_history(), mod_ocean_vars::ocean_vars_restart_close(), mod_ocean_vars::ocean_vars_restart_create(), mod_ocean_vars::ocean_vars_restart_def_var(), mod_ocean_vars::ocean_vars_restart_enddef(), mod_ocean_vars::ocean_vars_restart_open(), mod_ocean_vars::ocean_vars_restart_read(), mod_ocean_vars::ocean_vars_restart_write(), mod_mkinit::read_sounding(), mod_realinput::realinput_surface(), mod_rm_driver::restart_read(), mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), scale::scale_init(), scale_statistics::statistics_detail_2d(), scale_statistics::statistics_detail_3d(), scale_statistics::statistics_horizontal_max_2d(), scale_statistics::statistics_horizontal_max_3d(), scale_statistics::statistics_horizontal_mean_2d(), scale_statistics::statistics_horizontal_mean_3d(), scale_statistics::statistics_horizontal_min_2d(), scale_statistics::statistics_horizontal_min_3d(), scale_statistics::statistics_total_2d(), scale_statistics::statistics_total_3d(), mod_urban_driver::urban_driver_calc_tendency(), mod_urban_driver::urban_driver_update(), mod_urban_driver::urban_surface_get(), mod_urban_driver::urban_surface_set(), mod_urban_vars::urban_vars_history(), mod_urban_vars::urban_vars_restart_close(), mod_urban_vars::urban_vars_restart_create(), mod_urban_vars::urban_vars_restart_def_var(), mod_urban_vars::urban_vars_restart_enddef(), mod_urban_vars::urban_vars_restart_open(), mod_urban_vars::urban_vars_restart_read(), mod_urban_vars::urban_vars_restart_write(), scale_debug::valcheck_1d(), scale_debug::valcheck_2d(), and scale_debug::valcheck_3d().

Here is the call graph for this function:

◆ prof_rapend()

subroutine, public scale_prof::prof_rapend ( character(len=*), intent(in)  rapname_base,
integer, intent(in), optional  level,
logical, intent(in), optional  disable_barrier 
)

Save raptime.

Parameters
[in]rapname_basename of item
[in]levellevel of item
[in]disable_barrierdisable barrier if .true.

Definition at line 246 of file scale_prof.F90.

246  use scale_prc, only: &
247  prc_mpibarrier, &
249  implicit none
250 
251  character(len=*), intent(in) :: rapname_base
252  integer, intent(in), optional :: level
253  logical, intent(in), optional :: disable_barrier
254 
255  character(len=H_SHORT) :: rapname
256 
257  integer :: id
258  integer :: level_
259  integer :: tn
260  integer :: i
261  logical :: disable_barrier_
262  !$ integer :: omp_get_thread_num
263  !---------------------------------------------------------------------------
264 
265  tn = 0
266  !$ tn = omp_get_thread_num()
267  if ( tn > 0 ) return
268 
269  if ( present(level) ) then
270  if( level > prof_rap_level ) return
271  endif
272 
273  if ( len_trim(prof_prefix) > 0 ) then
274  rapname = trim(prof_prefix)//" "//trim(rapname_base)
275  else
276  rapname = rapname_base
277  end if
278 
279  if ( present(disable_barrier) ) then
280  disable_barrier_ = disable_barrier
281  else
282  disable_barrier_ = .false.
283  endif
284 
285 
286  level_ = -1
287  id = get_rapid( rapname, level_ )
288 
289  if( level_ > prof_rap_level ) return
290 
291  prof_rapcnt(id) = prof_rapcnt(id) - 1
292 
293  if ( prof_rapcnt(id) > 0 ) return
294 
295 #ifdef FAPP
296  i = index(rapname," ")
297  if ( i == 0 .or. i > len_trim(rapname)) then
298  call fapp_stop( rapname, id, level_ )
299  else
300  call fapp_stop( rapname(1:i-1)//"_"//trim(rapname(i+1:)), id, level_ )
301  end if
302 #endif
303 
304  prof_rapttot(id) = prof_rapttot(id) + ( prc_mpitime()-prof_raptstr(id) )
305  prof_rapnend(id) = prof_rapnend(id) + 1
306 
307  if ( ( .not. disable_barrier_ ) .and. prof_mpi_barrier ) call prc_mpibarrier
308 
309  return

References scale_prc::prc_mpibarrier(), and scale_prc::prc_mpitime().

Referenced by mod_atmos_driver::atmos_driver_calc_tendency(), mod_atmos_driver::atmos_driver_calc_tendency_from_sflux(), mod_atmos_driver::atmos_driver_setup(), mod_atmos_driver::atmos_driver_update(), scale_atmos_dyn::atmos_dyn(), scale_atmos_dyn_common::atmos_dyn_divergence(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_apply_numfilter(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux(), scale_atmos_dyn_fvm_numfilter::atmos_dyn_fvm_numfilter_flux_q(), scale_atmos_dyn_tinteg_large_rk3::atmos_dyn_tinteg_large_rk3(), scale_atmos_dyn_tinteg_short_rk11s8o::atmos_dyn_tinteg_short_rk11s8o(), scale_atmos_dyn_tinteg_short_rk3::atmos_dyn_tinteg_short_rk3(), scale_atmos_dyn_tinteg_short_rk4::atmos_dyn_tinteg_short_rk4(), scale_atmos_dyn_tinteg_short_rk7s6o::atmos_dyn_tinteg_short_rk7s6o(), scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), scale_atmos_dyn_tstep_short_fvm_hevi::atmos_dyn_tstep_short_fvm_hevi(), scale_atmos_phy_ae_kajino13::atmos_phy_ae_kajino13_negative_fixer(), scale_atmos_phy_cp_kf::atmos_phy_cp_kf_tendency(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_electric_field(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_f2013(), scale_atmos_phy_lt_sato2019::atmos_phy_lt_neutralization_mg2001(), mod_atmos_phy_mp_driver::atmos_phy_mp_driver_calc_tendency(), scale_atmos_phy_mp_kessler::atmos_phy_mp_kessler_adjustment(), scale_atmos_phy_mp_common::atmos_phy_mp_negative_fixer(), scale_atmos_phy_mp_common::atmos_phy_mp_saturation_adjustment_3d(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_crg_qtrc2qhyd(), scale_atmos_phy_mp_suzuki10::atmos_phy_mp_suzuki10_tendency(), scale_atmos_phy_mp_tomita08::atmos_phy_mp_tomita08_adjustment(), scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx_flux(), mod_atmos_driver::atmos_surface_get(), mod_atmos_driver::atmos_surface_set(), mod_atmos_vars::atmos_vars_calc_diagnostics(), mod_atmos_vars::atmos_vars_history(), mod_atmos_vars::atmos_vars_history_setpres(), mod_atmos_vars::atmos_vars_restart_check(), mod_atmos_vars::atmos_vars_restart_close(), mod_atmos_vars::atmos_vars_restart_create(), mod_atmos_vars::atmos_vars_restart_def_var(), mod_atmos_vars::atmos_vars_restart_enddef(), mod_atmos_vars::atmos_vars_restart_open(), mod_atmos_vars::atmos_vars_restart_read(), mod_atmos_vars::atmos_vars_restart_write(), scale_debug::check(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_nestdown_send(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_recvwait_issue_send(), scale_comm_cartesc_nest::comm_cartesc_nest_test_recv(), scale_comm_cartesc_nest::comm_cartesc_nest_test_send(), scale_comm_icoa::comm_data_transfer_dp(), scale_comm_icoa::comm_data_transfer_nopl(), scale_comm_icoa::comm_data_transfer_sp(), scale_comm_icoa::comm_var_dp(), scale_comm_icoa::comm_var_sp(), mod_da_driver::da_driver_update(), scale_file::file_add_associatedvariable(), scale_file_cartesc::file_cartesc_close(), scale_file_cartesc::file_cartesc_create(), scale_file_cartesc::file_cartesc_def_var(), scale_file_cartesc::file_cartesc_enddef(), scale_file_cartesc::file_cartesc_flush(), scale_file_cartesc::file_cartesc_open(), scale_file_cartesc::file_cartesc_put_globalattributes(), scale_file_cartesc::file_cartesc_read_1d(), scale_file_cartesc::file_cartesc_read_auto_2d(), scale_file_cartesc::file_cartesc_read_auto_3d(), scale_file_cartesc::file_cartesc_read_var_2d(), scale_file_cartesc::file_cartesc_read_var_3d(), scale_file_cartesc::file_cartesc_read_var_4d(), scale_file_cartesc::file_cartesc_write_var_1d(), scale_file_cartesc::file_cartesc_write_var_2d(), scale_file_cartesc::file_cartesc_write_var_3d(), scale_file_cartesc::file_cartesc_write_var_3d_t(), scale_file_cartesc::file_cartesc_write_var_4d(), scale_file::file_create(), scale_file::file_def_axis(), scale_file::file_get_dimlength(), scale_file_history_cartesc::file_history_cartesc_truncate_3d(), scale_file_history::file_history_in_0d(), scale_file_history::file_history_in_1d(), scale_file_history::file_history_in_2d(), scale_file_history::file_history_in_3d(), scale_file_history::file_history_reg(), scale_file_history::file_history_write(), scale_file::file_set_option(), scale_interp::interp_factor2d_linear_latlon(), scale_interp::interp_factor2d_linear_xy(), scale_interp::interp_factor2d_weight(), scale_interp::interp_factor3d_linear_latlon(), scale_interp::interp_factor3d_linear_xy(), scale_interp::interp_factor3d_weight(), scale_interp::interp_interp2d(), scale_interp::interp_interp3d(), scale_interp_vert::interp_vert_z2xi(), mod_land_driver::land_driver_calc_tendency(), mod_land_driver::land_driver_update(), mod_land_driver::land_surface_get(), mod_land_driver::land_surface_set(), mod_land_vars::land_vars_history(), mod_land_vars::land_vars_restart_close(), mod_land_vars::land_vars_restart_create(), mod_land_vars::land_vars_restart_def_var(), mod_land_vars::land_vars_restart_enddef(), mod_land_vars::land_vars_restart_open(), mod_land_vars::land_vars_restart_read(), mod_land_vars::land_vars_restart_write(), mod_mkinit::mkinit(), scale_monitor::monitor_put_2d(), scale_monitor::monitor_put_3d(), scale_monitor::monitor_reg(), scale_monitor::monitor_write(), mod_ocean_driver::ocean_driver_calc_tendency(), mod_ocean_driver::ocean_driver_update(), mod_ocean_driver::ocean_surface_get(), mod_ocean_driver::ocean_surface_set(), mod_ocean_vars::ocean_vars_history(), mod_ocean_vars::ocean_vars_restart_close(), mod_ocean_vars::ocean_vars_restart_create(), mod_ocean_vars::ocean_vars_restart_def_var(), mod_ocean_vars::ocean_vars_restart_enddef(), mod_ocean_vars::ocean_vars_restart_open(), mod_ocean_vars::ocean_vars_restart_read(), mod_ocean_vars::ocean_vars_restart_write(), mod_mkinit::read_sounding(), mod_realinput::realinput_surface(), mod_rm_driver::restart_read(), mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), scale::scale_finalize(), scale_statistics::statistics_detail_2d(), scale_statistics::statistics_detail_3d(), scale_statistics::statistics_horizontal_max_2d(), scale_statistics::statistics_horizontal_max_3d(), scale_statistics::statistics_horizontal_mean_2d(), scale_statistics::statistics_horizontal_mean_3d(), scale_statistics::statistics_horizontal_min_2d(), scale_statistics::statistics_horizontal_min_3d(), scale_statistics::statistics_total_2d(), scale_statistics::statistics_total_3d(), mod_urban_driver::urban_driver_calc_tendency(), mod_urban_driver::urban_driver_update(), mod_urban_driver::urban_surface_get(), mod_urban_driver::urban_surface_set(), mod_urban_vars::urban_vars_history(), mod_urban_vars::urban_vars_restart_close(), mod_urban_vars::urban_vars_restart_create(), mod_urban_vars::urban_vars_restart_def_var(), mod_urban_vars::urban_vars_restart_enddef(), mod_urban_vars::urban_vars_restart_open(), mod_urban_vars::urban_vars_restart_read(), mod_urban_vars::urban_vars_restart_write(), scale_debug::valcheck_1d(), scale_debug::valcheck_2d(), and scale_debug::valcheck_3d().

Here is the call graph for this function:

◆ prof_rapreport()

subroutine, public scale_prof::prof_rapreport

Report raptime.

Definition at line 315 of file scale_prof.F90.

315  use scale_prc, only: &
316  prc_mpitimestat, &
318  implicit none
319 
320  real(DP) :: avgvar(PROF_rapnlimit)
321  real(DP) :: maxvar(PROF_rapnlimit)
322  real(DP) :: minvar(PROF_rapnlimit)
323  integer :: maxidx(PROF_rapnlimit)
324  integer :: minidx(PROF_rapnlimit)
325 
326  integer :: idx(PROF_rapnlimit)
327  integer :: cnt
328 
329  integer :: id, gid
330  integer :: fid
331  integer :: i, j
332  !---------------------------------------------------------------------------
333 
334  do id = 1, prof_rapnmax
335  if ( prof_rapnstr(id) /= prof_rapnend(id) ) then
336  log_warn("PROF_rapreport",*) 'Mismatch Report',id,prof_rapname(id),prof_rapnstr(id),prof_rapnend(id)
337  endif
338  enddo
339 
340  log_newline
341  log_info("PROF_rapreport",'(1x,A,I2,A)') 'Computational Time Report (Rap level = ', prof_rap_level, ')'
342 
343  if ( io_log_allnode ) then ! report for each node
344 
345  do gid = 1, prof_rapnmax
346  cnt = 0
347  do id = 1, prof_rapnmax
348  if ( prof_raplevel(id) <= prof_rap_level &
349  .AND. prof_grpid(id) == gid ) then
350  cnt = cnt + 1
351  idx(cnt) = id
352  end if
353  end do
354  do j = 1, cnt-1
355  do i = j+1, cnt
356  if ( prof_raplevel(idx(i)) < prof_raplevel(idx(j)) .or. &
357  ( prof_raplevel(idx(i)) == prof_raplevel(idx(j)) &
358  .and. prof_rapname(idx(i)) < prof_rapname(idx(j)) ) ) then
359  id = idx(i)
360  idx(i) = idx(j)
361  idx(j) = id
362  end if
363  end do
364  end do
365  do i = 1, cnt
366  id = idx(i)
367  log_info_cont('(1x,2A,I2,A,F10.3,A,I9)') &
368  prof_rapname(id), ' lev=', prof_raplevel(id), &
369  ': T=',prof_rapttot(id),' N=',prof_rapnstr(id)
370  enddo
371  enddo
372 
373  else
374 
375  call prc_mpitimestat( avgvar(1:prof_rapnmax), &
376  maxvar(1:prof_rapnmax), &
377  minvar(1:prof_rapnmax), &
378  maxidx(1:prof_rapnmax), &
379  minidx(1:prof_rapnmax), &
380  prof_rapttot(1:prof_rapnmax) )
381 
382  fid = -1
383  if ( io_log_suppress ) then ! report to STDOUT
384  if ( prc_ismaster ) then
385  write(*,*) 'INFO [PROF_rapreport] Computational Time Report'
386  fid = io_fid_stdout ! master node
387  endif
388  else
389  if ( io_l ) fid = io_fid_log
390  endif
391 
392  if ( fid > 0 ) then
393  do gid = 1, prof_rapnmax
394  cnt = 0
395  do id = 1, prof_rapnmax
396  if ( prof_raplevel(id) <= prof_rap_level &
397  .AND. prof_grpid(id) == gid ) then
398  cnt = cnt + 1
399  idx(cnt) = id
400  end if
401  end do
402  do j = 1, cnt-1
403  do i = j+1, cnt
404  if ( prof_raplevel(idx(i)) < prof_raplevel(idx(j)) .or. &
405  ( prof_raplevel(idx(i)) == prof_raplevel(idx(j)) &
406  .and. prof_rapname(idx(i)) < prof_rapname(idx(j)) ) ) then
407  id = idx(i)
408  idx(i) = idx(j)
409  idx(j) = id
410  end if
411  end do
412  end do
413  do i = 1, cnt
414  id = idx(i)
415  write(fid,'(1x,2A,I2,A,F10.3,2(A,F10.3,A,I6,A),A,I9)') &
416  prof_rapname(id), ' lev=', prof_raplevel(id), &
417  ': T(avg)=',avgvar(id), &
418  ', T(max)=',maxvar(id),'[',maxidx(id),']', &
419  ', T(min)=',minvar(id),'[',minidx(id),']', &
420  ', N=',prof_rapnstr(id)
421  end do
422  enddo
423  end if
424 
425  endif
426 
427  return

References get_grpid(), scale_io::io_fid_log, scale_io::io_fid_stdout, scale_io::io_l, scale_io::io_log_allnode, scale_io::io_log_suppress, scale_prc::prc_abort(), scale_prc::prc_ismaster, scale_prc::prc_mpitimestat(), and scale_prc::prc_nprocs.

Referenced by mod_rm_driver::rm_driver(), mod_rm_prep::rm_prep(), and scale::scale_finalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_grpid()

integer function scale_prof::get_grpid ( character(len=*), intent(in)  rapname)

Get group ID.

Parameters
[in]rapnamename of item

Definition at line 597 of file scale_prof.F90.

597  implicit none
598 
599  character(len=*), intent(in) :: rapname
600 
601  character(len=H_SHORT) :: grpname
602 
603  integer :: gid
604  integer :: idx
605  !---------------------------------------------------------------------------
606 
607  idx = index(rapname," ")
608  if ( idx > 1 ) then
609  grpname = rapname(1:idx-1)
610  else
611  grpname = rapname
612  endif
613 
614  do gid = 1, prof_grpnmax
615  if( grpname == prof_grpname(gid) ) return
616  enddo
617 
618  prof_grpnmax = prof_grpnmax + 1
619  gid = prof_grpnmax
620  prof_grpname(gid) = grpname
621 
622  return

Referenced by prof_rapreport().

Here is the caller graph for this function:
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:349
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_prc::prc_mpibarrier
subroutine, public prc_mpibarrier
Barrier MPI.
Definition: scale_prc.F90:827
scale_prc::prc_mpitimestat
subroutine, public prc_mpitimestat(avgvar, maxvar, minvar, maxidx, minidx, var)
Calc global statistics for timer.
Definition: scale_prc.F90:864
scale_prc::prc_mpitime
real(dp) function, public prc_mpitime()
Get MPI time.
Definition: scale_prc.F90:842
scale_prc::prc_ismaster
logical, public prc_ismaster
master process in local communicator?
Definition: scale_prc.F90:91