18 real(kind=DEFAULT_PRECISION) ::
totqv,
totql,
totqz,
wmax,
wmin,
qlmax,
qlcrit,
cltop_av,
clbas_av,
cltop,
clbas 55 type(model_state_type),
target,
intent(inout) :: current_state
59 qlcrit=options_get_real(current_state%options_database,
"qlcrit")
61 total_points=current_state%global_grid%size(z_index) * current_state%global_grid%size(y_index) * &
62 current_state%global_grid%size(x_index)
64 allocate(
tempfac(current_state%local_grid%size(z_index)),
theta_tot(current_state%local_grid%size(z_index)))
65 do k=2, current_state%local_grid%size(z_index)
66 tempfac(k)=current_state%global_grid%configuration%vertical%dz(k)*&
67 current_state%global_grid%configuration%vertical%rhon(k)/
total_points 72 type(model_state_type),
target,
intent(inout) :: current_state
75 real(kind=DEFAULT_PRECISION) :: cltop_col, clbas_col
77 if (current_state%first_timestep_column)
then 78 totqv=0.0_default_precision
79 totql=0.0_default_precision
80 totqz=0.0_default_precision
81 wmax=0.0_default_precision
82 wmin=0.0_default_precision
83 qlmax=0.0_default_precision
86 cltop=0.0_default_precision
87 clbas=0.0_default_precision
90 if (.not. current_state%halo_column)
then 91 cltop_col=0.0_default_precision
92 clbas_col=0.0_default_precision
93 do k=2, current_state%local_grid%size(z_index)
94 wmax=max(
wmax, current_state%w%data(k, current_state%column_local_y, current_state%column_local_x))
95 wmin=min(
wmin, current_state%w%data(k, current_state%column_local_y, current_state%column_local_x))
97 if (current_state%number_q_fields .gt. 0)
then 98 if (current_state%liquid_water_mixing_ratio_index .gt. 0 .and. &
99 current_state%number_q_fields .ge. current_state%liquid_water_mixing_ratio_index)
then 100 if (
qlmax .lt. current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
101 current_state%column_local_y, current_state%column_local_x))
then 102 qlmax=max(
qlmax, current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
103 current_state%column_local_y, current_state%column_local_x))
107 if (current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
108 current_state%column_local_y, current_state%column_local_x) .gt.
qlcrit)
then 109 cltop_col=current_state%global_grid%configuration%vertical%zn(k)
110 cltop=max(
cltop, current_state%global_grid%configuration%vertical%zn(k))
111 clbas=min(
clbas, current_state%global_grid%configuration%vertical%zn(k))
114 if (current_state%q(current_state%liquid_water_mixing_ratio_index)%data(current_state%local_grid%size(z_index)+1-k, &
115 current_state%column_local_y, current_state%column_local_x) .gt.
qlcrit)
then 116 clbas_col=current_state%global_grid%configuration%vertical%zn(current_state%local_grid%size(z_index)+1-k)
120 totqz=
totqz+
tempfac(k)*current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
121 current_state%column_local_y, current_state%column_local_x)*current_state%global_grid%configuration%vertical%zn(k)
124 if (current_state%water_vapour_mixing_ratio_index .gt. 0 .and. &
125 current_state%number_q_fields .ge. current_state%water_vapour_mixing_ratio_index)
then 126 totqv=
totqv+
tempfac(k)*current_state%q(current_state%water_vapour_mixing_ratio_index)%data(k, &
127 current_state%column_local_y, current_state%column_local_x)
128 totql=
totql+
tempfac(k)*current_state%q(current_state%liquid_water_mixing_ratio_index)%data(k, &
129 current_state%column_local_y, current_state%column_local_x)
145 type(model_state_type),
target,
intent(inout) :: current_state
146 character(len=*),
intent(in) :: name
147 type(component_field_information_type),
intent(out) :: field_information
149 field_information%field_type=component_scalar_field_type
150 field_information%data_type=component_double_data_type
151 field_information%enabled=.true.
152 if (name .eq.
"thdiag_local")
then 153 field_information%field_type=component_array_field_type
154 field_information%number_dimensions=1
155 field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
158 if (name .eq.
"totpnts" .or. name .eq.
"hqlmax_local" .or. name .eq.
"ncl_col_local")
then 159 field_information%data_type=component_integer_data_type
161 field_information%data_type=component_double_data_type
170 type(model_state_type),
target,
intent(inout) :: current_state
171 character(len=*),
intent(in) :: name
172 type(component_field_value_type),
intent(out) :: field_value
176 if (name .eq.
"totpnts")
then 178 else if (name .eq.
"zn_top")
then 179 field_value%scalar_real=current_state%global_grid%configuration%vertical%zn(current_state%global_grid%size(z_index))
180 else if (name .eq.
"wmax_local")
then 181 field_value%scalar_real=
wmax 182 else if (name .eq.
"wmin_local")
then 183 field_value%scalar_real=
wmin 184 else if (name .eq.
"totqv_local")
then 185 field_value%scalar_real=
totqv 186 else if (name .eq.
"totql_local")
then 187 field_value%scalar_real=
totql 188 else if (name .eq.
"totqz_local")
then 189 field_value%scalar_real=
totqz 190 else if (name .eq.
"qlmax_local")
then 191 field_value%scalar_real=
qlmax 192 else if (name .eq.
"hqlmax_local")
then 193 field_value%scalar_int=
hqlmax 194 else if (name .eq.
"cltop_local")
then 195 field_value%scalar_real=
cltop 196 else if (name .eq.
"clbas_local")
then 197 field_value%scalar_real=
clbas 198 else if (name .eq.
"cltop_av_local")
then 200 else if (name .eq.
"clbas_av_local")
then 202 else if (name .eq.
"ncl_col_local")
then 204 else if (name .eq.
"thdiag_local")
then 205 allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
206 do i=1, current_state%local_grid%size(z_index)
207 field_value%real_1d_array(i)=maxval(current_state%th%data(i,:,:) + current_state%thref0)
real(kind=default_precision) clbas
integer, parameter, public component_scalar_field_type
subroutine field_information_retrieval_callback(current_state, name, field_information)
Field information retrieval callback, this returns information for a specific components published fi...
Wrapper type for the value returned for a published field from a component.
real(kind=default_precision) cltop_av
subroutine initialisation_callback(current_state)
real(kind=default_precision) qlmax
real(kind=default_precision) wmax
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
integer, parameter, public z_index
Grid index parameters.
Contains common definitions for the data and datatypes used by MONC.
The ModelState which represents the current state of a run.
type(component_descriptor_type) function, public diagnostics_get_descriptor()
Provides the component descriptor for the core to register.
real(kind=default_precision) cltop
Description of a component.
real(kind=default_precision), dimension(:), allocatable tempfac
integer, parameter, public component_array_field_type
real(kind=default_precision) totqv
real(kind=default_precision) qlcrit
Interfaces and types that MONC components must specify.
real(kind=default_precision) totql
real(kind=default_precision) wmin
real(kind=default_precision), dimension(:), allocatable theta_tot
integer, parameter, public component_integer_data_type
subroutine timestep_callback(current_state)
real(kind=default_precision) function, public options_get_real(options_database, key, index)
Retrieves a real value from the database that matches the provided key.
Functionality to support the different types of grid and abstraction between global grids and local o...
real(kind=default_precision) clbas_av
Manages the options database. Contains administration functions and deduce runtime options from the c...
real(kind=default_precision) totqz
The model state which represents the current state of a run.
integer, parameter, public y_index
integer, parameter, public x_index
subroutine field_value_retrieval_callback(current_state, name, field_value)
Field value retrieval callback, this returns the value of a specific published field.
integer, parameter, public component_double_data_type