def At_SO(at, charge):
    """
    Returns atomic energy correction due to spin orbit coupling

            Input:
                    at (str): Atomic symbol
                    charge (int): Atomic charge

            Returns:
                    At_SO (float): Energy correction due to spin orbit coupling
    """

    S_dict_neutral = {"B" : -0.05, "C" : -0.14, "O" : -0.36, "F"  : -0.61, "Al" : -0.34, "Si" : -0.68,  "S" : -0.89, "Cl" : -1.34, "Ga" : -2.51, "Ge" : -4.41, "Se" : -4.3,  "Br" : -5.6, "Fe" : -1.84, "I" : -11.548}
    S_dict_cation  = {"C" : -0.2,  "N" : -0.43, "F" : -0.67, "Ne" :-1.19,  "Si" : -0.93, "P"  : -1.43, "Cl" : -1.68, "Ar" : -2.18, "Ge" : -5.37, "As" : -8.04, "Br" : -6.71, "Kr" : -8.16, "I" :-14.028}
    S_dict_anion   = {"B" : -0.03, "O" : -0.26, "Al": -0.28, "P"  : -0.45,  "S" : -0.88}

    At_SO = 0.0 # default

    if charge == 0:
        if at in S_dict_neutral:
            At_SO = S_dict_neutral[at]
    elif charge == +1:
        if at in S_dict_cation:
            At_SO = S_dict_cation[at]
    elif charge == -1:
        if at in S_dict_anion:
            At_SO = S_dict_anion[at]

    return(At_SO)