MONC
debugger.F90
Go to the documentation of this file.
1 
4  use grids_mod
6  use state_mod
7  use logging_mod
10  implicit none
11 
12 #ifndef TEST_MODE
13  private
14 #endif
15 
17 
18 contains
19 
23  debugger_get_descriptor%name="debugger"
24  debugger_get_descriptor%version=0.1
27  end function debugger_get_descriptor
28 
31  subroutine init_callback(current_state)
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")
35  end subroutine init_callback
36 
38  subroutine timestep_callback(current_state)
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
66  end subroutine timestep_callback
67 end module debugger_mod
conversions_mod
Conversion between common inbuilt FORTRAN data types.
Definition: conversions.F90:5
prognostics_mod
Contains prognostic field definitions and functions.
Definition: prognostics.F90:2
debugger_mod::timestep_callback
subroutine timestep_callback(current_state)
Produces debugging information on each timestep.
Definition: debugger.F90:39
monc_component_mod
Interfaces and types that MONC components must specify.
Definition: monc_component.F90:6
debugger_mod::debugger_get_descriptor
type(component_descriptor_type) function, public debugger_get_descriptor()
Provides the component descriptor for the core to register.
Definition: debugger.F90:23
debugger_mod::init_callback
subroutine init_callback(current_state)
Called on MONC initialisation.
Definition: debugger.F90:32
logging_mod
Logging utility.
Definition: logging.F90:2
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
monc_component_mod::component_descriptor_type
Description of a component.
Definition: monc_component.F90:42
state_mod
The model state which represents the current state of a run.
Definition: state.F90:2
debugger_mod
General purpose debugger. By changing the priority and other logic we can plug it in whereever we wan...
Definition: debugger.F90:3