MONC
Functions/Subroutines | Variables
diagnostics_3d_mod Module Reference

Derive 3-D diagnostic fields which are available in current_state. More...

Functions/Subroutines

type(component_descriptor_type) function, public diagnostics_3d_get_descriptor ()
 Provides the component descriptor for the core to register. More...
 
subroutine initialisation_callback (current_state)
 
subroutine timestep_callback (current_state)
 
subroutine field_information_retrieval_callback (current_state, name, field_information)
 Field information retrieval callback, this returns information for a specific components published field. More...
 
subroutine field_value_retrieval_callback (current_state, name, field_value)
 Field value retrieval callback, this returns the value of a specific published field. More...
 

Variables

integer total_points
 
integer iqv
 
integer iql
 
integer iqr
 
real(kind=default_precision), dimension(:,:,:), allocatable tdegk
 
real(kind=default_precision), dimension(:,:,:), allocatable theta
 
real(kind=default_precision), dimension(:,:,:), allocatable liquid_ice_theta
 
real(kind=default_precision), dimension(:), allocatable total_condensate
 
real(kind=default_precision) qlcrit
 

Detailed Description

Derive 3-D diagnostic fields which are available in current_state.

Function/Subroutine Documentation

◆ diagnostics_3d_get_descriptor()

type(component_descriptor_type) function, public diagnostics_3d_mod::diagnostics_3d_get_descriptor

Provides the component descriptor for the core to register.

Returns
The descriptor describing this component

Definition at line 39 of file diagnostics_3d.F90.

40  diagnostics_3d_get_descriptor%name="diagnostics_3d"
41  diagnostics_3d_get_descriptor%version=0.1
42  diagnostics_3d_get_descriptor%initialisation=>initialisation_callback
43  diagnostics_3d_get_descriptor%timestep=>timestep_callback
44 
45  diagnostics_3d_get_descriptor%field_value_retrieval=>field_value_retrieval_callback
46  diagnostics_3d_get_descriptor%field_information_retrieval=>field_information_retrieval_callback
47  allocate(diagnostics_3d_get_descriptor%published_fields(3))
48 
49  diagnostics_3d_get_descriptor%published_fields(1)="temperature"
50  diagnostics_3d_get_descriptor%published_fields(2)="theta"
51  diagnostics_3d_get_descriptor%published_fields(3)="thetali"
52 
Here is the call graph for this function:

◆ field_information_retrieval_callback()

subroutine diagnostics_3d_mod::field_information_retrieval_callback ( type(model_state_type), intent(inout), target  current_state,
character(len=*), intent(in)  name,
type(component_field_information_type), intent(out)  field_information 
)
private

Field information retrieval callback, this returns information for a specific components published field.

Parameters
current_stateCurrent model state
nameThe name of the field to retrieve information for
field_informationPopulated with information about the field

Definition at line 124 of file diagnostics_3d.F90.

125  type(model_state_type), target, intent(inout) :: current_state
126  character(len=*), intent(in) :: name
127  type(component_field_information_type), intent(out) :: field_information
128 
129  field_information%field_type=component_array_field_type
130  field_information%number_dimensions=3
131  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
132  field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
133  field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
134  field_information%data_type=component_double_data_type
135  if (name .eq. "temperature" .or. name .eq. "theta" &
136  .or. name .eq. "thetali") then
137  field_information%enabled=current_state%th%active
138  else
139  field_information%enabled=.true.
140  endif
Here is the caller graph for this function:

◆ field_value_retrieval_callback()

subroutine diagnostics_3d_mod::field_value_retrieval_callback ( type(model_state_type), intent(inout), target  current_state,
character(len=*), intent(in)  name,
type(component_field_value_type), intent(out)  field_value 
)
private

Field value retrieval callback, this returns the value of a specific published field.

Parameters
current_stateCurrent model state
nameThe name of the field to retrieve the value for
field_valuePopulated with the value of the field

Definition at line 147 of file diagnostics_3d.F90.

148  type(model_state_type), target, intent(inout) :: current_state
149  character(len=*), intent(in) :: name
150  type(component_field_value_type), intent(out) :: field_value
151 
152  integer :: k
153 
154  if (name .eq. "temperature") then
155  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
156  current_state%local_grid%size(y_index), &
157  current_state%local_grid%size(x_index)))
158  field_value%real_3d_array(:,:,:) = tdegk(:,:,:)
159  elseif (name .eq. "theta") then
160  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
161  current_state%local_grid%size(y_index), &
162  current_state%local_grid%size(x_index)))
163  field_value%real_3d_array(:,:,:) = theta(:,:,:)
164  elseif (name .eq. "thetali") then
165  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
166  current_state%local_grid%size(y_index), &
167  current_state%local_grid%size(x_index)))
168  field_value%real_3d_array(:,:,:) = liquid_ice_theta(:,:,:)
169  end if
170 
Here is the caller graph for this function:

◆ initialisation_callback()

subroutine diagnostics_3d_mod::initialisation_callback ( type(model_state_type), intent(inout), target  current_state)
private

