18 USE def_control,
ONLY: strctrl, allocate_control
19 USE def_spectrum,
ONLY: strspecdata
20 USE ereport_mod,
ONLY: ereport
21 USE errormessagelength_mod,
ONLY: errormessagelength
27 TYPE(strctrl),
INTENT(INOUT) :: control
30 TYPE (StrSpecData),
INTENT(IN) :: spectrum
36 INTEGER :: ierr = i_normal
37 CHARACTER (LEN=*),
PARAMETER :: RoutineName =
'set_control'
38 CHARACTER (LEN=errormessagelength) :: cmessage
43 LOGICAL :: l_mixing_ratio = .true.
47 control%last_band = spectrum%basic%n_band
50 CALL allocate_control(control, spectrum)
53 SELECT CASE (control%isolir)
56 control%l_clear = .true.
57 control%l_cloud_extinction = .true.
58 control%l_ls_cloud_extinction = .true.
59 control%l_cnv_cloud_extinction = .false.
62 control%l_clear = .true.
63 control%l_cloud_absorptivity = .true.
64 control%l_ls_cloud_absorptivity = .true.
65 control%l_cnv_cloud_absorptivity = .false.
71 control%l_orog = .false.
74 control%l_aerosol_mode = .false.
75 control%l_aerosol = .false.
76 control%l_aerosol_ccn=.false.
80 DO i = 1, spectrum%basic%n_band
81 control%map_channel(i) = 1
82 control%weight_band(i) = 1.0
83 control%i_scatter_method_band(i) = control%i_scatter_method
84 control%i_gas_overlap_band(i) = control%i_gas_overlap
85 IF (any(spectrum%gas%i_scale_fnc(i,:) == ip_scale_ses2))
THEN
87 control%i_gas_overlap_band(i) = ip_overlap_mix_ses2
92 IF (control%i_angular_integration == ip_two_stream)
THEN
94 IF (control%l_rescale) control%n_order_forward=2
95 control%l_tile=.false.
97 ELSE IF (control%i_angular_integration == ip_spherical_harmonic)
THEN
99 IF (control%i_sph_mode == ip_sph_mode_flux)
THEN
101 control%n_channel = 1
102 control%map_channel(1:spectrum%basic%n_band) = 1
105 control%n_channel = spectrum%basic%n_band
106 DO i = 1, spectrum%basic%n_band
107 control%map_channel(i) = i
111 IF (control%l_rescale) control%n_order_forward=control%ls_global_trunc+1
116 IF (control%l_euler_trnf)
THEN
117 control%euler_factor=0.5
119 control%euler_factor=1.0
126 IF ( control%l_clear )
THEN
127 cmessage =
'Clear-sky fluxes not directly available in harmonics'
134 control%l_tile=.false.
141 IF (ierr /= i_normal)
THEN
142 CALL ereport(routinename, ierr, cmessage)