def unpack(gh):
    """
    unpacks gh list into l m g h type list

    Parameters
    _________
    gh : list of gauss coefficients (as returned by, e.g., doigrf)

    Returns
   data : nested list of [[l,m,g,h],...]

    """
    data = []
    k, l = 0, 1
    while k + 1 < len(gh):
        for m in range(l + 1):
            if m == 0:
                data.append([l, m, gh[k], 0])
                k += 1
            else:
                data.append([l, m, gh[k], gh[k + 1]])
                k += 2
        l += 1
    return data
