MONC
socrates_couple.F90
Go to the documentation of this file.
1 
13  use grids_mod, only : z_index, y_index, x_index
14  use science_constants_mod, only : cp
16  use logging_mod, only : log_info, log_warn, log_error, &
21  use sw_rad_input_mod, only: sw_input
22  use lw_rad_input_mod, only: lw_input
23  ! this module exists in the radiance_core dir
24  USE def_spectrum, ONLY: strspecdata
25  ! monc socrates couple modules, based on UM
26  USE sw_control_mod, ONLY: sw_control
27  USE lw_control_mod, ONLY: lw_control
28  USE rad_ctl_mod, ONLY: rad_ctl
29  ! monc socrates couple modules, only used in MONC
38  use merge_atm_data, only: merge_data
40 
41  implicit none
42 
43  ! Index for the top of the domain
45  !
46  ! local density factor and raidiation factor used in conversions
47  real(kind=default_precision), allocatable :: density_factor(:), radiation_factor(:)
48  !
49  TYPE (strspecdata), SAVE :: sw_spectrum
50  TYPE (strspecdata), SAVE :: lw_spectrum
51 
56 
58 contains
59 
63  socrates_couple_get_descriptor%name="socrates_couple"
68 
71 
72  allocate(socrates_couple_get_descriptor%published_fields(14))
73 
74  socrates_couple_get_descriptor%published_fields(1)="flux_up_shortwave"
75  socrates_couple_get_descriptor%published_fields(2)="flux_down_shortwave"
76  socrates_couple_get_descriptor%published_fields(3)="flux_up_longwave"
77  socrates_couple_get_descriptor%published_fields(4)="flux_down_longwave"
78  socrates_couple_get_descriptor%published_fields(5)="toa_up_longwave"
79  socrates_couple_get_descriptor%published_fields(6)="surface_down_longwave"
80  socrates_couple_get_descriptor%published_fields(7)="surface_up_longwave"
81  socrates_couple_get_descriptor%published_fields(8)="toa_down_shortwave"
82  socrates_couple_get_descriptor%published_fields(9)="toa_up_shortwave"
83  socrates_couple_get_descriptor%published_fields(10)="surface_down_shortwave"
84  socrates_couple_get_descriptor%published_fields(11)="surface_up_shortwave"
85  socrates_couple_get_descriptor%published_fields(12)="shortwave_heating_rate"
86  socrates_couple_get_descriptor%published_fields(13)="longwave_heating_rate"
87  socrates_couple_get_descriptor%published_fields(14)="total_radiative_heating_rate"
88 
90 
94  subroutine initialisation_callback(current_state)
95  type(model_state_type), target, intent(inout) :: current_state
96 
97  integer :: k ! look counter
98 
99  k_top=current_state%local_grid%size(z_index) + current_state%local_grid%halo_size(z_index) * 2
100  y_local=current_state%local_grid%size(y_index) + current_state%local_grid%halo_size(y_index) * 2
101  x_local=current_state%local_grid%size(x_index) + current_state%local_grid%halo_size(x_index) * 2
102 
103  y_nohalos=current_state%local_grid%size(y_index)
104  x_nohalos=current_state%local_grid%size(x_index)
105 
106  !if (.not. current_state%continuation_run) then
107  ! Allocated the longwave and shortwave heating rates.They need to be added to
108  ! the dump
109  ! allocate(current_state%sth_lw%data(k_top, y_local, x_local))
110  ! allocate(current_state%sth_sw%data(k_top, y_local, x_local))
111  ! current_state%sth_lw%data(:,:,:) = 0.0
112  ! current_state%sth_sw%data(:,:,:) = 0.0
113  ! Allocate downward surface fluxes
114  ! allocate(current_state%sw_down_surf(y_local, x_local))
115  ! allocate(current_state%lw_down_surf(y_local, x_local))
116  ! current_state%sw_down_surf(:, :) = 0.0
117  ! current_state%lw_down_surf(:, :) = 0.0
118  !endif
119 
120  ! allocate the density and radiation factor needed for heating rates
121  allocate(socrates_derived_fields%density_factor(k_top))
122  allocate(socrates_derived_fields%radiation_factor(k_top))
123  !
124  ! allocate the fluxes, which do not need to be dumped
125  allocate(socrates_derived_fields%flux_up_sw(k_top,y_nohalos,x_nohalos))
126  allocate(socrates_derived_fields%flux_down_sw(k_top,y_nohalos,x_nohalos))
127  allocate(socrates_derived_fields%flux_up_lw(k_top,y_nohalos,x_nohalos))
128  allocate(socrates_derived_fields%flux_down_lw(k_top,y_nohalos,x_nohalos))
129  allocate(socrates_derived_fields%flux_net_sw(k_top,y_nohalos,x_nohalos))
130  allocate(socrates_derived_fields%flux_net_lw(k_top,y_nohalos,x_nohalos))
131  !
132  ! allocate the surface and TOA fields which are used for diagnostics
133  allocate(socrates_derived_fields%toa_up_longwave(y_nohalos,x_nohalos))
134  allocate(socrates_derived_fields%toa_down_shortwave(y_nohalos,x_nohalos))
135  allocate(socrates_derived_fields%toa_up_shortwave(y_nohalos,x_nohalos))
136  allocate(socrates_derived_fields%surface_up_longwave(y_nohalos,x_nohalos))
137  allocate(socrates_derived_fields%surface_down_longwave(y_nohalos,x_nohalos))
138  allocate(socrates_derived_fields%surface_down_shortwave(y_nohalos,x_nohalos))
139  allocate(socrates_derived_fields%surface_up_shortwave(y_nohalos,x_nohalos))
140  !
141  ! allocate radiative heating rates for diagnostics
142  allocate(socrates_derived_fields%swrad_hr(k_top, y_nohalos,x_nohalos))
143  allocate(socrates_derived_fields%lwrad_hr(k_top, y_nohalos,x_nohalos))
144  allocate(socrates_derived_fields%totrad_hr(k_top, y_nohalos,x_nohalos))
145 
146  ! initialise allocated variables to 0 for safety
147  socrates_derived_fields%flux_up_sw(:,:,:) = 0.0
148  socrates_derived_fields%flux_down_sw(:,:,:) = 0.0
149  socrates_derived_fields%flux_up_lw(:,:,:) = 0.0
150  socrates_derived_fields%flux_down_lw(:,:,:) = 0.0
151  socrates_derived_fields%flux_net_sw(:,:,:) = 0.0
152  socrates_derived_fields%flux_net_lw(:,:,:) = 0.0
153  socrates_derived_fields%toa_up_longwave(:,:) = 0.0
154  socrates_derived_fields%toa_down_shortwave(:,:) = 0.0
155  socrates_derived_fields%toa_up_shortwave(:,:) = 0.0
156  socrates_derived_fields%surface_up_longwave(:,:) = 0.0
157  socrates_derived_fields%surface_down_longwave(:,:) = 0.0
158  socrates_derived_fields%surface_down_shortwave(:,:) = 0.0
159  socrates_derived_fields%surface_up_shortwave(:,:) = 0.0
160  socrates_derived_fields%swrad_hr(:,:,:) = 0.0
161  socrates_derived_fields%lwrad_hr(:,:,:) = 0.0
162  socrates_derived_fields%totrad_hr(:,:,:) = 0.0
163 
164  ! derive density and radiation factor for heating rate calculation
165  socrates_derived_fields%density_factor(1) = 0.0
166  do k = 2, k_top
167  socrates_derived_fields%density_factor(k) = &
168  current_state%global_grid%configuration%vertical%rhon(k)* &
169  current_state%global_grid%configuration%vertical%dz(k)
170  enddo
171  socrates_derived_fields%density_factor(1) = socrates_derived_fields%density_factor(2)
172 
173  socrates_derived_fields%radiation_factor(2:k_top) = &
174  1.0/(socrates_derived_fields%density_factor(2:k_top)*cp)
175  socrates_derived_fields%radiation_factor(1) = socrates_derived_fields%radiation_factor(2)
176 
177  call set_and_test_socrates_monc_options(current_state, socrates_opt)
178 
179  ! set up the switches and names for Edwards-Slingo code
180  call sw_input(current_state)
181  ! DEPENDS ON: read_spectrum
182  call read_spectrum( sw_control%spectral_file, &
183  sw_spectrum )
184  ! DEPENDS ON: compress_spectrum
185  CALL compress_spectrum( sw_control, sw_spectrum )
186 
187  call lw_input(current_state, lw_control)
188  call read_spectrum( lw_control%spectral_file, &
189  lw_spectrum )
190  CALL compress_spectrum( lw_control, lw_spectrum )
191 
192  ! Read the mcc_profile
193  call read_mcclatchey_profiles(current_state, mcc)
194  !
195  ! Calculate the number of radiation levels with
196  ! mcc_levs combined to monc model levels
197  call calculate_radiation_levels(current_state, mcc)
198  !
199  ! allocate fields to pass to socrates
200  call allocate_merge_data_fields(current_state, merge_fields, mcc)
201 
202  end subroutine initialisation_callback
203 
207  subroutine timestep_callback(current_state)
208  type(model_state_type), target, intent(inout) :: current_state
209 
210  real(DEFAULT_PRECISION), parameter :: &
211  snotset = -9999. ! A value of sec_out meaing darkness
212  real(DEFAULT_PRECISION) :: local_dtm ! Local timestep variable
213  integer :: icol, jcol ! Shorthand column indices
214  integer :: target_x_index, target_y_index
215 
216  integer :: k ! look counter
217 
218  ! No need to do radiation calculations in the halos or on the first timestep
219  !
220  if (current_state%halo_column .or. current_state%timestep < 2) return
221 
222  local_dtm = current_state%dtm*2.0
223  if (current_state%field_stepping == forward_stepping) local_dtm=current_state%dtm
224 
225  ! work out column indexes from MONC (these include the halo)
226  icol=current_state%column_local_x
227  jcol=current_state%column_local_y
228  ! work out a target index for radiation arrays (no halo)
229  target_y_index=jcol-current_state%local_grid%halo_size(y_index)
230  target_x_index=icol-current_state%local_grid%halo_size(x_index)
231 
232  ! Test whether it is a radiation calc timestep on the first non-halo column
233  ! If it is, then calc all year, day, time in hours and timestep.
234  ! Note: all socrates time control variables are declared in the socrates_opt
235  ! or socrates_derived_fields structure, except rad_last_time, which is
236  ! in current_state.
237  if (current_state%first_nonhalo_timestep_column) then
238  !i) 1 call radiation on timestep 2 to initialise the heating rates
239  !ii) if rad_int_time less than or equal to 0.0, SOCRATES called on every timestep
240  if (socrates_opt%rad_int_time <= 0.0 .or. current_state%timestep == 2 ) then
241  socrates_opt%l_rad_calc = .true.
242  else
243  socrates_opt%l_rad_calc = &
244  ((current_state%time - &
245  (current_state%rad_last_time + socrates_opt%rad_int_time)) > 0.0)
246  endif
247  endif
248 
249  if (socrates_opt%l_rad_calc) then
250  if (current_state%first_nonhalo_timestep_column) then
251  call log_master_log &
252  (log_info, "Socrates called, time ="//trim(conv_to_string(current_state%time))//&
253  " rad_int_time="//trim(conv_to_string(socrates_opt%rad_int_time))//&
254  " local dtm="//trim(conv_to_string(local_dtm)))
255  call log_master_log &
256  (log_info, "methane ="//trim(conv_to_string(socrates_opt%ch4_mmr))//&
257  " l_ch4="//trim(conv_to_string(lw_control%l_ch4)))
258 
259  ! Do not really like this but update the rad_time_hours and
260  ! rad_day here using time.
261  socrates_opt%rad_day = socrates_opt%rad_start_day + &
262  int((socrates_opt%rad_start_time + (current_state%time/3600.0))/24.0)
263  socrates_opt%rad_time_hours = &
264  (socrates_opt%rad_start_time + ((current_state%time+local_dtm)/3600.0)) &
265  - (24.0*(socrates_opt%rad_day-socrates_opt%rad_start_day))
266  ! set the radiation timestep
267  if (socrates_opt%rad_int_time == 0) then
268  socrates_derived_fields%dt_secs = local_dtm
269  else
270  socrates_derived_fields%dt_secs = socrates_opt%rad_int_time
271  endif
272  ! Finally, if we will calculate radiative fluxes on this timestep update the last
273  ! radiative timetep to this one.
274  current_state%rad_last_time = current_state%time
275  endif
276 
277  ! set surface temperature. Based on LEM, but needs some thought to capture
278  ! atmospheric surface and actual surface. Here they are the same
279  ! which may lead to too much emission (depending on profile)
280  !
281  if (current_state%use_surface_boundary_conditions) then
282  if (current_state%type_of_surface_boundary_conditions == prescribed_surface_values) then
283  socrates_derived_fields%srf_temperature = &
284  current_state%theta_surf / &
285  ((current_state%surface_reference_pressure/current_state%surface_pressure)**r_over_cp)
286  elseif (current_state%type_of_surface_boundary_conditions == prescribed_surface_fluxes) then
287  !THIS IS NOT CORRECT - SHOULD WORK OUT TEMP FROM FLUXES
288  socrates_derived_fields%srf_temperature = &
289  (current_state%th%data(2, jcol, icol) &
290  + current_state%global_grid%configuration%vertical%thref(2)) &
291  * current_state%global_grid%configuration%vertical%rprefrcp(2)
292  end if
293  !else if(DO SOMETHING WITH JULES OUTPUT WHEN AVAILABLE)
294  else
295  socrates_derived_fields%srf_temperature = &
296  (current_state%th%data(2, jcol, icol) &
297  + current_state%global_grid%configuration%vertical%thref(2)) &
298  * current_state%global_grid%configuration%vertical%rprefrcp(2)
299  end if
300 
301  ! merge_data takes t,qv, ql, qi and then returns t_socrates, qv_socrates
302  ! ql_socrates, qi_socrates (all declared at head of module so no need
303  ! to pass as arguments
304  !
305  call merge_data(current_state, socrates_opt, socrates_derived_fields, merge_fields, mcc )
306  !
307  ! intialise variables for rad_calc just to be on safe side
308  socrates_derived_fields%sindec = 0.0
309  socrates_derived_fields%scs = 1.0
310  socrates_derived_fields%fraction_lit = 0.0
311  socrates_derived_fields%cosz = snotset
312 
313  if (socrates_opt%l_solar_fixed) then
314  socrates_derived_fields%sol_const = socrates_opt%solar_fixed
315  socrates_derived_fields%sec_out = socrates_opt%sec_fixed
316  socrates_derived_fields%fraction_lit = 1.0
317  else
318  ! this routine uses the rad_start_day, rad_start_year, and l_360
319  ! to work out position of sun. Returns sindec and scs to use in
320  ! solar angle calculation
321  call solar_pos_calculation(socrates_opt, socrates_derived_fields)
322  !
323  ! set the solar constant by scaling default constant by scs from
324  ! solar_pos_calculation
325  socrates_derived_fields%sol_const= &
326  socrates_opt%default_solar_constant * &
328 
329  ! calulates the solar angle, fraction_lit and cos of zenith angle
330  call solar_angle_calculation(socrates_opt, socrates_derived_fields)
331  !
332  ! set fraction_lit to 1 or 0 depending, i.e. grid is lit or not, there
333  ! is no partial lighting
334  if (socrates_derived_fields%fraction_lit .ne. 0.0) then
335  socrates_derived_fields%fraction_lit = 1.0
336  socrates_derived_fields%sec_out = &
338  else
339  ! seems a silly value to set sec_out to check as it will break
340  ! the variable albedo calc
341  socrates_derived_fields%sec_out = snotset
342  endif
343  endif
344  !
345  ! Set surface albedo for rad_calc
346  !
347  if (socrates_derived_fields%fraction_lit .ne. 0.0) then
348  if (socrates_opt%l_variable_srf_albedo) then
349  stop
350 !!$ ! albfac1=0.026 albfac2=1.7 albfac3=0.065
351 !!$ ! albfac4=0.15 albfac5=0.1 albfac6=0.5
352 !!$ ! albfac7=1.0 alb2_var=0.06
353 !!$ cosz = 1./sec_out
354 !!$ albedoin1 = albfac1/(cosz**albfac2 + albfac3)
355 !!$ & + albfac4*(cosz - albfac5)*
356 !!$ & (cosz - albfac6)*(cosz - albfac7)
357 !!$ albedoin2 = alb2_var
358  else
359  socrates_derived_fields%albedoin1 = socrates_opt%surface_albedo
360  socrates_derived_fields%albedoin2 = socrates_opt%surface_albedo
361  endif
362  endif
363 
364  ! AH - after all this testing check whether solar is required. If
365  ! no solar then set fraction_lit = 0.0
366  if (socrates_opt%l_no_solar) then
367  socrates_derived_fields%fraction_lit = 0.0
368  endif
369 
370  call rad_ctl(current_state, sw_spectrum, lw_spectrum, &
372 
373  ! This is needed for JULES coupling. Including irrespective of JULES enabled
374  ! assign downward fluxes at the surface
375  !current_state%sw_down_surf(jcol, icol) = &
376  ! socrates_derived_fields%flux_down_sw(1, target_y_index, target_x_index)
377  !current_state%lw_down_surf(jcol, icol) = &
378  ! socrates_derived_fields%flux_down_lw(1, target_y_index, target_x_index)
379 
380  endif
381 
382  ! update the current_state sth
383  ! AH - temporary code to check bit comparison of socrates_couple
384  !current_state%sth_lw%data(:, jcol, icol) = 0.0
385  !current_state%sth_sw%data(:, jcol, icol) = 0.0
386  ! AH - end temporary code
387  current_state%sth%data(:, jcol, icol) = &
388  current_state%sth%data(:, jcol, icol) + &
389  current_state%sth_lw%data(:, jcol, icol) + &
390  current_state%sth_sw%data(:, jcol, icol)
391 
392  end subroutine timestep_callback
393 
394  subroutine finalisation_callback(current_state)
395 
396  type(model_state_type), target, intent(inout) :: current_state
397 
398 ! deallocate(merge_fields%t, merge_fields%qv, &
399 ! ql_socrates, qi_socrates)
400 
401  end subroutine finalisation_callback
402 
407  subroutine field_information_retrieval_callback(current_state, name, field_information)
408  type(model_state_type), target, intent(inout) :: current_state
409  character(len=*), intent(in) :: name
410  type(component_field_information_type), intent(out) :: field_information
411 
412  if ( name .eq. "flux_up_shortwave" .or. name .eq. "flux_down_shortwave" .or. &
413  name .eq. "flux_up_longwave" .or. name .eq. "flux_down_longwave" .or. &
414  name .eq. "shortwave_heating_rate" .or. name .eq. "longwave_heating_rate" &
415  .or. name .eq. "total_radiative_heating_rate") then
416  field_information%field_type=component_array_field_type
417  field_information%number_dimensions=3
418  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
419  field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
420  field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
421  field_information%data_type=component_double_data_type
422  else
423  field_information%field_type=component_array_field_type
424  field_information%number_dimensions=2
425  field_information%dimension_sizes(1)=current_state%local_grid%size(y_index)
426  field_information%dimension_sizes(2)=current_state%local_grid%size(x_index)
427  field_information%data_type=component_double_data_type
428  endif
429 
430  field_information%enabled=.true.
431 
433 
438  subroutine field_value_retrieval_callback(current_state, name, field_value)
439  type(model_state_type), target, intent(inout) :: current_state
440  character(len=*), intent(in) :: name
441  type(component_field_value_type), intent(out) :: field_value
442 
443  integer :: k
444 
445  ! 3D radiative flux and heating rates
446  if (name .eq. "flux_up_shortwave") then
447  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
448  current_state%local_grid%size(y_index), &
449  current_state%local_grid%size(x_index)))
450  field_value%real_3d_array(:,:,:) = socrates_derived_fields%flux_up_sw(:,:,:)
451  else if (name .eq. "flux_down_shortwave") then
452  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
453  current_state%local_grid%size(y_index), &
454  current_state%local_grid%size(x_index)))
455  field_value%real_3d_array(:,:,:) = socrates_derived_fields%flux_down_sw(:,:,:)
456  else if (name .eq. "flux_up_longwave") then
457  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
458  current_state%local_grid%size(y_index), &
459  current_state%local_grid%size(x_index)))
460  field_value%real_3d_array(:,:,:) = socrates_derived_fields%flux_up_lw(:,:,:)
461  else if (name .eq. "flux_down_longwave") then
462  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
463  current_state%local_grid%size(y_index), &
464  current_state%local_grid%size(x_index)))
465  field_value%real_3d_array(:,:,:) = socrates_derived_fields%flux_down_lw(:,:,:)
466  else if (name .eq. "shortwave_heating_rate") then
467  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
468  current_state%local_grid%size(y_index), &
469  current_state%local_grid%size(x_index)))
470  field_value%real_3d_array(:,:,:) = socrates_derived_fields%swrad_hr(:,:,:)
471  else if (name .eq. "longwave_heating_rate") then
472  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
473  current_state%local_grid%size(y_index), &
474  current_state%local_grid%size(x_index)))
475  field_value%real_3d_array(:,:,:) = socrates_derived_fields%lwrad_hr(:,:,:)
476  else if (name .eq. "total_radiative_heating_rate") then
477  allocate(field_value%real_3d_array(current_state%local_grid%size(z_index), &
478  current_state%local_grid%size(y_index), &
479  current_state%local_grid%size(x_index)))
480  field_value%real_3d_array(:,:,:) = socrates_derived_fields%totrad_hr(:,:,:)
481  !
482  ! 2D radiative fluxes
483  else if (name .eq. "toa_up_longwave") then
484  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
485  current_state%local_grid%size(x_index)))
486  field_value%real_2d_array(:,:) = socrates_derived_fields%toa_up_longwave(:,:)
487  else if (name .eq. "surface_down_longwave") then
488  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
489  current_state%local_grid%size(x_index)))
490  field_value%real_2d_array(:,:) = socrates_derived_fields%surface_down_longwave(:,:)
491  else if (name .eq. "surface_up_longwave") then
492  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
493  current_state%local_grid%size(x_index)))
494  field_value%real_2d_array(:,:) = socrates_derived_fields%surface_up_longwave(:,:)
495  else if (name .eq. "toa_up_shortwave") then
496  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
497  current_state%local_grid%size(x_index)))
498  field_value%real_2d_array(:,:) = socrates_derived_fields%toa_up_shortwave(:,:)
499  else if (name .eq. "toa_down_shortwave") then
500  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
501  current_state%local_grid%size(x_index)))
502  field_value%real_2d_array(:,:) = socrates_derived_fields%toa_down_shortwave(:,:)
503  else if (name .eq. "surface_down_shortwave") then
504  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
505  current_state%local_grid%size(x_index)))
506  field_value%real_2d_array(:,:) = socrates_derived_fields%surface_down_shortwave(:,:)
507  else if (name .eq. "surface_up_shortwave") then
508  allocate(field_value%real_2d_array(current_state%local_grid%size(y_index), &
509  current_state%local_grid%size(x_index)))
510  field_value%real_2d_array(:,:) = socrates_derived_fields%surface_up_shortwave(:,:)
511  end if
512 
513  end subroutine field_value_retrieval_callback
514 
515 end module socrates_couple_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
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
conversions_mod
Conversion between common inbuilt FORTRAN data types.
Definition: conversions.F90:5
lw_control_mod
Definition: lw_control_mod.F90:13
science_constants_mod::r_over_cp
real(kind=default_precision), public r_over_cp
Definition: scienceconstants.F90:13
logging_mod::log_warn
integer, parameter, public log_warn
Log WARNING and ERROR messages.
Definition: logging.F90:12
def_mcc_profiles
Definition: def_mcc_profiles.F90:1
def_mcc_profiles::str_mcc_profiles
Definition: def_mcc_profiles.F90:7
def_socrates_derived_fields
Definition: def_socrates_derived_fields.F90:1
state_mod::prescribed_surface_values
integer, parameter, public prescribed_surface_values
Definition: state.F90:15
rad_ctl_mod
Definition: rad_ctl_mod.F90:1
solar_position_angle_mod::solar_angle_calculation
subroutine solar_angle_calculation(socrates_opt, socrates_derived_fields)
Definition: solar_position_angle_mod.F90:70
grids_mod::x_index
integer, parameter, public x_index
Definition: grids.F90:14
optionsdatabase_mod::options_get_integer
integer function, public options_get_integer(options_database, key, index)
Retrieves an integer value from the database that matches the provided key.
Definition: optionsdatabase.F90:217
grids_mod::y_index
integer, parameter, public y_index
Definition: grids.F90:14
sw_rad_input_mod
Definition: sw_rad_input_mod.F90:18
logging_mod::log_info
integer, parameter, public log_info
Log INFO, WARNING and ERROR messages.
Definition: logging.F90:13
socrates_couple_mod::y_local
integer y_local
Definition: socrates_couple.F90:44
solar_position_angle_mod::solar_pos_calculation
subroutine solar_pos_calculation(socrates_opt, socrates_derived_fields)
Definition: solar_position_angle_mod.F90:14
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75
sw_control_mod
Definition: sw_control_mod.F90:13
science_constants_mod::cp
real(kind=default_precision), public cp
Definition: scienceconstants.F90:13
logging_mod::log_get_logging_level
integer function, public log_get_logging_level()
Retrieves the current logging level.
Definition: logging.F90:122
logging_mod::log_debug
integer, parameter, public log_debug
Log DEBUG, INFO, WARNING and ERROR messages.
Definition: logging.F90:14
lw_control_mod::lw_control
type(strctrl), save lw_control
Definition: lw_control_mod.F90:19
compress_spectrum
subroutine compress_spectrum(con, spec)
Definition: compress_spectrum.F90:10
socrates_couple_mod::sw_spectrum
type(strspecdata), save sw_spectrum
Definition: socrates_couple.F90:49
monc_component_mod
Interfaces and types that MONC components must specify.
Definition: monc_component.F90:6
sw_rad_input_mod::sw_input
subroutine sw_input(current_state)
Definition: sw_rad_input_mod.F90:39
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
socrates_couple_mod::lw_spectrum
type(strspecdata), save lw_spectrum
Definition: socrates_couple.F90:50
socrates_couple_mod::mcc
type(str_mcc_profiles) mcc
Definition: socrates_couple.F90:52
def_merge_atm::str_merge_atm
Definition: def_merge_atm.F90:10
science_constants_mod
Scientific constant values used throughout simulations. Each has a default value and this can be over...
Definition: scienceconstants.F90:3
mcclatchey_profiles
Definition: mcclatchey_profiles.F90:1
lw_rad_input_mod
Definition: lw_rad_input_mod.F90:18
def_socrates_options::str_socrates_options
Definition: def_socrates_options.F90:7
grids_mod::z_index
integer, parameter, public z_index
Grid index parameters.
Definition: grids.F90:14
merge_atm_data::merge_data
subroutine merge_data(current_state, socrates_opt, socrates_derived_fields, merge_fields, mcc)
Definition: merge_atm_data.F90:16
socrates_couple_mod::socrates_opt
type(str_socrates_options) socrates_opt
Definition: socrates_couple.F90:54
conversions_mod::conv_to_string
Converts data types to strings.
Definition: conversions.F90:38
socrates_couple_mod::socrates_derived_fields
type(str_socrates_derived_fields) socrates_derived_fields
Definition: socrates_couple.F90:55
solar_position_angle_mod
Definition: solar_position_angle_mod.F90:1
def_merge_atm::allocate_merge_data_fields
subroutine allocate_merge_data_fields(current_state, merge_fields, mcc)
Definition: def_merge_atm.F90:51
q_indices_mod::standard_q_names
type(standard_q_names_type), public standard_q_names
Definition: q_indices.F90:59
monc_component_mod::component_field_value_type
Wrapper type for the value returned for a published field from a component.
Definition: monc_component.F90:22
state_mod::model_state_type
The ModelState which represents the current state of a run.
Definition: state.F90:39
socrates_couple_mod::x_local
integer x_local
Definition: socrates_couple.F90:44
state_mod::forward_stepping
integer, parameter, public forward_stepping
Definition: state.F90:15
monc_component_mod::component_field_information_type
Definition: monc_component.F90:31
socrates_couple_mod::y_nohalos
integer y_nohalos
Definition: socrates_couple.F90:44
mcclatchey_profiles::calculate_radiation_levels
subroutine calculate_radiation_levels(current_state, mcc)
Definition: mcclatchey_profiles.F90:236
sw_control_mod::sw_control
type(strctrl), save sw_control
Definition: sw_control_mod.F90:19
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
monc_component_mod::component_scalar_field_type
integer, parameter, public component_scalar_field_type
Definition: monc_component.F90:15
socrates_couple_mod::timestep_callback
subroutine timestep_callback(current_state)
Called for each column per timestep this will apply a forcing term to the aerosol fields.
Definition: socrates_couple.F90:208
socrates_couple_mod
This module sets up the logicals and parameters for the edward-slingo code from the UM....
Definition: socrates_couple.F90:4
mcclatchey_profiles::read_mcclatchey_profiles
subroutine read_mcclatchey_profiles(current_state, mcc)
Definition: mcclatchey_profiles.F90:25
lw_rad_input_mod::lw_input
subroutine lw_input(current_state, lw_control)
Definition: lw_rad_input_mod.F90:39
socrates_couple_mod::finalisation_callback
subroutine finalisation_callback(current_state)
Definition: socrates_couple.F90:395
socrates_couple_mod::socrates_couple_get_descriptor
type(component_descriptor_type) function, public socrates_couple_get_descriptor()
Provides the descriptor back to the caller and is used in component registration.
Definition: socrates_couple.F90:63
rad_ctl_mod::rad_ctl
subroutine rad_ctl(current_state, sw_spectrum, lw_spectrum, mcc, socrates_opt, merge_fields, socrates_derived_fields)
Definition: rad_ctl_mod.F90:9
socrates_couple_mod::x_nohalos
integer x_nohalos
Definition: socrates_couple.F90:44
socrates_couple_mod::density_factor
real(kind=default_precision), dimension(:), allocatable density_factor
Definition: socrates_couple.F90:47
socrates_couple_mod::merge_fields
type(str_merge_atm) merge_fields
Definition: socrates_couple.F90:53
q_indices_mod::get_q_index
integer function, public get_q_index(name, assigning_component)
Add in a new entry into the register if the name does not already exist or return the index of the pr...
Definition: q_indices.F90:112
logging_mod
Logging utility.
Definition: logging.F90:2
datadefn_mod
Contains common definitions for the data and datatypes used by MONC.
Definition: datadefn.F90:2
state_mod::prescribed_surface_fluxes
integer, parameter, public prescribed_surface_fluxes
Definition: state.F90:15
get_and_test_socrates_options_mod
Definition: get_and_test_socrates_options.F90:1
merge_atm_data
Definition: merge_atm_data.F90:1
socrates_couple_mod::radiation_factor
real(kind=default_precision), dimension(:), allocatable radiation_factor
Definition: socrates_couple.F90:47
def_socrates_derived_fields::str_socrates_derived_fields
Definition: def_socrates_derived_fields.F90:7
logging_mod::log_master_log
subroutine, public log_master_log(level, message)
Will log just from the master process.
Definition: logging.F90:47
get_and_test_socrates_options_mod::set_and_test_socrates_monc_options
subroutine set_and_test_socrates_monc_options(current_state, socrates_opt)
Definition: get_and_test_socrates_options.F90:20
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
socrates_couple_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: socrates_couple.F90:408
registry_mod
MONC component registry.
Definition: registry.F90:5
def_socrates_options
Definition: def_socrates_options.F90:1
def_merge_atm
Definition: def_merge_atm.F90:1
monc_component_mod::component_integer_data_type
integer, parameter, public component_integer_data_type
Definition: monc_component.F90:16
grids_mod
Functionality to support the different types of grid and abstraction between global grids and local o...
Definition: grids.F90:5
socrates_couple_mod::k_top
integer k_top
Definition: socrates_couple.F90:44
optionsdatabase_mod
Manages the options database. Contains administration functions and deduce runtime options from the c...
Definition: optionsdatabase.F90:7
socrates_couple_mod::initialisation_callback
subroutine initialisation_callback(current_state)
The initialisation callback sets up the prescribed longwave fluxes and the exponential decay factor.
Definition: socrates_couple.F90:95
socrates_couple_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: socrates_couple.F90:439
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