def convert_to_gpa(C, units):
    """Convert the elastic constants in C to GPa from specified units"""
    units = units.lower()
    if units == "gpa":
        pass
    elif units == "pa":
        C = C / 1.0E9
    elif units == "mbar":
        C = C * 100.0
    elif units == "bar":
        C = C / 10.0E3
    else:
        raise ValueError("Elasticity unit not recognised")
    return C