MONC
Functions/Subroutines
debugger_mod Module Reference

General purpose debugger. By changing the priority and other logic we can plug it in whereever we want in the run to dump out information. More...

Functions/Subroutines

type(component_descriptor_type) function, public debugger_get_descriptor ()
 Provides the component descriptor for the core to register. More...
 
subroutine init_callback (current_state)
 Called on MONC initialisation. More...
 
subroutine timestep_callback (current_state)
 Produces debugging information on each timestep. More...
 

Detailed Description

General purpose debugger. By changing the priority and other logic we can plug it in whereever we want in the run to dump out information.

Function/Subroutine Documentation

◆ debugger_get_descriptor()

type(component_descriptor_type) function, public debugger_mod::debugger_get_descriptor ( )

Provides the component descriptor for the core to register.

Returns
The descriptor describing this component

Definition at line 23 of file debugger.F90.

23  debugger_get_descriptor%name="debugger"
24  debugger_get_descriptor%version=0.1
25  debugger_get_descriptor%initialisation=>init_callback
26  debugger_get_descriptor%timestep=>timestep_callback
Here is the call graph for this function:

◆ init_callback()

subroutine debugger_mod::init_callback ( type(model_state_type), intent(inout), target  current_state)
private

Called on MONC initialisation.

Parameters
current_stateThe current model stat

Definition at line 32 of file debugger.F90.

32  type(model_state_type), target, intent(inout) :: current_state
33 
34  call log_log(log_warn, "Debugger is active - disable this for production runs")
Here is the caller graph for this function:

◆ timestep_callback()

subroutine debugger_mod::timestep_callback ( type(model_state_type), intent(inout), target  current_state)
private

Produces debugging information on each timestep.

Definition at line 39 of file debugger.F90.

39  type(model_state_type), target, intent(inout) :: current_state
40 
41  integer :: i, j, k
42  character :: halo_classifier
43 
44  if (.not. current_state%first_timestep_column) return
45 !!$ if (.not. current_state%last_timestep_column) return
46 !!$ do i=1,current_state%local_grid%size(X_INDEX) + current_state%local_grid%halo_size(X_INDEX)*2
47 !!$ do j=1,current_state%local_grid%size(Y_INDEX) + current_state%local_grid%halo_size(Y_INDEX)*2
48 !!$ do k=1,current_state%local_grid%size(Z_INDEX) + current_state%local_grid%halo_size(Z_INDEX)*2
49 !!$ haloClassifier = merge('H', 'D', i .le. current_state%local_grid%halo_size(X_INDEX) .or. &
50 !!$ i .gt. current_state%local_grid%size(X_INDEX) + current_state%local_grid%halo_size(X_INDEX) .or. &
51 !!$ j .le. current_state%local_grid%halo_size(Y_INDEX) .or. &
52 !!$ j .gt. current_state%local_grid%size(Y_INDEX) + current_state%local_grid%halo_size(Y_INDEX) .or. &
53 !!$ k .le. current_state%local_grid%halo_size(Z_INDEX) .or. &
54 !!$ k .gt. current_state%local_grid%size(Z_INDEX) + current_state%local_grid%halo_size(Z_INDEX))
55 !!$ call log_log(LOG_DEBUG, "Ts: "//trim(conv_to_string(current_state%timestep))//"("//trim(conv_to_string(k))//","//&
56 !!$ trim(conv_to_string(j))//"," //trim(conv_to_string(i))//") q="&
57 !!$ //trim(conv_to_string(current_state%q(1)%data(k,j,i)))//" zq="//trim(conv_to_string(current_state%zq(1)%data(k,j,i)))&
58 !!$ //"("//haloClassifier//")")
59 !!$ end do
60 !!$ end do
61 !!$ end do
62  do i=1,3
63  write(*,*) current_state%parallel%my_rank, size(current_state%u%data, i), lbound(current_state%u%data, i), &
64  ubound(current_state%u%data, i)
65  end do
Here is the caller graph for this function: