This paper presents a FORTRAN IV subroutine to calculate inbreeding and kinship coefficients from pedigree information in a diploid population without self-fertilization. The user can specify the number of ancestral generations to be taken into account. It is thus possible to determine contributions of succeeding ancestral generations to the inbreeding and kinship coefficients under consideration. The subroutine is based on a recursive procedure that generates systematically all paths connecting two individuals. NP and NM, whose kinship coefficient is to be calculated (or between the father NP and the mother NM of the individual whose inbreeding coefficient is to be calculated). These paths obey the following conditions: (i) a given path does not contain the same parent-offspring link more than once; (ii) the vertex of a path is an ancestor common to individuals NP and NM, with a rank lower or equal to the parameter specified in input. Constraints regarding the size of the corpus of genealogical data and the storage method are discussed, as well as the interest of this subroutine compared to the existing ones. An example of application is given.