17 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable ::
w_buoyancy 46 type(model_state_type),
target,
intent(inout) :: current_state
47 character(len=*),
intent(in) :: name
48 type(component_field_information_type),
intent(out) :: field_information
51 field_information%field_type=component_array_field_type
52 field_information%data_type=component_double_data_type
53 field_information%number_dimensions=1
54 field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
55 field_information%enabled=.true.
63 type(model_state_type),
target,
intent(inout) :: current_state
64 character(len=*),
intent(in) :: name
65 type(component_field_value_type),
intent(out) :: field_value
67 if (name .eq.
"w_buoyancy")
then 75 type(model_state_type),
target,
intent(inout) :: current_state
79 if (.not. current_state%passive_q .and. current_state%number_q_fields > 0)
then 80 if (.not.
allocated(current_state%cq))
then 81 allocate(current_state%cq(current_state%number_q_fields))
82 current_state%cq=0.0_default_precision
84 iqv = get_q_index(standard_q_names%VAPOUR,
'buoyancy')
85 current_state%cq(
iqv) = ratio_mol_wts-1.0
89 z_size=current_state%global_grid%size(z_index)
94 type(model_state_type),
target,
intent(inout) :: current_state
102 type(model_state_type),
target,
intent(inout) :: current_state
107 if (.not. current_state%passive_th .and. current_state%th%active)
then 108 do k=2,current_state%local_grid%size(z_index)-1
109 w_buoyancy(k)=(0.5_default_precision*current_state%global_grid%configuration%vertical%buoy_co(k))*&
110 (current_state%th%data(k, current_state%column_local_y, current_state%column_local_x)&
111 +current_state%th%data(k+1, current_state%column_local_y, current_state%column_local_x))
112 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
113 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+
w_buoyancy(k)
116 if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
then 117 if (current_state%use_anelastic_equations)
then 118 do n=1,current_state%number_q_fields
119 do k=2,current_state%local_grid%size(z_index)-1
120 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
121 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+&
122 (0.5_default_precision*current_state%global_grid%configuration%vertical%buoy_co(k))*&
123 current_state%cq(n)* (current_state%global_grid%configuration%vertical%thref(k)*&
124 current_state%q(n)%data(k, current_state%column_local_y, current_state%column_local_x)+&
125 current_state%global_grid%configuration%vertical%thref(k+1)*&
126 current_state%q(n)%data(k+1, current_state%column_local_y, current_state%column_local_x))
130 do n=1,current_state%number_q_fields
131 do k=2,current_state%local_grid%size(z_index)-1
132 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
133 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+&
135 (current_state%q(n)%data(k, current_state%column_local_y, current_state%column_local_x)+&
136 current_state%q(n)%data(k+1, current_state%column_local_y, current_state%column_local_x))
type(component_descriptor_type) function, public buoyancy_get_descriptor()
Provides the descriptor back to the caller and is used in component registration. ...
Wrapper type for the value returned for a published field from a component.
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 forward_stepping
type(standard_q_names_type), public standard_q_names
subroutine field_information_retrieval_callback(current_state, name, field_information)
Field information retrieval callback, this returns information for a specific components published fi...
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.
subroutine timestep_callback(current_state)
Called for each column per timestep this will calculate the buoyancy terms for the SW field...
Contains common definitions for the data and datatypes used by MONC.
The ModelState which represents the current state of a run.
logical function, public is_component_enabled(options_database, component_name)
Determines whether or not a specific component is registered and enabled.
Calculates buoyancy terms for the SW field.
Description of a component.
integer, parameter, public component_array_field_type
Scientific constant values used throughout simulations. Each has a default value and this can be over...
This manages the Q variables and specifically the mapping between names and the index that they are s...
Interfaces and types that MONC components must specify.
subroutine initialisation_callback(current_state)
The initialisation callback sets up the buoyancy coefficient.
Functionality to support the different types of grid and abstraction between global grids and local o...
subroutine finalisation_callback(current_state)
Manages the options database. Contains administration functions and deduce runtime options from the c...
real(kind=default_precision), dimension(:), allocatable w_buoyancy
real(kind=default_precision) g_over_2
subroutine, public options_get_real_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) real array.
logical function, public options_has_key(options_database, key)
Determines whether a specific key is in the database.
The model state which represents the current state of a run.
integer function, public get_q_index(name, assigning_component)
Add in a new entry into the register if the name does not already exist or return the index of the pr...
integer, parameter, public component_double_data_type