def _check_missing_inputs(dataset, model):
    """Check if all model inputs have their corresponding variables
    in the input Dataset.
    """
    missing_xr_vars = []
    for p_name, var_name in model.input_vars:
        xr_var_name = p_name + '__' + var_name
        if xr_var_name not in dataset:
            missing_xr_vars.append(xr_var_name)
    if missing_xr_vars:
        raise KeyError(f'Missing variables {missing_xr_vars} in Dataset')
