31 real(kind=DEFAULT_PRECISION),
allocatable ::
q_profile(:)
32 real(kind=DEFAULT_PRECISION),
allocatable ::
u_profile(:)
33 real(kind=DEFAULT_PRECISION),
allocatable ::
v_profile(:)
36 real(kind=DEFAULT_PRECISION),
allocatable ::
dq_profile(:)
37 real(kind=DEFAULT_PRECISION),
allocatable ::
du_profile(:)
38 real(kind=DEFAULT_PRECISION),
allocatable ::
dv_profile(:)
103 type(model_state_type),
target,
intent(inout) :: current_state
104 character(len=*),
intent(in) :: name
105 type(component_field_information_type),
intent(out) :: field_information
107 field_information%field_type=component_array_field_type
108 field_information%data_type=component_double_data_type
109 field_information%number_dimensions=1
110 field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
112 if (name .eq.
"u_subsidence")
then 113 field_information%enabled=current_state%u%active .and.
l_subs_pl_theta .and. &
114 allocated(current_state%global_grid%configuration%vertical%olzubar)
115 else if (name .eq.
"v_subsidence")
then 116 field_information%enabled=current_state%v%active .and.
l_subs_pl_theta .and. &
117 allocated(current_state%global_grid%configuration%vertical%olzvbar)
118 else if (name .eq.
"th_subsidence")
then 119 field_information%enabled=current_state%th%active .and.
l_subs_pl_theta .and. &
120 allocated(current_state%global_grid%configuration%vertical%olzthbar)
121 else if (name .eq.
"q_subsidence")
then 122 field_information%number_dimensions=2
123 field_information%dimension_sizes(2)=current_state%number_q_fields
124 field_information%enabled=current_state%number_q_fields .gt. 0 .and.
l_subs_pl_q .and. &
125 allocated(current_state%global_grid%configuration%vertical%olzqbar)
126 else if (name .eq.
"u_large_scale")
then 128 else if (name .eq.
"v_large_scale")
then 130 else if (name .eq.
"th_large_scale")
then 132 else if (name .eq.
"q_large_scale")
then 133 field_information%number_dimensions=2
134 field_information%dimension_sizes(2)=current_state%number_q_fields
144 type(model_state_type),
target,
intent(inout) :: current_state
145 character(len=*),
intent(in) :: name
146 type(component_field_value_type),
intent(out) :: field_value
148 integer :: k, n, column_size
150 column_size=current_state%local_grid%size(z_index)
152 if (name .eq.
"u_subsidence")
then 153 allocate(field_value%real_1d_array(column_size))
154 do k=2, column_size-1
155 field_value%real_1d_array(k)=0.0_default_precision-2.0*&
156 current_state%global_grid%configuration%vertical%w_subs(k-1)*&
157 current_state%global_grid%configuration%vertical%tzc1(k)*(&
158 current_state%global_grid%configuration%vertical%olzubar(k)-&
159 current_state%global_grid%configuration%vertical%olzubar(k-1))+&
160 current_state%global_grid%configuration%vertical%w_subs(k)*&
161 current_state%global_grid%configuration%vertical%tzc2(k)*&
162 (current_state%global_grid%configuration%vertical%olzubar(k+1)-&
163 current_state%global_grid%configuration%vertical%olzubar(k))
165 else if (name .eq.
"v_subsidence")
then 166 allocate(field_value%real_1d_array(column_size))
167 do k=2, column_size-1
168 field_value%real_1d_array(k)=0.0_default_precision-2.0*&
169 current_state%global_grid%configuration%vertical%w_subs(k-1)*&
170 current_state%global_grid%configuration%vertical%tzc1(k)*(&
171 current_state%global_grid%configuration%vertical%olzvbar(k)-&
172 current_state%global_grid%configuration%vertical%olzvbar(k-1))+&
173 current_state%global_grid%configuration%vertical%w_subs(k)*&
174 current_state%global_grid%configuration%vertical%tzc2(k)*(&
175 current_state%global_grid%configuration%vertical%olzvbar(k+1)-&
176 current_state%global_grid%configuration%vertical%olzvbar(k))
178 else if (name .eq.
"th_subsidence")
then 179 allocate(field_value%real_1d_array(column_size))
180 do k=2, column_size-1
181 field_value%real_1d_array(k)=0.0_default_precision-2.0*&
182 current_state%global_grid%configuration%vertical%w_subs(k-1)*&
183 current_state%global_grid%configuration%vertical%tzc1(k)*(&
184 current_state%global_grid%configuration%vertical%olzthbar(k)-&
185 current_state%global_grid%configuration%vertical%olzthbar(k-1)+&
186 current_state%global_grid%configuration%vertical%dthref(k-1))+&
187 current_state%global_grid%configuration%vertical%w_subs(k)*&
188 current_state%global_grid%configuration%vertical%tzc2(k)*(&
189 current_state%global_grid%configuration%vertical%olzthbar(k+1)-&
190 current_state%global_grid%configuration%vertical%olzthbar(k)+&
191 current_state%global_grid%configuration%vertical%dthref(k))
193 else if (name .eq.
"q_subsidence")
then 194 allocate(field_value%real_2d_array(column_size, current_state%number_q_fields))
195 do n=1, current_state%number_q_fields
196 do k=2, column_size-1
197 field_value%real_2d_array(k,n)=0.0_default_precision-2.0*&
198 current_state%global_grid%configuration%vertical%w_subs(k-1)*&
199 current_state%global_grid%configuration%vertical%tzc1(k)*(&
200 current_state%global_grid%configuration%vertical%olzqbar(k,n)-&
201 current_state%global_grid%configuration%vertical%olzqbar(k-1,n))+&
202 current_state%global_grid%configuration%vertical%w_subs(k)&
203 *current_state%global_grid%configuration%vertical%tzc2(k)*(&
204 current_state%global_grid%configuration%vertical%olzqbar(k+1,n)-&
205 current_state%global_grid%configuration%vertical%olzqbar(k,n))
208 else if (name .eq.
"u_large_scale")
then 209 allocate(field_value%real_1d_array(column_size))
211 else if (name .eq.
"v_large_scale")
then 212 allocate(field_value%real_1d_array(column_size))
214 else if (name .eq.
"th_large_scale")
then 215 allocate(field_value%real_1d_array(column_size))
217 else if (name .eq.
"q_large_scale")
then 218 allocate(field_value%real_2d_array(column_size, current_state%number_q_fields))
219 do n=1, current_state%number_q_fields
227 type(model_state_type),
target,
intent(inout) :: current_state
235 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: f_subs_pl
236 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: z_subs_pl
239 real(kind=DEFAULT_PRECISION),
dimension(:, :),
allocatable :: f_force_pl_q
240 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: z_force_pl_q
241 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: f_force_pl_theta
242 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: z_force_pl_theta
243 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: f_force_pl_u
244 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: z_force_pl_u
245 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: f_force_pl_v
246 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable :: z_force_pl_v
250 real(kind=DEFAULT_PRECISION),
allocatable :: f_force_pl_q_tmp(:)
251 real(kind=DEFAULT_PRECISION),
allocatable :: zgrid(:)
253 character(len=STRING_LENGTH),
dimension(:),
allocatable :: units_q_force
254 character(len=STRING_LENGTH) :: units_theta_force=
'unset' 255 character(len=STRING_LENGTH) :: units_u_force=
'unset' 256 character(len=STRING_LENGTH) :: units_v_force=
'unset' 258 logical :: convert_input_theta_from_temperature=.false.
263 allocate(
theta_profile(current_state%local_grid%size(z_index)), &
264 q_profile(current_state%local_grid%size(z_index)), &
265 u_profile(current_state%local_grid%size(z_index)), &
266 v_profile(current_state%local_grid%size(z_index)))
268 allocate(
dtheta_profile(current_state%local_grid%size(z_index)), &
269 dq_profile(current_state%local_grid%size(z_index)), &
270 du_profile(current_state%local_grid%size(z_index)), &
271 dv_profile(current_state%local_grid%size(z_index)))
275 dq_profile_diag(current_state%local_grid%size(z_index), current_state%number_q_fields))
277 allocate(zgrid(current_state%local_grid%size(z_index)))
281 l_subs_pl_theta=options_get_logical(current_state%options_database,
"l_subs_pl_theta")
282 l_subs_pl_q=options_get_logical(current_state%options_database,
"l_subs_pl_q")
283 subsidence_input_type=options_get_integer(current_state%options_database,
"subsidence_input_type")
284 l_subs_local_theta=options_get_logical(current_state%options_database,
"subsidence_local_theta")
285 l_subs_local_q=options_get_logical(current_state%options_database,
"subsidence_local_q")
290 if (.not. is_component_enabled(current_state%options_database,
"mean_profiles"))
then 291 call log_master_log(log_error,
"Damping requires the mean profiles component to be enabled")
296 allocate(z_subs_pl(options_get_array_size(current_state%options_database,
"z_subs_pl")), &
297 f_subs_pl(options_get_array_size(current_state%options_database,
"f_subs_pl")))
298 call options_get_real_array(current_state%options_database,
"z_subs_pl", z_subs_pl)
299 call options_get_real_array(current_state%options_database,
"f_subs_pl", f_subs_pl)
301 zgrid=current_state%global_grid%configuration%vertical%z(:)
302 call piecewise_linear_1d(z_subs_pl(1:
size(z_subs_pl)), f_subs_pl(1:
size(f_subs_pl)), zgrid, &
303 current_state%global_grid%configuration%vertical%w_subs)
305 current_state%global_grid%configuration%vertical%w_subs(:) = &
306 -1.0*current_state%global_grid%configuration%vertical%w_subs(:)*zgrid(:)
308 deallocate(z_subs_pl, f_subs_pl)
314 if (.not.
allocated(current_state%l_forceq))
then 315 allocate(current_state%l_forceq(current_state%number_q_fields))
316 current_state%l_forceq=.false.
320 l_constant_forcing_q=options_get_logical(current_state%options_database,
"l_constant_forcing_q")
321 l_constant_forcing_u=options_get_logical(current_state%options_database,
"l_constant_forcing_u")
322 l_constant_forcing_v=options_get_logical(current_state%options_database,
"l_constant_forcing_v")
325 allocate(
names_force_pl_q(options_get_array_size(current_state%options_database,
"names_constant_forcing_q")))
326 call options_get_string_array(current_state%options_database,
"names_constant_forcing_q",
names_force_pl_q)
334 allocate(z_force_pl_theta(options_get_array_size(current_state%options_database,
"z_force_pl_theta")), &
335 f_force_pl_theta(options_get_array_size(current_state%options_database,
"f_force_pl_theta")))
336 call options_get_real_array(current_state%options_database,
"z_force_pl_theta", z_force_pl_theta)
337 call options_get_real_array(current_state%options_database,
"f_force_pl_theta", f_force_pl_theta)
341 current_state%global_grid%configuration%vertical%theta_force(:) = &
342 current_state%global_grid%configuration%vertical%theta_init(:)
345 zgrid=current_state%global_grid%configuration%vertical%zn(:)
347 zgrid=current_state%global_grid%configuration%vertical%prefn(:)
349 call piecewise_linear_1d(z_force_pl_theta(1:
size(z_force_pl_theta)), f_force_pl_theta(1:
size(f_force_pl_theta)), zgrid, &
350 current_state%global_grid%configuration%vertical%theta_force)
354 if (convert_input_theta_from_temperature)
then 355 current_state%global_grid%configuration%vertical%theta_force(:) = &
356 current_state%global_grid%configuration%vertical%theta_force(:)* &
357 current_state%global_grid%configuration%vertical%prefrcp(:)
361 units_theta_force=options_get_string(current_state%options_database,
"units_theta_force")
362 select case(trim(units_theta_force))
364 current_state%global_grid%configuration%vertical%theta_force(:) = &
365 current_state%global_grid%configuration%vertical%theta_force(:)/seconds_in_a_day
369 deallocate(z_force_pl_theta, f_force_pl_theta)
375 forcing_timescale_u=options_get_real(current_state%options_database,
"forcing_timescale_u")
378 current_state%global_grid%configuration%vertical%u_force(:) = &
379 current_state%global_grid%configuration%vertical%u_init(:)
381 allocate(z_force_pl_u(options_get_array_size(current_state%options_database,
"z_force_pl_u")), &
382 f_force_pl_u(options_get_array_size(current_state%options_database,
"f_force_pl_u")))
383 call options_get_real_array(current_state%options_database,
"z_force_pl_u", z_force_pl_u)
384 call options_get_real_array(current_state%options_database,
"f_force_pl_u", f_force_pl_u)
386 zgrid=current_state%global_grid%configuration%vertical%zn(:)
387 call piecewise_linear_1d(z_force_pl_u(1:
size(z_force_pl_u)), f_force_pl_u(1:
size(f_force_pl_u)), zgrid, &
388 current_state%global_grid%configuration%vertical%u_force)
389 deallocate(z_force_pl_u, f_force_pl_u)
395 units_u_force=options_get_string(current_state%options_database,
"units_u_force")
396 select case(trim(units_u_force))
397 case(m_per_second_per_day)
398 current_state%global_grid%configuration%vertical%u_force(:) = &
399 current_state%global_grid%configuration%vertical%u_force(:)/seconds_in_a_day
409 forcing_timescale_v=options_get_real(current_state%options_database,
"forcing_timescale_v")
412 current_state%global_grid%configuration%vertical%v_force(:) = &
413 current_state%global_grid%configuration%vertical%v_init(:)
415 allocate(z_force_pl_v(options_get_array_size(current_state%options_database,
"z_force_pl_v")), &
416 f_force_pl_v(options_get_array_size(current_state%options_database,
"f_force_pl_v")))
417 call options_get_real_array(current_state%options_database,
"z_force_pl_v", z_force_pl_v)
418 call options_get_real_array(current_state%options_database,
"f_force_pl_v", f_force_pl_v)
420 zgrid=current_state%global_grid%configuration%vertical%zn(:)
421 call piecewise_linear_1d(z_force_pl_v(1:
size(z_force_pl_v)), f_force_pl_v(1:
size(f_force_pl_v)), zgrid, &
422 current_state%global_grid%configuration%vertical%v_force)
423 deallocate(z_force_pl_v, f_force_pl_v)
429 units_v_force=options_get_string(current_state%options_database,
"units_v_force")
430 select case(trim(units_v_force))
431 case(m_per_second_per_day)
432 current_state%global_grid%configuration%vertical%v_force(:) = &
433 current_state%global_grid%configuration%vertical%v_force(:)/seconds_in_a_day
442 forcing_timescale_q=options_get_real(current_state%options_database,
"forcing_timescale_q")
444 allocate(z_force_pl_q(options_get_array_size(current_state%options_database,
"z_force_pl_q")))
445 call options_get_real_array(current_state%options_database,
"z_force_pl_q", z_force_pl_q)
446 nzq=
size(z_force_pl_q)
447 zgrid=current_state%global_grid%configuration%vertical%zn(:)
448 allocate(f_force_pl_q_tmp(nq_force*nzq))
449 call options_get_real_array(current_state%options_database,
"f_force_pl_q", f_force_pl_q_tmp)
450 allocate(f_force_pl_q(nzq, nq_force))
451 f_force_pl_q(1:nzq, 1:nq_force)=reshape(f_force_pl_q_tmp, (/nzq, nq_force/))
453 allocate(units_q_force(options_get_array_size(current_state%options_database,
"units_q_force")))
454 call options_get_string_array(current_state%options_database,
"units_q_force", units_q_force)
457 call piecewise_linear_1d(z_force_pl_q(1:nzq), f_force_pl_q(1:nzq,n), zgrid, &
458 current_state%global_grid%configuration%vertical%q_force(:,iq))
460 current_state%l_forceq(iq)=.true.
464 select case(trim(units_q_force(n)))
465 case(kg_per_kg_per_day)
466 current_state%global_grid%configuration%vertical%q_force(:,iq) = &
467 current_state%global_grid%configuration%vertical%q_force(:,iq)/seconds_in_a_day
468 case(g_per_kg_per_day)
469 current_state%global_grid%configuration%vertical%q_force(:,iq) = &
470 0.001*current_state%global_grid%configuration%vertical%q_force(:,iq)/seconds_in_a_day
471 case(g_per_kg_per_second)
472 current_state%global_grid%configuration%vertical%q_force(:,iq) = &
473 0.001*current_state%global_grid%configuration%vertical%q_force(:,iq)
478 deallocate(f_force_pl_q_tmp, units_q_force, f_force_pl_q, z_force_pl_q)
488 type(model_state_type),
target,
intent(inout) :: current_state
490 if (current_state%first_timestep_column)
then 497 if (current_state%halo_column .or. current_state%timestep<3)
return 515 type(model_state_type),
intent(inout) :: current_state
518 real(kind=DEFAULT_PRECISION) :: usub, vsub
522 u_profile(:)=current_state%zu%data(:,current_state%column_local_y,current_state%column_local_x)
523 v_profile(:)=current_state%zv%data(:,current_state%column_local_y,current_state%column_local_x)
525 u_profile(:)=current_state%global_grid%configuration%vertical%olzubar(:)
526 v_profile(:)=current_state%global_grid%configuration%vertical%olzvbar(:)
529 do k=2,current_state%local_grid%size(z_index)-1
531 usub = 2.0 * (current_state%global_grid%configuration%vertical%w_subs(k-1)* &
532 current_state%global_grid%configuration%vertical%tzc1(k)*(
u_profile(k)-
u_profile(k-1)) &
533 + current_state%global_grid%configuration%vertical%w_subs(k)* &
534 current_state%global_grid%configuration%vertical%tzc2(k)* &
536 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) = &
537 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) - usub
540 vsub = 2.0 * (current_state%global_grid%configuration%vertical%w_subs(k-1)* &
541 current_state%global_grid%configuration%vertical%tzc1(k)*(
v_profile(k)-
v_profile(k-1)) &
542 + current_state%global_grid%configuration%vertical%w_subs(k)* &
543 current_state%global_grid%configuration%vertical%tzc2(k)* &
545 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) = &
546 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) - vsub
549 k=current_state%local_grid%size(z_index)
551 usub = 2.0 * (current_state%global_grid%configuration%vertical%w_subs(k-1)* &
552 current_state%global_grid%configuration%vertical%tzc1(k)*(
u_profile(k)-
u_profile(k-1)))
553 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) = &
554 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) - usub
557 vsub = 2.0 * (current_state%global_grid%configuration%vertical%w_subs(k-1)* &
558 current_state%global_grid%configuration%vertical%tzc1(k)*(
v_profile(k)-
v_profile(k-1)))
559 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) = &
560 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) - vsub
565 type(model_state_type),
intent(inout) :: current_state
568 real(kind=DEFAULT_PRECISION) :: thsub
571 theta_profile(:)=current_state%zth%data(:,current_state%column_local_y,current_state%column_local_x) &
572 + current_state%global_grid%configuration%vertical%thref(:)
574 theta_profile(:)=current_state%global_grid%configuration%vertical%olzthbar(:) &
575 + current_state%global_grid%configuration%vertical%thref(:)
578 do k=2,current_state%local_grid%size(z_index)-1
579 thsub = current_state%global_grid%configuration%vertical%w_subs(k)* &
581 current_state%global_grid%configuration%vertical%rdzn(k+1)
583 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) = &
584 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) - thsub
586 k=current_state%local_grid%size(z_index)
587 thsub = current_state%global_grid%configuration%vertical%w_subs(k)* &
589 current_state%global_grid%configuration%vertical%rdzn(k)
591 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) = &
592 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) - thsub
596 type(model_state_type),
intent(inout) :: current_state
599 real(kind=DEFAULT_PRECISION) :: qsub
602 do n=1,current_state%number_q_fields
604 q_profile(:)=current_state%zq(n)%data(:,current_state%column_local_y,current_state%column_local_x)
606 q_profile(:)=current_state%global_grid%configuration%vertical%olzqbar(:,n)
608 do k=2,current_state%local_grid%size(z_index)-1
609 qsub = current_state%global_grid%configuration%vertical%w_subs(k)* &
611 current_state%global_grid%configuration%vertical%rdzn(k+1)
612 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) = &
613 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) - qsub
615 k=current_state%local_grid%size(z_index)
616 qsub = current_state%global_grid%configuration%vertical%w_subs(k)* &
618 current_state%global_grid%configuration%vertical%rdzn(k)
619 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) = &
620 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) - qsub
625 type(model_state_type),
intent(inout) :: current_state
628 real(kind=DEFAULT_PRECISION) :: dtm_scale
631 dtm_scale=1.0_default_precision
637 dtheta_profile(:)=dtm_scale * (current_state%global_grid%configuration%vertical%theta_force(:) - &
638 current_state%zth%data(:,current_state%column_local_y,current_state%column_local_x) - &
639 current_state%global_grid%configuration%vertical%thref(:))
641 dtheta_profile(:)=dtm_scale * current_state%global_grid%configuration%vertical%theta_force(:)
647 do k=2,current_state%local_grid%size(z_index)-1
648 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) = &
649 current_state%sth%data(k,current_state%column_local_y,current_state%column_local_x) &
656 type(model_state_type),
intent(inout) :: current_state
659 real(kind=DEFAULT_PRECISION) :: dtm_scale
661 do n=1,current_state%number_q_fields
662 if (current_state%l_forceq(n))
then 664 dtm_scale=1.0_default_precision
670 dq_profile(:)=dtm_scale * (current_state%global_grid%configuration%vertical%q_force(:,n) - &
671 current_state%zq(n)%data(:,current_state%column_local_y,current_state%column_local_x))
673 dq_profile(:)=dtm_scale * current_state%global_grid%configuration%vertical%q_force(:,n)
678 do k=2,current_state%local_grid%size(z_index)-1
679 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) = &
680 current_state%sq(n)%data(k,current_state%column_local_y,current_state%column_local_x) &
689 type(model_state_type),
intent(inout) :: current_state
692 real(kind=DEFAULT_PRECISION) :: dtm_scale
695 dtm_scale=1.0_default_precision
701 du_profile(:)=dtm_scale * (current_state%global_grid%configuration%vertical%u_force(:) - &
702 current_state%global_grid%configuration%vertical%olzubar(:))
704 du_profile(:)=dtm_scale * current_state%global_grid%configuration%vertical%u_force(:)
709 do k=2,current_state%local_grid%size(z_index)-1
710 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) = &
711 current_state%su%data(k,current_state%column_local_y,current_state%column_local_x) &
718 type(model_state_type),
intent(inout) :: current_state
721 real(kind=DEFAULT_PRECISION) :: dtm_scale
724 dtm_scale=1.0_default_precision
730 dv_profile(:)=dtm_scale * (current_state%global_grid%configuration%vertical%v_force(:) - &
731 current_state%global_grid%configuration%vertical%olzvbar(:) )
733 dv_profile(:)=dtm_scale * current_state%global_grid%configuration%vertical%v_force(:)
738 do k=2,current_state%local_grid%size(z_index)-1
739 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) = &
740 current_state%sv%data(k,current_state%column_local_y,current_state%column_local_x) &
748 type(model_state_type),
target,
intent(inout) :: current_state
762 type(model_state_type),
target,
intent(inout) :: current_state
763 real(kind=DEFAULT_PRECISION),
dimension(:),
intent(in) :: diagnostics_summed
764 real(kind=DEFAULT_PRECISION),
dimension(size(diagnostics_summed)) :: get_averaged_diagnostics
766 integer :: horizontal_points
768 horizontal_points=current_state%local_grid%size(x_index) * current_state%local_grid%size(y_index)
770 get_averaged_diagnostics(:)=diagnostics_summed(:)/horizontal_points
integer, parameter tendency
real(kind=default_precision), dimension(:), allocatable dv_profile
logical relax_to_initial_theta_profile
subroutine apply_time_independent_forcing_to_v(current_state)
subroutine field_value_retrieval_callback(current_state, name, field_value)
Field value retrieval callback, this returns the value of a specific published field.
integer function, public options_get_array_size(options_database, key)
Gets the size of the array held in the options database corresponding to a specific key...
type(component_descriptor_type) function, public forcing_get_descriptor()
Provides the component descriptor for the core to register.
Wrapper type for the value returned for a published field from a component.
subroutine apply_subsidence_to_flow_fields(current_state)
subroutine apply_time_independent_forcing_to_q(current_state)
type(standard_q_names_type), public standard_q_names
real(kind=default_precision), dimension(:), allocatable dtheta_profile_diag
integer, parameter, public log_error
Only log ERROR messages.
character(len=string_length) function, public options_get_string(options_database, key, index)
Retrieves a string value from the database that matches the provided key.
integer constant_forcing_type_v
real(kind=default_precision), dimension(:), allocatable u_profile
subroutine finalisation_callback(current_state)
Finalises the component Current model state.
real(kind=default_precision), dimension(:), allocatable dq_profile
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.
real(kind=default_precision) function, dimension(size(diagnostics_summed)) get_averaged_diagnostics(current_state, diagnostics_summed)
Averages some diagnostic values across all local horizontal points.
real(kind=default_precision) forcing_timescale_u
real(kind=default_precision), dimension(:), allocatable du_profile
logical l_constant_forcing_q
Contains common definitions for the data and datatypes used by MONC.
The ModelState which represents the current state of a run.
integer constant_forcing_type_theta
real(kind=default_precision), dimension(:), allocatable v_profile
logical function, public is_component_enabled(options_database, component_name)
Determines whether or not a specific component is registered and enabled.
subroutine init_callback(current_state)
Initialises the forcing data structures.
real(kind=default_precision), dimension(:), allocatable theta_profile
subroutine, public log_master_log(level, message)
Will log just from the master process.
integer, parameter relaxation
Description of a component.
real(kind=default_precision), dimension(:), allocatable dtheta_profile
logical relax_to_initial_v_profile
integer, parameter, public component_array_field_type
real(kind=default_precision) forcing_timescale_theta
subroutine apply_time_independent_forcing_to_theta(current_state)
real(kind=default_precision), dimension(:,:), allocatable dq_profile_diag
logical l_subs_local_theta
Scientific constant values used throughout simulations. Each has a default value and this can be over...
logical l_constant_forcing_v
This manages the Q variables and specifically the mapping between names and the index that they are s...
logical l_constant_forcing_u
logical l_constant_forcing_theta_z2pressure
Interfaces and types that MONC components must specify.
subroutine piecewise_linear_1d(zvals, vals, zgrid, field)
Does a simple 1d piecewise linear interpolation.
real(kind=default_precision), public seconds_in_a_day
real(kind=default_precision), dimension(:), allocatable dv_profile_diag
subroutine, public options_get_logical_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) logical array.
subroutine apply_subsidence_to_theta(current_state)
integer, parameter, public string_length
Default length of strings.
subroutine apply_time_independent_forcing_to_u(current_state)
real(kind=default_precision), dimension(:), allocatable q_profile
integer constant_forcing_type_q
real(kind=default_precision), dimension(:), allocatable du_profile_diag
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...
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
subroutine timestep_callback(current_state)
Called for each data column and will determine the forcing values in x and y which are then applied t...
integer, parameter subsidence
Manages the options database. Contains administration functions and deduce runtime options from the c...
integer, parameter increment
integer constant_forcing_type_u
logical function, public options_get_logical(options_database, key, index)
Retrieves a logical value from the database that matches the provided key.
character(len=string_length), dimension(:), allocatable names_force_pl_q
integer, parameter divergence
subroutine apply_subsidence_to_q_fields(current_state)
real(kind=default_precision) forcing_timescale_q
Forcing, both subsidence and large scale.
subroutine, public options_get_string_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) string array.
subroutine, public options_get_real_array(options_database, key, array_data, from, to)
Retrieves an entire (or subset) real array.
The model state which represents the current state of a run.
integer, parameter, public y_index
logical relax_to_initial_u_profile
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 x_index
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...
real(kind=default_precision) forcing_timescale_v
integer, parameter, public component_double_data_type
logical l_constant_forcing_theta