MONC
profile_diagnostics.F90
Go to the documentation of this file.
7  use state_mod, only : model_state_type
10  use saturation_mod, only: qsaturation
13 
14  implicit none
15 
16 #ifndef TEST_MODE
17  private
18 #endif
19 
20  integer :: total_points, iqv=0, iql=0, iqr=0, iqi=0, iqs=0, &
21  iqg=0
22  real(kind=default_precision), dimension(:), allocatable :: &
28  ! mositure means
30  ! moisture flux terms
35 
36  ! 3D and local profile total binary cloud masks
37  character(len=STRING_LENGTH) :: cloud_mask_method
38  real(kind=default_precision), dimension(:,:,:), allocatable :: cloud_mask
39  real(kind=default_precision), dimension(:) , allocatable :: cloud_mask_tot
40  real(kind=default_precision), dimension(:) , allocatable :: cloud_liq_mask_tot
41  real(kind=default_precision), dimension(:) , allocatable :: cloud_ice_mask_tot
42  logical :: l_partial_liq_ice
43 
45  ! character string to determine the advection scheme
46  character(len=5) :: advect_theta, advect_q, advect_flow
47 
49 
51 
52 contains
53 
57  profile_diagnostics_get_descriptor%name="profile_diagnostics"
59 
62  ! profile_diagnostics_get_descriptor%finalisation=>finalisation_callback
63 
66  allocate(profile_diagnostics_get_descriptor%published_fields(42+26+4))
67 
68  profile_diagnostics_get_descriptor%published_fields(1)="thref_local"
69  profile_diagnostics_get_descriptor%published_fields(2)="prefn_local"
70  profile_diagnostics_get_descriptor%published_fields(3)="rho_local"
71  profile_diagnostics_get_descriptor%published_fields(4)="rhon_local"
72  profile_diagnostics_get_descriptor%published_fields(5)="thinit_local"
73  profile_diagnostics_get_descriptor%published_fields(6)="uinit_local"
74  profile_diagnostics_get_descriptor%published_fields(7)="vinit_local"
75  profile_diagnostics_get_descriptor%published_fields(8)="theta_total_local"
76  profile_diagnostics_get_descriptor%published_fields(9)="rh_total_local"
77  profile_diagnostics_get_descriptor%published_fields(10)="u_wind_total_local"
78  profile_diagnostics_get_descriptor%published_fields(11)="v_wind_total_local"
79  profile_diagnostics_get_descriptor%published_fields(12)="w_wind_total_local"
80 
81  profile_diagnostics_get_descriptor%published_fields(13)="uu_total_local"
82  profile_diagnostics_get_descriptor%published_fields(14)="vv_total_local"
83  profile_diagnostics_get_descriptor%published_fields(15)="ww_total_local"
84  profile_diagnostics_get_descriptor%published_fields(16)="uw_total_local"
85  profile_diagnostics_get_descriptor%published_fields(17)="vw_total_local"
86  profile_diagnostics_get_descriptor%published_fields(18)="uv_total_local"
87  profile_diagnostics_get_descriptor%published_fields(19)="wke_total_local"
88  profile_diagnostics_get_descriptor%published_fields(20)="wwww_total_local"
89  profile_diagnostics_get_descriptor%published_fields(21)="www_total_local"
90  profile_diagnostics_get_descriptor%published_fields(22)="wtheta_ad_total_local"
91  profile_diagnostics_get_descriptor%published_fields(23)="wtheta_cn_total_local"
92  profile_diagnostics_get_descriptor%published_fields(24)="th2_total_local"
93 
94  profile_diagnostics_get_descriptor%published_fields(25)="vapour_mmr_total_local"
95  profile_diagnostics_get_descriptor%published_fields(26)="liquid_mmr_total_local"
96  profile_diagnostics_get_descriptor%published_fields(27)="rain_mmr_total_local"
97  profile_diagnostics_get_descriptor%published_fields(28)="ice_mmr_total_local"
98  profile_diagnostics_get_descriptor%published_fields(29)="snow_mmr_total_local"
99  profile_diagnostics_get_descriptor%published_fields(30)="graupel_mmr_total_local"
100 
101  profile_diagnostics_get_descriptor%published_fields(31)="wqv_ad_total_local"
102  profile_diagnostics_get_descriptor%published_fields(32)="wqv_cn_total_local"
103  profile_diagnostics_get_descriptor%published_fields(33)="wql_ad_total_local"
104  profile_diagnostics_get_descriptor%published_fields(34)="wql_cn_total_local"
105  profile_diagnostics_get_descriptor%published_fields(35)="wqr_ad_total_local"
106  profile_diagnostics_get_descriptor%published_fields(36)="wqr_cn_total_local"
107  profile_diagnostics_get_descriptor%published_fields(37)="wqi_ad_total_local"
108  profile_diagnostics_get_descriptor%published_fields(38)="wqi_cn_total_local"
109  profile_diagnostics_get_descriptor%published_fields(39)="wqs_ad_total_local"
110  profile_diagnostics_get_descriptor%published_fields(40)="wqs_cn_total_local"
111  profile_diagnostics_get_descriptor%published_fields(41)="wqg_ad_total_local"
112  profile_diagnostics_get_descriptor%published_fields(42)="wqg_cn_total_local"
113 
114 ! =====================================================
115 ! 2nd, provisionally instantaneous, stream
116  profile_diagnostics_get_descriptor%published_fields(42+1)="i_theta_total_local"
117  profile_diagnostics_get_descriptor%published_fields(42+2)="i_vapour_mmr_total_local"
118  profile_diagnostics_get_descriptor%published_fields(42+3)="i_liquid_mmr_total_local"
119  profile_diagnostics_get_descriptor%published_fields(42+4)="i_u_wind_total_local"
120  profile_diagnostics_get_descriptor%published_fields(42+5)="i_uu_total_local"
121  profile_diagnostics_get_descriptor%published_fields(42+6)="i_v_wind_total_local"
122  profile_diagnostics_get_descriptor%published_fields(42+7)="i_vv_total_local"
123  profile_diagnostics_get_descriptor%published_fields(42+8)="i_ww_total_local"
124  profile_diagnostics_get_descriptor%published_fields(42+9)="i_w_wind_total_local"
125  profile_diagnostics_get_descriptor%published_fields(42+10)="i_rh_total_local"
126  profile_diagnostics_get_descriptor%published_fields(42+11)="i_thref_local"
127  profile_diagnostics_get_descriptor%published_fields(42+12)="i_prefn_local"
128  profile_diagnostics_get_descriptor%published_fields(42+13)="i_rho_local"
129  profile_diagnostics_get_descriptor%published_fields(42+14)="i_rhon_local"
130  profile_diagnostics_get_descriptor%published_fields(42+15)="i_thinit_local"
131 
132  profile_diagnostics_get_descriptor%published_fields(42+16)="i_uw_total_local"
133  profile_diagnostics_get_descriptor%published_fields(42+17)="i_vw_total_local"
134  profile_diagnostics_get_descriptor%published_fields(42+18)="i_wtheta_cn_total_local"
135  profile_diagnostics_get_descriptor%published_fields(42+19)="i_th2_total_local"
136 
137  profile_diagnostics_get_descriptor%published_fields(42+20)="i_uinit_local"
138  profile_diagnostics_get_descriptor%published_fields(42+21)="i_vinit_local"
139 
140  profile_diagnostics_get_descriptor%published_fields(42+22)="i_rain_mmr_total_local"
141  profile_diagnostics_get_descriptor%published_fields(42+23)="i_ice_mmr_total_local"
142  profile_diagnostics_get_descriptor%published_fields(42+24)="i_snow_mmr_total_local"
143  profile_diagnostics_get_descriptor%published_fields(42+25)="i_graupel_mmr_total_local"
144 
145 ! =====================================================
146 ! cloud mask fields
147  profile_diagnostics_get_descriptor%published_fields(42+25+1)="cloud_mask"
148  profile_diagnostics_get_descriptor%published_fields(42+25+2)="cloud_mask_total_local"
149  profile_diagnostics_get_descriptor%published_fields(42+25+3)="cloud_liq_mask_total_local"
150  profile_diagnostics_get_descriptor%published_fields(42+25+4)="cloud_ice_mask_total_local"
151 
152 
154 
155  subroutine initialisation_callback(current_state)
156  type(model_state_type), target, intent(inout) :: current_state
157 
158  integer :: k
159 
160  vertical_grid=current_state%global_grid%configuration%vertical
161 
162  total_points=(current_state%local_grid%size(y_index) * current_state%local_grid%size(x_index))
163 
164  ! allocate local arrays for the horizontal wind averages
165  allocate(u_wind_tot(current_state%local_grid%size(z_index)) &
166  , v_wind_tot(current_state%local_grid%size(z_index)) &
167  , ww_tot(current_state%local_grid%size(z_index)) &
168  , w_wind_tot(current_state%local_grid%size(z_index)) &
169  , prefn(current_state%local_grid%size(z_index)) &
170  , rho(current_state%local_grid%size(z_index)) &
171  , rhon(current_state%local_grid%size(z_index)) &
172  , uinit(current_state%local_grid%size(z_index)) &
173  , vinit(current_state%local_grid%size(z_index)))
174  allocate( uw_tot(current_state%local_grid%size(z_index)) &
175  , vw_tot(current_state%local_grid%size(z_index)) &
176  , uv_tot(current_state%local_grid%size(z_index)) &
177  , wwww_tot(current_state%local_grid%size(z_index)) &
178  , www_tot(current_state%local_grid%size(z_index)) )
179 
180  if (allocated(current_state%global_grid%configuration%vertical%olubar)) then
181  allocate(uprime_tot(current_state%local_grid%size(z_index)), &
182  uprime(current_state%local_grid%size(z_index)))
183  end if
184 
185  if (allocated(current_state%global_grid%configuration%vertical%olvbar)) then
186  allocate(vprime_tot(current_state%local_grid%size(z_index)), &
187  vprime(current_state%local_grid%size(z_index)))
188  end if
189 
190  if (allocated(vprime) .and. allocated(uprime)) then
191  allocate(wke_tot(current_state%local_grid%size(z_index)))
192  endif
193 
194  if (current_state%th%active) then
195  allocate(theta_tot(current_state%local_grid%size(z_index)) &
196  , thref(current_state%local_grid%size(z_index)) &
197  , thinit(current_state%local_grid%size(z_index)) &
198  , wtheta_ad_tot(current_state%local_grid%size(z_index)) &
199  , wtheta_cn_tot(current_state%local_grid%size(z_index)) &
200  , th2_tot(current_state%local_grid%size(z_index)) )
201  endif
202 
203  ! determine advection scheme used for mom and scalars
204  advect_flow = options_get_string(current_state%options_database, "advection_flow_fields")
205  advect_theta = options_get_string(current_state%options_database, "advection_theta_field")
206  advect_q = options_get_string(current_state%options_database, "advection_q_fields")
207 
208  if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0) then
209  iqv=get_q_index(standard_q_names%VAPOUR, 'profile_diags')
210  iql=get_q_index(standard_q_names%CLOUD_LIQUID_MASS, 'profile_diags')
211  qlcrit=options_get_real(current_state%options_database, "qlcrit")
212  qicrit=options_get_real(current_state%options_database, "qicrit")
213 
214  allocate(qv_tot(current_state%local_grid%size(z_index)) &
215  , ql_tot(current_state%local_grid%size(z_index)), &
216  q_temp(current_state%local_grid%size(z_index)), &
217  wqv_cn_tot(current_state%local_grid%size(z_index)), &
218  wqv_ad_tot(current_state%local_grid%size(z_index)), &
219  wql_cn_tot(current_state%local_grid%size(z_index)), &
220  wql_ad_tot(current_state%local_grid%size(z_index)))
221  if (current_state%th%active) &
222  allocate(rh_tot(current_state%local_grid%size(z_index)))
223 
224  ! allocate other hydrometeors. Allocation dependent on index being set in
225  ! appropriate microphysics scheme (see casim component from example)
226  if (current_state%rain_water_mixing_ratio_index > 0) then
227  iqr = current_state%rain_water_mixing_ratio_index
228  allocate(qr_tot(current_state%local_grid%size(z_index)))
229  allocate(wqr_cn_tot(current_state%local_grid%size(z_index)))
230  allocate(wqr_ad_tot(current_state%local_grid%size(z_index)))
231  endif
232  if (current_state%ice_water_mixing_ratio_index > 0) then
233  iqi = current_state%ice_water_mixing_ratio_index
234  allocate(qi_tot(current_state%local_grid%size(z_index)))
235  allocate(wqi_cn_tot(current_state%local_grid%size(z_index)))
236  allocate(wqi_ad_tot(current_state%local_grid%size(z_index)))
237  endif
238  if (current_state%snow_water_mixing_ratio_index > 0) then
239  iqs = current_state%snow_water_mixing_ratio_index
240  allocate(qs_tot(current_state%local_grid%size(z_index)))
241  allocate(wqs_cn_tot(current_state%local_grid%size(z_index)))
242  allocate(wqs_ad_tot(current_state%local_grid%size(z_index)))
243  endif
244  if (current_state%graupel_water_mixing_ratio_index > 0) then
245  iqg = current_state%graupel_water_mixing_ratio_index
246  allocate(qg_tot(current_state%local_grid%size(z_index)))
247  allocate(wqg_cn_tot(current_state%local_grid%size(z_index)))
248  allocate(wqg_ad_tot(current_state%local_grid%size(z_index)))
249  endif
250 
251  ! arrange and allocate cloud fraction diagnostics...3d mask is optional
253  options_get_string(current_state%options_database, "cloud_mask_method")
254  if (.not. (trim(cloud_mask_method) == "DEFAULT" .or. &
255  trim(cloud_mask_method) == "SOCRATES" ) ) then
256  call log_master_log(log_error, &
257  "Requested cloud_mask_method is invalid. Check profile_diagnostics.F90")
258  end if ! cloud_mask_method validity check
259  if (options_get_logical(current_state%options_database, "l_cloud_mask")) &
260  allocate(cloud_mask(current_state%local_grid%size(z_index), &
261  current_state%local_grid%size(y_index), &
262  current_state%local_grid%size(x_index)))
263  allocate(cloud_mask_tot(current_state%local_grid%size(z_index)))
264  allocate(cloud_liq_mask_tot(current_state%local_grid%size(z_index)))
265  allocate(cloud_ice_mask_tot(current_state%local_grid%size(z_index)))
267  options_get_logical(current_state%options_database, "l_partial_liq_ice")
268  endif
269 
270  call allocate_tvd_diagnostic_terms(current_state, tvd_dgs_terms)
271 
272  end subroutine initialisation_callback
273 
274  subroutine timestep_callback(current_state)
275  type(model_state_type), target, intent(inout) :: current_state
276 
277  integer :: k, i, iq_tmp, km1, kp1, icol, jcol
278  real(kind=default_precision) :: cltop_col, clbas_col, qv, qc, tdegk, pmb &
279  , qs, exner
280  real(kind=default_precision) :: uprime_w_local, vprime_w_local &
281  , thprime_w_local, qprime_w_local
282 
283 
284  icol=current_state%column_local_x
285  jcol=current_state%column_local_y
286 
287  if (current_state%first_timestep_column) then
288  u_wind_tot(:) = 0.0_default_precision
289  if (allocated(uprime_tot)) uprime_tot(:) = 0.0_default_precision
290  if (allocated(uprime)) uprime(:) = 0.0_default_precision
291  v_wind_tot(:) = 0.0_default_precision
292  if (allocated(vprime_tot)) vprime_tot(:) = 0.0_default_precision
293  if (allocated(vprime)) vprime(:) = 0.0_default_precision
294  if (allocated(wke_tot)) wke_tot(:) = 0.0_default_precision
295 
296  w_wind_tot(:) = 0.0_default_precision
297  ww_tot(:) = 0.0_default_precision
298  wwww_tot(:) = 0.0_default_precision
299  www_tot(:) = 0.0_default_precision
300  uw_tot(:) = 0.0_default_precision
301  vw_tot(:) = 0.0_default_precision
302  uv_tot(:) = 0.0_default_precision
303 
304  if (current_state%th%active) then
305  wtheta_ad_tot(:) = 0.0_default_precision
306  wtheta_cn_tot(:) = 0.0_default_precision
307  th2_tot(:) = 0.0_default_precision
308  theta_tot(:)=0.0_default_precision
309  endif
310  if (.not. current_state%passive_q .and. &
311  current_state%number_q_fields .gt. 0) then
312  q_temp(:)=0.0_default_precision
313  qv_tot(:)=0.0_default_precision
314  ql_tot(:)=0.0_default_precision
315  wqv_cn_tot(:)=0.0_default_precision
316  wqv_ad_tot(:)=0.0_default_precision
317  wql_cn_tot(:)=0.0_default_precision
318  wql_ad_tot(:)=0.0_default_precision
319  if (current_state%th%active) &
320  rh_tot(:) = 0.0_default_precision
321  if (iqr > 0) then
322  qr_tot(:) = 0.0_default_precision
323  wqr_cn_tot(:) = 0.0_default_precision
324  wqr_ad_tot(:) = 0.0_default_precision
325  endif
326  if (iqi > 0) then
327  qi_tot(:) = 0.0_default_precision
328  wqi_cn_tot(:) = 0.0_default_precision
329  wqi_ad_tot(:) = 0.0_default_precision
330  endif
331  if (iqs > 0) then
332  qs_tot(:) = 0.0_default_precision
333  wqs_cn_tot(:) = 0.0_default_precision
334  wqs_ad_tot(:) = 0.0_default_precision
335  endif
336  if (iqg > 0) then
337  qg_tot(:) = 0.0_default_precision
338  wqg_cn_tot(:) = 0.0_default_precision
339  wqg_ad_tot(:) = 0.0_default_precision
340  endif
341 
342  if (allocated(cloud_mask)) cloud_mask(:,:,:) = 0.0_default_precision
343  cloud_mask_tot(:) = 0.0_default_precision
344  cloud_liq_mask_tot(:) = 0.0_default_precision
345  cloud_ice_mask_tot(:) = 0.0_default_precision
346  endif
347  end if
348  !
349 
350  if (.not. current_state%halo_column) then
351  ! work out the sum of u and v wind over local domain
352  do k=1, current_state%local_grid%size(z_index)
353  u_wind_tot(k) = u_wind_tot(k) + &
354  (current_state%u%data(k,jcol,icol) &
355  + current_state%ugal)
356  if (allocated(uprime_tot)) then
357  uprime(k) = &
358  (current_state%u%data(k, jcol, icol) &
359  - (current_state%global_grid%configuration%vertical%olubar(k) - current_state%ugal))
360  !uprime(k) = &
361  ! ((current_state%u%data(k,jcol,icol) &
362  ! - (current_state%global_grid%configuration%vertical%olubar(k) - current_state%ugal)))
363  uprime_tot(k) = uprime_tot(k) + uprime(k)**2.0_default_precision
364  end if
365  v_wind_tot(k) = v_wind_tot(k) + &
366  (current_state%v%data(k,jcol,icol) &
367  + current_state%vgal)
368  if (allocated(vprime_tot)) then
369  vprime(k) = &
370  (current_state%v%data(k, jcol, icol) &
371  - (current_state%global_grid%configuration%vertical%olvbar(k) - current_state%vgal))
372  !vprime(k) = &
373  ! ((current_state%v%data(k,jcol,icol) &
374  ! - (current_state%global_grid%configuration%vertical%olvbar(k) - current_state%vgal)))
375  vprime_tot(k) = vprime_tot(k) + vprime(k)**2.0_default_precision
376  end if
377  enddo
378  ! Note: If TVD advection used, a conversion for the grid (from the LEM (RESDGS.653,654))
379  ! is used but it is unclear whether that is correct. Also, it is worth noting that
380  ! www and wwww have no offset relating to the advection scheme - AH 21/09/2017
381  if (trim(advect_flow) .eq. "pw") then
382  ww_tot(:) = ww_tot(:) + &
383  (current_state%w%data(:,jcol,icol)**2.)
384  else if (trim(advect_flow) .eq. "tvd") then
385  do k=2, current_state%local_grid%size(z_index)
386  ww_tot(k) = ww_tot(k) + 0.5 * &
387  ((current_state%w%data(k-1,jcol,icol) + current_state%w%data(k,jcol,icol)) * &
388  tvd_dgs_terms%adv_w_dgs(k,jcol,icol))
389  enddo
390  endif
391 
392  do k=2, current_state%local_grid%size(z_index)
393  www_tot(k) = www_tot(k) + &
394  (current_state%w%data(k,jcol,icol)**3.)
395  wwww_tot(k) = wwww_tot(k) + &
396  (current_state%w%data(k,jcol,icol)**4.)
397  w_wind_tot(k) = w_wind_tot(k) + &
398  (current_state%w%data(k,jcol,icol))
399  enddo
400 
401 ! <u'w'> and <v'w'> are on w-points, so we interpolate u and v both horizontally and vertically.
402 ! NOTE: all "prime_w" values are the prognostic interpolated on to the w levels
403  if (trim(advect_flow) .eq. "pw") then
404  do k=1, current_state%local_grid%size(z_index)-1
405  uprime_w_local = &
406  0.25 * ( current_state%u%data(k,jcol,icol) + &
407  current_state%u%data(k,jcol,icol-1) + &
408  current_state%u%data(k+1,jcol,icol) + &
409  current_state%u%data(k+1,jcol,icol-1) ) + &
410  current_state%ugal
411  if (allocated(current_state%global_grid%configuration%vertical%olubar)) &
412  uprime_w_local = uprime_w_local - &
413  0.5 * ( current_state%global_grid%configuration%vertical%olubar(k) + &
414  current_state%global_grid%configuration%vertical%olubar(k+1) )
415  uw_tot(k) = uw_tot(k) + uprime_w_local * &
416  current_state%w%data(k,jcol,icol)
417  enddo
418  else if (trim(advect_flow) .eq. "tvd") then
419  do k=2, current_state%local_grid%size(z_index)-1
420  uw_tot(k) = uw_tot(k) + 0.5 * ( &
421  (current_state%w%data(k,jcol,icol) + current_state%w%data(k,jcol,icol+1)) * &
422  tvd_dgs_terms%adv_u_dgs(k+1,jcol,icol))
423  enddo
424  endif
425 
426  if (trim(advect_flow) .eq. "pw") then
427  do k=1, current_state%local_grid%size(z_index)-1
428  vprime_w_local = &
429  0.25 * ( current_state%v%data(k,jcol,icol) + &
430  current_state%v%data(k,jcol-1,icol) + &
431  current_state%v%data(k+1,jcol,icol) + &
432  current_state%v%data(k+1,jcol-1,icol) ) + &
433  current_state%vgal
434  if (allocated(current_state%global_grid%configuration%vertical%olvbar)) &
435  vprime_w_local = vprime_w_local - &
436  0.5 * ( current_state%global_grid%configuration%vertical%olvbar(k) + &
437  current_state%global_grid%configuration%vertical%olvbar(k+1) )
438  vw_tot(k) = vw_tot(k) + vprime_w_local * &
439  current_state%w%data(k,jcol,icol)
440  enddo
441  else if (trim(advect_flow) .eq. "tvd") then
442  do k=2, current_state%local_grid%size(z_index)-1
443  vw_tot(k) = vw_tot(k) + 0.5 * ( &
444  (current_state%w%data(k,jcol,icol) + current_state%w%data(k,jcol+1,icol)) * &
445  tvd_dgs_terms%adv_v_dgs(k+1,jcol,icol))
446  enddo
447  endif
448 
449  if (allocated(current_state%global_grid%configuration%vertical%olvbar) .and. &
450  allocated(current_state%global_grid%configuration%vertical%olubar)) then
451  ! LEM equivalent code RESDGS.784, 785, comment from LEM
452  ! No attempt has been made to provide a calculation of this term which
453  ! is consistent with TVD advection
454  do k=1, current_state%local_grid%size(z_index)-1
455  uv_tot(k) = uv_tot(k) + 0.25 * uprime(k) * (vprime(k) &
456  + (current_state%v%data(k,jcol,icol+1)) &
457  ! v primed term (not squared) at y - 1 , do whole calc for vprime at y-1
458  + (current_state%v%data(k,jcol-1,icol) &
459  - (current_state%global_grid%configuration%vertical%olvbar(k) - current_state%vgal)) &
460  + (current_state%v%data(k,jcol-1,icol+1)))
461  enddo
462  endif
463 
464  if (allocated(wke_tot)) then
465  do k=1, current_state%local_grid%size(z_index)
466  kp1=min(k+1,current_state%local_grid%size(z_index))
467  km1=max(k-1,1)
468  wke_tot(k) = wke_tot(k) + 0.25_default_precision * ( &
469  current_state%global_grid%configuration%vertical%rho(k) * &
470  ( (current_state%v%data(k,jcol,icol) &
471  + current_state%v%data(k,jcol,icol+1)) &
472  * uprime(k)*uprime(kp1) &
473  + (current_state%v%data(k,jcol,icol) &
474  + current_state%v%data(k,jcol+1,icol)) &
475  * vprime(k) * vprime(kp1) ) &
476  + 0.5_default_precision * ( &
477  (current_state%w%data(k,jcol,icol) &
478  + current_state%w%data(kp1,jcol,icol)) &
479  * current_state%w%data(k,jcol,icol) &
480  * current_state%w%data(kp1,jcol,icol) &
481  * current_state%global_grid%configuration%vertical%rhon(kp1) &
482  +(current_state%w%data(k,jcol,icol) &
483  + current_state%w%data(km1,jcol,icol)) &
484  * current_state%w%data(k,jcol,icol) &
485  * current_state%w%data(km1,jcol,icol) &
486  * current_state%global_grid%configuration%vertical%rhon(k) ) &
487  )
488  enddo
489  endif
490 
491  if (current_state%th%active) then
492  do k=1, current_state%local_grid%size(z_index)
493  theta_tot(k) = theta_tot(k) + &
494  (current_state%th%data(k,jcol,icol) &
495  + current_state%global_grid%configuration%vertical%thref(k))
496  th2_tot(k) = th2_tot(k) + &
497  (current_state%th%data(k,jcol,icol) - &
498  current_state%global_grid%configuration%vertical%olthbar(k) )**2
499  enddo
500  ! <w'theta'> is on w-levels, so theta is interpolated to w-levels.
501  ! Set wtheta_ad_tot to the actual model TH flux.
502 ! Set wtheta_cn_tot slot to flux seen by w times the w-momentum equation.
503  ! This is the flux relevant for the tke balance.
504  ! The two are equal if the centred scheme is used but differ if TVD advection is used on scalars).
505  if (trim(advect_theta) .eq. "pw") then
506  do k=1, current_state%local_grid%size(z_index)-1
507  thprime_w_local = 0.5 * ( &
508  current_state%th%data(k,jcol,icol) + &
509  current_state%th%data(k+1,jcol,icol) )
510  wtheta_ad_tot(k) = wtheta_ad_tot(k) + &
511  (current_state%w%data(k,jcol,icol) * &
512  thprime_w_local)
514  enddo
515  else if (trim(advect_theta) .eq. "tvd") then
516  do k=2, current_state%local_grid%size(z_index)-1
517  thprime_w_local = 0.5 * ( &
518  current_state%th%data(k,jcol,icol) + &
519  current_state%th%data(k+1,jcol,icol) )
520  wtheta_cn_tot(k) = wtheta_cn_tot(k) + &
521  current_state%w%data(k,jcol,icol) * &
522  thprime_w_local
523  wtheta_ad_tot(k) = wtheta_ad_tot(k) + &
524  current_state%w%data(k,jcol,icol) * &
525  tvd_dgs_terms%adv_th_dgs(k+1,jcol,icol)
526  enddo
527  endif
528  endif
529 
530  if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0) then
531  qv_tot(:) = qv_tot(:) + (current_state%q(iqv)%data(:,jcol,icol))
532  ql_tot(:) = ql_tot(:) + (current_state%q(iql)%data(:,jcol,icol))
533  if (current_state%th%active) then
534  ! temporary code for RH calculation
535  do k=1, current_state%local_grid%size(z_index)
536  exner = current_state%global_grid%configuration%vertical%rprefrcp(k)
537  pmb = (current_state%global_grid%configuration%vertical%prefn(k)/100.)
538  qv = current_state%q(iqv)%data(k, jcol,icol)
539  qc = current_state%q(iql)%data(k, jcol,icol)
540  tdegk = (current_state%th%data(k,jcol,icol) &
541  + current_state%global_grid%configuration%vertical%thref(k))*exner
542  qs = qsaturation(tdegk, pmb)
543  rh_tot(k) = rh_tot(k) + (qv/qs)
544  enddo
545  endif
546  ! hydrometeor mass profiles
547  if (iqr > 0) &
548  qr_tot(:) = qr_tot(:) + (current_state%q(iqr)%data(:,jcol,icol))
549  if (iqi > 0) &
550  qi_tot(:) = qi_tot(:) + (current_state%q(iqi)%data(:,jcol,icol))
551  if (iqs > 0) &
552  qs_tot(:) = qs_tot(:) + (current_state%q(iqs)%data(:,jcol,icol))
553  if (iqg > 0) &
554  qg_tot(:) = qg_tot(:) + (current_state%q(iqg)%data(:,jcol,icol))
555  !
556  ! moisture field fluxes
557  ! vapour
558  call calculate_wq(current_state, jcol, icol, iqv, wqv_cn_tot, wqv_ad_tot, advect_q)
559  ! cloud liquid
560  call calculate_wq(current_state, jcol, icol, iql , wql_cn_tot, wql_ad_tot, advect_q)
561  ! rain mass
562  if (iqr > 0) &
563  call calculate_wq(current_state, jcol, icol, iqr, wqr_cn_tot, wqr_ad_tot, advect_q)
564  ! ice mass
565  if (iqi > 0) &
566  call calculate_wq(current_state, jcol, icol, iqi, wqi_cn_tot, wqi_ad_tot, advect_q)
567  ! snow mass
568  if (iqs > 0) &
569  call calculate_wq(current_state, jcol, icol, iqs, wqs_cn_tot, wqs_ad_tot, advect_q)
570  ! graupel mass
571  if (iqg > 0) &
572  call calculate_wq(current_state, jcol, icol, iqg, wqg_cn_tot, wqg_ad_tot, advect_q)
573 
574  ! cloud mask / cloud fraction
575  call calculate_cloud_mask(current_state, jcol, icol)
576  endif ! end q_passive and number q field test
577  endif
578  end subroutine timestep_callback
579 
580 ! !> Frees up the memory associated with the advection
581 ! !! @param current_state The current model state
582 ! subroutine finalisation_callback(current_state)
583 ! type(model_state_type), target, intent(inout) :: current_state
584 !
585 ! call deallocate_tvd_diagnostic_terms(current_state, tvd_dgs_terms)
586 !
587 ! end subroutine finalisation_callback
588 
593  subroutine field_information_retrieval_callback(current_state, name, field_information)
594  type(model_state_type), target, intent(inout) :: current_state
595  character(len=*), intent(in) :: name
596  type(component_field_information_type), intent(out) :: field_information
597 
598  field_information%field_type=component_array_field_type
599  field_information%number_dimensions=1
600  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
601  field_information%data_type=component_double_data_type
602  if (name .eq. "theta_total_local") then
603  field_information%enabled=current_state%th%active
604  else if (name .eq. "vapour_mmr_total_local" .or. name .eq. "liquid_mmr_total_local" &
605  .or. name .eq. "wqv_ad_total_local" .or. name .eq. "wqv_cn_total_local" &
606  .or. name .eq. "wql_ad_total_local" .or. name .eq. "wql_cn_total_local" ) then
607  field_information%enabled=.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0
608  else if (name .eq. "rain_mmr_total_local" .or. name .eq. "wqr_ad_total_local" &
609  .or. name .eq. "wqr_cn_total_local" ) then
610  field_information%enabled= current_state%rain_water_mixing_ratio_index .gt. 0
611  else if (name .eq. "ice_mmr_total_local" .or. name .eq. "wqi_ad_total_local" &
612  .or. name .eq. "wqi_cn_total_local" ) then
613  field_information%enabled= current_state%ice_water_mixing_ratio_index .gt. 0
614  else if (name .eq. "snow_mmr_total_local" .or. name .eq. "wqs_ad_total_local" &
615  .or. name .eq. "wqs_cn_total_local" ) then
616  field_information%enabled= current_state%snow_water_mixing_ratio_index .gt. 0
617  else if (name .eq. "graupel_mmr_total_local" .or. name .eq. "wqg_ad_total_local" &
618  .or. name .eq. "wqg_cn_total_local" ) then
619  field_information%enabled= current_state%graupel_water_mixing_ratio_index .gt. 0
620  else if (name .eq. "rh_total_local") then
621  field_information%enabled=current_state%th%active .and. .not. current_state%passive_q .and. &
622  current_state%number_q_fields .gt. 0
623  else if (name .eq. "uu_total_local") then
624  field_information%enabled=allocated(uprime_tot)
625  else if (name .eq. "vv_total_local") then
626  field_information%enabled=allocated(vprime_tot)
627  else if (name .eq. "wtheta_ad_total_local" .or. name .eq. "wtheta_cn_total_local") then
628  field_information%enabled=current_state%th%active
629  else if (name .eq. "th2_total_local") then
630  field_information%enabled=current_state%th%active
631 ! ========================================================================
632 ! 2nd stream
633  else if (name .eq. "i_theta_total_local") then
634  field_information%enabled=current_state%th%active
635  else if (name .eq. "i_vapour_mmr_total_local" .or. name .eq. "i_liquid_mmr_total_local") then
636  field_information%enabled=.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0
637  else if (name .eq. "i_rain_mmr_total_local" ) then
638  field_information%enabled= current_state%rain_water_mixing_ratio_index .gt. 0
639  else if (name .eq. "i_ice_mmr_total_local" ) then
640  field_information%enabled= current_state%ice_water_mixing_ratio_index .gt. 0
641  else if (name .eq. "i_snow_mmr_total_local" ) then
642  field_information%enabled= current_state%snow_water_mixing_ratio_index .gt. 0
643  else if (name .eq. "i_graupel_mmr_total_local" ) then
644  field_information%enabled= current_state%graupel_water_mixing_ratio_index .gt. 0
645  else if (name .eq. "i_rh_total_local") then
646  field_information%enabled=current_state%th%active .and. .not. current_state%passive_q .and. &
647  current_state%number_q_fields .gt. 0
648  else if (name .eq. "i_uu_total_local") then
649  field_information%enabled=allocated(uprime_tot)
650  else if (name .eq. "i_vv_total_local") then
651  field_information%enabled=allocated(vprime_tot)
652  else if (name .eq. "i_wtheta_cn_total_local") then
653  field_information%enabled=current_state%th%active
654  else if (name .eq. "i_th2_total_local") then
655  field_information%enabled=current_state%th%active
656 ! ========================================================================
657  else if (name .eq. "cloud_mask") then
658  field_information%number_dimensions=3
659  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
660  field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
661  field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
662  field_information%enabled=allocated(cloud_mask)
663  else if (name .eq. "cloud_mask_total_local") then
664  field_information%enabled=allocated(cloud_mask_tot)
665  else if (name .eq. "cloud_liq_mask_total_local") then
666  field_information%enabled=allocated(cloud_liq_mask_tot)
667  else if (name .eq. "cloud_ice_mask_total_local") then
668  field_information%enabled=allocated(cloud_ice_mask_tot)
669 ! ========================================================================
670  else
671  field_information%enabled=.true.
672  end if
674 
679  subroutine field_value_retrieval_callback(current_state, name, field_value)
680  type(model_state_type), target, intent(inout) :: current_state
681  character(len=*), intent(in) :: name
682  type(component_field_value_type), intent(out) :: field_value
683 
684  integer :: k
685 
686  if (name .eq. "prefn_local") then
687  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
688  do k = 1, current_state%local_grid%size(z_index)
689  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%prefn(k)
690  enddo
691  else if (name .eq. "rho_local") then
692  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
693  do k = 1, current_state%local_grid%size(z_index)
694  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%rho(k)
695  enddo
696  else if (name .eq. "rhon_local") then
697  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
698  do k = 1, current_state%local_grid%size(z_index)
699  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%rhon(k)
700  enddo
701  else if (name .eq. "thref_local") then
702  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
703  do k = 1, current_state%local_grid%size(z_index)
704  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%thref(k)
705  enddo
706  else if (name .eq. "thinit_local") then
707  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
708  do k = 1, current_state%local_grid%size(z_index)
709  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%theta_init(k)
710  enddo
711  elseif (name .eq. "u_wind_total_local") then
712  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
713  do k = 1, current_state%local_grid%size(z_index)
714  field_value%real_1d_array(k)=u_wind_tot(k)
715  enddo
716  else if (name .eq. "uu_total_local") then
717  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
718  do k = 1, current_state%local_grid%size(z_index)
719  field_value%real_1d_array(k)=uprime_tot(k)
720  enddo
721  else if (name .eq. "v_wind_total_local") then
722  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
723  do k = 1, current_state%local_grid%size(z_index)
724  field_value%real_1d_array(k)=v_wind_tot(k)
725  enddo
726  else if (name .eq. "vv_total_local") then
727  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
728  do k = 1, current_state%local_grid%size(z_index)
729  field_value%real_1d_array(k)=vprime_tot(k)
730  enddo
731  else if (name .eq. "ww_total_local") then
732  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
733  do k = 1, current_state%local_grid%size(z_index)
734  field_value%real_1d_array(k)=ww_tot(k)
735  enddo
736  else if (name .eq. "www_total_local") then
737  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
738  do k = 1, current_state%local_grid%size(z_index)
739  field_value%real_1d_array(k)=www_tot(k)
740  enddo
741  else if (name .eq. "wwww_total_local") then
742  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
743  do k = 1, current_state%local_grid%size(z_index)
744  field_value%real_1d_array(k)=wwww_tot(k)
745  enddo
746  else if (name .eq. "theta_total_local") then
747  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
748  do k = 1, current_state%local_grid%size(z_index)
749  field_value%real_1d_array(k)=theta_tot(k)
750  enddo
751  else if (name .eq. "vapour_mmr_total_local") then
752  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
753  do k = 1, current_state%local_grid%size(z_index)
754  field_value%real_1d_array(k)=qv_tot(k)
755  enddo
756  else if (name .eq. "liquid_mmr_total_local") then
757  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
758  do k = 1, current_state%local_grid%size(z_index)
759  field_value%real_1d_array(k)=ql_tot(k)
760  enddo
761  else if (name .eq. "rain_mmr_total_local" ) then
762  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
763  do k = 1, current_state%local_grid%size(z_index)
764  field_value%real_1d_array(k)=qr_tot(k)
765  enddo
766  else if (name .eq. "ice_mmr_total_local" ) then
767  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
768  do k = 1, current_state%local_grid%size(z_index)
769  field_value%real_1d_array(k)=qi_tot(k)
770  enddo
771  else if (name .eq. "snow_mmr_total_local" ) then
772  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
773  do k = 1, current_state%local_grid%size(z_index)
774  field_value%real_1d_array(k)=qs_tot(k)
775  enddo
776  else if (name .eq. "graupel_mmr_total_local" ) then
777  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
778  do k = 1, current_state%local_grid%size(z_index)
779  field_value%real_1d_array(k)=qg_tot(k)
780  enddo
781  else if (name .eq. "w_wind_total_local") then
782  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
783  do k = 1, current_state%local_grid%size(z_index)
784  field_value%real_1d_array(k)=w_wind_tot(k)
785  enddo
786  else if (name .eq. "rh_total_local") then
787  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
788  do k = 1, current_state%local_grid%size(z_index)
789  field_value%real_1d_array(k)=rh_tot(k)
790  enddo
791  else if (name .eq. "wtheta_cn_total_local") then
792  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
793  do k = 1, current_state%local_grid%size(z_index)
794  field_value%real_1d_array(k)=wtheta_cn_tot(k)
795  enddo
796  else if (name .eq. "wtheta_ad_total_local") then
797  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
798  do k = 1, current_state%local_grid%size(z_index)
799  field_value%real_1d_array(k)=wtheta_ad_tot(k)
800  enddo
801  else if (name .eq. "uw_total_local") then
802  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
803  do k = 1, current_state%local_grid%size(z_index)
804  field_value%real_1d_array(k)=uw_tot(k)
805  enddo
806  else if (name .eq. "vw_total_local") then
807  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
808  do k = 1, current_state%local_grid%size(z_index)
809  field_value%real_1d_array(k)=vw_tot(k)
810  enddo
811  else if (name .eq. "uv_total_local") then
812  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
813  do k = 1, current_state%local_grid%size(z_index)
814  field_value%real_1d_array(k)=uv_tot(k)
815  enddo
816  else if (name .eq. "wke_total_local") then
817  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
818  do k = 1, current_state%local_grid%size(z_index)
819  field_value%real_1d_array(k)=wke_tot(k)
820  enddo
821  else if (name .eq. "th2_total_local") then
822  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
823  do k = 1, current_state%local_grid%size(z_index)
824  field_value%real_1d_array(k)=th2_tot(k)
825  enddo
826  else if (name .eq. "wqv_cn_total_local") then
827  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
828  do k = 1, current_state%local_grid%size(z_index)
829  field_value%real_1d_array(k)=wqv_cn_tot(k)
830  enddo
831  else if (name .eq. "wqv_ad_total_local") then
832  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
833  do k = 1, current_state%local_grid%size(z_index)
834  field_value%real_1d_array(k)=wqv_ad_tot(k)
835  enddo
836  else if (name .eq. "wql_cn_total_local") then
837  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
838  do k = 1, current_state%local_grid%size(z_index)
839  field_value%real_1d_array(k)=wql_cn_tot(k)
840  enddo
841  else if (name .eq. "wql_ad_total_local") then
842  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
843  do k = 1, current_state%local_grid%size(z_index)
844  field_value%real_1d_array(k)=wql_ad_tot(k)
845  enddo
846  else if (name .eq. "wqr_cn_total_local") then
847  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
848  do k = 1, current_state%local_grid%size(z_index)
849  field_value%real_1d_array(k)=wqr_cn_tot(k)
850  enddo
851  else if (name .eq. "wqr_ad_total_local") then
852  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
853  do k = 1, current_state%local_grid%size(z_index)
854  field_value%real_1d_array(k)=wqr_ad_tot(k)
855  enddo
856  else if (name .eq. "wqi_cn_total_local") then
857  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
858  do k = 1, current_state%local_grid%size(z_index)
859  field_value%real_1d_array(k)=wqi_cn_tot(k)
860  enddo
861  else if (name .eq. "wqi_ad_total_local") then
862  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
863  do k = 1, current_state%local_grid%size(z_index)
864  field_value%real_1d_array(k)=wqi_ad_tot(k)
865  enddo
866  else if (name .eq. "wqs_cn_total_local") then
867  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
868  do k = 1, current_state%local_grid%size(z_index)
869  field_value%real_1d_array(k)=wqs_cn_tot(k)
870  enddo
871  else if (name .eq. "wqs_ad_total_local") then
872  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
873  do k = 1, current_state%local_grid%size(z_index)
874  field_value%real_1d_array(k)=wqs_ad_tot(k)
875  enddo
876  else if (name .eq. "wqg_cn_total_local") then
877  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
878  do k = 1, current_state%local_grid%size(z_index)
879  field_value%real_1d_array(k)=wqg_cn_tot(k)
880  enddo
881  else if (name .eq. "wqg_ad_total_local") then
882  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
883  do k = 1, current_state%local_grid%size(z_index)
884  field_value%real_1d_array(k)=wqg_ad_tot(k)
885  enddo
886 ! =====================================================
887 ! 2nd stream
888  else if (name .eq. "i_prefn_local") then
889  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
890  do k = 1, current_state%local_grid%size(z_index)
891  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%prefn(k)
892  enddo
893  else if (name .eq. "i_rho_local") then
894  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
895  do k = 1, current_state%local_grid%size(z_index)
896  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%rho(k)
897  enddo
898  else if (name .eq. "i_rhon_local") then
899  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
900  do k = 1, current_state%local_grid%size(z_index)
901  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%rhon(k)
902  enddo
903  else if (name .eq. "i_thref_local") then
904  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
905  do k = 1, current_state%local_grid%size(z_index)
906  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%thref(k)
907  enddo
908  else if (name .eq. "i_thinit_local") then
909  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
910  do k = 1, current_state%local_grid%size(z_index)
911  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%theta_init(k)
912  enddo
913  else if (name .eq. "i_uinit_local") then
914  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
915  do k = 1, current_state%local_grid%size(z_index)
916  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%u_init(k)
917  enddo
918  else if (name .eq. "i_vinit_local") then
919  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
920  do k = 1, current_state%local_grid%size(z_index)
921  field_value%real_1d_array(k)=current_state%global_grid%configuration%vertical%v_init(k)
922  enddo
923  elseif (name .eq. "i_u_wind_total_local") then
924  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
925  do k = 1, current_state%local_grid%size(z_index)
926  field_value%real_1d_array(k)=u_wind_tot(k)
927  enddo
928  else if (name .eq. "i_uu_total_local") then
929  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
930  do k = 1, current_state%local_grid%size(z_index)
931  field_value%real_1d_array(k)=uprime_tot(k)
932  enddo
933  else if (name .eq. "i_v_wind_total_local") then
934  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
935  do k = 1, current_state%local_grid%size(z_index)
936  field_value%real_1d_array(k)=v_wind_tot(k)
937  enddo
938  else if (name .eq. "i_vv_total_local") then
939  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
940  do k = 1, current_state%local_grid%size(z_index)
941  field_value%real_1d_array(k)=vprime_tot(k)
942  enddo
943  else if (name .eq. "i_ww_total_local") then
944  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
945  do k = 1, current_state%local_grid%size(z_index)
946  field_value%real_1d_array(k)=ww_tot(k)
947  enddo
948  else if (name .eq. "i_theta_total_local") then
949  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
950  do k = 1, current_state%local_grid%size(z_index)
951  field_value%real_1d_array(k)=theta_tot(k)
952  enddo
953  else if (name .eq. "i_vapour_mmr_total_local") then
954  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
955  do k = 1, current_state%local_grid%size(z_index)
956  field_value%real_1d_array(k)=qv_tot(k)
957  enddo
958  else if (name .eq. "i_liquid_mmr_total_local") then
959  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
960  do k = 1, current_state%local_grid%size(z_index)
961  field_value%real_1d_array(k)=ql_tot(k)
962  enddo
963  else if (name .eq. "rain_mmr_total_local" ) then
964  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
965  do k = 1, current_state%local_grid%size(z_index)
966  field_value%real_1d_array(k)=qr_tot(k)
967  enddo
968  else if (name .eq. "ice_mmr_total_local" ) then
969  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
970  do k = 1, current_state%local_grid%size(z_index)
971  field_value%real_1d_array(k)=qi_tot(k)
972  enddo
973  else if (name .eq. "snow_mmr_total_local" ) then
974  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
975  do k = 1, current_state%local_grid%size(z_index)
976  field_value%real_1d_array(k)=qs_tot(k)
977  enddo
978  else if (name .eq. "graupel_mmr_total_local" ) then
979  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
980  do k = 1, current_state%local_grid%size(z_index)
981  field_value%real_1d_array(k)=qg_tot(k)
982  enddo
983  else if (name .eq. "i_w_wind_total_local") then
984  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
985  do k = 1, current_state%local_grid%size(z_index)
986  field_value%real_1d_array(k)=w_wind_tot(k)
987  enddo
988  else if (name .eq. "i_rh_total_local") then
989  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
990  do k = 1, current_state%local_grid%size(z_index)
991  field_value%real_1d_array(k)=rh_tot(k)
992  enddo
993  else if (name .eq. "i_wtheta_ad_total_local") then
994  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
995  do k = 1, current_state%local_grid%size(z_index)
996  field_value%real_1d_array(k)=wtheta_ad_tot(k)
997  enddo
998  else if (name .eq. "i_uw_total_local") then
999  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1000  do k = 1, current_state%local_grid%size(z_index)
1001  field_value%real_1d_array(k)=uw_tot(k)
1002  enddo
1003  else if (name .eq. "i_vw_total_local") then
1004  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1005  do k = 1, current_state%local_grid%size(z_index)
1006  field_value%real_1d_array(k)=vw_tot(k)
1007  enddo
1008  else if (name .eq. "i_th2_total_local") then
1009  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1010  do k = 1, current_state%local_grid%size(z_index)
1011  field_value%real_1d_array(k)=th2_tot(k)
1012  enddo
1013 ! =====================================================
1014  else if (name .eq. "cloud_mask") then
1015  allocate(field_value%real_3d_array( &
1016  size(cloud_mask, 1), size(cloud_mask, 2), size(cloud_mask, 3)),&
1017  source=cloud_mask)
1018  else if (name .eq. "cloud_mask_total_local") then
1019  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1020  do k = 1, current_state%local_grid%size(z_index)
1021  field_value%real_1d_array(k)=cloud_mask_tot(k)
1022  enddo
1023  else if (name .eq. "cloud_liq_mask_total_local") then
1024  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1025  do k = 1, current_state%local_grid%size(z_index)
1026  field_value%real_1d_array(k)=cloud_liq_mask_tot(k)
1027  enddo
1028  else if (name .eq. "cloud_ice_mask_total_local") then
1029  allocate(field_value%real_1d_array(current_state%local_grid%size(z_index)))
1030  do k = 1, current_state%local_grid%size(z_index)
1031  field_value%real_1d_array(k)=cloud_ice_mask_tot(k)
1032  enddo
1033  end if
1034  end subroutine field_value_retrieval_callback
1035 
1036  subroutine calculate_wq(current_state, jcol, icol, iq, wq_cn, wq_ad, advect_q)
1037 
1038  type(model_state_type), target, intent(inout) :: current_state
1039 
1040  real(kind=default_precision), intent(inout) :: wq_cn(:), wq_ad(:)
1041  character(len=*), intent(in) :: advect_q
1042  integer, intent(in) :: jcol, icol, iq
1043 
1044  integer :: k
1045 
1046  if (trim(advect_q) .eq. "pw") then
1047  do k=1, current_state%local_grid%size(z_index)-1
1048  wq_ad(k) = wq_ad(k) + ( 0.5 * ( &
1049  current_state%q(iq)%data(k,jcol,icol) + &
1050  current_state%q(iq)%data(k+1,jcol,icol)) * &
1051  current_state%w%data(k,jcol,icol))
1052  wq_cn(k) = wq_ad(k)
1053  enddo
1054  else if (trim(advect_q) .eq. "tvd") then
1055  do k=2, current_state%local_grid%size(z_index)-1
1056  wq_ad(k) = wq_ad(k) + (current_state%w%data(k,jcol,icol) &
1057  * tvd_dgs_terms%adv_q_dgs(k+1, jcol, icol, iq) )
1058  wq_cn(k) = wq_cn(k) + ( 0.5 * ( &
1059  current_state%q(iq)%data(k,jcol,icol) + &
1060  current_state%q(iq)%data(k+1,jcol,icol)) * &
1061  current_state%w%data(k,jcol,icol) )
1062  enddo
1063  endif
1064 
1065  end subroutine calculate_wq
1066 
1067  !---------------------------------------------------------------------
1069  ! cloud_mask a binary 3D total cloud mask
1070  ! optional: l_cloud_mask
1071  ! cloud_mask_tot the total cloud mask profile local sum
1072  ! cloud_liq_mask_tot the liquid cloud mask profile local sum
1073  ! cloud_ice_mask_tot the ice cloud mask profile local sum
1074  ! The latter 3 are intended to be transformed into
1075  ! cloud fraction profile diagnostics via xml processing.
1076  !
1077  !
1079  ! The definition used here is consistent with that within
1080  ! SOCRATES, where i_cloud_representation = 2, that is, liquid and
1081  ! ice cloud are treated separately, with their individual fractions
1082  ! within a cell summing to 1 based their mixing ratios relative to
1083  ! the cell total.
1084  ! Each element of the SOCRATES calculation is reproduced
1085  ! here because the current formulation within SOCRATES will
1086  ! not be available here when that component is not enabled.
1087  ! See: def_merge_atm.F90
1088  ! merge_atm_data.F90
1089  ! A better solution might be to have both work from
1090  ! the same source for easy consistency in the case where
1091  ! definitions of cloudy cells were to change.
1092  ! We do not apply special consideration to the cases where
1093  ! MONC is run with SOCRATES and i_cloud_representation != 2.
1094  ! That is, values are calculated here even when cloud is
1095  ! off in SOCRATES, and no stratiform/convective distinction
1096  ! is made.
1097  !
1098  !
1100  ! Cloud fraction is based on exceeding qlcrit and qicrit.
1101  ! This definition is consistent with that used in the conditional
1102  ! diagnostics routine (condition "AC"). It does not include
1103  ! consideration of rain, snow, and graupel fields. Liquid and
1104  ! ice cloud are treated separately, with their individual fractions
1105  ! within a cell summing to 1 based their mixing ratios relative to
1106  ! the cell total.
1107  subroutine calculate_cloud_mask(current_state, jcol, icol)
1108  type(model_state_type), target, intent(inout) :: current_state
1109  integer, intent(in) :: jcol, icol
1110  integer :: k, target_y_index, target_x_index
1111  logical :: l_prepare_3d_mask, cloud_present
1112 
1113  ! The factors below were derived as part of J. Petch PhD
1114  ! These are used in the SOCRATES method.
1115  real(kind=default_precision) :: &
1116  rainfac = 0.02, &
1117  snowfac = 0.40, &
1118  graupfac = 0.05
1119 
1120  ! Local temporary terms
1121  real(kind=default_precision) :: templ, tempi, tempt
1122 
1123  target_y_index = jcol - current_state%local_grid%halo_size(y_index)
1124  target_x_index = icol - current_state%local_grid%halo_size(x_index)
1125 
1126  templ = 0.0_default_precision
1127  tempi = 0.0_default_precision
1128  tempt = 0.0_default_precision
1129 
1130  l_prepare_3d_mask = allocated(cloud_mask)
1131 
1132  do k=1, current_state%local_grid%size(z_index)
1133 
1135  if (iql > 0) &
1136  templ = current_state%q(iql)%data(k, jcol, icol)
1137  if (iqi > 0) &
1138  tempi = current_state%q(iqi)%data(k, jcol, icol)
1139 
1141 
1143  if (trim(cloud_mask_method) == "SOCRATES") then
1144  if (iqr > 0) &
1145  templ = templ + rainfac * current_state%q(iqr)%data(k, jcol, icol)
1146  if (iqs > 0) &
1147  tempi = tempi + snowfac * current_state%q(iqs)%data(k, jcol, icol)
1148  if (iqg > 0) &
1149  tempi = tempi + graupfac * current_state%q(iqg)%data(k, jcol, icol)
1150  endif ! check cloud_mask_method
1151 
1153  tempt = templ + tempi
1154  if (trim(cloud_mask_method) == "SOCRATES") then
1155  cloud_present = (tempt > epsilon(tempt))
1156  else ! DEFAULT
1157  cloud_present = (templ > qlcrit .or. tempi > qicrit .or. (templ+tempi) > qlcrit)
1158  end if
1159 
1160  if (cloud_present) then
1161  if (l_prepare_3d_mask) &
1162  cloud_mask(k, target_y_index, target_x_index) = 1.0_default_precision
1163  cloud_mask_tot(k) = cloud_mask_tot(k) + 1.0_default_precision
1164 
1165  if (l_partial_liq_ice) then ! separated cloud, partial coverage
1166  cloud_liq_mask_tot(k) = cloud_liq_mask_tot(k) + (templ / tempt)
1167  cloud_ice_mask_tot(k) = cloud_ice_mask_tot(k) + (tempi / tempt)
1168  else ! homogeneous cloud, full coverage for both types of condensate
1169  if (templ > qlcrit) &
1170  cloud_liq_mask_tot(k) = cloud_liq_mask_tot(k) + 1.0_default_precision
1171  if (tempi > qicrit) &
1172  cloud_ice_mask_tot(k) = cloud_ice_mask_tot(k) + 1.0_default_precision
1173  end if ! check liquid/ice partition method
1174  end if ! check cloud_present
1175 
1176  end do ! k loop over vertical model levels
1177 
1178  end subroutine calculate_cloud_mask
1179 
1180 
1181 end module profile_diagnostics_mod
profile_diagnostics_mod::theta_tot
real(kind=default_precision), dimension(:), allocatable theta_tot
Definition: profile_diagnostics.F90:22
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
profile_diagnostics_mod::wqg_ad_tot
real(kind=default_precision), dimension(:), allocatable wqg_ad_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::vprime
real(kind=default_precision), dimension(:), allocatable vprime
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::iqv
integer iqv
Definition: profile_diagnostics.F90:20
saturation_mod
Saturation physics functionality which is used throughout the code.
Definition: saturation.F90:2
profile_diagnostics_mod::uprime_tot
real(kind=default_precision), dimension(:), allocatable uprime_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::q_temp
real(kind=default_precision), dimension(:), allocatable q_temp
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::l_partial_liq_ice
logical l_partial_liq_ice
Definition: profile_diagnostics.F90:42
profile_diagnostics_mod::uinit
real(kind=default_precision), dimension(:), allocatable uinit
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::tempfac
real(kind=default_precision), dimension(:), allocatable tempfac
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::qlcrit
real(kind=default_precision) qlcrit
Definition: profile_diagnostics.F90:44
profile_diagnostics_mod::uw_tot
real(kind=default_precision), dimension(:), allocatable uw_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::th2_tot
real(kind=default_precision), dimension(:), allocatable th2_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wwww_tot
real(kind=default_precision), dimension(:), allocatable wwww_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_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 components published fi...
Definition: profile_diagnostics.F90:594
profile_diagnostics_mod::cloud_liq_mask_tot
real(kind=default_precision), dimension(:), allocatable cloud_liq_mask_tot
Definition: profile_diagnostics.F90:40
profile_diagnostics_mod::w_wind_tot
real(kind=default_precision), dimension(:), allocatable w_wind_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::qicrit
real(kind=default_precision) qicrit
Definition: profile_diagnostics.F90:44
grids_mod::x_index
integer, parameter, public x_index
Definition: grids.F90:14
saturation_mod::qsaturation
real(kind=default_precision) function, public qsaturation(temperature, pressure)
Function to return the saturation mixing ratio over water based on tetans formular QS=3....
Definition: saturation.F90:22
profile_diagnostics_mod::thref
real(kind=default_precision), dimension(:), allocatable thref
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::profile_diagnostics_get_descriptor
type(component_descriptor_type) function, public profile_diagnostics_get_descriptor()
Provides the component descriptor for the core to register.
Definition: profile_diagnostics.F90:57
grids_mod::y_index
integer, parameter, public y_index
Definition: grids.F90:14
profile_diagnostics_mod::ql_tot
real(kind=default_precision), dimension(:), allocatable ql_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::total_points
integer total_points
Definition: profile_diagnostics.F90:20
profile_diagnostics_mod::wqs_cn_tot
real(kind=default_precision), dimension(:), allocatable wqs_cn_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::cloud_mask_method
character(len=string_length) cloud_mask_method
Definition: profile_diagnostics.F90:37
profile_diagnostics_mod::wql_cn_tot
real(kind=default_precision), dimension(:), allocatable wql_cn_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::prefn
real(kind=default_precision), dimension(:), allocatable prefn
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::iqs
integer iqs
Definition: profile_diagnostics.F90:20
def_tvd_diagnostic_terms
Definition: def_tvd_diagnostic_terms.F90:1
profile_diagnostics_mod::timestep_callback
subroutine timestep_callback(current_state)
Definition: profile_diagnostics.F90:275
monc_component_mod
Interfaces and types that MONC components must specify.
Definition: monc_component.F90:6
profile_diagnostics_mod::wke_tot
real(kind=default_precision), dimension(:), allocatable wke_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wqv_cn_tot
real(kind=default_precision), dimension(:), allocatable wqv_cn_tot
Definition: profile_diagnostics.F90:22
optionsdatabase_mod::options_get_string
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.
Definition: optionsdatabase.F90:280
profile_diagnostics_mod::wqi_ad_tot
real(kind=default_precision), dimension(:), allocatable wqi_ad_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::calculate_cloud_mask
subroutine calculate_cloud_mask(current_state, jcol, icol)
This routine calculates:
Definition: profile_diagnostics.F90:1108
profile_diagnostics_mod::uprime
real(kind=default_precision), dimension(:), allocatable uprime
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::vinit
real(kind=default_precision), dimension(:), allocatable vinit
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::vprime_tot
real(kind=default_precision), dimension(:), allocatable vprime_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::vw_tot
real(kind=default_precision), dimension(:), allocatable vw_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::www_tot
real(kind=default_precision), dimension(:), allocatable www_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::cloud_mask_tot
real(kind=default_precision), dimension(:), allocatable cloud_mask_tot
Definition: profile_diagnostics.F90:39
profile_diagnostics_mod
Definition: profile_diagnostics.F90:1
profile_diagnostics_mod::cloud_mask
real(kind=default_precision), dimension(:,:,:), allocatable cloud_mask
Definition: profile_diagnostics.F90:38
profile_diagnostics_mod::rhon
real(kind=default_precision), dimension(:), allocatable rhon
Definition: profile_diagnostics.F90:22
grids_mod::z_index
integer, parameter, public z_index
Grid index parameters.
Definition: grids.F90:14
def_tvd_diagnostic_terms::tvd_dgs_terms
type(str_tvd_diagnostic_terms) tvd_dgs_terms
Definition: def_tvd_diagnostic_terms.F90:23
profile_diagnostics_mod::wqs_ad_tot
real(kind=default_precision), dimension(:), allocatable wqs_ad_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::vertical_grid
type(vertical_grid_configuration_type) vertical_grid
Definition: profile_diagnostics.F90:48
q_indices_mod::standard_q_names
type(standard_q_names_type), public standard_q_names
Definition: q_indices.F90:59
profile_diagnostics_mod::wtheta_ad_tot
real(kind=default_precision), dimension(:), allocatable wtheta_ad_tot
Definition: profile_diagnostics.F90:22
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
profile_diagnostics_mod::qr_tot
real(kind=default_precision), dimension(:), allocatable qr_tot
Definition: profile_diagnostics.F90:22
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
profile_diagnostics_mod::qs_tot
real(kind=default_precision), dimension(:), allocatable qs_tot
Definition: profile_diagnostics.F90:22
monc_component_mod::component_field_information_type
Definition: monc_component.F90:31
profile_diagnostics_mod::cloud_ice_mask_tot
real(kind=default_precision), dimension(:), allocatable cloud_ice_mask_tot
Definition: profile_diagnostics.F90:41
profile_diagnostics_mod::advect_theta
character(len=5) advect_theta
Definition: profile_diagnostics.F90:46
profile_diagnostics_mod::advect_flow
character(len=5) advect_flow
Definition: profile_diagnostics.F90:46
profile_diagnostics_mod::rh_tot
real(kind=default_precision), dimension(:), allocatable rh_tot
Definition: profile_diagnostics.F90:22
optionsdatabase_mod::options_get_logical
logical function, public options_get_logical(options_database, key, index)
Retrieves a logical value from the database that matches the provided key.
Definition: optionsdatabase.F90:154
profile_diagnostics_mod::qg_tot
real(kind=default_precision), dimension(:), allocatable qg_tot
Definition: profile_diagnostics.F90:22
monc_component_mod::component_scalar_field_type
integer, parameter, public component_scalar_field_type
Definition: monc_component.F90:15
profile_diagnostics_mod::calculate_wq
subroutine calculate_wq(current_state, jcol, icol, iq, wq_cn, wq_ad, advect_q)
Definition: profile_diagnostics.F90:1037
profile_diagnostics_mod::iqg
integer iqg
Definition: profile_diagnostics.F90:20
profile_diagnostics_mod::u_wind_tot
real(kind=default_precision), dimension(:), allocatable u_wind_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::iql
integer iql
Definition: profile_diagnostics.F90:20
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
profile_diagnostics_mod::qi_tot
real(kind=default_precision), dimension(:), allocatable qi_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::rho
real(kind=default_precision), dimension(:), allocatable rho
Definition: profile_diagnostics.F90:22
logging_mod
Logging utility.
Definition: logging.F90:2
grids_mod::vertical_grid_configuration_type
The configuration of the grid vertically.
Definition: grids.F90:28
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
profile_diagnostics_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: profile_diagnostics.F90:680
profile_diagnostics_mod::wqr_cn_tot
real(kind=default_precision), dimension(:), allocatable wqr_cn_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::v_wind_tot
real(kind=default_precision), dimension(:), allocatable v_wind_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wqr_ad_tot
real(kind=default_precision), dimension(:), allocatable wqr_ad_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::qv_tot
real(kind=default_precision), dimension(:), allocatable qv_tot
Definition: profile_diagnostics.F90:22
datadefn_mod::string_length
integer, parameter, public string_length
Default length of strings.
Definition: datadefn.F90:10
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
profile_diagnostics_mod::ww_tot
real(kind=default_precision), dimension(:), allocatable ww_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wqi_cn_tot
real(kind=default_precision), dimension(:), allocatable wqi_cn_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::iqr
integer iqr
Definition: profile_diagnostics.F90:20
profile_diagnostics_mod::wtheta_cn_tot
real(kind=default_precision), dimension(:), allocatable wtheta_cn_tot
Definition: profile_diagnostics.F90:22
def_tvd_diagnostic_terms::allocate_tvd_diagnostic_terms
subroutine allocate_tvd_diagnostic_terms(current_state, tvd_dgs_terms)
Definition: def_tvd_diagnostic_terms.F90:28
monc_component_mod::component_integer_data_type
integer, parameter, public component_integer_data_type
Definition: monc_component.F90:16
profile_diagnostics_mod::initialisation_callback
subroutine initialisation_callback(current_state)
Definition: profile_diagnostics.F90:156
profile_diagnostics_mod::advect_q
character(len=5) advect_q
Definition: profile_diagnostics.F90:46
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
profile_diagnostics_mod::uv_tot
real(kind=default_precision), dimension(:), allocatable uv_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wql_ad_tot
real(kind=default_precision), dimension(:), allocatable wql_ad_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::wqv_ad_tot
real(kind=default_precision), dimension(:), allocatable wqv_ad_tot
Definition: profile_diagnostics.F90:22
optionsdatabase_mod
Manages the options database. Contains administration functions and deduce runtime options from the c...
Definition: optionsdatabase.F90:7
profile_diagnostics_mod::wqg_cn_tot
real(kind=default_precision), dimension(:), allocatable wqg_cn_tot
Definition: profile_diagnostics.F90:22
profile_diagnostics_mod::iqi
integer iqi
Definition: profile_diagnostics.F90:20
profile_diagnostics_mod::thinit
real(kind=default_precision), dimension(:), allocatable thinit
Definition: profile_diagnostics.F90:22
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
state_mod
The model state which represents the current state of a run.
Definition: state.F90:2
monc_component_mod::component_array_field_type
integer, parameter, public component_array_field_type
Definition: monc_component.F90:15