@@ -104,19 +104,6 @@ void read_and_set_aer(
104104 }
105105}
106106
107-
108-
109-
110-
111-
112-
113-
114-
115-
116-
117-
118-
119-
120107void configure_memory_pool (int nlays, int ncols, int nchunks, int ngpts, int nbnds)
121108{
122109 /* Heuristic way to set up memory pool queues */
@@ -239,7 +226,9 @@ void solve_radiation(int argc, char** argv)
239226 {" longwave" , { false , " Enable computation of longwave radiation." }},
240227 {" fluxes" , { true , " Enable computation of fluxes." }},
241228 {" raytracing" , { true , " Use raytracing for flux computation." }},
242- {" cloud-optics" , { false , " Enable cloud optics." }},
229+ {" cloud-optics" , { false , " Enable cloud optics (both liquid and ice)." }},
230+ {" liq-cloud-optics" , { false , " liquid only cloud optics." }},
231+ {" ice-cloud-optics" , { false , " ice only cloud optics." }},
243232 {" cloud-mie" , { false , " mie cloud droplet scattering." }},
244233 {" aerosol-optics" , { false , " Enable aerosol optics." }},
245234 {" output-optical" , { false , " Enable output of optical properties." }},
@@ -260,7 +249,9 @@ void solve_radiation(int argc, char** argv)
260249 const bool switch_shortwave = command_line_options.at (" shortwave" ).first ;
261250 const bool switch_longwave = command_line_options.at (" longwave" ).first ;
262251 const bool switch_fluxes = command_line_options.at (" fluxes" ).first ;
263- const bool switch_cloud_optics = command_line_options.at (" cloud-optics" ).first ;
252+ bool switch_cloud_optics = command_line_options.at (" cloud-optics" ).first ;
253+ bool switch_liq_cloud_optics = command_line_options.at (" liq-cloud-optics" ).first ;
254+ bool switch_ice_cloud_optics = command_line_options.at (" ice-cloud-optics" ).first ;
264255 const bool switch_cloud_mie = command_line_options.at (" cloud-mie" ).first ;
265256 const bool switch_aerosol_optics = command_line_options.at (" aerosol-optics" ).first ;
266257 const bool switch_output_optical = command_line_options.at (" output-optical" ).first ;
@@ -280,6 +271,22 @@ void solve_radiation(int argc, char** argv)
280271 throw std::runtime_error (error);
281272 }
282273
274+ if (switch_cloud_optics)
275+ {
276+ switch_liq_cloud_optics = true ;
277+ switch_ice_cloud_optics = true ;
278+ }
279+ if (switch_liq_cloud_optics || switch_ice_cloud_optics)
280+ {
281+ switch_cloud_optics = true ;
282+ }
283+
284+ if (switch_cloud_mie && switch_ice_cloud_optics)
285+ {
286+ std::string error = " Thou shall not use mie tables as long as ice optics are enabled" ;
287+ throw std::runtime_error (error);
288+ }
289+
283290 // Print the options to the screen.
284291 print_command_line_options (command_line_options);
285292
@@ -385,17 +392,23 @@ void solve_radiation(int argc, char** argv)
385392
386393 if (switch_cloud_optics || switch_cloud_cam)
387394 {
388- lwp.set_dims ({n_col, n_lay});
389- lwp = std::move (input_nc.get_variable <Float>(" lwp" , {n_lay, n_col_y, n_col_x}));
395+ if (switch_liq_cloud_optics)
396+ {
397+ lwp.set_dims ({n_col, n_lay});
398+ lwp = std::move (input_nc.get_variable <Float>(" lwp" , {n_lay, n_col_y, n_col_x}));
390399
391- iwp.set_dims ({n_col, n_lay});
392- iwp = std::move (input_nc.get_variable <Float>(" iwp" , {n_lay, n_col_y, n_col_x}));
400+ rel.set_dims ({n_col, n_lay});
401+ rel = std::move (input_nc.get_variable <Float>(" rel" , {n_lay, n_col_y, n_col_x}));
402+ }
393403
394- rel.set_dims ({n_col, n_lay});
395- rel = std::move (input_nc.get_variable <Float>(" rel" , {n_lay, n_col_y, n_col_x}));
404+ if (switch_ice_cloud_optics)
405+ {
406+ iwp.set_dims ({n_col, n_lay});
407+ iwp = std::move (input_nc.get_variable <Float>(" iwp" , {n_lay, n_col_y, n_col_x}));
396408
397- dei.set_dims ({n_col, n_lay});
398- dei = std::move (input_nc.get_variable <Float>(" dei" , {n_lay, n_col_y, n_col_x}));
409+ dei.set_dims ({n_col, n_lay});
410+ dei = std::move (input_nc.get_variable <Float>(" dei" , {n_lay, n_col_y, n_col_x}));
411+ }
399412 }
400413 else
401414 {
0 commit comments