MONC
casim.F90
Go to the documentation of this file.
1 
2 module casim_mod
8  use grids_mod, only : z_index, y_index, x_index
14 
15  ! casim modules...
16  use variable_precision, ONLY: wp
17  use initialize, only: mphys_init
18  use mphys_switches, only: set_mphys_switches, &
19  l_warm, &
20  nq_l, nq_r, nq_i, nq_s, nq_g, &
21  l_2mc, l_2mr, l_2mi, l_2ms, l_2mg, &
22  l_3mr, l_3ms, l_3mg, &
23  soluble_modes, active_cloud, active_rain, &
24  insoluble_modes, active_ice, active_number, &
25  isol, iinsol, option, aerosol_option, &
26  iopt_act, option, aerosol_option &
27  ! All process rates are read in using read_configuration
28  ! routine in this component
29  , l_aaut, l_aacc, l_aevp, l_ased, l_warm &
30  , l_inuc, iopt_rcrit, iopt_inuc, l_iaut, l_iacw &
31  , l_rain, l_boussinesq, diag_mu_option &
32  , l_sed_3mdiff, l_cons, l_abelshipway, l_sed_icecloud_as_1m &
33  , l_active_inarg2000, process_level, l_separate_rain, l_idep &
34  , max_step_length, max_sed_length, l_sg, l_g, l_passive &
35  , l_passive3m, l_limit_psd, l_override_checks &
36  , max_mu, fix_mu, l_raci_g, l_onlycollect, l_inhom_revp &
37  , l_tidy_conserve_e , l_tidy_conserve_q &
38  , l_pcond & ! Condensation
39  , l_praut & ! Autoconversion cloud -> rain
40  , l_pracw & ! Accretion cloud -> rain
41  , l_pracr & ! aggregation of rain drops
42  , l_prevp & ! evaporation of rain
43  , l_psedl & ! sedimentation of cloud
44  , l_psedr & ! sedimentation of rain
45  , l_ptidy & ! tidying term 1
46  , l_ptidy2 & ! tidying term 2
47  , l_pinuc & ! ice nucleation
48  , l_pidep & ! ice deposition
49  , l_piacw & ! ice accreting water
50  , l_psaut & ! ice autoconversion ice -> snow
51  , l_psdep & ! vapour deposition onto snow
52  , l_psacw & ! snow accreting water
53  , l_pgdep & ! vapour deposition onto graupel
54  , l_pseds & ! snow sedimentation
55  , l_psedi & ! ice sedimentation
56  , l_psedg & ! graupel sedimentation
57  , l_psaci & ! snow accreting ice
58  , l_praci & ! rain accreting ice
59  , l_psacr & ! snow accreting rain
60  , l_pgacr & ! graupel accreting rain
61  , l_pgacw & ! graupel accreting cloud water
62  , l_pgaci & ! graupel accreting ice
63  , l_pgacs & ! graupel accreting snow
64  , l_piagg & ! aggregation of ice particles
65  , l_psagg & ! aggregation of snow particles
66  , l_pgagg & ! aggregation of graupel particles
67  , l_psbrk & ! break up of snow flakes
68  , l_pgshd & ! shedding of liquid from graupel
69  , l_pihal & ! hallet mossop
70  , l_psmlt & ! snow melting
71  , l_pgmlt & ! graupel melting
72  , l_phomr & ! homogeneous freezing of rain
73  , l_phomc & ! homogeneous freezing of cloud droplets
74  , l_pssub & ! sublimation of snow
75  , l_pgsub & ! sublimation of graupel
76  , l_pisub & ! sublimation of ice
77  , l_pimlt ! ice melting
78 
79  use micro_main, only: shipway_microphysics
80  use generic_diagnostic_variables, ONLY: casdiags, allocate_diagnostic_space, &
81  deallocate_diagnostic_space
84 
85  implicit none
86 
87 #ifndef TEST_MODE
88  private
89 #endif
90 
91  REAL(wp), allocatable :: theta(:,:,:), pressure(:,:,:), &
92  z_half(:,:,:), z_centre(:,:,:), dz(:,:,:), qv(:,:,:),qc(:,:,:) &
93  , nc(:,:,:), qr(:,:,:), nr(:,:,:), m3r(:,:,:),rho(:,:,:) &
94  , exner(:,:,:), w(:,:,:), tke(:,:,:) &
95  , qi(:,:,:), ni(:,:,:), qs(:,:,:), ns(:,:,:), m3s(:,:,:) &
96  , qg(:,:,:), ng(:,:,:), m3g(:,:,:)
97 
98  REAL(wp), allocatable :: accumsolmass(:,:,:), accumsolnumber(:,:,:) ! Accumulation mode aerosol
99  REAL(wp), allocatable :: activesolliquid(:,:,:) ! Activated aerosol
100  REAL(wp), allocatable :: aitkensolmass(:,:,:), aitkensolnumber(:,:,:) ! Aitken mode aerosol
101  REAL(wp), allocatable :: coarsesolmass(:,:,:), coarsesolnumber(:,:,:) ! Course mode aerosol
102  REAL(wp), allocatable :: activesolrain(:,:,:) ! Activeated aerosol in rain
103  REAL(wp), allocatable :: coarsedustmass(:,:,:), coarsedustnumber(:,:,:) ! Coarse Dust
104  REAL(wp), allocatable :: activeinsolice(:,:,:) ! Activeated dust
105  REAL(wp), allocatable :: activesolice(:,:,:) ! Activeated aerosol in ice
106  REAL(wp), allocatable :: activeinsolliquid(:,:,:) ! Activeated dust in cloud
107  REAL(wp), allocatable :: accuminsolmass(:,:,:) ! Accum mode dust mass
108  REAL(wp), allocatable :: accuminsolnumber(:,:,:) ! Accum mode dust number
109  REAL(wp), allocatable :: activesolnumber(:,:,:) ! Activated soluble number (if we need a tracer)
110  REAL(wp), allocatable :: activeinsolnumber(:,:,:) ! Activated insoluble number (if we need a tracer)
111  !!AH - these are dummy arrays to accommodate the hygroscopicity from
112  !! UKCA-MODE. At present these are only required so that the shipway_microphysics
113  !! argument list matches between the UM and MONC interface. These may become non-dummy
114  !! arguments in the future
115  REAL(wp), allocatable :: aitkensolbk(:,:,:)
116  REAL(wp), allocatable :: accumsolbk(:,:,:)
117  REAL(wp), allocatable :: coarsesolbk(:,:,:)
118 
119  ! Tendency from other physics/advection/forcing
120  ! NB This is tendency (/s) not an increment over the timestep
121  REAL(wp), allocatable :: dqv(:,:,:), dth(:,:,:), dqc(:,:,:), dnc(:,:,:) &
122  , dqr(:,:,:), dnr(:,:,:), dm3r(:,:,:) &
123  , dqi(:,:,:), dni(:,:,:), dqs(:,:,:), dns(:,:,:), dm3s(:,:,:) &
124  , dqg(:,:,:), dng(:,:,:), dm3g(:,:,:)
125 
126  REAL(wp), allocatable :: daccumsolmass(:,:,:), daccumsolnumber(:,:,:) ! Accumulation mode aerosol
127  REAL(wp), allocatable :: dactivesolliquid(:,:,:) ! Activated aerosol
128  REAL(wp), allocatable :: daitkensolmass(:,:,:), daitkensolnumber(:,:,:) ! Aitken mode aerosol
129  REAL(wp), allocatable :: dcoarsesolmass(:,:,:), dcoarsesolnumber(:,:,:) ! Course mode aerosol
130  REAL(wp), allocatable :: dactivesolrain(:,:,:) ! Activeated aerosol in rain
131  REAL(wp), allocatable :: dcoarsedustmass(:,:,:), dcoarsedustnumber(:,:,:) ! Dust
132  REAL(wp), allocatable :: dactiveinsolice(:,:,:) ! Activeated dust
133  REAL(wp), allocatable :: dactivesolice(:,:,:) ! Activeated aerosol in ice
134  REAL(wp), allocatable :: dactiveinsolliquid(:,:,:) ! Activeated dust in cloud
135  REAL(wp), allocatable :: daccuminsolmass(:,:,:) ! Accum mode dust mass
136  REAL(wp), allocatable :: daccuminsolnumber(:,:,:) ! Accum mode dust number
137  REAL(wp), allocatable :: dactivesolnumber(:,:,:) ! Activated soluble number (if we need a tracer)
138  REAL(wp), allocatable :: dactiveinsolnumber(:,:,:) ! Activated insoluble number (if we need a tracer)
139 
140  REAL(wp), allocatable :: surface_precip(:,:)
141 
142  INTEGER :: ils,ile, jls,jle, kls,kle, &
143  its,ite, jts,jte, kts,kte
144 
145  INTEGER :: iqv=0, iql=0, iqr=0, iqi=0, iqs=0, iqg=0
146  INTEGER :: inl=0, inr=0, ini=0, ins=0, ing=0
147  INTEGER :: i3mr=0, i3ms=0, i3mg=0
148  INTEGER :: &
149  i_accumsolmass=0, &
150  i_accumsolnumber=0, &
151  i_activesolliquid=0, &
152  i_aitkensolmass=0, &
153  i_aitkensolnumber=0, &
154  i_coarsesolmass=0, &
155  i_coarsesolnumber=0, &
156  i_activesolrain=0, &
157  i_coarsedustmass=0, &
158  i_coarsedustnumber=0, &
159  i_activeinsolice=0, &
160  i_activesolice=0, &
162  i_accuminsolmass=0, &
163  i_accuminsolnumber=0, &
164  i_activesolnumber=0, &
166 
167  real(kind=default_precision), dimension(:), allocatable :: &
172 
173  public casim_get_descriptor
174 contains
175 
179  casim_get_descriptor%name="casim"
180  casim_get_descriptor%version=0.1
183 
184  ! Set up fields to be published for diagnostics. These are made available to
185  ! IO server in the field_value_retrieval_callback at the end of this module
186  !
189 
190  allocate(casim_get_descriptor%published_fields(27))
191 
192  casim_get_descriptor%published_fields(1)="surface_precip"
193  casim_get_descriptor%published_fields(2)="homogeneous_freezing_rate"
194  casim_get_descriptor%published_fields(3)="ice_nucleations_rate"
195  casim_get_descriptor%published_fields(4)="ice_deposition_rate"
196  casim_get_descriptor%published_fields(5)="snow_deposition_rate"
197  casim_get_descriptor%published_fields(6)="ice_acc_cloud_rate"
198  casim_get_descriptor%published_fields(7)="snow_acc_cloud_rate"
199  casim_get_descriptor%published_fields(8)="snow_acc_rain_rate"
200  casim_get_descriptor%published_fields(9)="ice_sublime_rate"
201  casim_get_descriptor%published_fields(10)="snow_sublime_rate"
202  casim_get_descriptor%published_fields(11)="ice_melt_rate"
203  casim_get_descriptor%published_fields(12)="snow_melt_rate"
204  casim_get_descriptor%published_fields(13)="snow_autoconversion_rate"
205  casim_get_descriptor%published_fields(14)="snow_acc_ice_rate"
206  casim_get_descriptor%published_fields(15)="rain_autoconversion_rate"
207  casim_get_descriptor%published_fields(16)="rain_acc_cloud_rate"
208  casim_get_descriptor%published_fields(17)="rain_evap_rate"
209  casim_get_descriptor%published_fields(18)="graup_acc_cloud_rate"
210  casim_get_descriptor%published_fields(19)="graup_acc_snow_rate"
211  casim_get_descriptor%published_fields(20)="graup_melt_rate"
212  casim_get_descriptor%published_fields(21)="graup_sublime_rate"
213  casim_get_descriptor%published_fields(22)="ice_sed_rate"
214  casim_get_descriptor%published_fields(23)="snow_sed_rate"
215  casim_get_descriptor%published_fields(24)="rain_sed_rate"
216  casim_get_descriptor%published_fields(25)="graup_sed_rate"
217  casim_get_descriptor%published_fields(26)="cloud_sed_rate"
218  casim_get_descriptor%published_fields(27)="condensation_rate"
219 
220  end function casim_get_descriptor
221 
224  subroutine initialisation_callback(current_state)
225  type(model_state_type), target, intent(inout) :: current_state
226 
227  integer :: y_size_local, x_size_local
228 
229  if (is_component_enabled(current_state%options_database, "simplecloud")) then
230  call log_master_log(log_error, "Casim and Simplecloud are enabled, this does not work yet. Please disable one")
231  end if
232 
233  !allocate(psedl_tot(current_state%local_grid%size(Z_INDEX)), &
234  ! pcond_tot(current_state%local_grid%size(Z_INDEX)))
235 
236  y_size_local = current_state%local_grid%size(y_index)
237  x_size_local = current_state%local_grid%size(x_index)
238 
239  call read_configuration(current_state)
240 
241  ils=1
242  ile=1
243  jls=1
244  jle=1
245  kls=2
246  kle=current_state%local_grid%size(z_index)
247  its=1
248  ite=1
249  jts=1
250  jte=1
251  kts=1
252  kte=current_state%local_grid%size(z_index)
253 
255 
256  allocate(pressure(kte,1,1))
257  allocate(z_half(0:kte,1,1))
258  allocate(z_centre(kte,1,1))
259  allocate(dz(kte,1,1))
260  allocate(rho(kte,1,1))
261  allocate(exner(kte,1,1))
262  allocate(w(kte,1,1))
263  allocate(tke(kte,1,1))
264 
265  allocate(theta(kte,1,1))
266  allocate(qv(kte,1,1))
267  allocate(qc(kte,1,1))
268  allocate(nc(kte,1,1))
269  allocate(qr(kte,1,1))
270  allocate(nr(kte,1,1))
271  allocate(m3r(kte,1,1))
272  allocate(qi(kte,1,1))
273  allocate(ni(kte,1,1))
274  allocate(qs(kte,1,1))
275  allocate(ns(kte,1,1))
276  allocate(m3s(kte,1,1))
277  allocate(qg(kte,1,1))
278  allocate(ng(kte,1,1))
279  allocate(m3g(kte,1,1))
280 
281  allocate(accumsolmass(kte,1,1))
282  allocate(accumsolnumber(kte,1,1))
283  allocate(activesolliquid(kte,1,1))
284  allocate(aitkensolmass(kte,1,1))
285  allocate(aitkensolnumber(kte,1,1))
286  allocate(coarsesolmass(kte,1,1))
287  allocate(coarsesolnumber(kte,1,1))
288  allocate(activesolrain(kte,1,1))
289  allocate(coarsedustmass(kte,1,1))
290  allocate(coarsedustnumber(kte,1,1))
291  allocate(activeinsolice(kte,1,1))
292  allocate(activesolice(kte,1,1))
293  allocate(activeinsolliquid(kte,1,1))
294  allocate(accuminsolmass(kte,1,1))
295  allocate(accuminsolnumber(kte,1,1))
296  allocate(activesolnumber(kte,1,1))
297  allocate(activeinsolnumber(kte,1,1))
298  ! allocate the hygoscopicity arrays
299  allocate(aitkensolbk(kte,1,1))
300  allocate(accumsolbk(kte,1,1))
301  allocate(coarsesolbk(kte,1,1))
302 
303  allocate(dth(kte,1,1))
304  allocate(dqv(kte,1,1))
305  allocate(dqc(kte,1,1))
306  allocate(dnc(kte,1,1))
307  allocate(dqr(kte,1,1))
308  allocate(dnr(kte,1,1))
309  allocate(dm3r(kte,1,1))
310  allocate(dqi(kte,1,1))
311  allocate(dni(kte,1,1))
312  allocate(dqs(kte,1,1))
313  allocate(dns(kte,1,1))
314  allocate(dm3s(kte,1,1))
315  allocate(dqg(kte,1,1))
316  allocate(dng(kte,1,1))
317  allocate(dm3g(kte,1,1))
318 
319  allocate(daccumsolmass(kte,1,1))
320  allocate(daccumsolnumber(kte,1,1))
321  allocate(dactivesolliquid(kte,1,1))
322  allocate(daitkensolmass(kte,1,1))
323  allocate(daitkensolnumber(kte,1,1))
324  allocate(dcoarsesolmass(kte,1,1))
325  allocate(dcoarsesolnumber(kte,1,1))
326  allocate(dactivesolrain(kte,1,1))
327  allocate(dcoarsedustmass(kte,1,1))
328  allocate(dcoarsedustnumber(kte,1,1))
329  allocate(dactiveinsolice(kte,1,1))
330  allocate(dactivesolice(kte,1,1))
331  allocate(dactiveinsolliquid(kte,1,1))
332  allocate(daccuminsolmass(kte,1,1))
333  allocate(daccuminsolnumber(kte,1,1))
334  allocate(dactivesolnumber(kte,1,1))
335  allocate(dactiveinsolnumber(kte,1,1))
336 
337  call set_mphys_switches(option,aerosol_option)
338  call mphys_init(its, ite, jts, jte, kts, kte, ils, ile, jls, jle, kls, kle, l_tendency=.true.)
339 
340  ! Need to allocate the appropriate indices, e.g. iqv, iql...
341  ! This needs to be compatible with the rest of the model
342  ! This essentially reproduces the switching in the main microphysics
343  ! code already done above (set_mphys_switches), so could be combined
344  ! once the MONC method has been finalized.
345  ! Note the numbers assigned here may be different from those assigned
346  ! in the microphysics since we share the q array with other components.
347 
348  if (.not. allocated(current_state%cq))then
349  allocate(current_state%cq(current_state%number_q_fields))
350  current_state%cq=0.0_default_precision
351  end if
352 
353  ! Mass
354  iqv = get_q_index(standard_q_names%VAPOUR, 'casim')
355  if (nq_l>0)then
356  iql = get_q_index(standard_q_names%CLOUD_LIQUID_MASS, 'casim')
357  current_state%cq(iql) = -1.0
358  end if
359  if (nq_r>0)then
360  iqr = get_q_index(standard_q_names%RAIN_MASS, 'casim')
361  current_state%rain_water_mixing_ratio_index=iqr
362  current_state%cq(iqr) = -1.0
363  end if
364  if (.not. l_warm)then
365  if (nq_i>0)then
366  iqi = get_q_index(standard_q_names%ICE_MASS, 'casim')
367  current_state%ice_water_mixing_ratio_index=iqi
368  current_state%cq(iqi) = -1.0
369  end if
370  if (nq_s>0)then
371  iqs = get_q_index(standard_q_names%SNOW_MASS, 'casim')
372  current_state%snow_water_mixing_ratio_index=iqs
373  current_state%cq(iqs) = -1.0
374  end if
375  if (nq_g>0)then
376  iqg = get_q_index(standard_q_names%GRAUPEL_MASS, 'casim')
377  current_state%graupel_water_mixing_ratio_index=iqg
378  current_state%cq(iqg) = -1.0
379  end if
380  end if
381 
382  ! Number
383  if (l_2mc)inl = get_q_index(standard_q_names%CLOUD_LIQUID_NUMBER, 'casim')
384  if (l_2mr)inr = get_q_index(standard_q_names%RAIN_NUMBER, 'casim')
385  if (.not. l_warm)then
386  if (l_2mi)ini = get_q_index(standard_q_names%ICE_NUMBER, 'casim')
387  if (l_2ms)ins = get_q_index(standard_q_names%SNOW_NUMBER, 'casim')
388  if (l_2mg)ing = get_q_index(standard_q_names%GRAUPEL_NUMBER, 'casim')
389  end if
390 
391  ! Third moments
392  if (l_3mr)i3mr = get_q_index(standard_q_names%RAIN_THIRD_MOMENT, 'casim')
393  if (.not. l_warm)then
394  if (l_3ms)i3ms = get_q_index(standard_q_names%SNOW_THIRD_MOMENT, 'casim')
395  if (l_3mg)i3mg = get_q_index(standard_q_names%GRAUPEL_THIRD_MOMENT, 'casim')
396  end if
397 
398  ! Aerosol
399  if (soluble_modes(1) > 1) i_aitkensolmass = &
400  get_q_index(standard_q_names%AITKEN_SOL_MASS, 'casim')
401  if (soluble_modes(1) > 0) i_aitkensolnumber = &
402  get_q_index(standard_q_names%AITKEN_SOL_NUMBER, 'casim')
403  if (soluble_modes(2) > 1) i_accumsolmass = &
404  get_q_index(standard_q_names%ACCUM_SOL_MASS, 'casim')
405  if (soluble_modes(2) > 0) i_accumsolnumber = &
406  get_q_index(standard_q_names%ACCUM_SOL_NUMBER, 'casim')
407  if (soluble_modes(3) > 1) i_coarsesolmass = &
408  get_q_index(standard_q_names%COARSE_SOL_MASS, 'casim')
409  if (soluble_modes(3) > 0) i_coarsesolnumber = &
410  get_q_index(standard_q_names%COARSE_SOL_NUMBER, 'casim')
411  if (active_cloud(isol)) i_activesolliquid = &
412  get_q_index(standard_q_names%ACTIVE_SOL_LIQUID, 'casim')
413  if (active_rain(isol)) i_activesolrain = &
414  get_q_index(standard_q_names%ACTIVE_SOL_RAIN, 'casim')
415  if (insoluble_modes(2) > 1) i_coarsedustmass = &
416  get_q_index(standard_q_names%COARSE_DUST_MASS, 'casim')
417  if (insoluble_modes(2) > 0) i_coarsedustnumber = &
418  get_q_index(standard_q_names%COARSE_DUST_NUMBER, 'casim')
419  if (active_ice(iinsol)) i_activeinsolice = &
420  get_q_index(standard_q_names%ACTIVE_INSOL_ICE, 'casim')
421  if (active_ice(isol)) i_activesolice = &
422  get_q_index(standard_q_names%ACTIVE_SOL_ICE, 'casim')
423  if (active_cloud(iinsol)) i_activeinsolliquid = &
424  get_q_index(standard_q_names%ACTIVE_INSOL_LIQUID, 'casim')
425  if (insoluble_modes(1) > 1) i_accuminsolmass = &
426  get_q_index(standard_q_names%ACCUM_INSOL_MASS, 'casim')
427  if (insoluble_modes(1) > 0) i_accuminsolnumber = &
428  get_q_index(standard_q_names%ACCUM_INSOL_NUMBER, 'casim')
429  if (active_number(isol)) i_activesolnumber = &
430  get_q_index(standard_q_names%ACTIVE_SOL_NUMBER, 'casim')
431  if (active_number(iinsol)) i_activeinsolnumber = &
432  get_q_index(standard_q_names%ACTIVE_INSOL_NUMBER, 'casim')
433 
434  ! set logicals for the microphysics diagnostics: process rates
435  casdiags % l_dth = .true.
436  casdiags % l_dqv = .true.
437  if ( nq_l>0 ) casdiags % l_dqc = .true.
438  if ( nq_r>0 ) casdiags % l_dqr = .true.
439  if ( l_pcond ) casdiags % l_pcond = .true.
440  if ( l_psedl ) then
441  casdiags % l_psedl = .true.
442  casdiags % l_surface_rain = .true.
443  casdiags % l_precip = .true.
444  endif
445  if ( l_praut ) casdiags % l_praut = .true.
446  if ( l_pracw ) casdiags % l_pracw = .true.
447  if ( l_prevp ) casdiags % l_prevp = .true.
448  if ( l_psedr ) then
449  casdiags % l_psedr = .true.
450  casdiags % l_surface_rain = .true.
451  casdiags % l_precip = .true.
452  endif
453  if (.not. l_warm) then
454  if ( nq_i>0 ) casdiags % l_dqi = .true.
455  if ( nq_s>0 ) casdiags % l_dqs = .true.
456  if ( nq_g>0 ) casdiags % l_dqg = .true.
457  if ( l_phomc ) casdiags % l_phomc = .true.
458  if ( l_pinuc ) casdiags % l_pinuc = .true.
459  if ( l_pidep ) casdiags % l_pidep = .true.
460  if ( l_piacw ) casdiags % l_piacw = .true.
461  if ( l_pisub ) casdiags % l_pisub = .true.
462  if ( l_pimlt ) casdiags % l_pimlt = .true.
463  if ( l_psedi ) then
464  casdiags % l_psedi = .true.
465  casdiags % l_surface_snow = .true.
466  casdiags % l_precip = .true.
467  endif
468  if ( l_psmlt ) casdiags % l_psmlt = .true.
469  if ( l_psaut ) casdiags % l_psaut = .true.
470  if ( l_psaci ) casdiags % l_psaci = .true.
471  if ( l_psacw ) casdiags % l_psacw = .true.
472  if ( l_psacr ) casdiags % l_psacr = .true.
473  if ( l_pssub ) casdiags % l_pssub = .true.
474  if ( l_psdep ) casdiags % l_psdep = .true.
475  if ( l_pseds ) then
476  casdiags % l_pseds = .true.
477  casdiags % l_surface_snow = .true.
478  casdiags % l_precip = .true.
479  endif
480  if ( l_pgacw ) casdiags % l_pgacw = .true.
481  if ( l_pgacs ) casdiags % l_pgacs = .true.
482  if ( l_pgmlt ) casdiags % l_pgmlt = .true.
483  if ( l_pgsub ) casdiags % l_pgsub = .true.
484  if ( l_psedg ) then
485  casdiags % l_psedg = .true.
486  casdiags % l_surface_graup = .true.
487  casdiags % l_precip = .true.
488  endif
489  endif
490 
491  ! allocate diagnostic space in casdiags depending on the logicals defined above
492  CALL allocate_diagnostic_space(its, ite, jts, jte, kts, kte)
493  ! this is no longer needed since can use cas_monc_dgs structure but keep for now
494  allocate(surface_precip(y_size_local, x_size_local))
495  ! allocate diagnostic space for MONC fields to export to IO server
496  call allocate_casim_monc_dgs_space(current_state, casdiags)
497 
498  end subroutine initialisation_callback
499 
502  subroutine timestep_callback(current_state)
503  type(model_state_type), target, intent(inout) :: current_state
504 
505  REAL(wp) :: dtwp
506  INTEGER :: icol, jcol, iqx, target_x_index, target_y_index
507 
508  icol=current_state%column_local_x
509  jcol=current_state%column_local_y
510  target_y_index=jcol-current_state%local_grid%halo_size(y_index)
511  target_x_index=icol-current_state%local_grid%halo_size(x_index)
512 
513  !if (current_state%first_timestep_column) then
514  ! psedl_tot(:)= 0.0_DEFAULT_PRECISION
515  ! pcond_tot(:)= 0.0_DEFAULT_PRECISION
516  !endif
517 
518  if (current_state%halo_column .or. current_state%timestep < 2) return
519 
520  if (current_state%field_stepping == forward_stepping)then
521  call log_master_log(log_error, 'Currently, CASIM assumes CENTERED_STEPPING')
522  dtwp = current_state%dtm
523  else
524  dtwp = 2.0*current_state%dtm
525  end if
526 
527  ! Initialize aerosol fields to zero...
528  aitkensolmass = 0.0
529  daitkensolmass = 0.0
530  aitkensolnumber = 0.0
531  daitkensolnumber = 0.0
532  accumsolmass = 0.0
533  daccumsolmass = 0.0
534  accumsolnumber = 0.0
535  daccumsolnumber = 0.0
536  coarsesolmass = 0.0
537  dcoarsesolmass = 0.0
538  coarsesolnumber = 0.0
539  dcoarsesolnumber = 0.0
540  activesolliquid = 0.0
541  dactivesolliquid = 0.0
542  coarsedustmass = 0.0
543  dcoarsedustmass = 0.0
544  coarsedustnumber = 0.0
545  dcoarsedustnumber = 0.0
546  activeinsolice = 0.0
547  dactiveinsolice = 0.0
548  activesolice = 0.0
549  dactivesolice = 0.0
550  activeinsolliquid = 0.0
551  dactiveinsolliquid = 0.0
552  accuminsolmass = 0.0
553  daccuminsolmass = 0.0
554  accuminsolnumber = 0.0
555  daccuminsolnumber = 0.0
556  activesolnumber = 0.0
557  dactivesolnumber = 0.0
558  activeinsolnumber = 0.0
559  dactiveinsolnumber = 0.0
560  aitkensolbk = 0.0
561  accumsolbk = 0.0
562  coarsesolbk = 0.0
563 
564  theta(:,1,1) = current_state%zth%data(:, jcol, icol) + current_state%global_grid%configuration%vertical%thref(:)
565  dth(:,1,1) = current_state%sth%data(:, jcol, icol)
566  exner(:,1,1) = current_state%global_grid%configuration%vertical%rprefrcp(:)
567  pressure(:,1,1) = current_state%global_grid%configuration%vertical%prefn(:)
568  z_centre(:,1,1) = current_state%global_grid%configuration%vertical%zn(:)
569  dz(:,1,1) = current_state%global_grid%configuration%vertical%dz(:)
570  z_half(:kte-1,1,1) = current_state%global_grid%configuration%vertical%z(:)
571  rho(:,1,1) = current_state%global_grid%configuration%vertical%rhon(:)
572  w(:,1,1) = current_state%zw%data(:, jcol, icol)
573  tke(:,1,1) = 0.1 ! Test value
574 
575  iqx = iqv
576  qv(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
577  dqv(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
578 
579  ! Warm microphysical fields
580  IF (nq_l > 0)then
581  iqx = iql
582  qc(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
583  dqc(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
584  end IF
585  IF (nq_r > 0)then
586  iqx = iqr
587  qr(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
588  dqr(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
589  end IF
590  IF (nq_l > 1)then
591  iqx = inl
592  nc(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
593  dnc(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
594  end IF
595  IF (nq_r > 1)then
596  iqx = inr
597  nr(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
598  dnr(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
599  end IF
600  IF (nq_r > 2)then
601  iqx = i3mr
602  m3r(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
603  dm3r(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
604  end IF
605 
606  ! Ice microphysical fields
607  IF (nq_i > 0)then
608  iqx = iqi
609  qi(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
610  dqi(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
611  end IF
612  IF (nq_s > 0)then
613  iqx = iqs
614  qs(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
615  dqs(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
616  end IF
617  IF (nq_g > 0)then
618  iqx = iqg
619  qg(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
620  dqg(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
621  end IF
622  IF (nq_i > 1)then
623  iqx = ini
624  ni(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
625  dni(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
626  end IF
627  IF (nq_s > 1)then
628  iqx = ins
629  ns(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
630  dns(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
631  end IF
632  IF (nq_g > 1)then
633  iqx = ing
634  ng(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
635  dng(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
636  end IF
637  IF (nq_s > 2)then
638  iqx = i3ms
639  m3s(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
640  dm3s(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
641  end IF
642  IF (nq_g > 2)then
643  iqx = i3mg
644  m3g(:,1,1) = current_state%zq(iqx)%data(:,jcol,icol)
645  dm3g(:,1,1) = current_state%sq(iqx)%data(:,jcol,icol)
646  end IF
647 
648  ! Aerosol fields
649 
650  if (i_aitkensolmass>0) aitkensolmass(:,1,1) = current_state%zq(i_aitkensolmass)%data(:,jcol,icol)
651  if (i_aitkensolmass>0) daitkensolmass(:,1,1) = current_state%sq(i_aitkensolmass)%data(:,jcol,icol)
652  if (i_aitkensolnumber>0) aitkensolnumber(:,1,1) = current_state%zq(i_aitkensolnumber)%data(:,jcol,icol)
653  if (i_aitkensolnumber>0) daitkensolnumber(:,1,1) = current_state%sq(i_aitkensolnumber)%data(:,jcol,icol)
654  if (i_accumsolmass>0) accumsolmass(:,1,1) = current_state%zq(i_accumsolmass)%data(:,jcol,icol)
655  if (i_accumsolmass>0) daccumsolmass(:,1,1) = current_state%sq(i_accumsolmass)%data(:,jcol,icol)
656  if (i_accumsolnumber>0) accumsolnumber(:,1,1) = current_state%zq(i_accumsolnumber)%data(:,jcol,icol)
657  if (i_accumsolnumber>0) daccumsolnumber(:,1,1) = current_state%sq(i_accumsolnumber)%data(:,jcol,icol)
658  if (i_coarsesolmass>0) coarsesolmass(:,1,1) = current_state%zq(i_coarsesolmass)%data(:,jcol,icol)
659  if (i_coarsesolmass>0) dcoarsesolmass(:,1,1) = current_state%sq(i_coarsesolmass)%data(:,jcol,icol)
660  if (i_coarsesolnumber>0) coarsesolnumber(:,1,1) = current_state%zq(i_coarsesolnumber)%data(:,jcol,icol)
661  if (i_coarsesolnumber>0) dcoarsesolnumber(:,1,1) = current_state%sq(i_coarsesolnumber)%data(:,jcol,icol)
662  if (i_activesolliquid>0) activesolliquid(:,1,1) = current_state%zq(i_activesolliquid)%data(:,jcol,icol)
663  if (i_activesolliquid>0) dactivesolliquid(:,1,1) = current_state%sq(i_activesolliquid)%data(:,jcol,icol)
664  if (i_coarsedustmass>0) coarsedustmass(:,1,1) = current_state%zq(i_coarsedustmass)%data(:,jcol,icol)
665  if (i_coarsedustmass>0) dcoarsedustmass(:,1,1) = current_state%sq(i_coarsedustmass)%data(:,jcol,icol)
666  if (i_coarsedustnumber>0) coarsedustnumber(:,1,1) = current_state%zq(i_coarsedustnumber)%data(:,jcol,icol)
667  if (i_coarsedustnumber>0) dcoarsedustnumber(:,1,1) = current_state%sq(i_coarsedustnumber)%data(:,jcol,icol)
668  if (i_activeinsolice>0) activeinsolice(:,1,1) = current_state%zq(i_activeinsolice)%data(:,jcol,icol)
669  if (i_activeinsolice>0) dactiveinsolice(:,1,1) = current_state%sq(i_activeinsolice)%data(:,jcol,icol)
670  if (i_activesolice>0) activesolice(:,1,1) = current_state%zq(i_activesolice)%data(:,jcol,icol)
671  if (i_activesolice>0) dactivesolice(:,1,1) = current_state%sq(i_activesolice)%data(:,jcol,icol)
672  if (i_activeinsolliquid>0) activeinsolliquid(:,1,1) = current_state%zq(i_activeinsolliquid)%data(:,jcol,icol)
673  if (i_activeinsolliquid>0)dactiveinsolliquid(:,1,1) = current_state%sq(i_activeinsolliquid)%data(:,jcol,icol)
674  if (i_accuminsolmass>0) accuminsolmass(:,1,1) = current_state%zq(i_accuminsolmass)%data(:,jcol,icol)
675  if (i_accuminsolmass>0) daccuminsolmass(:,1,1) = current_state%sq(i_accuminsolmass)%data(:,jcol,icol)
676  if (i_accuminsolnumber>0) accuminsolnumber(:,1,1) = current_state%zq(i_accuminsolnumber)%data(:,jcol,icol)
677  if (i_accuminsolnumber>0) daccuminsolnumber(:,1,1) = current_state%sq(i_accuminsolnumber)%data(:,jcol,icol)
678  if (i_activesolnumber>0) activesolnumber(:,1,1) = current_state%zq(i_activesolnumber)%data(:,jcol,icol)
679  if (i_activesolnumber>0) dactivesolnumber(:,1,1) = current_state%sq(i_activesolnumber)%data(:,jcol,icol)
680  if (i_activeinsolnumber>0) activeinsolnumber(:,1,1) = current_state%zq(i_activeinsolnumber)%data(:,jcol,icol)
681  if (i_activeinsolnumber>0)dactiveinsolnumber(:,1,1) = current_state%sq(i_activeinsolnumber)%data(:,jcol,icol)
682 
683  CALL shipway_microphysics( &
684  ! in
685  its, ite, &
686  jts, jte, &
687  kts, kte, &
688  dtwp, &
689  qv, qc, qr, &
690  nc, nr, m3r, &
691  qi, qs, qg, &
692  ni, ns, ng, &
693  m3s, m3g, &
694  theta, &
698  activesolliquid, &
699  activesolrain, &
701  activeinsolice, &
702  activesolice, &
704  accuminsolmass, &
706  activesolnumber, &
708  aitkensolbk, &
709  accumsolbk, &
710  coarsesolbk, &
711  exner, &
712  pressure, rho, &
713  w, tke, &
714  z_half, z_centre, &
715  dz, &
716  ! in/out
717  dqv, dqc, dqr, dnc, dnr, dm3r, &
718  dqi, dqs, dqg, dni, dns, dng, dm3s, dm3g, &
719  dth, &
724  dactivesolrain, &
726  dactiveinsolice, &
727  dactivesolice, &
729  daccuminsolmass, &
733  ils, ile, &
734  jls, jle, &
735  kls, kle, &
736  l_tendency=.true. &
737  )
738 
739  ! write back the tendencies
740  current_state%sth%data(:,jcol,icol) = current_state%sth%data(:,jcol,icol) + dth(:,1,1)
741 
742  iqx = iqv
743  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqv(:,1,1)
744 
745  ! Warm microphysical fields
746  IF (nq_l > 0)then
747  iqx = iql
748  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqc(:,1,1)
749  end IF
750 
751  IF (nq_r > 0)then
752  iqx = iqr
753  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqr(:,1,1)
754  end IF
755  IF (nq_l > 1)then
756  iqx = inl
757  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dnc(:,1,1)
758  end IF
759  IF (nq_r > 1)then
760  iqx = inr
761  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dnr(:,1,1)
762  end IF
763  IF (nq_r > 2)then
764  iqx = i3mr
765  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dm3r(:,1,1)
766  end IF
767 
768  ! Ice microphysical fields
769  IF (nq_i > 0)then
770  iqx = iqi
771  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqi(:,1,1)
772  end IF
773  IF (nq_s > 0)then
774  iqx = iqs
775  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqs(:,1,1)
776  end IF
777  IF (nq_g > 0)then
778  iqx = iqg
779  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dqg(:,1,1)
780  end IF
781  IF (nq_i > 1)then
782  iqx = ini
783  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dni(:,1,1)
784  end IF
785  IF (nq_s > 1)then
786  iqx = ins
787  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dns(:,1,1)
788  end IF
789  IF (nq_g > 1)then
790  iqx = ing
791  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dng(:,1,1)
792  end IF
793  IF (nq_s > 2)then
794  iqx = i3ms
795  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dm3s(:,1,1)
796  end IF
797  IF (nq_g > 2)then
798  iqx = i3mg
799  current_state%sq(iqx)%data(:,jcol,icol) = current_state%sq(iqx)%data(:,jcol,icol) + dm3g(:,1,1)
800  end IF
801 
802  ! Aerosol fields
803 
804  if (i_aitkensolmass>0) current_state%sq(i_aitkensolmass)%data(:,jcol,icol) &
805  = current_state%sq(i_aitkensolmass)%data(:,jcol,icol) + daitkensolmass(:,1,1)
806  if (i_aitkensolnumber>0) current_state%sq(i_aitkensolnumber)%data(:,jcol,icol) &
807  = current_state%sq(i_aitkensolnumber)%data(:,jcol,icol) + daitkensolnumber(:,1,1)
808  if (i_accumsolmass>0) current_state%sq(i_accumsolmass)%data(:,jcol,icol) &
809  = current_state%sq(i_accumsolmass)%data(:,jcol,icol) + daccumsolmass(:,1,1)
810  if (i_accumsolnumber>0) current_state%sq(i_accumsolnumber)%data(:,jcol,icol) &
811  = current_state%sq(i_accumsolnumber)%data(:,jcol,icol) + daccumsolnumber(:,1,1)
812  if (i_coarsesolmass>0) current_state%sq(i_coarsesolmass)%data(:,jcol,icol) &
813  = current_state%sq(i_coarsesolmass)%data(:,jcol,icol) + dcoarsesolmass(:,1,1)
814  if (i_coarsesolnumber>0) current_state%sq(i_coarsesolnumber)%data(:,jcol,icol) &
815  = current_state%sq(i_coarsesolnumber)%data(:,jcol,icol) + dcoarsesolnumber(:,1,1)
816  if (i_activesolliquid>0) current_state%sq(i_activesolliquid)%data(:,jcol,icol) &
817  = current_state%sq(i_activesolliquid)%data(:,jcol,icol) + dactivesolliquid(:,1,1)
818  if (i_coarsedustmass>0) current_state%sq(i_coarsedustmass)%data(:,jcol,icol) &
819  = current_state%sq(i_coarsedustmass)%data(:,jcol,icol) + dcoarsedustmass(:,1,1)
820  if (i_coarsedustnumber>0) current_state%sq(i_coarsedustnumber)%data(:,jcol,icol) &
821  = current_state%sq(i_coarsedustnumber)%data(:,jcol,icol) + dcoarsedustnumber(:,1,1)
822  if (i_activeinsolice>0) current_state%sq(i_activeinsolice)%data(:,jcol,icol) &
823  = current_state%sq(i_activeinsolice)%data(:,jcol,icol) + dactiveinsolice(:,1,1)
824  if (i_activesolice>0) current_state%sq(i_activesolice)%data(:,jcol,icol) &
825  = current_state%sq(i_activesolice)%data(:,jcol,icol) + dactivesolice(:,1,1)
826  if (i_activeinsolliquid>0) current_state%sq(i_activeinsolliquid)%data(:,jcol,icol) &
827  = current_state%sq(i_activeinsolliquid)%data(:,jcol,icol) + dactiveinsolliquid(:,1,1)
828  if (i_accuminsolmass>0) current_state%sq(i_accuminsolmass)%data(:,jcol,icol) &
829  = current_state%sq(i_accuminsolmass)%data(:,jcol,icol) + daccuminsolmass(:,1,1)
830  if (i_accuminsolnumber>0) current_state%sq(i_accuminsolnumber)%data(:,jcol,icol) &
831  = current_state%sq(i_accuminsolnumber)%data(:,jcol,icol) + daccuminsolnumber(:,1,1)
832  if (i_activesolnumber>0) current_state%sq(i_activesolnumber)%data(:,jcol,icol) &
833  = current_state%sq(i_activesolnumber)%data(:,jcol,icol) + dactivesolnumber(:,1,1)
834  if (i_activeinsolnumber>0) current_state%sq(i_activeinsolnumber)%data(:,jcol,icol) &
835  = current_state%sq(i_activeinsolnumber)%data(:,jcol,icol) + dactiveinsolnumber(:,1,1)
836 
837  ! for total surface precipitation, sum the surface rain rate (cloud + rain which is precip_r)
838  ! and surface
839  ! snow rate (precip_s), which is the sum of ice, snow and graupel (See micromain.F90 in casim for
840  ! calculation).
841  if (l_warm) then
842  surface_precip(target_y_index,target_x_index) = &
843  casdiags % SurfaceRainR(1,1)
844  else
845  surface_precip(target_y_index,target_x_index) = &
846  casdiags % SurfaceRainR(1,1) + casdiags % SurfaceSnowR(1,1)
847  endif
848  call populate_casim_monc_dg(current_state, casdiags)
849 
850 
851  end subroutine timestep_callback
852 
853 
854  !! Reads the casim configuration
855  !! @param current_state The current model state
856  subroutine read_configuration(current_state)
857 
858 
859  Use mphys_parameters, only: p1, p2, p3, sp1, sp2, sp3
860 
861  type(model_state_type), target, intent(inout) :: current_state
862 
863  integer :: ierr
864 
865  option = options_get_integer(current_state%options_database, 'option')
866  diag_mu_option = options_get_integer(current_state%options_database, 'diag_mu_option')
867  iopt_act = options_get_integer(current_state%options_database, 'iopt_act')
868  iopt_inuc = options_get_integer(current_state%options_database, 'iopt_inuc')
869  process_level = options_get_integer(current_state%options_database, 'process_level')
870  aerosol_option = options_get_integer(current_state%options_database, 'aerosol_option')
871  max_step_length = options_get_real(current_state%options_database, 'max_step_length')
872  max_sed_length = options_get_real(current_state%options_database, 'max_sed_length')
873  p1 = options_get_real(current_state%options_database, 'p1')
874  p2 = options_get_real(current_state%options_database, 'p2')
875  p3 = options_get_real(current_state%options_database, 'p3')
876  sp1 = options_get_real(current_state%options_database, 'sp1')
877  sp2 = options_get_real(current_state%options_database, 'sp2')
878  sp3 = options_get_real(current_state%options_database, 'sp3')
879  max_mu = options_get_real(current_state%options_database, 'max_mu')
880  fix_mu = options_get_real(current_state%options_database, 'fix_mu')
881 
882  l_aaut = options_get_logical(current_state%options_database, 'l_aaut')
883  l_aacc = options_get_logical(current_state%options_database, 'l_aacc')
884  l_aevp = options_get_logical(current_state%options_database, 'l_aevp')
885  l_ased = options_get_logical(current_state%options_database, 'l_ased')
886  l_warm = options_get_logical(current_state%options_database, 'l_warm')
887  l_inuc = options_get_logical(current_state%options_database, 'l_inuc')
888  l_iaut = options_get_logical(current_state%options_database, 'l_iaut')
889  l_idep = options_get_logical(current_state%options_database, 'l_idep')
890  l_iacw = options_get_logical(current_state%options_database, 'l_iacw')
891  l_active_inarg2000 = options_get_logical(current_state%options_database, 'l_active_inarg2000')
892  l_separate_rain = options_get_logical(current_state%options_database, 'l_separate_rain')
893  l_sg = options_get_logical(current_state%options_database, 'l_sg')
894  l_g = options_get_logical(current_state%options_database, 'l_g')
895  l_passive = options_get_logical(current_state%options_database, 'l_passive')
896  l_passive3m = options_get_logical(current_state%options_database, 'l_passive3m')
897  l_limit_psd = options_get_logical(current_state%options_database, 'l_limit_psd')
898  l_override_checks = options_get_logical(current_state%options_database, 'l_override_checks')
899  l_raci_g = options_get_logical(current_state%options_database, 'l_raci_g')
900  l_onlycollect = options_get_logical(current_state%options_database, 'l_onlycollect')
901  l_abelshipway = options_get_logical(current_state%options_database, 'l_abelshipway')
902  l_cons = options_get_logical(current_state%options_database, 'l_cons')
903  l_rain = options_get_logical(current_state%options_database, 'l_rain')
904  l_sed_3mdiff = options_get_logical(current_state%options_database, 'l_sed_3mdiff')
905  l_sed_icecloud_as_1m = options_get_logical(current_state%options_database, 'l_sed_icecloud_as_1m')
906  l_tidy_conserve_e = options_get_logical(current_state%options_database, 'l_tidy_conserve_E')
907  l_tidy_conserve_q = options_get_logical(current_state%options_database, 'l_tidy_conserve_q')
908 
909  l_inhom_revp = options_get_logical(current_state%options_database, 'l_inhom_revp')
910  l_pcond = options_get_logical(current_state%options_database, 'l_pcond')
911  l_praut = options_get_logical(current_state%options_database, 'l_praut')
912  l_pracw = options_get_logical(current_state%options_database, 'l_pracw')
913  l_pracr = options_get_logical(current_state%options_database, 'l_pracr')
914  l_prevp = options_get_logical(current_state%options_database, 'l_prevp')
915  l_psedl = options_get_logical(current_state%options_database, 'l_psedl')
916  l_psedr = options_get_logical(current_state%options_database, 'l_psedr')
917  l_ptidy = options_get_logical(current_state%options_database, 'l_ptidy')
918  l_ptidy2 = options_get_logical(current_state%options_database, 'l_ptidy2')
919  l_pinuc = options_get_logical(current_state%options_database, 'l_pinuc')
920  l_pidep = options_get_logical(current_state%options_database, 'l_pidep')
921  l_piacw = options_get_logical(current_state%options_database, 'l_piacw')
922  l_psaut = options_get_logical(current_state%options_database, 'l_psaut')
923  l_psdep = options_get_logical(current_state%options_database, 'l_psdep')
924  l_psacw = options_get_logical(current_state%options_database, 'l_psacw')
925  l_pgdep = options_get_logical(current_state%options_database, 'l_pgdep')
926  l_pseds = options_get_logical(current_state%options_database, 'l_pseds')
927  l_psedi = options_get_logical(current_state%options_database, 'l_psedi')
928  l_psedg = options_get_logical(current_state%options_database, 'l_psedg')
929  l_psaci = options_get_logical(current_state%options_database, 'l_psaci')
930  l_praci = options_get_logical(current_state%options_database, 'l_praci')
931  l_psacr = options_get_logical(current_state%options_database, 'l_psacr')
932  l_pgacr = options_get_logical(current_state%options_database, 'l_pgacr')
933  l_pgacw = options_get_logical(current_state%options_database, 'l_pgacw')
934  l_pgaci = options_get_logical(current_state%options_database, 'l_pgaci')
935  l_pgacs = options_get_logical(current_state%options_database, 'l_pgacs')
936  l_piagg = options_get_logical(current_state%options_database, 'l_piagg')
937  l_psagg = options_get_logical(current_state%options_database, 'l_psagg')
938  l_pgagg = options_get_logical(current_state%options_database, 'l_pgagg')
939  l_psbrk = options_get_logical(current_state%options_database, 'l_psbrk')
940  l_pgshd = options_get_logical(current_state%options_database, 'l_pgshd')
941  l_pihal = options_get_logical(current_state%options_database, 'l_pihal')
942  l_psmlt = options_get_logical(current_state%options_database, 'l_psmlt')
943  l_pgmlt = options_get_logical(current_state%options_database, 'l_pgmlt')
944  l_phomr = options_get_logical(current_state%options_database, 'l_phomr')
945  l_phomc = options_get_logical(current_state%options_database, 'l_phomc')
946  l_pssub = options_get_logical(current_state%options_database, 'l_pssub')
947  l_pgsub = options_get_logical(current_state%options_database, 'l_pgsub')
948  l_pisub = options_get_logical(current_state%options_database, 'l_pisub')
949  l_pimlt = options_get_logical(current_state%options_database, 'l_pimlt')
950 
951  end subroutine read_configuration
952 
953  subroutine field_information_retrieval_callback(current_state, name, field_information)
954  type(model_state_type), target, intent(inout) :: current_state
955  character(len=*), intent(in) :: name
956  type(component_field_information_type), intent(out) :: field_information
957 
958  field_information%field_type=component_array_field_type
959  field_information%data_type=component_double_data_type
960  if (name .eq. "surface_precip") then
961  field_information%number_dimensions=2
962  field_information%dimension_sizes(1)=current_state%local_grid%size(y_index)
963  field_information%dimension_sizes(2)=current_state%local_grid%size(x_index)
964  !else if (name .eq. "pcond_total" .or. name .eq. "psedl_total") then
965  ! field_information%number_dimensions=1
966  ! field_information%dimension_sizes(1)=current_state%local_grid%size(Z_INDEX)
967  else
968  field_information%number_dimensions=3
969  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
970  field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
971  field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
972  endif
973 
974  field_information%enabled=.true.
975 
977 
982  subroutine field_value_retrieval_callback(current_state, name, field_value)
983  type(model_state_type), target, intent(inout) :: current_state
984  character(len=*), intent(in) :: name
985  type(component_field_value_type), intent(out) :: field_value
986 
987  integer :: i
988 
989  if (name .eq. "surface_precip") then
990  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
991  current_state%local_grid%size(x_index)))
992  field_value%real_2d_array(:,:)= surface_precip(:,:)
993  else if (name .eq. "condensation_rate") then
994  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
995  current_state%local_grid%size(y_index), &
996  current_state%local_grid%size(x_index)))
997  field_value%real_3d_array(:,:,:) = casim_monc_dgs % pcond(:,:,:)
998 !!$ else if (name .eq. "pcond_total") then
999 !!$ allocate(field_value%real_1d_array(current_state%local_grid%size(Z_INDEX)))
1000 !!$ field_value%real_1d_array(:)=pcond_tot(:)
1001  end if
1002 
1003  end subroutine field_value_retrieval_callback
1004 
1005 end module casim_mod
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
casim_mod::daccuminsolmass
real(wp), dimension(:,:,:), allocatable daccuminsolmass
Definition: casim.F90:135
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
casim_mod::dactiveinsolice
real(wp), dimension(:,:,:), allocatable dactiveinsolice
Definition: casim.F90:132
casim_mod::iqv
integer iqv
Definition: casim.F90:145
casim_mod::dth
real(wp), dimension(:,:,:), allocatable dth
Definition: casim.F90:121
casim_mod::dns
real(wp), dimension(:,:,:), allocatable dns
Definition: casim.F90:121
casim_mod::daitkensolmass
real(wp), dimension(:,:,:), allocatable daitkensolmass
Definition: casim.F90:128
casim_mod::i_activeinsolice
integer i_activeinsolice
Definition: casim.F90:148
casim_mod::psedr_tot
real(kind=default_precision), dimension(:), allocatable psedr_tot
Definition: casim.F90:167
casim_mod::kle
integer kle
Definition: casim.F90:142
casim_mod::qs
real(wp), dimension(:,:,:), allocatable qs
Definition: casim.F90:91
casim_mod::activesolnumber
real(wp), dimension(:,:,:), allocatable activesolnumber
Definition: casim.F90:109
casim_mod::i_activesolice
integer i_activesolice
Definition: casim.F90:148
casim_mod::psedg_tot
real(kind=default_precision), dimension(:), allocatable psedg_tot
Definition: casim.F90:167
casim_mod::i_activesolrain
integer i_activesolrain
Definition: casim.F90:148
casim_mod::pimlt_tot
real(kind=default_precision), dimension(:), allocatable pimlt_tot
Definition: casim.F90:167
casim_mod::dnc
real(wp), dimension(:,:,:), allocatable dnc
Definition: casim.F90:121
casim_mod::activesolliquid
real(wp), dimension(:,:,:), allocatable activesolliquid
Definition: casim.F90:99
casim_mod::jle
integer jle
Definition: casim.F90:142
casim_mod::initialisation_callback
subroutine initialisation_callback(current_state)
The initialisation callback sets up the microphysics.
Definition: casim.F90:225
casim_mod::daccumsolnumber
real(wp), dimension(:,:,:), allocatable daccumsolnumber
Definition: casim.F90:126
grids_mod::x_index
integer, parameter, public x_index
Definition: grids.F90:14
casim_mod::psacw_tot
real(kind=default_precision), dimension(:), allocatable psacw_tot
Definition: casim.F90:167
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
grids_mod::y_index
integer, parameter, public y_index
Definition: grids.F90:14
casim_mod::dactivesolliquid
real(wp), dimension(:,:,:), allocatable dactivesolliquid
Definition: casim.F90:127
casim_mod::i_coarsesolmass
integer i_coarsesolmass
Definition: casim.F90:148
casim_mod::dqv
real(wp), dimension(:,:,:), allocatable dqv
Definition: casim.F90:121
casim_mod::i_aitkensolnumber
integer i_aitkensolnumber
Definition: casim.F90:148
casim_mod::pseds_tot
real(kind=default_precision), dimension(:), allocatable pseds_tot
Definition: casim.F90:167
logging_mod::log_info
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
Definition: logging.F90:13
casim_mod::coarsedustmass
real(wp), dimension(:,:,:), allocatable coarsedustmass
Definition: casim.F90:103
casim_mod::dcoarsedustmass
real(wp), dimension(:,:,:), allocatable dcoarsedustmass
Definition: casim.F90:131
casim_monc_dgs_space::allocate_casim_monc_dgs_space
subroutine allocate_casim_monc_dgs_space(current_state, casdiags)
Definition: casim_monc_dgs_space.F90:85
casim_mod::praut_tot
real(kind=default_precision), dimension(:), allocatable praut_tot
Definition: casim.F90:167
casim_mod::prevp_tot
real(kind=default_precision), dimension(:), allocatable prevp_tot
Definition: casim.F90:167
casim_mod::ils
integer ils
Definition: casim.F90:142
casim_mod::i3ms
integer i3ms
Definition: casim.F90:147
casim_mod::i_activeinsolnumber
integer i_activeinsolnumber
Definition: casim.F90:148
casim_mod::psaci_tot
real(kind=default_precision), dimension(:), allocatable psaci_tot
Definition: casim.F90:167
casim_mod::activesolice
real(wp), dimension(:,:,:), allocatable activesolice
Definition: casim.F90:105
casim_mod::dng
real(wp), dimension(:,:,:), allocatable dng
Definition: casim.F90:121
casim_mod::dqr
real(wp), dimension(:,:,:), allocatable dqr
Definition: casim.F90:121
casim_mod::dqg
real(wp), dimension(:,:,:), allocatable dqg
Definition: casim.F90:121
casim_mod::w
real(wp), dimension(:,:,:), allocatable w
Definition: casim.F90:91
casim_mod::kls
integer kls
Definition: casim.F90:142
casim_mod::pgsub_tot
real(kind=default_precision), dimension(:), allocatable pgsub_tot
Definition: casim.F90:167
casim_mod::i_activeinsolliquid
integer i_activeinsolliquid
Definition: casim.F90:148
casim_mod::i_aitkensolmass
integer i_aitkensolmass
Definition: casim.F90:148
casim_mod::ns
real(wp), dimension(:,:,:), allocatable ns
Definition: casim.F90:91
casim_mod::kte
integer kte
Definition: casim.F90:142
casim_mod::dcoarsesolnumber
real(wp), dimension(:,:,:), allocatable dcoarsesolnumber
Definition: casim.F90:129
casim_mod::m3g
real(wp), dimension(:,:,:), allocatable m3g
Definition: casim.F90:91
casim_mod::m3s
real(wp), dimension(:,:,:), allocatable m3s
Definition: casim.F90:91
casim_mod::dqs
real(wp), dimension(:,:,:), allocatable dqs
Definition: casim.F90:121
monc_component_mod
Interfaces and types that MONC components must specify.
Definition: monc_component.F90:6
casim_mod::inl
integer inl
Definition: casim.F90:146
casim_mod::pressure
real(wp), dimension(:,:,:), allocatable pressure
Definition: casim.F90:91
casim_mod::casim_get_descriptor
type(component_descriptor_type) function, public casim_get_descriptor()
Provides the descriptor back to the caller and is used in component registration.
Definition: casim.F90:179
casim_mod::theta
real(wp), dimension(:,:,:), allocatable theta
Definition: casim.F90:91
casim_mod::i_coarsedustmass
integer i_coarsedustmass
Definition: casim.F90:148
casim_mod::inr
integer inr
Definition: casim.F90:146
casim_mod::jte
integer jte
Definition: casim.F90:142
casim_mod::i_accuminsolnumber
integer i_accuminsolnumber
Definition: casim.F90:148
casim_mod::psmlt_tot
real(kind=default_precision), dimension(:), allocatable psmlt_tot
Definition: casim.F90:167
casim_mod::nc
real(wp), dimension(:,:,:), allocatable nc
Definition: casim.F90:91
casim_mod::jls
integer jls
Definition: casim.F90:142
casim_mod::i_activesolnumber
integer i_activesolnumber
Definition: casim.F90:148
casim_mod::i_accumsolnumber
integer i_accumsolnumber
Definition: casim.F90:148
casim_mod::qc
real(wp), dimension(:,:,:), allocatable qc
Definition: casim.F90:91
casim_mod::its
integer its
Definition: casim.F90:142
casim_mod::dz
real(wp), dimension(:,:,:), allocatable dz
Definition: casim.F90:91
casim_mod::dni
real(wp), dimension(:,:,:), allocatable dni
Definition: casim.F90:121
casim_mod::ile
integer ile
Definition: casim.F90:142
casim_mod::dactivesolice
real(wp), dimension(:,:,:), allocatable dactivesolice
Definition: casim.F90:133
casim_mod::coarsesolmass
real(wp), dimension(:,:,:), allocatable coarsesolmass
Definition: casim.F90:101
casim_mod::field_information_retrieval_callback
subroutine field_information_retrieval_callback(current_state, name, field_information)
Definition: casim.F90:954
casim_mod::psedi_tot
real(kind=default_precision), dimension(:), allocatable psedi_tot
Definition: casim.F90:167
casim_mod::ni
real(wp), dimension(:,:,:), allocatable ni
Definition: casim.F90:91
casim_mod::rho
real(wp), dimension(:,:,:), allocatable rho
Definition: casim.F90:91
casim_mod::aitkensolbk
real(wp), dimension(:,:,:), allocatable aitkensolbk
Definition: casim.F90:115
casim_mod::iqg
integer iqg
Definition: casim.F90:145
casim_mod::dqi
real(wp), dimension(:,:,:), allocatable dqi
Definition: casim.F90:121
casim_mod::activesolrain
real(wp), dimension(:,:,:), allocatable activesolrain
Definition: casim.F90:102
science_constants_mod
Scientific constant values used throughout simulations. Each has a default value and this can be over...
Definition: scienceconstants.F90:3
casim_mod::i_coarsedustnumber
integer i_coarsedustnumber
Definition: casim.F90:148
casim_mod::psedl_tot
real(kind=default_precision), dimension(:), allocatable psedl_tot
Definition: casim.F90:167
casim_mod::qg
real(wp), dimension(:,:,:), allocatable qg
Definition: casim.F90:91
casim_mod::daccuminsolnumber
real(wp), dimension(:,:,:), allocatable daccuminsolnumber
Definition: casim.F90:136
casim_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: casim.F90:983
casim_mod::pcond_tot
real(kind=default_precision), dimension(:), allocatable pcond_tot
Definition: casim.F90:167
casim_mod::exner
real(wp), dimension(:,:,:), allocatable exner
Definition: casim.F90:91
grids_mod::z_index
integer, parameter, public z_index
Grid index parameters.
Definition: grids.F90:14
casim_mod::iqr
integer iqr
Definition: casim.F90:145
casim_mod::accumsolnumber
real(wp), dimension(:,:,:), allocatable accumsolnumber
Definition: casim.F90:98
casim_monc_dgs_space
Definition: casim_monc_dgs_space.F90:1
casim_mod::qi
real(wp), dimension(:,:,:), allocatable qi
Definition: casim.F90:91
casim_mod::tke
real(wp), dimension(:,:,:), allocatable tke
Definition: casim.F90:91
casim_mod::dqc
real(wp), dimension(:,:,:), allocatable dqc
Definition: casim.F90:121
casim_mod::daitkensolnumber
real(wp), dimension(:,:,:), allocatable daitkensolnumber
Definition: casim.F90:128
casim_mod::dm3s
real(wp), dimension(:,:,:), allocatable dm3s
Definition: casim.F90:121
q_indices_mod::standard_q_names
type(standard_q_names_type), public standard_q_names
Definition: q_indices.F90:59
casim_mod::i3mr
integer i3mr
Definition: casim.F90:147
casim_mod::dcoarsedustnumber
real(wp), dimension(:,:,:), allocatable dcoarsedustnumber
Definition: casim.F90:131
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
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
casim_mod::ing
integer ing
Definition: casim.F90:146
casim_mod::i_coarsesolnumber
integer i_coarsesolnumber
Definition: casim.F90:148
casim_mod::pidep_tot
real(kind=default_precision), dimension(:), allocatable pidep_tot
Definition: casim.F90:167
state_mod::forward_stepping
integer, parameter, public forward_stepping
Definition: state.F90:15
casim_mod::nr
real(wp), dimension(:,:,:), allocatable nr
Definition: casim.F90:91
monc_component_mod::component_field_information_type
Definition: monc_component.F90:31
casim_mod::psacr_tot
real(kind=default_precision), dimension(:), allocatable psacr_tot
Definition: casim.F90:167
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
casim_monc_dgs_space::populate_casim_monc_dg
subroutine populate_casim_monc_dg(current_state, casdiags)
Definition: casim_monc_dgs_space.F90:298
casim_mod::read_configuration
subroutine read_configuration(current_state)
Definition: casim.F90:857
casim_mod::i_accumsolmass
integer i_accumsolmass
Definition: casim.F90:148
casim_mod
Implimentation of CASIM microphysics.
Definition: casim.F90:2
casim_mod::activeinsolliquid
real(wp), dimension(:,:,:), allocatable activeinsolliquid
Definition: casim.F90:106
casim_mod::pinuc_tot
real(kind=default_precision), dimension(:), allocatable pinuc_tot
Definition: casim.F90:167
casim_mod::i3mg
integer i3mg
Definition: casim.F90:147
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
casim_mod::pracw_tot
real(kind=default_precision), dimension(:), allocatable pracw_tot
Definition: casim.F90:167
casim_mod::timestep_callback
subroutine timestep_callback(current_state)
Called for each column per timestep this will calculate the microphysical tendencies.
Definition: casim.F90:503
logging_mod
Logging utility.
Definition: logging.F90:2
casim_mod::ite
integer ite
Definition: casim.F90:142
casim_mod::pssub_tot
real(kind=default_precision), dimension(:), allocatable pssub_tot
Definition: casim.F90:167
casim_mod::aitkensolmass
real(wp), dimension(:,:,:), allocatable aitkensolmass
Definition: casim.F90:100
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
casim_mod::dactivesolrain
real(wp), dimension(:,:,:), allocatable dactivesolrain
Definition: casim.F90:130
casim_mod::ng
real(wp), dimension(:,:,:), allocatable ng
Definition: casim.F90:91
casim_mod::aitkensolnumber
real(wp), dimension(:,:,:), allocatable aitkensolnumber
Definition: casim.F90:100
casim_mod::daccumsolmass
real(wp), dimension(:,:,:), allocatable daccumsolmass
Definition: casim.F90:126
casim_mod::accuminsolmass
real(wp), dimension(:,:,:), allocatable accuminsolmass
Definition: casim.F90:107
casim_mod::jts
integer jts
Definition: casim.F90:142
casim_mod::m3r
real(wp), dimension(:,:,:), allocatable m3r
Definition: casim.F90:91
logging_mod::log_master_log
subroutine, public log_master_log(level, message)
Will log just from the master process.
Definition: logging.F90:47
casim_mod::iqs
integer iqs
Definition: casim.F90:145
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
casim_mod::coarsedustnumber
real(wp), dimension(:,:,:), allocatable coarsedustnumber
Definition: casim.F90:103
registry_mod
MONC component registry.
Definition: registry.F90:5
casim_mod::pgacs_tot
real(kind=default_precision), dimension(:), allocatable pgacs_tot
Definition: casim.F90:167
casim_mod::accuminsolnumber
real(wp), dimension(:,:,:), allocatable accuminsolnumber
Definition: casim.F90:108
casim_mod::psdep_tot
real(kind=default_precision), dimension(:), allocatable psdep_tot
Definition: casim.F90:167
casim_mod::pgmlt_tot
real(kind=default_precision), dimension(:), allocatable pgmlt_tot
Definition: casim.F90:167
casim_mod::iql
integer iql
Definition: casim.F90:145
casim_mod::accumsolbk
real(wp), dimension(:,:,:), allocatable accumsolbk
Definition: casim.F90:116
casim_mod::ins
integer ins
Definition: casim.F90:146
casim_mod::activeinsolice
real(wp), dimension(:,:,:), allocatable activeinsolice
Definition: casim.F90:104
casim_mod::pgacw_tot
real(kind=default_precision), dimension(:), allocatable pgacw_tot
Definition: casim.F90:167
casim_mod::ini
integer ini
Definition: casim.F90:146
casim_mod::i_activesolliquid
integer i_activesolliquid
Definition: casim.F90:148
casim_mod::activeinsolnumber
real(wp), dimension(:,:,:), allocatable activeinsolnumber
Definition: casim.F90:110
casim_mod::kts
integer kts
Definition: casim.F90:142
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
casim_mod::dactivesolnumber
real(wp), dimension(:,:,:), allocatable dactivesolnumber
Definition: casim.F90:137
casim_mod::accumsolmass
real(wp), dimension(:,:,:), allocatable accumsolmass
Definition: casim.F90:98
casim_mod::dactiveinsolnumber
real(wp), dimension(:,:,:), allocatable dactiveinsolnumber
Definition: casim.F90:138
casim_mod::phomc_tot
real(kind=default_precision), dimension(:), allocatable phomc_tot
Definition: casim.F90:167
casim_mod::z_half
real(wp), dimension(:,:,:), allocatable z_half
Definition: casim.F90:91
optionsdatabase_mod
Manages the options database. Contains administration functions and deduce runtime options from the c...
Definition: optionsdatabase.F90:7
casim_mod::iqi
integer iqi
Definition: casim.F90:145
casim_mod::pisub_tot
real(kind=default_precision), dimension(:), allocatable pisub_tot
Definition: casim.F90:167
casim_mod::qv
real(wp), dimension(:,:,:), allocatable qv
Definition: casim.F90:91
casim_mod::piacw_tot
real(kind=default_precision), dimension(:), allocatable piacw_tot
Definition: casim.F90:167
casim_mod::dactiveinsolliquid
real(wp), dimension(:,:,:), allocatable dactiveinsolliquid
Definition: casim.F90:134
casim_mod::dm3g
real(wp), dimension(:,:,:), allocatable dm3g
Definition: casim.F90:121
casim_mod::z_centre
real(wp), dimension(:,:,:), allocatable z_centre
Definition: casim.F90:91
casim_monc_dgs_space::casim_monc_dgs
type(casim_monc_dglist) casim_monc_dgs
Definition: casim_monc_dgs_space.F90:80
casim_mod::dm3r
real(wp), dimension(:,:,:), allocatable dm3r
Definition: casim.F90:121
monc_component_mod::component_descriptor_type
Description of a component.
Definition: monc_component.F90:42
casim_mod::surface_precip
real(wp), dimension(:,:), allocatable surface_precip
Definition: casim.F90:140
monc_component_mod::component_double_data_type
integer, parameter, public component_double_data_type
Definition: monc_component.F90:16
casim_mod::qr
real(wp), dimension(:,:,:), allocatable qr
Definition: casim.F90:91
casim_mod::psaut_tot
real(kind=default_precision), dimension(:), allocatable psaut_tot
Definition: casim.F90:167
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
casim_mod::coarsesolnumber
real(wp), dimension(:,:,:), allocatable coarsesolnumber
Definition: casim.F90:101
casim_mod::coarsesolbk
real(wp), dimension(:,:,:), allocatable coarsesolbk
Definition: casim.F90:117
casim_mod::dnr
real(wp), dimension(:,:,:), allocatable dnr
Definition: casim.F90:121
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
casim_mod::i_accuminsolmass
integer i_accuminsolmass
Definition: casim.F90:148
state_mod
The model state which represents the current state of a run.
Definition: state.F90:2
casim_mod::dcoarsesolmass
real(wp), dimension(:,:,:), allocatable dcoarsesolmass
Definition: casim.F90:129
monc_component_mod::component_array_field_type
integer, parameter, public component_array_field_type
Definition: monc_component.F90:15