def get_cart_coords(comm_dims, procs, rank):
    """ Get coordinates of process placed on cartesian grid.
        Implementation based on OpenMPI.mca.topo.topo_base_cart_coords

    Parameters
    ----------
    comm_dims : list
        Division of processes in cartesian grid
    procs: int
        Size/number of processes in communicator
    rank : int
        Process rank in communicator

    Returns
    -------
    coordinates : list, None
        Coordinates of rank in grid
    """
    if comm_dims == None:
        return None

    coordinates = []
    rem_procs = procs

    for dim in comm_dims:
        rem_procs = rem_procs // dim
        coordinates.append(rank // rem_procs)
        rank = rank % rem_procs

    return coordinates