MONC
damping.F90
Go to the documentation of this file.
1 
2 module damping_mod
6  use grids_mod, only : z_index, y_index, x_index
7  use state_mod, only : model_state_type
8  use collections_mod, only : map_type
14 
15  implicit none
16 
17 #ifndef TEST_MODE
18  private
19 #endif
20 
21  real(kind=default_precision) :: dmptim,&
22  zdmp,&
23  hdmp
24 
25  ! Local tendency diagnostic variables for this component
26  ! 3D tendency fields and logicals for their use
27  real(kind=default_precision), dimension(:,:,:), allocatable :: &
34  ! Local mean tendency profile fields and logicals for their use
35  real(kind=default_precision), dimension(:), allocatable :: &
42  ! q indices
43  integer :: iqv=0, iql=0, iqr=0, iqi=0, iqs=0, iqg=0
45 
46 
47  ! tke tendency diagnostic
48  real(kind=default_precision), dimension(:), allocatable :: tend_pr_tot_tke
49  logical :: l_tend_pr_tot_tke
50 
52 
53 contains
54 
58  damping_get_descriptor%name="damping"
59  damping_get_descriptor%version=0.1
63 
66  allocate(damping_get_descriptor%published_fields(11+11+1))
67 
68  damping_get_descriptor%published_fields(1)= "tend_u_damping_3d_local"
69  damping_get_descriptor%published_fields(2)= "tend_v_damping_3d_local"
70  damping_get_descriptor%published_fields(3)= "tend_w_damping_3d_local"
71  damping_get_descriptor%published_fields(4)= "tend_th_damping_3d_local"
72  damping_get_descriptor%published_fields(5)= "tend_qv_damping_3d_local"
73  damping_get_descriptor%published_fields(6)= "tend_ql_damping_3d_local"
74  damping_get_descriptor%published_fields(7)= "tend_qi_damping_3d_local"
75  damping_get_descriptor%published_fields(8)= "tend_qr_damping_3d_local"
76  damping_get_descriptor%published_fields(9)= "tend_qs_damping_3d_local"
77  damping_get_descriptor%published_fields(10)="tend_qg_damping_3d_local"
78  damping_get_descriptor%published_fields(11)="tend_tabs_damping_3d_local"
79 
80  damping_get_descriptor%published_fields(11+1)= "tend_u_damping_profile_total_local"
81  damping_get_descriptor%published_fields(11+2)= "tend_v_damping_profile_total_local"
82  damping_get_descriptor%published_fields(11+3)= "tend_w_damping_profile_total_local"
83  damping_get_descriptor%published_fields(11+4)= "tend_th_damping_profile_total_local"
84  damping_get_descriptor%published_fields(11+5)= "tend_qv_damping_profile_total_local"
85  damping_get_descriptor%published_fields(11+6)= "tend_ql_damping_profile_total_local"
86  damping_get_descriptor%published_fields(11+7)= "tend_qi_damping_profile_total_local"
87  damping_get_descriptor%published_fields(11+8)= "tend_qr_damping_profile_total_local"
88  damping_get_descriptor%published_fields(11+9)= "tend_qs_damping_profile_total_local"
89  damping_get_descriptor%published_fields(11+10)="tend_qg_damping_profile_total_local"
90  damping_get_descriptor%published_fields(11+11)="tend_tabs_damping_profile_total_local"
91 
92  damping_get_descriptor%published_fields(11+11+1)="tend_tke_damping_profile_total_local"
93 
94 
95  end function damping_get_descriptor
96 
99  subroutine init_callback(current_state)
100  type(model_state_type), target, intent(inout) :: current_state
101 
102  integer :: k
103  logical :: l_qdiag
104 
105  if (.not. is_component_enabled(current_state%options_database, "mean_profiles")) then
106  call log_master_log(log_error, "Damping requires the mean profiles component to be enabled")
107  end if
108 
109  dmptim=options_get_real(current_state%options_database, "dmptim")
110  zdmp=options_get_real(current_state%options_database, "zdmp")
111  hdmp=options_get_real(current_state%options_database, "hdmp")
112 
113  allocate(current_state%global_grid%configuration%vertical%dmpco(current_state%local_grid%size(z_index)), &
114  current_state%global_grid%configuration%vertical%dmpcoz(current_state%local_grid%size(z_index)))
115  current_state%global_grid%configuration%vertical%dmpco(:)=0.
116  current_state%global_grid%configuration%vertical%dmpcoz(:)=0.
117  do k=current_state%local_grid%size(z_index),1,-1
118  current_state%global_grid%configuration%vertical%kdmpmin=k
119  if (current_state%global_grid%configuration%vertical%zn(k) .ge. zdmp) then
120  current_state%global_grid%configuration%vertical%dmpco(k)=dmptim*(exp((&
121  current_state%global_grid%configuration%vertical%zn(k)-zdmp)/hdmp)-1.0)
122  end if
123  if (current_state%global_grid%configuration%vertical%z(k) .ge. zdmp) then
124  current_state%global_grid%configuration%vertical%dmpcoz(k)=dmptim*(exp((&
125  current_state%global_grid%configuration%vertical%z(k)-zdmp)/hdmp)-1.0)
126  end if
127  if(current_state%global_grid%configuration%vertical%zn(k).lt. zdmp) exit
128  end do
129 
130  ! Set tendency diagnostic logicals based on availability
131  ! Need to use 3d tendencies to compute the profiles, so they will be allocated
132  ! in the case where profiles are available
133  l_qdiag = (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
134 
135  l_tend_pr_tot_u = current_state%u%active
136  l_tend_pr_tot_v = current_state%v%active
137  l_tend_pr_tot_w = current_state%w%active
138  l_tend_pr_tot_th = current_state%th%active
139  l_tend_pr_tot_qv = l_qdiag .and. current_state%number_q_fields .ge. 1
140  l_tend_pr_tot_ql = l_qdiag .and. current_state%number_q_fields .ge. 2
141  l_tend_pr_tot_qi = l_qdiag .and. current_state%number_q_fields .ge. 11
142  l_tend_pr_tot_qr = l_qdiag .and. current_state%number_q_fields .ge. 11
143  l_tend_pr_tot_qs = l_qdiag .and. current_state%number_q_fields .ge. 11
144  l_tend_pr_tot_qg = l_qdiag .and. current_state%number_q_fields .ge. 11
146 
147  l_tend_3d_u = current_state%u%active .or. l_tend_pr_tot_u
148  l_tend_3d_v = current_state%v%active .or. l_tend_pr_tot_v
149  l_tend_3d_w = current_state%w%active .or. l_tend_pr_tot_w
150  l_tend_3d_th = current_state%th%active .or. l_tend_pr_tot_th
151  l_tend_3d_qv = (l_qdiag .and. current_state%number_q_fields .ge. 1) .or. l_tend_pr_tot_qv
152  l_tend_3d_ql = (l_qdiag .and. current_state%number_q_fields .ge. 2) .or. l_tend_pr_tot_ql
153  l_tend_3d_qi = (l_qdiag .and. current_state%number_q_fields .ge. 11) .or. l_tend_pr_tot_qi
154  l_tend_3d_qr = (l_qdiag .and. current_state%number_q_fields .ge. 11) .or. l_tend_pr_tot_qr
155  l_tend_3d_qs = (l_qdiag .and. current_state%number_q_fields .ge. 11) .or. l_tend_pr_tot_qs
156  l_tend_3d_qg = (l_qdiag .and. current_state%number_q_fields .ge. 11) .or. l_tend_pr_tot_qg
158 
159  l_tend_pr_tot_tke = current_state%u%active .and. current_state%v%active .and. current_state%w%active
160 
161  ! Allocate 3d tendency fields upon availability
162  if (l_tend_3d_u) then
163  allocate( tend_3d_u(current_state%local_grid%size(z_index), &
164  current_state%local_grid%size(y_index), &
165  current_state%local_grid%size(x_index) ) )
166  endif
167  if (l_tend_3d_v) then
168  allocate( tend_3d_v(current_state%local_grid%size(z_index), &
169  current_state%local_grid%size(y_index), &
170  current_state%local_grid%size(x_index) ) )
171  endif
172  if (l_tend_3d_w) then
173  allocate( tend_3d_w(current_state%local_grid%size(z_index), &
174  current_state%local_grid%size(y_index), &
175  current_state%local_grid%size(x_index) ) )
176  endif
177  if (l_tend_3d_th) then
178  allocate( tend_3d_th(current_state%local_grid%size(z_index), &
179  current_state%local_grid%size(y_index), &
180  current_state%local_grid%size(x_index) ) )
181  endif
182  if (l_tend_3d_qv) then
183  iqv=get_q_index(standard_q_names%VAPOUR, 'damping')
184  allocate( tend_3d_qv(current_state%local_grid%size(z_index), &
185  current_state%local_grid%size(y_index), &
186  current_state%local_grid%size(x_index) ) )
187  endif
188  if (l_tend_3d_ql) then
189  iql=get_q_index(standard_q_names%CLOUD_LIQUID_MASS, 'damping')
190  allocate( tend_3d_ql(current_state%local_grid%size(z_index), &
191  current_state%local_grid%size(y_index), &
192  current_state%local_grid%size(x_index) ) )
193  endif
194  if (l_tend_3d_qi) then
195  iqi=get_q_index(standard_q_names%ICE_MASS, 'damping')
196  allocate( tend_3d_qi(current_state%local_grid%size(z_index), &
197  current_state%local_grid%size(y_index), &
198  current_state%local_grid%size(x_index) ) )
199  endif
200  if (l_tend_3d_qr) then
201  iqr=get_q_index(standard_q_names%RAIN_MASS, 'damping')
202  allocate( tend_3d_qr(current_state%local_grid%size(z_index), &
203  current_state%local_grid%size(y_index), &
204  current_state%local_grid%size(x_index) ) )
205  endif
206  if (l_tend_3d_qs) then
207  iqs=get_q_index(standard_q_names%SNOW_MASS, 'damping')
208  allocate( tend_3d_qs(current_state%local_grid%size(z_index), &
209  current_state%local_grid%size(y_index), &
210  current_state%local_grid%size(x_index) ) )
211  endif
212  if (l_tend_3d_qg) then
213  iqg=get_q_index(standard_q_names%GRAUPEL_MASS, 'damping')
214  allocate( tend_3d_qg(current_state%local_grid%size(z_index), &
215  current_state%local_grid%size(y_index), &
216  current_state%local_grid%size(x_index) ) )
217  endif
218  if (l_tend_3d_tabs) then
219  allocate( tend_3d_tabs(current_state%local_grid%size(z_index), &
220  current_state%local_grid%size(y_index), &
221  current_state%local_grid%size(x_index) ) )
222  endif
223 
224  ! Allocate profile tendency fields upon availability
225  if (l_tend_pr_tot_u) then
226  allocate( tend_pr_tot_u(current_state%local_grid%size(z_index)) )
227  endif
228  if (l_tend_pr_tot_v) then
229  allocate( tend_pr_tot_v(current_state%local_grid%size(z_index)) )
230  endif
231  if (l_tend_pr_tot_w) then
232  allocate( tend_pr_tot_w(current_state%local_grid%size(z_index)) )
233  endif
234  if (l_tend_pr_tot_th) then
235  allocate( tend_pr_tot_th(current_state%local_grid%size(z_index)) )
236  endif
237  if (l_tend_pr_tot_qv) then
238  allocate( tend_pr_tot_qv(current_state%local_grid%size(z_index)) )
239  endif
240  if (l_tend_pr_tot_ql) then
241  allocate( tend_pr_tot_ql(current_state%local_grid%size(z_index)) )
242  endif
243  if (l_tend_pr_tot_qi) then
244  allocate( tend_pr_tot_qi(current_state%local_grid%size(z_index)) )
245  endif
246  if (l_tend_pr_tot_qr) then
247  allocate( tend_pr_tot_qr(current_state%local_grid%size(z_index)) )
248  endif
249  if (l_tend_pr_tot_qs) then
250  allocate( tend_pr_tot_qs(current_state%local_grid%size(z_index)) )
251  endif
252  if (l_tend_pr_tot_qg) then
253  allocate( tend_pr_tot_qg(current_state%local_grid%size(z_index)) )
254  endif
255  if (l_tend_pr_tot_tabs) then
256  allocate( tend_pr_tot_tabs(current_state%local_grid%size(z_index)) )
257  endif
258 
259  ! Allocate profile tendency tke upon availability
260  if (l_tend_pr_tot_tke) then
261  allocate( tend_pr_tot_tke(current_state%local_grid%size(z_index)) )
262  endif
263 
264 
265  ! Save the sampling_frequency to force diagnostic calculation on select time steps
266  diagnostic_generation_frequency=options_get_integer(current_state%options_database, "sampling_frequency")
267 
268  end subroutine init_callback
269 
270 
271  subroutine finalisation_callback(current_state)
272  type(model_state_type), target, intent(inout) :: current_state
273 
274  if (allocated(tend_3d_u)) deallocate(tend_3d_u)
275  if (allocated(tend_3d_v)) deallocate(tend_3d_v)
276  if (allocated(tend_3d_w)) deallocate(tend_3d_w)
277  if (allocated(tend_3d_th)) deallocate(tend_3d_th)
278  if (allocated(tend_3d_qv)) deallocate(tend_3d_qv)
279  if (allocated(tend_3d_ql)) deallocate(tend_3d_ql)
280  if (allocated(tend_3d_qi)) deallocate(tend_3d_qi)
281  if (allocated(tend_3d_qr)) deallocate(tend_3d_qr)
282  if (allocated(tend_3d_qs)) deallocate(tend_3d_qs)
283  if (allocated(tend_3d_qg)) deallocate(tend_3d_qg)
284  if (allocated(tend_3d_tabs)) deallocate(tend_3d_tabs)
285 
286  if (allocated(tend_pr_tot_u)) deallocate(tend_pr_tot_u)
287  if (allocated(tend_pr_tot_v)) deallocate(tend_pr_tot_v)
288  if (allocated(tend_pr_tot_w)) deallocate(tend_pr_tot_w)
289  if (allocated(tend_pr_tot_th)) deallocate(tend_pr_tot_th)
290  if (allocated(tend_pr_tot_qv)) deallocate(tend_pr_tot_qv)
291  if (allocated(tend_pr_tot_ql)) deallocate(tend_pr_tot_ql)
292  if (allocated(tend_pr_tot_qi)) deallocate(tend_pr_tot_qi)
293  if (allocated(tend_pr_tot_qr)) deallocate(tend_pr_tot_qr)
294  if (allocated(tend_pr_tot_qs)) deallocate(tend_pr_tot_qs)
295  if (allocated(tend_pr_tot_qg)) deallocate(tend_pr_tot_qg)
296  if (allocated(tend_pr_tot_tabs)) deallocate(tend_pr_tot_tabs)
297 
298  if (allocated(tend_pr_tot_tke)) deallocate(tend_pr_tot_tke)
299 
300  end subroutine finalisation_callback
301 
302 
307  subroutine timestep_callback(current_state)
308  type(model_state_type), target, intent(inout) :: current_state
309 
310  integer :: k, i
311  integer :: current_x_index, current_y_index, target_x_index, target_y_index
312 
313  current_x_index=current_state%column_local_x
314  current_y_index=current_state%column_local_y
315  target_y_index=current_y_index-current_state%local_grid%halo_size(y_index)
316  target_x_index=current_x_index-current_state%local_grid%halo_size(x_index)
317 
318 
319  ! Zero profile tendency totals on first instance in the sum
320  if (current_state%first_timestep_column) then
321  if (l_tend_pr_tot_u) then
322  tend_pr_tot_u(:)= 0.0_default_precision
323  endif
324  if (l_tend_pr_tot_v) then
325  tend_pr_tot_v(:)= 0.0_default_precision
326  endif
327  if (l_tend_pr_tot_w) then
328  tend_pr_tot_w(:)= 0.0_default_precision
329  endif
330  if (l_tend_pr_tot_th) then
331  tend_pr_tot_th(:)=0.0_default_precision
332  endif
333  if (l_tend_pr_tot_qv) then
334  tend_pr_tot_qv(:)=0.0_default_precision
335  endif
336  if (l_tend_pr_tot_ql) then
337  tend_pr_tot_ql(:)=0.0_default_precision
338  endif
339  if (l_tend_pr_tot_qi) then
340  tend_pr_tot_qi(:)=0.0_default_precision
341  endif
342  if (l_tend_pr_tot_qr) then
343  tend_pr_tot_qr(:)=0.0_default_precision
344  endif
345  if (l_tend_pr_tot_qs) then
346  tend_pr_tot_qs(:)=0.0_default_precision
347  endif
348  if (l_tend_pr_tot_qg) then
349  tend_pr_tot_qg(:)=0.0_default_precision
350  endif
351  if (l_tend_pr_tot_tabs) then
352  tend_pr_tot_tabs(:)=0.0_default_precision
353  endif
354 
355  if (l_tend_pr_tot_tke) then
356  tend_pr_tot_tke(:)=0.0_default_precision
357  endif
358  endif ! zero totals
359 
360 
361  if (current_state%halo_column .and. current_state%timestep <3) return
362 
363  if (mod(current_state%timestep, diagnostic_generation_frequency) == 0 .and. .not. current_state%halo_column) then
364  call save_precomponent_tendencies(current_state, current_x_index, current_y_index, target_x_index, target_y_index)
365  end if
366 
367  do k=current_state%global_grid%configuration%vertical%kdmpmin,current_state%local_grid%size(z_index)
368 #ifdef U_ACTIVE
369  current_state%su%data(k, current_state%column_local_y, current_state%column_local_x)=current_state%su%data(k, &
370  current_state%column_local_y, current_state%column_local_x)-&
371  current_state%global_grid%configuration%vertical%dmpco(k)*(current_state%zu%data(k, current_state%column_local_y, &
372  current_state%column_local_x)- (current_state%global_grid%configuration%vertical%olzubar(k)-current_state%ugal))
373 #endif
374 #ifdef V_ACTIVE
375  current_state%sv%data(k, current_state%column_local_y, current_state%column_local_x)=current_state%sv%data(k, &
376  current_state%column_local_y, current_state%column_local_x)-&
377  current_state%global_grid%configuration%vertical%dmpco(k)*(current_state%zv%data(k, current_state%column_local_y, &
378  current_state%column_local_x)-(current_state%global_grid%configuration%vertical%olzvbar(k)-current_state%vgal))
379 #endif
380  if (current_state%th%active) then
381  current_state%sth%data(k, current_state%column_local_y, current_state%column_local_x)=current_state%sth%data(k, &
382  current_state%column_local_y, current_state%column_local_x)-&
383  current_state%global_grid%configuration%vertical%dmpco(k)*(current_state%zth%data(k, current_state%column_local_y, &
384  current_state%column_local_x)-current_state%global_grid%configuration%vertical%olzthbar(k))
385  end if
386 
387  do i=1,current_state%number_q_fields
388  if (current_state%q(i)%active) then
389  current_state%sq(i)%data(k, current_state%column_local_y, current_state%column_local_x)=current_state%sq(i)%data(k, &
390  current_state%column_local_y, current_state%column_local_x)-&
391  current_state%global_grid%configuration%vertical%dmpco(k)*&
392  (current_state%zq(i)%data(k, current_state%column_local_y, current_state%column_local_x)-&
393  current_state%global_grid%configuration%vertical%olzqbar(k,i))
394  end if
395  end do
396  end do
397 #ifdef W_ACTIVE
398  do k=current_state%global_grid%configuration%vertical%kdmpmin,current_state%local_grid%size(z_index)-1
399  current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=current_state%sw%data(k, &
400  current_state%column_local_y, current_state%column_local_x)-&
401  current_state%global_grid%configuration%vertical%dmpcoz(k)*&
402  current_state%zw%data(k, current_state%column_local_y, current_state%column_local_x)
403  end do
404 #endif
405 
406  if (mod(current_state%timestep, diagnostic_generation_frequency) == 0 .and. .not. current_state%halo_column) then
407  call compute_component_tendencies(current_state, current_x_index, current_y_index, target_x_index, target_y_index)
408  end if
409 
410  end subroutine timestep_callback
411 
412 
419  subroutine save_precomponent_tendencies(current_state, cxn, cyn, txn, tyn)
420  type(model_state_type), target, intent(in) :: current_state
421  integer, intent(in) :: cxn, cyn, txn, tyn
422 
423  ! Save 3d tendency fields upon request (of 3d or profiles) and availability
424  if (l_tend_3d_u) then
425  tend_3d_u(:,tyn,txn)=current_state%su%data(:,cyn,cxn)
426  endif
427  if (l_tend_3d_v) then
428  tend_3d_v(:,tyn,txn)=current_state%sv%data(:,cyn,cxn)
429  endif
430  if (l_tend_3d_w) then
431  tend_3d_w(:,tyn,txn)=current_state%sw%data(:,cyn,cxn)
432  endif
433  if (l_tend_3d_th) then
434  tend_3d_th(:,tyn,txn)=current_state%sth%data(:,cyn,cxn)
435  endif
436  if (l_tend_3d_qv) then
437  tend_3d_qv(:,tyn,txn)=current_state%sq(iqv)%data(:,cyn,cxn)
438  endif
439  if (l_tend_3d_ql) then
440  tend_3d_ql(:,tyn,txn)=current_state%sq(iql)%data(:,cyn,cxn)
441  endif
442  if (l_tend_3d_qi) then
443  tend_3d_qi(:,tyn,txn)=current_state%sq(iqi)%data(:,cyn,cxn)
444  endif
445  if (l_tend_3d_qr) then
446  tend_3d_qr(:,tyn,txn)=current_state%sq(iqr)%data(:,cyn,cxn)
447  endif
448  if (l_tend_3d_qs) then
449  tend_3d_qs(:,tyn,txn)=current_state%sq(iqs)%data(:,cyn,cxn)
450  endif
451  if (l_tend_3d_qg) then
452  tend_3d_qg(:,tyn,txn)=current_state%sq(iqg)%data(:,cyn,cxn)
453  endif
454  if (l_tend_3d_tabs) then
455  tend_3d_tabs(:,tyn,txn)=current_state%sth%data(:,cyn,cxn) * current_state%global_grid%configuration%vertical%rprefrcp(:)
456  endif
457 
458  end subroutine save_precomponent_tendencies
459 
460 
467  subroutine compute_component_tendencies(current_state, cxn, cyn, txn, tyn)
468  type(model_state_type), target, intent(inout) :: current_state
469  integer, intent(in) :: cxn, cyn, txn, tyn
470 
471  real(kind=default_precision), dimension(current_state%local_grid%size(Z_INDEX)) :: &
472  uu_tendency, vv_tendency, ww_tendency
473  integer :: k
474 
475  ! Calculate change in tendency due to component
476  if (l_tend_3d_u) then
477  tend_3d_u(:,tyn,txn)=current_state%su%data(:,cyn,cxn) - tend_3d_u(:,tyn,txn)
478  endif
479  if (l_tend_3d_v) then
480  tend_3d_v(:,tyn,txn)=current_state%sv%data(:,cyn,cxn) - tend_3d_v(:,tyn,txn)
481  endif
482  if (l_tend_3d_w) then
483  tend_3d_w(:,tyn,txn)=current_state%sw%data(:,cyn,cxn) - tend_3d_w(:,tyn,txn)
484  endif
485  if (l_tend_3d_th) then
486  tend_3d_th(:,tyn,txn)=current_state%sth%data(:,cyn,cxn) - tend_3d_th(:,tyn,txn)
487  endif
488  if (l_tend_3d_qv) then
489  tend_3d_qv(:,tyn,txn)=current_state%sq(iqv)%data(:,cyn,cxn) - tend_3d_qv(:,tyn,txn)
490  endif
491  if (l_tend_3d_ql) then
492  tend_3d_ql(:,tyn,txn)=current_state%sq(iql)%data(:,cyn,cxn) - tend_3d_ql(:,tyn,txn)
493  endif
494  if (l_tend_3d_qi) then
495  tend_3d_qi(:,tyn,txn)=current_state%sq(iqi)%data(:,cyn,cxn) - tend_3d_qi(:,tyn,txn)
496  endif
497  if (l_tend_3d_qr) then
498  tend_3d_qr(:,tyn,txn)=current_state%sq(iqr)%data(:,cyn,cxn) - tend_3d_qr(:,tyn,txn)
499  endif
500  if (l_tend_3d_qs) then
501  tend_3d_qs(:,tyn,txn)=current_state%sq(iqs)%data(:,cyn,cxn) - tend_3d_qs(:,tyn,txn)
502  endif
503  if (l_tend_3d_qg) then
504  tend_3d_qg(:,tyn,txn)=current_state%sq(iqg)%data(:,cyn,cxn) - tend_3d_qg(:,tyn,txn)
505  endif
506  if (l_tend_3d_tabs) then
507  tend_3d_tabs(:,tyn,txn)= &
508  current_state%sth%data(:,cyn,cxn) * current_state%global_grid%configuration%vertical%rprefrcp(:) &
509  - tend_3d_tabs(:,tyn,txn)
510  endif
511 
512  ! Add local tendency fields to the profile total
513  if (l_tend_pr_tot_u) then
514  tend_pr_tot_u(:)=tend_pr_tot_u(:) + tend_3d_u(:,tyn,txn)
515  endif
516  if (l_tend_pr_tot_v) then
517  tend_pr_tot_v(:)=tend_pr_tot_v(:) + tend_3d_v(:,tyn,txn)
518  endif
519  if (l_tend_pr_tot_w) then
520  tend_pr_tot_w(:)=tend_pr_tot_w(:) + tend_3d_w(:,tyn,txn)
521  endif
522  if (l_tend_pr_tot_th) then
523  tend_pr_tot_th(:)=tend_pr_tot_th(:) + tend_3d_th(:,tyn,txn)
524  endif
525  if (l_tend_pr_tot_qv) then
526  tend_pr_tot_qv(:)=tend_pr_tot_qv(:) + tend_3d_qv(:,tyn,txn)
527  endif
528  if (l_tend_pr_tot_ql) then
529  tend_pr_tot_ql(:)=tend_pr_tot_ql(:) + tend_3d_ql(:,tyn,txn)
530  endif
531  if (l_tend_pr_tot_qi) then
532  tend_pr_tot_qi(:)=tend_pr_tot_qi(:) + tend_3d_qi(:,tyn,txn)
533  endif
534  if (l_tend_pr_tot_qr) then
535  tend_pr_tot_qr(:)=tend_pr_tot_qr(:) + tend_3d_qr(:,tyn,txn)
536  endif
537  if (l_tend_pr_tot_qs) then
538  tend_pr_tot_qs(:)=tend_pr_tot_qs(:) + tend_3d_qs(:,tyn,txn)
539  endif
540  if (l_tend_pr_tot_qg) then
541  tend_pr_tot_qg(:)=tend_pr_tot_qg(:) + tend_3d_qg(:,tyn,txn)
542  endif
543  if (l_tend_pr_tot_tabs) then
545  endif
546 
547 ! Estimate contribution to TKE budget due to damping.
548 ! Currently uses mean state at beginning of timestep where mean state at end is really required
549 ! (hence 'provisional' comments); assumption is mean state is very slowly varying.
550 
551  if (l_tend_pr_tot_tke) then
552  do k=2, current_state%local_grid%size(z_index)
553 
554  uu_tendency(k) = ((current_state%zu%data(k,cyn,cxn) &
555  + tend_3d_u(k,tyn,txn)*current_state%dtm * 2.0_default_precision &
556  - current_state%global_grid%configuration%vertical%olzubar(k) )**2 & ! provisional
557  - &
558  (current_state%zu%data(k,cyn,cxn) &
559  - current_state%global_grid%configuration%vertical%olzubar(k) )**2 & ! n-1
560  ) / (current_state%dtm * 2.0_default_precision)
561 
562  vv_tendency(k) = ((current_state%zv%data(k,cyn,cxn) &
563  + tend_3d_v(k,tyn,txn)*current_state%dtm * 2.0_default_precision &
564  - current_state%global_grid%configuration%vertical%olzvbar(k) )**2 & ! provisional
565  - &
566  (current_state%zv%data(k,cyn,cxn) &
567  - current_state%global_grid%configuration%vertical%olzvbar(k) )**2 & ! n-1
568  ) / (current_state%dtm * 2.0_default_precision)
569 
570  ww_tendency(k) = ((current_state%zw%data(k,cyn,cxn) & ! w_bar assumed zero
571  + tend_3d_w(k,tyn,txn)*current_state%dtm * 2.0_default_precision )**2 & ! provisional
572  - &
573  current_state%zw%data(k,cyn,cxn)**2 & ! n-1
574  ) / (current_state%dtm * 2.0_default_precision)
575 
576 
577  enddo
578 
579  ! handle surface so that interpolation goes to zero
580  uu_tendency(1) = -uu_tendency(2)
581  vv_tendency(1) = -vv_tendency(2)
582 
583  ! interpolate to w-levels
584  do k=2, current_state%local_grid%size(z_index)-1
585  tend_pr_tot_tke(k)=tend_pr_tot_tke(k) + 0.5_default_precision * (&
586  0.5_default_precision * (uu_tendency(k)+uu_tendency(k+1)) + &
587  0.5_default_precision * (vv_tendency(k)+vv_tendency(k+1)) + &
588  ww_tendency(k) )
589  enddo
590 
591  endif
592 
593  end subroutine compute_component_tendencies
594 
595 
601  subroutine field_information_retrieval_callback(current_state, name, field_information)
602  type(model_state_type), target, intent(inout) :: current_state
603  character(len=*), intent(in) :: name
604  type(component_field_information_type), intent(out) :: field_information
605  integer :: strcomp
606 
607  ! Field information for 3d
608  strcomp=index(name, "_damping_3d_local")
609  if (strcomp .ne. 0) then
610  field_information%field_type=component_array_field_type
611  field_information%number_dimensions=3
612  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
613  field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
614  field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
615  field_information%data_type=component_double_data_type
616 
617  if (name .eq. "tend_u_damping_3d_local") then
618  field_information%enabled=l_tend_3d_u
619  else if (name .eq. "tend_v_damping_3d_local") then
620  field_information%enabled=l_tend_3d_v
621  else if (name .eq. "tend_w_damping_3d_local") then
622  field_information%enabled=l_tend_3d_w
623  else if (name .eq. "tend_th_damping_3d_local") then
624  field_information%enabled=l_tend_3d_th
625  else if (name .eq. "tend_qv_damping_3d_local") then
626  field_information%enabled=l_tend_3d_qv
627  else if (name .eq. "tend_ql_damping_3d_local") then
628  field_information%enabled=l_tend_3d_ql
629  else if (name .eq. "tend_qi_damping_3d_local") then
630  field_information%enabled=l_tend_3d_qi
631  else if (name .eq. "tend_qr_damping_3d_local") then
632  field_information%enabled=l_tend_3d_qr
633  else if (name .eq. "tend_qs_damping_3d_local") then
634  field_information%enabled=l_tend_3d_qs
635  else if (name .eq. "tend_qg_damping_3d_local") then
636  field_information%enabled=l_tend_3d_qg
637  else if (name .eq. "tend_tabs_damping_3d_local") then
638  field_information%enabled=l_tend_3d_tabs
639  else
640  field_information%enabled=.true.
641  end if
642 
643  end if !end 3d check
644 
645  ! Field information for profiles
646  strcomp=index(name, "_damping_profile_total_local")
647  if (strcomp .ne. 0) then
648  field_information%field_type=component_array_field_type
649  field_information%number_dimensions=1
650  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
651  field_information%data_type=component_double_data_type
652 
653  if (name .eq. "tend_u_damping_profile_total_local") then
654  field_information%enabled=l_tend_pr_tot_u
655  else if (name .eq. "tend_v_damping_profile_total_local") then
656  field_information%enabled=l_tend_pr_tot_v
657  else if (name .eq. "tend_w_damping_profile_total_local") then
658  field_information%enabled=l_tend_pr_tot_w
659  else if (name .eq. "tend_th_damping_profile_total_local") then
660  field_information%enabled=l_tend_pr_tot_th
661  else if (name .eq. "tend_qv_damping_profile_total_local") then
662  field_information%enabled=l_tend_pr_tot_qv
663  else if (name .eq. "tend_ql_damping_profile_total_local") then
664  field_information%enabled=l_tend_pr_tot_ql
665  else if (name .eq. "tend_qi_damping_profile_total_local") then
666  field_information%enabled=l_tend_pr_tot_qi
667  else if (name .eq. "tend_qr_damping_profile_total_local") then
668  field_information%enabled=l_tend_pr_tot_qr
669  else if (name .eq. "tend_qs_damping_profile_total_local") then
670  field_information%enabled=l_tend_pr_tot_qs
671  else if (name .eq. "tend_qg_damping_profile_total_local") then
672  field_information%enabled=l_tend_pr_tot_qg
673  else if (name .eq. "tend_tabs_damping_profile_total_local") then
674  field_information%enabled=l_tend_pr_tot_tabs
675 
676  else if (name .eq. "tend_tke_damping_profile_total_local") then
677  field_information%enabled=l_tend_pr_tot_tke
678 
679  else
680  field_information%enabled=.true.
681  end if
682 
683  end if !end profile check
684 
686 
687 
692  subroutine field_value_retrieval_callback(current_state, name, field_value)
693  type(model_state_type), target, intent(inout) :: current_state
694  character(len=*), intent(in) :: name
695  type(component_field_value_type), intent(out) :: field_value
696 
697  ! 3d Tendency Fields
698  if (name .eq. "tend_u_damping_3d_local" .and. allocated(tend_3d_u)) then
699  call set_published_field_value(field_value, real_3d_field=tend_3d_u)
700  else if (name .eq. "tend_v_damping_3d_local" .and. allocated(tend_3d_v)) then
701  call set_published_field_value(field_value, real_3d_field=tend_3d_v)
702  else if (name .eq. "tend_w_damping_3d_local" .and. allocated(tend_3d_w)) then
703  call set_published_field_value(field_value, real_3d_field=tend_3d_w)
704  else if (name .eq. "tend_th_damping_3d_local" .and. allocated(tend_3d_th)) then
705  call set_published_field_value(field_value, real_3d_field=tend_3d_th)
706  else if (name .eq. "tend_qv_damping_3d_local" .and. allocated(tend_3d_qv)) then
707  call set_published_field_value(field_value, real_3d_field=tend_3d_qv)
708  else if (name .eq. "tend_ql_damping_3d_local" .and. allocated(tend_3d_ql)) then
709  call set_published_field_value(field_value, real_3d_field=tend_3d_ql)
710  else if (name .eq. "tend_qi_damping_3d_local" .and. allocated(tend_3d_qi)) then
711  call set_published_field_value(field_value, real_3d_field=tend_3d_qi)
712  else if (name .eq. "tend_qr_damping_3d_local" .and. allocated(tend_3d_qr)) then
713  call set_published_field_value(field_value, real_3d_field=tend_3d_qr)
714  else if (name .eq. "tend_qs_damping_3d_local" .and. allocated(tend_3d_qs)) then
715  call set_published_field_value(field_value, real_3d_field=tend_3d_qs)
716  else if (name .eq. "tend_qg_damping_3d_local" .and. allocated(tend_3d_qg)) then
717  call set_published_field_value(field_value, real_3d_field=tend_3d_qg)
718  else if (name .eq. "tend_tabs_damping_3d_local" .and. allocated(tend_3d_tabs)) then
719  call set_published_field_value(field_value, real_3d_field=tend_3d_tabs)
720 
721  ! Profile Tendency Fields
722  else if (name .eq. "tend_u_damping_profile_total_local" .and. allocated(tend_pr_tot_u)) then
723  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_u)
724  else if (name .eq. "tend_v_damping_profile_total_local" .and. allocated(tend_pr_tot_v)) then
725  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_v)
726  else if (name .eq. "tend_w_damping_profile_total_local" .and. allocated(tend_pr_tot_w)) then
727  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_w)
728  else if (name .eq. "tend_th_damping_profile_total_local" .and. allocated(tend_pr_tot_th)) then
729  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_th)
730  else if (name .eq. "tend_qv_damping_profile_total_local" .and. allocated(tend_pr_tot_qv)) then
731  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_qv)
732  else if (name .eq. "tend_ql_damping_profile_total_local" .and. allocated(tend_pr_tot_ql)) then
733  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_ql)
734  else if (name .eq. "tend_qi_damping_profile_total_local" .and. allocated(tend_pr_tot_qi)) then
735  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_qi)
736  else if (name .eq. "tend_qr_damping_profile_total_local" .and. allocated(tend_pr_tot_qr)) then
737  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_qr)
738  else if (name .eq. "tend_qs_damping_profile_total_local" .and. allocated(tend_pr_tot_qs)) then
739  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_qs)
740  else if (name .eq. "tend_qg_damping_profile_total_local" .and. allocated(tend_pr_tot_qg)) then
741  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_qg)
742  else if (name .eq. "tend_tabs_damping_profile_total_local" .and. allocated(tend_pr_tot_tabs)) then
743  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_tabs)
744 
745  else if (name .eq. "tend_tke_damping_profile_total_local" .and. allocated(tend_pr_tot_tke)) then
746  call set_published_field_value(field_value, real_1d_field=tend_pr_tot_tke)
747 
748  end if
749 
750  end subroutine field_value_retrieval_callback
751 
752 
757  subroutine set_published_field_value(field_value, real_1d_field, real_2d_field, real_3d_field)
758  type(component_field_value_type), intent(inout) :: field_value
759  real(kind=default_precision), dimension(:), optional :: real_1d_field
760  real(kind=default_precision), dimension(:,:), optional :: real_2d_field
761  real(kind=default_precision), dimension(:,:,:), optional :: real_3d_field
762 
763  if (present(real_1d_field)) then
764  allocate(field_value%real_1d_array(size(real_1d_field)), source=real_1d_field)
765  else if (present(real_2d_field)) then
766  allocate(field_value%real_2d_array(size(real_2d_field, 1), size(real_2d_field, 2)), source=real_2d_field)
767  else if (present(real_3d_field)) then
768  allocate(field_value%real_3d_array(size(real_3d_field, 1), size(real_3d_field, 2), size(real_3d_field, 3)), &
769  source=real_3d_field)
770  end if
771  end subroutine set_published_field_value
772 
773 end module damping_mod
774 
damping_mod::tend_pr_tot_th
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_th
Definition: damping.F90:35
registry_mod::is_component_enabled
logical function, public is_component_enabled(options_database, component_name)
Determines whether or not a specific component is registered and enabled.
Definition: registry.F90:334
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
collections_mod::map_type
Map data structure that holds string (length 20 maximum) key value pairs.
Definition: collections.F90:86
damping_mod::l_tend_3d_v
logical l_tend_3d_v
Definition: damping.F90:31
damping_mod::iqi
integer iqi
Definition: damping.F90:43
damping_mod::diagnostic_generation_frequency
integer diagnostic_generation_frequency
Definition: damping.F90:44
damping_mod::tend_3d_v
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_v
Definition: damping.F90:27
damping_mod::l_tend_pr_tot_tabs
logical l_tend_pr_tot_tabs
Definition: damping.F90:39
damping_mod::iqg
integer iqg
Definition: damping.F90:43
damping_mod::l_tend_pr_tot_tke
logical l_tend_pr_tot_tke
Definition: damping.F90:49
damping_mod::tend_pr_tot_ql
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_ql
Definition: damping.F90:35
damping_mod::l_tend_pr_tot_qr
logical l_tend_pr_tot_qr
Definition: damping.F90:39
damping_mod::tend_3d_qi
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_qi
Definition: damping.F90:27
collections_mod
Collection data structures.
Definition: collections.F90:7
grids_mod::x_index
integer, parameter, public x_index
Definition: grids.F90:14
optionsdatabase_mod::options_get_integer
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
Definition: optionsdatabase.F90:217
damping_mod::l_tend_3d_th
logical l_tend_3d_th
Definition: damping.F90:31
grids_mod::y_index
integer, parameter, public y_index
Definition: grids.F90:14
damping_mod::set_published_field_value
subroutine set_published_field_value(field_value, real_1d_field, real_2d_field, real_3d_field)
Sets the published field value from the temporary diagnostic values held by this component.
Definition: damping.F90:758
damping_mod
Damping applied to the W field at some point to stop stuff flying up and off.
Definition: damping.F90:2
damping_mod::l_tend_pr_tot_qi
logical l_tend_pr_tot_qi
Definition: damping.F90:39
damping_mod::l_tend_pr_tot_qs
logical l_tend_pr_tot_qs
Definition: damping.F90:39
damping_mod::l_tend_pr_tot_u
logical l_tend_pr_tot_u
Definition: damping.F90:39
damping_mod::l_tend_pr_tot_ql
logical l_tend_pr_tot_ql
Definition: damping.F90:39
damping_mod::tend_3d_qr
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_qr
Definition: damping.F90:27
damping_mod::iqv
integer iqv
Definition: damping.F90:43
damping_mod::iqs
integer iqs
Definition: damping.F90:43
damping_mod::tend_pr_tot_qi
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_qi
Definition: damping.F90:35
damping_mod::tend_pr_tot_tabs
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_tabs
Definition: damping.F90:35
damping_mod::l_tend_pr_tot_th
logical l_tend_pr_tot_th
Definition: damping.F90:39
damping_mod::l_tend_3d_qs
logical l_tend_3d_qs
Definition: damping.F90:31
monc_component_mod
Interfaces and types that MONC components must specify.
Definition: monc_component.F90:6
damping_mod::finalisation_callback
subroutine finalisation_callback(current_state)
Definition: damping.F90:272
damping_mod::tend_3d_qs
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_qs
Definition: damping.F90:27
damping_mod::l_tend_pr_tot_qv
logical l_tend_pr_tot_qv
Definition: damping.F90:39
damping_mod::tend_3d_qv
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_qv
Definition: damping.F90:27
damping_mod::tend_3d_qg
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_qg
Definition: damping.F90:27
damping_mod::l_tend_3d_u
logical l_tend_3d_u
Definition: damping.F90:31
damping_mod::l_tend_3d_tabs
logical l_tend_3d_tabs
Definition: damping.F90:31
damping_mod::dmptim
real(kind=default_precision) dmptim
Layer timescale.
Definition: damping.F90:21
damping_mod::field_information_retrieval_callback
subroutine field_information_retrieval_callback(current_state, name, field_information)
Field information retrieval callback, this returns information for a specific component's published f...
Definition: damping.F90:602
damping_mod::init_callback
subroutine init_callback(current_state)
On initialisation will set up data structures and field values.
Definition: damping.F90:100
damping_mod::l_tend_3d_qr
logical l_tend_3d_qr
Definition: damping.F90:31
grids_mod::z_index
integer, parameter, public z_index
Grid index parameters.
Definition: grids.F90:14
damping_mod::l_tend_3d_ql
logical l_tend_3d_ql
Definition: damping.F90:31
damping_mod::damping_get_descriptor
type(component_descriptor_type) function, public damping_get_descriptor()
Descriptor of this component for registration.
Definition: damping.F90:58
q_indices_mod::standard_q_names
type(standard_q_names_type), public standard_q_names
Definition: q_indices.F90:59
monc_component_mod::component_field_value_type
Wrapper type for the value returned for a published field from a component.
Definition: monc_component.F90:22
damping_mod::tend_pr_tot_qv
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_qv
Definition: damping.F90:35
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
damping_mod::tend_pr_tot_v
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_v
Definition: damping.F90:35
damping_mod::tend_pr_tot_qg
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_qg
Definition: damping.F90:35
monc_component_mod::component_field_information_type
Definition: monc_component.F90:31
damping_mod::zdmp
real(kind=default_precision) zdmp
The point (m) where the damping starts.
Definition: damping.F90:21
damping_mod::l_tend_3d_qg
logical l_tend_3d_qg
Definition: damping.F90:31
damping_mod::l_tend_3d_qv
logical l_tend_3d_qv
Definition: damping.F90:31
damping_mod::tend_pr_tot_qr
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_qr
Definition: damping.F90:35
damping_mod::iql
integer iql
Definition: damping.F90:43
damping_mod::tend_3d_ql
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_ql
Definition: damping.F90:27
damping_mod::timestep_callback
subroutine timestep_callback(current_state)
For each data column will calculate the damping term and apply this to the source term for that field...
Definition: damping.F90:308
damping_mod::tend_pr_tot_w
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_w
Definition: damping.F90:35
damping_mod::tend_pr_tot_u
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_u
Definition: damping.F90:35
q_indices_mod::get_q_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...
Definition: q_indices.F90:112
logging_mod
Logging utility.
Definition: logging.F90:2
damping_mod::tend_3d_w
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_w
Definition: damping.F90:27
damping_mod::tend_3d_tabs
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_tabs
Definition: damping.F90:27
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
damping_mod::iqr
integer iqr
Definition: damping.F90:43
damping_mod::tend_3d_th
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_th
Definition: damping.F90:27
logging_mod::log_master_log
subroutine, public log_master_log(level, message)
Will log just from the master process.
Definition: logging.F90:47
q_indices_mod
This manages the Q variables and specifically the mapping between names and the index that they are s...
Definition: q_indices.F90:2
damping_mod::l_tend_pr_tot_w
logical l_tend_pr_tot_w
Definition: damping.F90:39
registry_mod
MONC component registry.
Definition: registry.F90:5
damping_mod::tend_pr_tot_qs
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_qs
Definition: damping.F90:35
damping_mod::l_tend_pr_tot_v
logical l_tend_pr_tot_v
Definition: damping.F90:39
damping_mod::save_precomponent_tendencies
subroutine save_precomponent_tendencies(current_state, cxn, cyn, txn, tyn)
Save the 3d tendencies coming into the component.
Definition: damping.F90:420
damping_mod::compute_component_tendencies
subroutine compute_component_tendencies(current_state, cxn, cyn, txn, tyn)
Computation of component tendencies.
Definition: damping.F90:468
damping_mod::l_tend_pr_tot_qg
logical l_tend_pr_tot_qg
Definition: damping.F90:39
damping_mod::hdmp
real(kind=default_precision) hdmp
The height (m) of the damping layer.
Definition: damping.F90:21
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
damping_mod::l_tend_3d_w
logical l_tend_3d_w
Definition: damping.F90:31
optionsdatabase_mod
Manages the options database. Contains administration functions and deduce runtime options from the c...
Definition: optionsdatabase.F90:7
damping_mod::tend_pr_tot_tke
real(kind=default_precision), dimension(:), allocatable tend_pr_tot_tke
Definition: damping.F90:48
damping_mod::field_value_retrieval_callback
subroutine field_value_retrieval_callback(current_state, name, field_value)
Field value retrieval callback, this returns the value of a specific published field.
Definition: damping.F90:693
monc_component_mod::component_descriptor_type
Description of a component.
Definition: monc_component.F90:42
monc_component_mod::component_double_data_type
integer, parameter, public component_double_data_type
Definition: monc_component.F90:16
optionsdatabase_mod::options_get_real
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.
Definition: optionsdatabase.F90:91
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
damping_mod::tend_3d_u
real(kind=default_precision), dimension(:,:,:), allocatable tend_3d_u
Definition: damping.F90:27
state_mod
The model state which represents the current state of a run.
Definition: state.F90:2
damping_mod::l_tend_3d_qi
logical l_tend_3d_qi
Definition: damping.F90:31
monc_component_mod::component_array_field_type
integer, parameter, public component_array_field_type
Definition: monc_component.F90:15