Based on the CAM test suite results, the newly added avg_diameter_vec subroutine and gamma_bg_plus1 and gamma_bg_plus4 variables did not work properly for MG2 due to the following reasons:
gamma_bg_plus1 and gamma_bg_plus4 are not initialized in MG2 (both do_hail and do_graupel are False).
avg_diameter_vec subroutine fails for the calculation of dgout2 because rhogtmp is zero in MG2, which makes the denominator zero in the avg_diameter_vec subroutine.
Based on the CAM test suite results, the newly added
avg_diameter_vec
subroutine andgamma_bg_plus1
andgamma_bg_plus4
variables did not work properly for MG2 due to the following reasons:gamma_bg_plus1
andgamma_bg_plus4
are not initialized in MG2 (bothdo_hail
anddo_graupel
are False).avg_diameter_vec
subroutine fails for the calculation ofdgout2
becauserhogtmp
is zero in MG2, which makes the denominator zero in theavg_diameter_vec
subroutine.These issues are fixed in this PR.