def gci(ratio_21, e21_approx, p):
    """ Calculate the fine and coarse grid convergence index for two grids of 
    reducing resolution (ie grid_1 is finest). The refinement ration between the 
    grids is required along with the approximate relative error (e21_approx) and 
    the order of convergence, p.
    """
    safety_factor = 1.25
    gci_fine = safety_factor * e21_approx / (ratio_21 ** p - 1.0)
    gci_coarse = ratio_21 ** p * gci_fine
    return gci_fine, gci_coarse
