MONC
monc_component.F90
Go to the documentation of this file.
1 
7  use state_mod, only : model_state_type
9  implicit none
10 
11 #ifndef TEST_MODE
12  private
13 #endif
14 
17 
20 
23  real(kind=DEFAULT_PRECISION), dimension(:,:,:,:), allocatable :: real_4d_array
24  real(kind=DEFAULT_PRECISION), dimension(:,:,:), allocatable :: real_3d_array
25  real(kind=DEFAULT_PRECISION), dimension(:,:), allocatable :: real_2d_array
26  real(kind=DEFAULT_PRECISION), dimension(:), allocatable :: real_1d_array
27  real(kind=DEFAULT_PRECISION) :: scalar_real
28  integer :: scalar_int
30 
32  integer :: field_type, data_type, number_dimensions, dimension_sizes(4)
33  logical :: enabled
35 
42  type, public :: component_descriptor_type
43  procedure(component_initialisation), nopass, pointer :: initialisation => null()
44  procedure(component_timestep), nopass, pointer :: timestep => null()
45  procedure(component_finalisation), nopass, pointer :: finalisation => null()
46  procedure(component_get_field_value), nopass, pointer :: field_value_retrieval => null()
47  procedure(component_get_field_information), nopass, pointer :: field_information_retrieval => null()
48  character(len=STRING_LENGTH), dimension(:), pointer :: published_fields => null()
49  character(len=STRING_LENGTH) :: name
50  real(kind=DEFAULT_PRECISION) :: version
52 
56  abstract interface
59  type(component_descriptor_type) :: component_get_description
60  end function component_get_description
63  subroutine component_initialisation(current_state)
64  import :: model_state_type
65  type(model_state_type), target, intent(inout) :: current_state
66  end subroutine component_initialisation
67 
70  subroutine component_timestep(current_state)
71  import :: model_state_type
72  type(model_state_type), target, intent(inout) :: current_state
73  end subroutine component_timestep
74 
77  subroutine component_finalisation(current_state)
78  import :: model_state_type
79  type(model_state_type), target, intent(inout) :: current_state
80  end subroutine component_finalisation
81 
82  subroutine component_get_field_information(current_state, name, field_sizing)
84  type(model_state_type), target, intent(inout) :: current_state
85  character(len=*), intent(in) :: name
86  type(component_field_information_type), intent(out) :: field_sizing
87  end subroutine component_get_field_information
88 
92  subroutine component_get_field_value(current_state, name, field_value)
94  type(model_state_type), target, intent(inout) :: current_state
95  character(len=*), intent(in) :: name
96  type(component_field_value_type), intent(out) :: field_value
97  end subroutine component_get_field_value
98  end interface
99 
102 end module monc_component_mod
integer, parameter, public component_scalar_field_type
Wrapper type for the value returned for a published field from a component.
Component finalisation callback hook signature.
Interface defining the signature of each callback hook that a component may specify.
Retrieves a specific published field value from a component.
Component timestep callback hook signature.
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
The ModelState which represents the current state of a run.
Definition: state.F90:39
integer, parameter, public component_array_field_type
Component initialisation callback hook signature.
Interfaces and types that MONC components must specify.
integer, parameter, public timestep_priority_index
integer, parameter, public component_integer_data_type
integer, parameter, public string_length
Default length of strings.
Definition: datadefn.F90:10
integer, parameter, public finalisation_priority_index
integer, parameter, public init_priority_index
Index of each priority value in the descriptor.
The model state which represents the current state of a run.
Definition: state.F90:2
integer, parameter, public component_double_data_type