Definition at line 55 of file diagnostics_3d.F90.

56  type(model_state_type), target, intent(inout) :: current_state
57 
58  if (current_state%th%active) then
59  allocate(tdegk(current_state%local_grid%size(z_index), &
60  current_state%local_grid%size(y_index), &
61  current_state%local_grid%size(x_index)))
62  allocate(theta(current_state%local_grid%size(z_index), &
63  current_state%local_grid%size(y_index), &
64  current_state%local_grid%size(x_index)))
65  allocate(liquid_ice_theta(current_state%local_grid%size(z_index), &
66  current_state%local_grid%size(y_index), &
67  current_state%local_grid%size(x_index)))
68  endif
69 
70  if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0) then
71  allocate(total_condensate(current_state%local_grid%size(z_index)))
72  iqv=get_q_index(standard_q_names%VAPOUR, 'diagnostics_3d')
73  iql=get_q_index(standard_q_names%CLOUD_LIQUID_MASS, 'diagnostics_3d')
74  if (current_state%rain_water_mixing_ratio_index > 0) &
75  iqr = current_state%rain_water_mixing_ratio_index
76  endif
77 
Here is the caller graph for this function:

◆ timestep_callback()

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

Definition at line 80 of file diagnostics_3d.F90.

81  type(model_state_type), target, intent(inout) :: current_state
82 
83  real(kind=default_precision) :: exner, pmb, qv, qs
84 
85  integer :: k
86  integer :: current_y_index, current_x_index, target_x_index, target_y_index
87 
88  if (current_state%halo_column) return
89 
90  current_y_index=current_state%column_local_y
91  current_x_index=current_state%column_local_x
92  target_y_index=current_y_index-current_state%local_grid%halo_size(y_index)
93  target_x_index=current_x_index-current_state%local_grid%halo_size(x_index)
94 
95  if (current_state%th%active) then
96  theta(:,target_y_index, target_x_index) = &
97  (current_state%th%data(:,current_y_index,current_x_index) &
98  + current_state%global_grid%configuration%vertical%thref(:))
99  liquid_ice_theta(:,target_y_index, target_x_index) = &
100  (current_state%th%data(:,current_y_index,current_x_index) &
101  + current_state%global_grid%configuration%vertical%thref(:))
102  ! test for the qfields
103  if (.not. current_state%passive_q .and. &
104  current_state%number_q_fields .gt. 0) then
105  total_condensate(:) = &
106  current_state%q(iql)%data(:,current_y_index,current_x_index) + &
107  current_state%q(iqr)%data(:,current_y_index,current_x_index)
108  liquid_ice_theta(:,target_y_index, target_x_index) = &
109  liquid_ice_theta(:,target_y_index, target_x_index) - &
110  ( total_condensate(:) * (rlvap_over_cp) )
111  endif
112  tdegk(:,target_y_index, target_x_index) = &
113  (current_state%th%data(:,current_y_index,current_x_index) &
114  + current_state%global_grid%configuration%vertical%thref(:) &
115  * current_state%global_grid%configuration%vertical%rprefrcp(:))
116  endif
117 
Here is the caller graph for this function:

Variable Documentation

◆ iql

integer diagnostics_3d_mod::iql
private

Definition at line 24 of file diagnostics_3d.F90.

◆ iqr

integer diagnostics_3d_mod::iqr
private

Definition at line 24 of file diagnostics_3d.F90.

◆ iqv

integer diagnostics_3d_mod::iqv
private

Definition at line 24 of file diagnostics_3d.F90.

◆ liquid_ice_theta

real(kind=default_precision), dimension(:,:,:), allocatable diagnostics_3d_mod::liquid_ice_theta
private

Definition at line 25 of file diagnostics_3d.F90.

◆ qlcrit

real(kind=default_precision) diagnostics_3d_mod::qlcrit
private

Definition at line 31 of file diagnostics_3d.F90.

31  real(kind=default_precision) :: qlcrit

◆ tdegk

real(kind=default_precision), dimension(:,:,:), allocatable diagnostics_3d_mod::tdegk
private

Definition at line 25 of file diagnostics_3d.F90.

25  real(kind=default_precision), dimension(:,:,:), allocatable :: &
26  tdegk, & ! absolute temperature in kelvin
27  theta, & ! potential temperature in kelvin (th + thref)
28  liquid_ice_theta ! liquid-ice potential temperature in kelvin

◆ theta

real(kind=default_precision), dimension(:,:,:), allocatable diagnostics_3d_mod::theta
private

Definition at line 25 of file diagnostics_3d.F90.

◆ total_condensate

real(kind=default_precision), dimension(:), allocatable diagnostics_3d_mod::total_condensate
private

Definition at line 29 of file diagnostics_3d.F90.

29  real(kind=default_precision), dimension(:), allocatable :: &
30  total_condensate

◆ total_points

integer diagnostics_3d_mod::total_points
private

Definition at line 24 of file diagnostics_3d.F90.

24  integer :: total_points, iqv, iql, iqr
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17