@@ -77,15 +77,7 @@ void CldFraction::initialize_impl (const RunType /* run_type */)
7777 add_postcondition_check<Interval>(get_field_out (" cldfrac_tot_for_analysis" ),m_grid,0.0 ,1.0 ,false );
7878#ifdef EAMXX_HAS_PYTHON
7979 if (has_py_module ()) {
80- try {
81- py_module_call (" init" );
82- } catch (const pybind11::error_already_set& e) {
83- std::cout << " [CldFraction::initialize_impl] Error! Something went wrong while calling the python module's function 'init'.\n "
84- " - module name: " + m_params.get <std::string>(" py_module_name" ) + " \n "
85- " - pybind11 error: " + std::string (e.what ()) + " \n " ;
86- throw e;
87- }
88-
80+ py_module_call (" init" );
8981 }
9082#endif
9183}
@@ -118,14 +110,11 @@ void CldFraction::run_impl (const double /* dt */)
118110 double ice_threshold = m_params.get <double >(" ice_cloud_threshold" );
119111 double ice_4out_threshold = m_params.get <double >(" ice_cloud_for_analysis_threshold" );
120112
121- try {
122- py_module_call (" main" ,ice_threshold,ice_4out_threshold,py_qi,py_liq_cld_frac,py_ice_cld_frac,py_tot_cld_frac,py_ice_cld_frac_4out,py_tot_cld_frac_4out);
123- } catch (const pybind11::error_already_set& e) {
124- std::cout << " [CldFraction::run_impl] Error! Something went wrong while calling the python module's function 'main'.\n "
125- " - module name: " + m_params.get <std::string>(" py_module_name" ) + " \n "
126- " - pybind11 error: " + std::string (e.what ()) + " \n " ;
127- throw e;
128- }
113+ py_module_call (" main" ,
114+ ice_threshold,ice_4out_threshold,
115+ py_qi,py_liq_cld_frac,
116+ py_ice_cld_frac,py_tot_cld_frac,
117+ py_ice_cld_frac_4out,py_tot_cld_frac_4out);
129118
130119 // Sync outputs to dev
131120 ice_cld_frac.sync_to_dev ();
0 commit comments