diff --git a/etc/scripts/kpp_to_micm.py b/etc/scripts/kpp_to_micm.py index 2e739bf4c..004ac88ea 100644 --- a/etc/scripts/kpp_to_micm.py +++ b/etc/scripts/kpp_to_micm.py @@ -171,16 +171,21 @@ def parse_kpp_arrhenius(kpp_str): logging.debug(coeffs) arr_dict = dict() arr_dict['type'] = 'ARRHENIUS' + # note the interchange of B and C, and change of sign + # in the KPP and MICM conventions if ('_abc(' in kpp_str): arr_dict['A'] = coeffs[0] - arr_dict['B'] = coeffs[1] - arr_dict['C'] = coeffs[2] + arr_dict['B'] = coeffs[2] + arr_dict['C'] = - coeffs[1] + arr_dict['D'] = 300.0 elif ('_ab(' in kpp_str): arr_dict['A'] = coeffs[0] - arr_dict['B'] = coeffs[1] + arr_dict['C'] = - coeffs[1] + arr_dict['D'] = 300.0 elif ('_ac(' in kpp_str): arr_dict['A'] = coeffs[0] - arr_dict['C'] = coeffs[1] + arr_dict['B'] = coeffs[1] + arr_dict['D'] = 300.0 else: logging.error('unrecognized KPP Arrhenius syntax') logging.debug(arr_dict) diff --git a/etc/scripts/test_kpp_to_micm.py b/etc/scripts/test_kpp_to_micm.py index 874165593..2eac98e50 100644 --- a/etc/scripts/test_kpp_to_micm.py +++ b/etc/scripts/test_kpp_to_micm.py @@ -25,16 +25,16 @@ def test_parse_kpp_arrhenius(): arr_dict = kpp_to_micm.parse_kpp_arrhenius( 'ARR_ab(%.2e, %.2f)' % (kpp_A, kpp_B)) assert arr_dict['A'] == kpp_A - assert arr_dict['B'] == kpp_B + assert arr_dict['C'] == - kpp_B arr_dict = kpp_to_micm.parse_kpp_arrhenius( 'ARR_ac(%.2e, %.2f)' % (kpp_A, kpp_C)) assert arr_dict['A'] == kpp_A - assert arr_dict['C'] == kpp_C + assert arr_dict['B'] == kpp_C arr_dict = kpp_to_micm.parse_kpp_arrhenius( 'ARR_abc(%.2e, %.2f, %.2f)' % (kpp_A, kpp_B, kpp_C)) assert arr_dict['A'] == kpp_A - assert arr_dict['B'] == kpp_B - assert arr_dict['C'] == kpp_C + assert arr_dict['C'] == - kpp_B + assert arr_dict['B'] == kpp_C