def patch_from_tupled_dict(tupled_dict):
    """ Creates a nested dictionary that f90nml can interpret as a patch."""
    patch = {}
    for replace_this, replace_val in tupled_dict.items():
        group, field = replace_this
        group, field = group.lower(), field.lower()
        gdict = patch.get(group, {})
        gdict.update({field: replace_val})
        patch[group] = gdict
    return patch