def METHOD_NAME():
    '''Test that the create_fparser2 method in the CommonMetadata class
    works as expected.
    '''
    encoding = Fortran2003.Part_Ref
    fortran_string = "arg_type(GH_FIELD, GH_REAL, GH_READ)"
    result = CommonMetadata.create_fparser2(fortran_string, encoding)
    assert isinstance(result, encoding)
    with pytest.raises(ValueError) as info:
        _ = CommonMetadata.create_fparser2("#!$%", encoding)
    assert ("Expected kernel metadata to be a Fortran Part_Ref, but found "
            "'#!$%'." in str(info.value))
    with pytest.raises(ValueError) as info:
        _ = LFRicKernelMetadata.create_fparser2(
            "hello", Fortran2003.Derived_Type_Def)
    assert ("Expected kernel metadata to be a Fortran Derived_Type_Def, "
            "but found 'hello'." in str(info.value))