Computer-implemented method for exploiting an underground formation containing hydrocarbons, said formation containing at least one facies having undergone at least one diagenetic phase over geological time, based on at least one rock sample from said formation, on measured production data relating to said formation and on a meshed representation representative of said formation, said meshed representation being formed of meshes, each of said meshes of said meshed representation containing at least one indicator relating to the distribution of said facies present in said mesh, characterized in that at least the following steps are performed: A. based at least on measurements performed on said sample, for at least one of said facies and for each of said meshes of said meshed representation, determining a value of at least one parameter of the diagenetic state of said facies; B. based on said measured production data, for at least one mesh of said meshed representation, updating at least said values of said parameters of the diagenetic state of at least one of said facies, using the following steps: i. for each of said meshes of said meshed representation, based on said values of said determined parameters of the diagenetic state of said facies, determining at least one petrophysical property relating to the flow in said formation; ii. using a flow simulator and said meshed representation filled with petrophysical properties relating to the flow, simulating production data relating to said formation; iii. determining an objective function measuring at least one difference between said measured production data and said simulated production data; iv. for at least one of said meshes of said meshed representation, modifying, based on said objective function, at least said value of said parameter of the diagenetic state for one of said facies; and reiterating steps i) to iv) until a predetermined stoppage criterion is reached; C. based at least on said updated meshed representation, determining a scheme for exploiting said hydrocarbons of said formation, and exploiting said hydrocarbons of said formation. A. based at least on measurements performed on said sample, for at least one of said facies and for each of said meshes of said meshed representation, determining a value of at least one parameter of the diagenetic state of said facies; B. based on said measured production data, for at least one mesh of said meshed representation, updating at least said values of said parameters of the diagenetic state of at least one of said facies, using the following steps: i. for each of said meshes of said meshed representation, based on said values of said determined parameters of the diagenetic state of said facies, determining at least one petrophysical property relating to the flow in said formation; ii. using a flow simulator and said meshed representation filled with petrophysical properties relating to the flow, simulating production data relating to said formation; iii. determining an objective function measuring at least one difference between said measured production data and said simulated production data; iv. for at least one of said meshes of said meshed representation, modifying, based on said objective function, at least said value of said parameter of the diagenetic state for one of said facies; and reiterating steps i) to iv) until a predetermined stoppage criterion is reached; i. for each of said meshes of said meshed representation, based on said values of said determined parameters of the diagenetic state of said facies, determining at least one petrophysical property relating to the flow in said formation; ii. using a flow simulator and said meshed representation filled with petrophysical properties relating to the flow, simulating production data relating to said formation; iii. determining an objective function measuring at least one difference between said measured production data and said simulated production data; iv. for at least one of said meshes of said meshed representation, modifying, based on said objective function, at least said value of said parameter of the diagenetic state for one of said facies; C. based at least on said updated meshed representation, determining a scheme for exploiting said hydrocarbons of said formation, and exploiting said hydrocarbons of said formation.