def get_lonlat(iindex, jindex, grd, Cpos='rho'):
    """
    lon, lat = get_lonlat(iindex, jindex, grd)

    return the longitude (degree east) and latitude (degree north)
    for grid point (iindex, jindex)
    """

    if Cpos == 'u':
        lon = grd.hgrid.lon_u[:,:]
        lat = grd.hgrid.lat_u[:,:]
    elif Cpos == 'v':
        lon = grd.hgrid.lon_v[:,:]
        lat = grd.hgrid.lat_v[:,:]
    elif Cpos == 'rho':
        lon = grd.hgrid.lon_rho[:,:]
        lat = grd.hgrid.lat_rho[:,:]
    elif Cpos == 'psi':
        lon = grd.hgrid.lon_psi[:,:]
        lat = grd.hgrid.lat_psi[:,:]
    else:
        raise Warning('%s bad position. Cpos must be rho, psi, u or v.' % Cpos)

    return lon[jindex, iindex], lat[jindex, iindex]