Petrophysics and sediment variability in a mixed alluvial to lacustrine carbonate system (Miocene, Madrid Basin, Central Spain)

This study evaluates variations in petrophysical properties within a mixed alluvial to lacustrine carbonate system (Miocene, Madrid Basin, Central Spain). The transition from alluvial environments to lake margins settings displays a shift from alluvial, siliciclastic red sandstones and mudstones to palustrine–lacustrine mudstones to packstones. Fluctuations in lake‐water level enabled land plants to occupy the lake margins during periods of low lake levels. The palustrine carbonates include features like pseudo‐microkarst, nodular and mottled limestones; the lacustrine deposits include enlarged root cavities, desiccation cracks and channel bodies. Scarce fresh water biota comprises charophytes, gastropods and ostracods. The sediments possess high natural, irregular varying, gamma‐ray values at the alluvial–lacustrine transition, and low, but constant values at full lacustrine sites. Acoustic properties agree with lithological variations within individual facies. Porosity is the most important parameter influencing P‐wave and S‐wave velocities. The scatter in the velocity–porosity relationship links to the porosity type; macro‐porosity or microporosity. The wide range of pore types and pore sizes results in a weak porosity to permeability relationship for the carbonate‐dominated rocks with low permeability for microporous and high permeability for macro‐porous carbonates. The sandstones (probably only inhibiting interparticle porosity), and to a lesser extent the sandy wackestones to packstones, show quite a strong relationship between porosity and permeability. Elastic properties of mixed alluvial–lacustrine deposits (this study) and marine deposits (literature data) overlap as variations in pore structures and porosity values are similar. Only 16% of the marine and lacustrine carbonate sediments display Equivalent Pore Aspect Ratio values above 0.2. In travertine deposits, 83% of the samples exceed Equivalent Pore Aspect Ratio values above 0.2, which highlights that travertine deposits are dominated by larger Equivalent Pore Aspect Ratios compared to lacustrine and marine carbonate deposits. Travertines display other rock frameworks with different pore types, pore distribution and amount of porosity.


| INTRODUCTION
Textures of continental limestones differ in many cases from marine limestones, due to: (a) different carbonate components (bioclasts), (b) frequent exposure periods (low lake levels), (c) common stable mineralogy of continental limestones and (d) different operating diagenetic processes, amongst many others, therefore these sediments probably will have different petrophysical properties. Tectonic processes and climate variations control the sedimentary sequences of continental lake basins (Alonso-Zarza & Wright, 2010;Bohacs et al., 2000;de Wet et al., 1998;Platt & Wright, 1991). Tectonic processes determine large-scale changes in accommodation and thereby drive the long-term stratigraphic signal, whereas climatic processes relate to the development of short-term sedimentary cycles. Carbonate accumulation in lakes result from the balance between climate, morphological setting, source rocks and hydrology (Alonso-Zarza, 2003). In semiarid climates, the low activity of alluvial systems combined with the carbonate hinterland and surficial plus groundwater supply is the more favourable conditions for lacustrine limestone deposition (Alonso-Zarza, 2003;Alonso-Zarza & Wright, 2010). Palustrine limestones are a distinctive type of lacustrine limestone that respond to the modification of carbonate-rich muds by wetting and drying under subaerial exposure (Armenteros et al., 1997(Armenteros et al., , 1998Freytet & Plaziat, 1982;Plaziat & Freytet, 1978). They are common in relatively flat and low-energy lakes and thus slight variations in lake level can cause the exposure of significant lake areas (Abels et al., 2009;Alonso-Zarza, 2003;Alonso-Zarza et al., 2014;Freytet & Plaziat, 1982).
The north-east of the Madrid Basin in the province of Guadalajara ( Figure 1) encompasses a suite of continental carbonate deposits formed within distal alluvial, lake margin and open lake settings (Alonso-Zarza, 2008;Alonso-Zarza et al., 1992a;Calvo et al., 1989Calvo et al., , 1995. The carbonates are mostly calcitic and predominantly comprise palustrine carbonates; open lake deposits lacking subaerial exposure features are rare. Carbonate facies includes mudstones, mottled and nodular mudstones to wackestones, peloidal-intraclastic wackestones to packstones, and limestones with root cavities and pseudo-microkarst (Alonso-Zarza, 2008;Alonso-Zarza et al., 1992a). The limestones contain fresh water biota like charophytes, ostracods and gastropods. The fluvial-alluvial deposits studied in this paper consist of sandstones and siliciclastic red mudstones. Although the deposits have not undergone significant burial they are indurated as a result of early meteoric diagenesis (Wright et al., 1997). Bailly et al. (2019) in their study of a lacustrine-palustrine sedimentary system on Samos (Greece) highlighted that early diagenetic processes had a strong impact on the acoustic properties of the sediments. The Samos deposits showed | 319 REIJMER Et al. large variations in porosity and associated P-wave velocities. These variations were attributed to early diagenetic processes either infilling the original pore shapes decreasing porosity, and hence increasing P-wave velocities, or dissolving certain grains creating porosity, resulting in decreasing P-wave velocities.
This study focusses on Miocene mixed lacustrine and alluvial deposits outcropping in the north-east of the Madrid Basin, in the province of Guadalajara (Central Spain; Figure 1). The aim of this study is (a) to analyse the variations in petrophysical properties of lacustrine carbonates and (b) to resolve which factors determine the petrophysical characteristics of these continental deposits. Understanding the link between the actual sediments and their acoustic properties may help to determine to what extent petrophysical properties of these sediments differ from marine carbonates (Anselmetti & Eberli, 1993;Kenter & Ivanov, 1995;Kleipool et al., 2017;Verwer et al., 2008) and other continental carbonate deposits, for example, travertines and tufas (Bailly et al., 2019;García del Cura et al., 2012;Soete et al., 2015).

| GEOLOGICAL SETTING
The Madrid Basin is bounded to the north and south by igneous and metamorphic rocks of the Central System and Toledo mountains, and to the north-east and south-east by the Iberian Range and the Altomira Range which are made up of sedimentary rocks, mainly carbonates ( Figure 1). These mountain ranges were uplifted during Alpine movements (Calvo et al., 1989(Calvo et al., , 1995, which at the same shaped the Madrid Basin. The Neogene lacustrine sedimentary sequence outcropping in the north-east of the Madrid Basin consists of a lower unit, an intermediate unit and an upper unit (Alonso-Zarza et al., 1990;Alonso-Zarza & Pérez Jiménez, 2008; Figure 2). This study focusses on the sediments forming the lower to intermediate unit as defined by Alonso-Zarza and Pérez Jiménez (2008), which were deposited during the Aragonian to Vallesian continental time periods. The intermediate unit can be subdivided into five subunits being: (a) detrital unit I, (b) mixed unit I, (c) detrital unit II, (d) mixed unit II and (e) the upper carbonate unit (Figure 2). The detrital units mainly consist of conglomerate, sandstone and shale with individual channel bodies dissecting the other sediments (Alonso-Zarza et al., 1993). The mixed units consist of palustrine limestones and carbonate palaeosols, with interbedded mudstones. The upper carbonate unit (Aragonian/early Vallesian; Calvo et al., 1989Calvo et al., , 1995 is the main focus of this paper and contains lacustrine carbonates with minor interbedded detrital sediment layers (Alonso-Zarza et al., 1990). Alonso-Zarza et al. (1992a) distinguished three main facies/sedimentary environments in the alluvial to lacustrine sedimentary sequence: (a) distal alluvial to lake margin transition, (b) marginal lake facies and (c) open lake facies. The aforementioned facies were used to describe the up to 200 m thick successions in the study area.

| METHODS
In total, 264 samples were collected in the field and analysed to determine the facies variations, porosity, permeability, sediment composition and gamma-ray values. For 135 samples these properties were correlated with the acoustic properties of the sediments, for example, P-wave and S-wave velocities. F I G U R E 2 Schematic overview of the Madrid Basin including the different units and subunits. The field-areas are marked with red-lined boxes. Modified after Alonso-Zarza et al. (1990). The timescale was modified after the timescale of Alonso-Zarza and Pérez Jiménez (2008). The timescale was not absolutely dated and hence is relative. It is not distributed equally along the axis 320 | REIJMER Et al.

| Fieldwork
The area of interest is located in the Madrid Basin, north-east of Madrid (Guadalajara Province, Central Spain) (Figure 1). During a series of fieldwork campaigns, data were obtained from 10 different locations (Figures 1, 3 and 4). The outcrops were logged and sampled bed by bed to determine all sedimentological characteristics (Figure 3). The rock samples were used to produce thin sections and plugs for petrophysical analyses. A portable permeability device was also used to measure the permeability of fresh surfaces on the outcrops. In addition, a gamma-ray device was deployed to measure the natural emitted radioactivity.

| Logs
Logging of the outcrops was carried out using sedimentological log forms with a scale of 1:50. The logs include detailed descriptions of the different lithologies, sedimentological trends, bed thickness, fossils, erosional profile, specific features like vertical root cavities and channel bodies, interpretation of the facies following the classification of Alonso-Zarza et al. (1992a;  Table 1) and textural classification based on Dunham's (1962) classification of carbonate rocks. Specific features like vertical root cavities and channel bodies were also noted ( Figure 3).

| Gamma ray
Natural gamma ray was measured in the field with an Exploranium GR-320 portable gamma-ray spectrometer (See Table S1 Supporting Information). The data were used to evaluate terrestrial input and to evaluate the applicability of this technique as a correlation tool between the individual successions ( Figure 3). The machine measures the natural emitted radioactivity of Potassium-40, Uranium-238 and Thorium-232. The device was placed on all rock layers described in the log forms, on a clean | 321 REIJMER Et al. Figure 3. (A) Alarilla succession (ca 220 m in total): lower part with alluvial sandstones and conglomerates (foot of the hills), a poorly exposed middle part with massive limestone beds alternating with alluvial deposits (palustrine (lake margin) deposits), and, on the top of both hills, open lake deposits with massive, partially karstified wackestones. White arrow: Person for scale foreground. (B) Detail of (A) showing an alternation of alluvial channels filled with conglomerates and sandstones. (C) Castilmimbre. Transition from shallow alluvial and channel facies (lower right) to palustrine carbonate beds (first appearance marked by the white arrow). (D) Fuentes de la Alcarria: Channel filled with sands cutting into lake margin sandy wackestones. White arrow: fieldbook for scale) (E) Valvermoso de las Monjas: Succession with wackestone to packstones deposited in a palustrine setting (lower left), and mudstones, palustrine to open lake facies that alternate with and wackestones, palustrine deposits; base alternation starts at road intersecting massive beds on far-right side photograph (black arrow). Person for scale (white arrow) and smooth surface in order to obtain reliable data. The device measures radioactivity in a hemisphere with a diameter of 15 cm. It was deployed for 120 s and lists the results as counts that were transferred to API units using the following formula (Ellis, 1987):

| Laboratory analyses
The rock samples collected were used to produce thin sections, plugs and rock powders. In total 135 cylindrical plugs, which were all taken perpendicular to the bedding, were made to measure the porosity, the permeability and the acoustic properties of the studied sediments. Length, diameter and other characteristics of the individual plugs are listed in Table  S1 (Supporting Information). The same samples were used for thin sectioning and TGA measurements. An additional 129 thin sections were made to characterise the various facies.

| Permeability-laboratory and outcrop
Permeability was measured with a TinyPerm-3 machine (New England Research) placed in holder that was positioned on top of the plugs. The plugs were placed in a rubber sleeve to seal the sides of the plugs during measurements. Permeability was measured over a time span of 120 s and conducted multiple times from both sides of the plugs. Using the machine in the field showed its practical limitations as outcrop surfaces are often too irregular and altered because of weathering. Field measurements provided unrealistically high numbers, see Table S1 (Supporting Information) and thus were not used in the analysis.

| Porosity
The porosity of the rocks is calculated by measuring the grain density and dry bulk density of the plugs (Table S1 Supporting Information). Bulk density is derived from the volume and weight of the plug. Grain density is measured by placing the plug in a helium pycnometer (AccuPyc 1330, Micrometritics). The amount of pore space filled with helium is used to define the grain density (Kenter & Ivanov, 1995). The porosity is calculated by using the following formula: Isolated pore spaces, microporosity and gauging can influence the accuracy of the measurements. Kenter and Ivanov (1995) listed that the grain density in the set-up used, was measured with a precision of ±0.02 g/cm 3 , the bulk density with a precision of ±0.05 g/cm 3 and the porosity with a precision of ±3%. However, the latter 3% relates to porosity units, for example, 3% of a measured value of for example 20% relates to a porosity uncertainty range between 19.4% and 20.6% for the measured value.

| Scanning Electron Microscopy
Microporosity is difficult to assess with the AccuPyc device or to recognise in thin sections. Polished plugs were immersed in 0.1 M hydrochloric acid for 20 s and cleaned with distilled water before they were placed in the JCM-600 NeoScope Benchtop Scanning Electron Microscope (JEOL) for detailed microporosity analysis.

| Acoustic properties
Acoustic velocities of the plugs were measured in dry conditions with the Verde Geosciences High Pressure Measurement System (HPMS). Prior to the measurement the plugs were dried at 60°C for at least 72 h. The dry plugs were placed in an impermeable rubber sleeve and placed in a transducer, consisting of a receiver and an emitter. The source crystal emits two S-waves as orthogonal and polarised waves and a P-wave (Verwer et al., 2008). The transducer was placed in an oil reservoir with the confining pressure gradually built up to 40 MPa as the travel times of the waves within the plugs were sequentially measured at different confining pressures (2.5, 5, 10, 20 and 40 MPa). The waves that were emitted at 1 MHz pulses were recorded on an oscilloscope connected to a computer. The velocity can be defined as the point where the first wave arrives and has a constant signal. At increasing pressure, signals become clearer and interpretation of the first arrival time is more reliable. The first arrival wave is visualised by a LabVIEW application and used to determine the wave velocity. When the maximum amplitude has a voltage threshold of 3%, the first wave arrival is picked. An inaccuracy of 1% should be considered when the mixed carbonate samples are well consolidated and have a maximum porosity of 30%, otherwise the inaccuracy can increase to 5% (Anselmetti & Eberli, 1993). The Gassmann (1951) fluid substitution was used to recalculate the velocities with the water modelled in the pore system; see Kleipool et al. (2015) for further details.

| Thin sections
Thin sections were prepared from (a) the 135 plugs that were used for petrophysical measurements and (b) from an additional 129 rock samples which were only used for petrographic analysis. All sediments were impregnated with blue dye before thin-sectioning. The rocks were classified based on Dunham's (1962) classification scheme. The lacustrine sediment classification and facies interpretation followed Alonso-Zarza et al. (1992a). Additional facies information relies on Flügel (2004).

| Thermogravimetric Analysis
The carbonate content was measured with the TGA701 developed by LECO (Table S1 Supporting Information). For each sample, 5 g was roughly crushed in a steel jaw crusher. The rock samples were further processed to produce powders in the Planetary Mill PULVERISETTE 5/4 developed by Fritsch, with 2 g of each sample put into cups which were then placed in the device. The temperature was increased up to 1,000°C in 4 h following various steps: (a) the temperature was initially increased to 105°C to evaporate all moisture; (b) the temperature was then raised to 330°C in an oxygen atmosphere to oxidize the organic matter; (c) the temperature was further increased to 550°C under the same conditions to oxidize the rest of the organic material; and (d) the last step, the temperature was raised to 1,000°C, in an atmosphere filled with carbon dioxide, to release the OH groups in minerals and crystallization water. Based on mass loss, the mass fraction of calcium carbonate is defined. The outcomes are the total organic carbon (TOC) and carbonate content. The residue can be calculated and will include minerals like quartz, clays and plagioclase.

| Modelling of elastic properties and Equivalent Pore Aspect Ratio
Modelling of the velocity-porosity relationship is an essential step in quantitative seismic analysis (Anselmetti & Eberli, 1993Dvorkin et al., 2014;Soete et al., 2015;Weger et al., 2009). In this study, the differential effective medium theory (DEM) was applied to assess the velocityporosity relationship and model the effective elastic moduli of the studied rocks. The effective bulk (K) and shear (µ) moduli of the rock vary as a function of the volume fraction of inclusion (porosity, φ) as summarised by the following equations (Berryman, 1992;Mavko et al., 2009): µ with initial conditions K * (0) = K 1 and * (0) = 1 . Subscript 1 refers to the initial host material (for solid calcite K 1 = 75 GPa and 1 = 32 GPa). The bulk and shear moduli of the inclusion material (pores) are represented by K i and i , respectively, where both are set to zero for dry pores (Mavko et al., 2009). The terms P * i and Q * i are geometric factors that depend on the aspect ratio of the pores. The formulations for both P * i and Q * i can be found in Mavko et al. (2009). The aspect ratio α is defined as the ratio between the smallest to the largest lengths of an oblate ellipsoidal inclusion. For a spherical pore α = 1, while cracks or fractures have very small aspect ratios (α « 1). The EPAR++ is the aspect ratio of the oblate spheroidal pores that would result in an effective elastic medium characterised by the same elastic moduli (or velocity) as the actual rock at a given porosity (Fournier et al., 2011(Fournier et al., , 2018Lima Neto et al., 2014). Once the effective bulk and shear moduli of the rock are calculated at the target porosity, the P-wave and S-wave velocity is estimated using: where is the bulk density of the rock, with: where g and f correspond to the density of solid grains and fluid (air), respectively.
The DEM approach was used to construct velocityporosity curves for various EPAR values and then such curves were compared with experimental velocity-porosity data from this study. Comparing the results from DEM with the pore types classified from petrography analysis can help to evaluate the impact of pore type on P-wave and S-wave velocity.

| Proximal sections dominated by alluvial sediments
The Las Inviernas Li-1 section (Figure 1, no 4) is the most proximal section. It contains a mixture of distal alluvial material and lacustrine carbonates ( Figure 3).
The Alarilla AL-16 section (Figures 1, no 7 and 4A,B) can be divided into three parts. The lower part comprises alluvial sandstones and conglomerates, 82.5 m in total of which the upper 20 m is not exposed. The middle part (126 m, with the upper 69 m not exposed) consists of palustrine (lake margin) deposits with massive limestone beds alternating with alluvial deposits. The upper part, 10 m in total, consists of open lake deposits, massive, partially karstified wackestones with mottling, and algal mats, that alternate with pseudo-microkarst limestones.
The Castilmimbre CA-16 outcrop (Figure 1, no 6 and 4C) shows a gradual transition from shallow alluvial and channel facies (33 m thick) to palustrine facies, an 87 m thick succession of which 50% is well-exposed. The lower succession consists of poorly consolidated sandstones and extremely well-consolidated conglomerates with up to 10 cm sized pebbles. The upper succession contains wackestones with root cavities. Some charophytes are also present.

| Proximal to the alluvial-marginal lake transition
The base of the Cogollor CG-1 section (Figures 1, no 3 and 3) is dominated by mottled and nodular limestones with quartz grains that alternate with clay or marl beds. Several channel bodies containing carbonates and low-grade metamorphic rocks derived from the Iberian Range crosscut these sediments.
The Fuentes de la Alcarria FU-16 section (Figures 1, no 8 and 4D) is a well-exposed 70 m thick succession that can be divided into two intervals. The lower 49 m interval comprises sandy wackestones or marls at the base that alternate with sandstones located in separate channels consisting of angular quartz grains embedded in a micrite matrix. The upper 21 m thick interval shows massive limestone beds. Some gypsum is also present.
The Ciruelas CI-16 succession (Figure 1, no 5) can be divided into two intervals. The lower 18 m thick interval consists of alluvial sands, succeeded by several wackestone and packstone layers, palustrine (lake margin) facies. The deposits contain root traces, some show mottling and desiccation cracks as pseudo-microkarst is also present. The upper interval, 16 m in total, consists of mudstones and dolostones.
The Valdesaz VA-16 succession (Figure 1, no 9) can be divided in to three parts. The lower part (29 m) consists of limestones showing pedogenic features. The succeeding middle part, 40 m thick, comprises alluvial sandstones interfingering with limestones that still contain a significant amount of non-carbonate grains; angular quartz grains, up to coarse sand grain size. The upper 23 m of the section comprises wackestone and mudstones with, at times, some gypsum crystals.

| Lake margin-open lake
The base of the Castejón de Henares CA-3 section (Figures 1, no 1 and 3) contains mottled and nodular limestone with some alluvial input. The transition towards the surrounding basin ranges is indicated by more nodular and peloidal to intraclastic limestones with root cavities locally.
The Argecilla AR-1 section (Figures 1, no 2 and 3) starts with a mixture of peloidal packstone and intraclastic wackestone and nodular limestone with some vertical root cavities. This section shows one small channel body in the middle of the section. Towards the top of the section, an alternation of wackestone with some gypsum and nodular limestone occurs.
The Valfermoso de las Monjas VM-16 section (Figures 1, no 10 and 4E) displays two parts. A lower part (35 m) with wackestones to packstones with abundant root traces. The sediments contain minor amounts of quartz grains (<2%). Gastropods and ostracods and nodules are common. Porosity as well as root traces and nodules are infilled by sparite cements. The upper part consists of an alternation of whitecoloured mudstones and white/pink/beige wackestones, which are comparable to those occurring in the lower part of the section. The wackestones contain root traces.

| Depositional Facies
The facies assignments are based on various field data, for example, bed by bed logging, detailed sampling, natural gamma-ray measurements. They also refer to interpretations given in earlier studies by Alonso-Zarza et al. (1992a, 1992b.

| Alluvial and channel facies
The alluvial and channel facies is marked by siliciclastic pebbles to sand-sized grains embedded in a carbonate matrix and cement (facies 1 and 2; Figures 4A,B, 5A and 6A,B; Table 1). Different types of alluvial sediments like conglomerates, sandstones (facies 1) and litharenites to sandy wackestone to packstones (facies 2), are present in individual channels that incise the surrounding lacustrine deposits. The channels show lateral variations in thickness. The conglomerates present in the Alarilla (AL-16; Figure 4A,B) and Castilmimbre (CA-16; Figure 4C) sections, contain pebbles with a diameter varying between 5 and 50 cm. Well-sorted and well-rounded quartz and limestone clasts embedded in a grey-reddish carbonate matrix and cement are also present. The well-consolidated beds vary between 1 and 4 m in thickness. Imbrication is common and the conglomerates locally show cross-bedding.
The sandstone layers of the channel facies are dominated by quartz, feldspar and some muscovite grains that are embedded in a micrite matrix. Occasionally, reworked bioclasts, for example, bivalves and characeans, are present ( Figure 6A). The grains are poorly to well sorted, have an angular to sub-angular shape ( Figure 6A,B) and originate from the surrounding sedimentary and metamorphic mountain ranges. The 0.2 m to 2 m thick beds have red-greyish weathering colours and are poorly consolidated. The micrite matrix makes up to 40 and 65% of the sediments. The sandstones also form channel bodies that cut into the lacustrine sediments.
Distally the sandstones and conglomerates grade to red mudstones with interbedded palaeosols as discussed in Alonso-Zarza et al. (1992b). The quartz content decreases in these deposits and the carbonate content may reach values between 30% and 90%, relatively low when compared to the lacustrine limestones. The siliciclastic mudstones to litharenites contain poorly sorted and angular clasts up to 1 cm in diameter. A thin micritic layer occasionally occurs around the lithic fragments ( Figure 6B). The beds have a rusty red weathering colour.

| Palustrine facies
The palustrine (lake margin) facies comprises the transition from the alluvial towards the shallow-water, open lake sediments (facies 3, 4 and 5; Figures 4C through E, 5B, 6C,D and 7A). These facies contain wackestones and packstones with a nodular appearance, show mottling and modification by roots. The beds are massive and locally contain small lenses of clay or marl. The transition from alluvial to marginal lake sediments is marked by mottled and nodular limestones (facies 3; Figures 5B and 6C,D). The beds are massive, bed thickness varies between 30 cm and 2 m. They are well-consolidated and have a reddish to yellowish colour. Root traces are present in the clayey layers together with 2 to 10 cm diameter nodules of calcite. The wackestone contains yellow nodules that are surrounded by desiccation cracks (Figure 6C), which in later stages were filled with microspar. The micrite matrix has a clotted or mottled appearance, which is marked by colour differences. The limestones contain fragments of ostracods, bivalves and gastropods, and quartz grains. The pore spaces are filled with laminated sediment in which small coated grains alternate with finer grains. Geopetal structures are often recognisable on microscale ( Figure 6D), but poorly exposed on macroscale.
The mottled limestone (facies 5) present in the lake margin facies equals the mottled and nodular limestone but shows paler colours. The well-consolidated white/beige limestone layers vary in thickness between 30 cm to 2.7 m, but also vary laterally in thickness, since they form small channels and at times contain boulders. The beds have a massive appearance, are slightly weathered at the surface and locally show small clay lenses. The mottled limestone contains nodules of dark micrite in a matrix of reddish clotted micrite. The limestones contain fragments of bivalves, show root cavities and quartz grains. The root cavities are filled with microspar or are coated with a rim of blocky spar and are porous in the centre ( Figure 7A). The mottled limestone often contains round-shaped micritic peloids in a matrix of microspar and lighter coloured micrite (facies 4); the precursor lacustrine sediment probably was a peloidal packstone. Root cavities can be present forming geopetal structures ( Figure 6D) (Flügel, 2004). Porosity is defined as interparticle and mouldic with most of the porosity later being filled with sparite and microspar. Fossils like bivalve fragments and ostracods are present.
Pseudo-microkarst facies (facies 6; Figures 5B,C and 7B) are characteristic of the transitional/palustrine deposits. The limestones are marked by horizontal and vertical cavities that result from secondary processes created along the former root traces, desiccation and minor dissolution  Plaziat and Freytet (1978) and Alonso-Zarza et al. (1992a) refer to these phenomena as pseudomicrokarst. In places the root cavities can be filled with new sediment (original root cavities) or remain empty and were further eroded by meteoric water (enhanced root cavities). The original root cavities were fully or partially filled with coated grains, leaving space for micrite or secondary sparite and microspar to fill the pore spaces and in places form geopetal structures. The pore spaces can be classified as intraparticle, have a vuggy shape and are partially filled with microspar and sparite (facies 7). The beds have a thickness of approximately 20 cm and contain some freshwater bioclasts, for example, charophytes, gastropods, ostracods and fragments of bivalves. The fossils are often converted into microspar or form mouldic porosity.

| Open lake facies
The open lake facies include wackestones outcropping as beds consisting of white, powdery limestones (facies 8) with beds that vary in thickness between 30 cm and 3 m ( Figure 4A,E). The thicknesses vary laterally due to the presence of small channels and show transitions to soft marly layers. The rocks have a white to yellow colour, with orange oxidation spots, and contain desiccation cracks, organic material and enhanced root cavities. Biota present in this type of sediment are altered charophytes, gastropods, ostracods and bivalves. Often, the open lake sediments consist of granular packstones or mottled limestone in which the original structure is still visible. Besides dolomite, gypsum crystals appear in the limestones associated with root structures (facies 9; Figures 5D and 7C,D).
Small channel bodies with intraclasts cut the open lake facies or palustrine facies. The intraclasts often consist of pieces of nodular limestone, including fossil fragments, containing geopetal structures and peloids, that were broken-up and deposited in a channel. All the grains are covered by a thin probably microbial micritic coating, filling the irregularities and smoothing the grains.

| Gamma-ray
Gamma-ray measurements were carried out on all beds in the field (Figure 3; Table S1 Supporting Information). The average gamma-ray value decreases from the proximal alluvial and channel facies towards the open lake facies. The highest mean value, 63.5 API for facies 2 (sandy wackestone to packstone; 14 samples), was found in the alluvial and channel facies as low values characterise the open lake facies with 15.1 API for facies 8 (8 samples) and 14.0 API for facies 9 (31 samples). The highest mean gamma-ray value of 135.6 API was measured in the deep lake facies, which also showed the lowest value with 1.6 API.

| Permeability
The permeability of the rocks ranges from 0.03 mD in the wackestone to packstone with gypsum (sample Ca-16.45; Facies 9) to 4,900 mD in the alluvial and channel facies of sample CA-16.05 (Castilmimbre section; Facies 1; Table S1 Supporting Information). The permeability values fluctuate immensely but the range in values have not been linked to any specific facies (Figure 8).

| Porosity
Section CA-3 (Castejón de Henares section), which comprises the palustrine (marginal lake) facies, contains the most porous sediments with up to 30.5% (Figure 3; Table S1 Supporting Information; Sample Ca-3.28). The lowest porosity of 0.5% is recorded in the alluvial and channel facies of the Argecilla AR-1 section. The average porosity is highest in the marginal lake facies and is reduced in the alluvial and channel and open lake facies (Figure 8). Microporosity (Figure 9) was found in facies 5 in the Argecilla-(sample AR1.44), and Castejón de Henares sections (sample CA-3.18).
A discrepancy was observed between the reported grain density values and the mineralogy of the samples (Table S1 Supporting Information). In general, the reported grain density values are lower than expected given the mineralogy of the samples. For example, this is evident in several calcite dominant (>95%) samples where grain density values were much lower than 2.70 g/cc (e.g. 2.56 g/cc for samples Ca-16.56 and Ca-16.54, both from the Castilmimbre section). Such underestimation of grain density results in an underestimation of the porosity. This issue can be caused by the presence of micropores or isolated pores making it difficult for the helium to reach all pores during the helium pycnometer measurements.
To correct for such underestimation, the grain density was calculated based on the measured mineralogy of the samples (% of carbonates and residue) where calcite grain density was set to 2.7 g/cc and the residue (mainly quartz) was assigned a grain density of 2.65 g/cc. Finally, the porosity was recalculated using the bulk density (same values as before) and the calculated grain density (Table S1 Supporting Information).

| Pore shapes
The different facies do have varying sets of pore types. From microporosity in the marginal lake facies related to the root | 329 REIJMER Et al. cavities (Figure 9), interparticle porosity in the mottled limestone (deep lake facies) and interparticle and mouldic porosity in the wackestone with gypsum of the open lake facies ( Figures 5D and 7D), but otherwise, as mentioned above, the sediments are fairly tight with porosities below 20% (Figure 8).

| Acoustic properties
P-wave velocities change with increasing confined pressure; the largest differences are found for facies 1 and 2 ( Figure 10). The carbonate-dominated facies (facies 4, 6, 7, 8 and 9) remain fairly stable ( Figure 10). P-wave velocities increase when moving from alluvial and channel facies towards the open lake facies (Figures 8 and 11). Hence, the P-wave velocities increase with mounting carbonate content ( Figure 12A). The highest Vp occurs in the open lake facies of the Castilmimbre section (Ca-16.45; Figure 11; Table S1 Supporting Information), with 6,134 km/s. The lowest Vp with 2,895 km/s corresponds to the alluvial and channel facies of Alarilla (Al-16.12; Figure 11; Table S1 Supporting Information). The highest (3,295 km/s) and lowest F I G U R E 8 Cross-plots of (A) Porosity and permeability with facies colour scheme. (B) P-wave velocity and porosity, including the facies colour scheme. The Wyllie time-average (WTA; Wyllie et al., 1956Wyllie et al., , 1958 and Raymer-Hunt-Gardner (RHG) porosity-velocity models (Raymer et al., 1980) are used to predict the porosity in the subsurface. (C) Dry P-wave velocity and saturated P-wave velocity with colour-coded porosity; blue: low, red: high. Decrease in porosity corresponds to an increase in P-wave velocities, and also agrees with an increase in carbonate content (1,102 km/s) Vs can be found in the alluvial and channel facies of the Argecilla section (AR-1; Figure 3) and Alarilla succession (Al-16; Figure 4A,B).

| Thermogravimetric Analysis
The carbonate content varies from 31.0% in the alluvial and channel facies of section Al-16 (Alarilla) to 99.5% in the open lake facies of section Fu-16 (Fuentes de la Alcarria). The average carbonate content per facies increases gradually when moving from the alluvial and channel facies, to the palustrine facies comprising the lake margin and the pseudo-microkarst facies, and the open lake facies (Figure 12).

| Facies interpretation
The sections studied in the north-east Madrid Basin were categorised according to their field characteristics, facies variations and associated gamma-ray characteristics (Figure 3). Based on these measurements, an interpretation of the sections was made following the facies interpretation of Alonso-Zarza et al. (1992a). A profile consisting of four successions (Figure 3) representative of the entire dataset will be discussed to demonstrate the facies variability and associated fluctuations in the natural gamma-ray signal. Both parameters characterise the sediment type, which is also reflected in the petrophysical properties of the sediments deposited in the different facies realms.
The Las Inviernas section is the most proximal section displaying a thin alternation of distal alluvial material and lacustrine carbonates (Figure 3). This variation is well reflected in the gamma-ray measurements with layers that are rich in clays and organic material displaying relatively high values (Rider, 1990(Rider, , 2002. The sediments of the Cogollor section reflect the transition from alluvial fan facies to open lake facies (Figure 3). The alternation at the base of the section with mottled and nodular limestones with quartz grains and clay or marl beds probably indicates a rise in lake level as discussed for comparable Middle Miocene deposits in the southern part of the Madrid Basin (Bellanca et al., 1992). The gamma-ray signal varies significantly, with high values within the clay rich beds and lower values for limestone beds. Several channel bodies ( Figure 5A) containing carbonates and low-grade metamorphic rocks derived from the Iberian Range crosscut these sediments (Alonso-Zarza et al., 1993). The channel bodies rich in quartz, feldspars and clays display a moderate gamma-ray signal that is lower than those related to the clay beds ( Figure 5D), but higher than the values of the limestones. Towards the top of the section the gamma-ray signal decreases and the limestones show less terrigenous input.
The sediments of the Castejón de Henares section consist of mottled and nodular limestone ( Figure 5B), with some alluvial input, that were deposited in a shallow lake environment (Figures 1 and 3). The gamma-ray signal shows significant variations, which relate to variations between beds with F I G U R E 1 1 Cross plot of Vs and Vp with superimposed facies colour scheme and predicted carbonate range in grey (Hamilton, 1979;Wilkens et al., 1984). Do note the wider range in Vp and Vs of facies with a lower carbonate content (Green, orange, yellow circles, see legend) a high clay content and limestones. The transition towards the surrounding basin ranges is indicated by more nodular and peloidal to intraclastic limestones with root cavities locally (Alonso-Zarza et al., 1992a). The gamma-ray values are lower and become less divergent towards the top (Figure 3). The top part of the section mainly consists of limestone with scarce gypsum ( Figure 7D). The decrease in the gamma-ray signal suggests a lithology shift to purer limestones, deposited in a lacustrine environment.
The Argecilla section sediments consist of a mixture of peloidal packstone and intraclastic wackestone and nodular limestone with some vertical root cavities that are deposited in a shallow lake with multiple subaerial exposure periods as shown by the pseudo-microkarst facies (Figures 3 and  5C; Table S1 Supporting Information). Distal alluvial influences are absent, which results in low and constant gammaray values. This section shows one small channel body in the middle of the section with a distinct gamma-ray signal (Figure 3). Towards the top of the section, wackestone alternating with some gypsum and nodular limestone shows a low and constant gamma-ray value. One high value linked to a marl layer distorts the fairly constant signal. The presence of charophytes ( Figure 7B) confirms carbonate deposition in a littoral and shallow-water lake environment as charophyte calcification is associated with aquatic macrophyte carbonate incrustation (Anadón et al., 2000). The distal alluvial to lake margin transition is characterised by mottled and nodular limestone, mudstones and channel bodies. Carbonate nodules are moulded around roots due to carbonate precipitation ( Figure 6C; Alonso-Zarza et al., 1992a). The nodular carbonates formed by desiccation of micritic muds (Alonso-Zarza et al., 1992a). Desiccation cracks resulted from aerial exposure of the palustrine sediments and in most cases were filled diagenetically with micrite or sparite ( Figure 6C; Armenteros & Daley, 1998;Armenteros et al., 1997;Freytet & Verrecchia, 2002). The channel bodies representing influx from the hinterland eroded the limestones and marls, depositing quartz, feldspar and limestone debris ( Figure 5A,D). The channels have been consolidated by limestone that precipitated when the lake-level rose.
The marginal palustrine sediments were deposited on a low angle slope in a low-energy environment (Alonso-Zarza et al., 1992a;Bustillo et al., 2002;Platt & Wright, 1992). Plants occupied the margins of the lake and after decay their root cavities were either filled with sediments when lake-water level rose and flooded the lake shores, or they remained unfilled and subsequently were filled by sparite and microspar during burial diagenetic processes (Figures 6D and  7C). The micritic fragments formed by desiccation and root activity and were transported and rounded by water motion, and deposited in root cavities or as single beds ( Figure 5B; Alonso-Zarza et al., 1992a). The gypsum crystals of the limestones ( Figure 7D) were probably formed as a secondary process due to sulphate reduction processes associated with roots (Alonso-Zarza et al., 1992a). Similar deposits are known from the Late Eocene lacustrine and palustrine deposits of the Hampshire Basin (Isle of Wight, Southern England; Armenteros & Daley, 1998;Armenteros et al., 1997).

| Gamma Ray
As discussed in the previous paragraph the gamma-ray variations differ for the different facies realms, with relatively high signals for the alluvial and channel facies with sandstones and conglomerates, to low values for the carbonates of the open lake facies. Sediments with a high carbonate content usually have limited natural gamma-ray minerals, but often lacustrine carbonates include some organic matter within reducing micro-environments where uranium-bearing minerals form that emit gamma rays (Rider, 1990(Rider, , 2002) (compare Figure 12A,C), however, the range of organic matter in the samples is relatively low and does not exceed 1.34% (Table S1 Supporting Information). Other minerals also could have influenced the gamma-ray values, like feldspars or clay minerals, the detritus of the surrounding mountain ranges (Arribas et al., 2004); no detailed XRD analysis was applied to address the individual contribution. The positive relationship between the gamma ray and organic matter is confirmed by the porosity-velocity plots highlighting gamma ray and organic matter variations ( Figure 12B,C). Lower gammaray values correspond with higher P-waves and S-waves, probably because seismic wave velocities are higher in sediments with a higher carbonate content ( Figure 12A), a feature also observed by Kenter et al. (1997) in a mixed marine carbonate-siliciclastic system. As for clays, sediments with clay contents exceeding 12% will show a decrease in P-wave and S-wave velocity (Braaksma et al., 2003;Kleipool et al., 2015). However, Jafarian et al. (2017) in their analysis of upper Palaeozoic mixed carbonate and non-carbonate deposits found no clear threshold.

| Petrophysical properties
The permeability and porosity of the carbonate-dominated samples show a weak correlation ( Figure 8A). Permeability is sensitive to pore shapes, pore types, pore sizes and pore throat diameters (i.e. pore connectivity). The presence and distribution of microporosity in carbonate rocks may significantly impact the permeable response of the sample, whereas porosity measured in the helium pycnometer is sensitive to the microporosity (Anselmetti et al., 1998). The irregular pore shapes formed due to diagenetic processes influence F I G U R E 1 3 Porosity and P-wave velocity (dry) distribution in the Miocene continental carbonates from the north-east Madrid Basin (Guadalajara, Spain). Colours denote varying carbonate content. The Miocene lacustrine-palustrine samples with a high carbonate content show a clear decrease in velocity with increasing porosity. Lower values agree with samples with a high detrital content. The curves equal the DEM modelling results for variable Equivalent Pore Aspect Ratio (EPAR) values (shown by the numbers next to the individual curves), assuming pure calcite mineralogy. Velocities shown are values at 40 MPa the permeability in the rocks (Melim et al., 2001). These parameters result in dispersed data points ( Figure 8A) in which no clear trend is visible for the different facies. The permeability-porosity correlation in continental carbonates is generally poor, because of the rapidly changing parameters like temperature, water level and clastics input. These continuously changing parameters will determine the pore structure diversity, which ultimately, together with the diagenetic evolution of the continental sediments, will determine the development of porosity and permeability (Bailly et al., 2019;Soete et al., 2015).
The velocity-porosity relationship is shown in Figure 8B where data points were categorised according to their facies ( Figure 8; Table S1 Supporting Information), as indicated with different colours. The orange points are the channel bodies filled with quartz and feldspar grains. Quartz has a P-wave velocity of 6.05 km/s while calcite has a higher P-wave velocity of 6.530 km/s (Mavko et al., 2009) and therefore the Pwave velocities of the channel bodies will be somewhat lower than those of pure carbonate rocks (blue points in Figure 8B). The mottled and nodular limestones (light green data points) have a lower carbonate content than the limestones of the marginal lake facies and thus their P-wave velocities appear to be slightly lower ( Figures 8B and 11). The observed impact of facies on velocity documented here can be related to variations in mineralogy. This is highlighted in Figure 13 where samples characterised by higher carbonate content (dark red/brown data points), tend to have higher V p at any given porosity. On the other hand, samples characterised by a lower carbonate percentage (higher detrital content) occupy the lower part of the velocity-porosity plot. This observation can be explained by the lower V p in quartz compared to calcite, and is consistent with results reported by earlier studies (Kenter et al., 1997;Wilkens et al., 1984). Deviations from the pattern described above displaying lower velocities, as with the dataset of this study ( Figure 8B), relate to the amount of non-carbonate minerals, for example, quartz, feldspars and clays. Braaksma et al. (2006) analysing clastic sediments concluded that porosity controls the Pwave velocity, but differences in mineralogy also may result in minor changes in the velocities. Storvoll and Bjørlykke (2004) analysing sonic velocity variations in reservoir sandstones subjected to different burial depths demonstrated that grain to grain contacts and especially the size of the contact area plays an important role in determining velocity variations in those sandstones. As for the Miocene lacustrinepalustrine deposits the mineralogy variations do display an impact on the acoustic velocities as carbonate contents vary from slightly over 40% in the sandstones of the alluvial and channel facies up to 99% in the mottled limestones of the open lake facies. With lower carbonate content the velocities decrease, which is mainly related to a higher non-carbonate input that originate from the Palaeozoic metamorphic rocks outcropping north-west of the Madrid Basin. Other studies researching mixed carbonate and non-carbonate deposits indicated that mineralogy is the main parameter influencing the P-wave velocity (Jafarian et al., 2017;Kleipool et al., 2015Kleipool et al., , 2017, but also state that pore geometries influence the velocities as well. The evaluation of the relationship between the Vp and Vs may help to predict the lithology of a rock sample (Figure 11; Table S1 Supporting Information; Kenter & Ivanov, 1995;Wilkens et al., 1984). The Vp/Vs ratio of carbonates usually ranges between 1.7 and 2.0 (Hamilton, 1979;Wilkens et al., 1984); grey zone in Figure 10. The ratio can vary due to the influence of lithologies other than carbonates or due to pore geometries (Wilkens et al., 1984). The Vp/Vs ratio of quartz at 1.5 is lower than the ratio for carbonates (Wilkens et al., 1984). The Vp/Vs ratio in carbonates can also be lowered due to the closure of microcracks (Figure 11), since the S-wave velocity is more sensitive to this change than the P-wave velocity (Wilkens et al., 1984). Pore geometries, like cracks, lower the Vp/Vs ratio, which might apply to the mottled limestone sample (green point in Figure 10; Sample AR-1.44, Argecilla section) that falls out of the grey area. The carbonate content of sample AR-1.44 reaches 97% (Table S1 Supporting Information), and thus it is unlikely that lithology influenced the Vp/Vs ratio. This nodular limestone showed abundant microporosity ( Figure 9A,B). Pressure might have closed some of the porosity during the acoustic velocity measurements (Figure 10). Such a process, would increase the S-wave velocity, resulting in a lower Vp/Vs ratio (Toksöz et al., 1976;Wilkens et al., 1984). With increasing confined pressure, the majority of the measured velocities change and increase ( Figure 10); this especially holds for the alluvial and channel facies samples (Facies 1 and 2). These changes are limited for the carbonate-rich, low-porosity samples (Facies 4,6,7,8 and 9). The majority of samples show slightly higher velocity values at the end of the confined pressure trajectory ( Figure 10). This is because of closed porosity and microcracks that did not re-open during the pressure release (Eberli et al., 2003).
Focussing on carbonate-dominated samples, porosity generally has an inverse relationship with velocity ( Figure 13). The curves in Figure 13 show the DEM modelling results for different Equivalent Pore Aspect Ratio (EPAR) values (displayed next to the curve). For carbonate-rich samples, most data points plot between EPAR values of 0.08 and 0.2 ( Figure 13). Such EPAR values suggest that these samples are dominated by microporosity and interparticle porosity which is consistent with observations from thin sections as mentioned earlier (Figures 6 and 7). The occasional increase of EPAR seen in a few samples could be attributed to the presence of some mouldic and intraparticle porosity ( Figure 6D) Hairabian et al., 2014;Jaballah et al., 2021), but the impact of such pore types remains limited since they were not well-developed in most of the studied | 335 REIJMER Et al.
samples. These observations and the reported EPAR values are consistent with results obtained by several studies for microporosity and interparticle porosity dominated carbonates (Baechle et al., 2008;Fournier et al., 2011Fournier et al., , 2014.

| Comparison with other continental and marine carbonates
Lacustrine to palustrine carbonates share the continental aspect with travertines and associated continental carbonate deposits, while sharing the sediment transport and sediment distribution aspect with marine carbonates. Therefore, it can be expected that the acoustic properties do shown an overlap with the aforementioned carbonate sediments. The porosity-velocity trends of the travertines differ from those of continental-to-lacustrine deposits in this study as the pore types, pore distribution and the amount of porosity linked to the rock framework are different (Figure 14; Soete et al., 2015). On the other hand, a very good match is observed with the velocity-porosity trends from the lacustrine-palustrine sediments of Samos Island (Figure 14; Bailly et al., 2019). Travertines are mainly composed of precipitates that produce a rigid rock framework while a major part of marine carbonates consist of transported carbonate sediments . Nevertheless, there is an overlap between the data from this current study and those for the travertine samples characterised by porosities lower than 10% (Figure 14). This is because at such low porosity, travertines are dominated by microporosity  as the framework and mouldic porosity are not yet developed well. Above 10% porosity, travertines are dominated by well-developed vuggy and mouldic porosity, and thus the majority of samples (83%) have EPAR values above 0.2 ( Figure 14). The facies analysis of Claes et al. (2015) for Pleistocene travertine deposits from Turkey, and Claes et al. (2017) for travertines from Hungary, essentially the same outcrops as discussed in Soete et al. (2015), highlighted some distinct facies variability. Both travertine deposits incorporate facies with a strong lacustrine component, being (a) the biostromal travertines in the Turkey dataset, which are part of the reed facies  representing a small pond to lacustrine subfacies, and (b) the marsh-pool facies in the Hungarian outcrops (Claes et al., 2017) that were classified as a transition from a subaerial travertine to a palustrine and lacustrine system. The root systems present in both facies resemble the structures characterising the pseudo-microkarst deposits of the current Miocene dataset and, hence the porosity and permeability distribution probably are very similar. Therefore, some overlap in the velocity-porosity trends can be expected as shown in Figure 14.
F I G U R E 1 4 Porosity versus P-wave velocity (dry) distribution in (a) Miocene continental carbonates from Guadalajara (brown dots; only samples with carbonate content above 90% from this study were used here), (b) Pleistocene travertines from Turkey and Hungary (blue dots: Soete et al., 2015), and (c) Upper Miocene lacustrine carbonates from Samos Island, Greece (green dots: Bailly et al., 2019). Note the different trend lines of the travertines and the continental-lacustrine carbonate deposits. The Miocene lacustrine-palustrine carbonate data do largely overlap and are situated within the same Equivalent Pore Aspect Ratio (EPAR) range, but differ distinctly from the EPAR range of the travertines. Miocene (this study) and Pleistocene  velocities values measured at 40 MPa. Upper Miocene samples from Samos Island (Bailly et al., 2019) measured at ambient pressure F I G U R E 1 5 Comparison of porosity-P-wave velocity (dry) distribution in Miocene continental carbonates from Guadalajara (brown dots: this study), full marine Cretaceous carbonate deposits from Southern France (light blue dots: Fournier et al., 2011;purple dots: Fournier et al., 2014) and Miocene marine carbonates from SE Spain (orange dots: Kleipool et al., 2017). The Miocene lacustrinepalustrine carbonate-rich deposits do largely overlap with the marine deposits and occupy the same EPAR range. All values presented measured at 40 MPa Only 9% of samples from the current study and the one by Bailly et al. (2019) have EPAR values above 0.2. The majority of the carbonate-dominated, continental to lacustrine deposits of the Madrid Basin fall within the same EPAR range, between 0.08 and 0.2, as the Samos Island sediments ( Figure 14). So, these two datasets have very similar velocityporosity trajectories with the current studied deposits being slightly tighter.
Studies on marine carbonates concluded that porosity is the main parameter controlling the P-wave velocity (Eberli et al., 2003;Fournier & Borgomano, 2009;Kenter & Ivanov, 1995;Weger et al., 2009). In addition, the pore types influence the P-wave velocity with sediments with mouldic, vuggy and intergranular macropores displaying higher velocities than those with microporosity (Anselmetti & Eberli, 1993;El-Husseiny et al., 2019;Fournier et al., 2014;Salih et al., 2021;Weger et al., 2009). The Miocene continental Madrid Basin sediments possess comparable acoustic values for a given porosity as full marine systems ( Figure 15). This similarity probably agrees with the relatively low inorganic and detrital sediment fraction of the majority of the continental lake sediments and the non-bio-constructional nature of these sediments. Lacustrine deposits mainly have a sediment transport origin with limited in-situ framework building, only the root structures and peloidal infill can be considered as such, and hence have a porosity distribution and pore shape variety that overlaps with what is known from the marine realm. This overlap is very well shown in Figure 15 in which the porosity-Vp distribution of the marine carbonates and the lacustrine-palustrine deposits display similar variations. The EPAR of both the full-marine carbonate sediments and the carbonate lacustrine sediments display values with only 16% above the 0.2 EPAR curve while for the travertine deposits, 83% of the samples have EPAR values above 0.2. Hence, the travertine deposits are dominated by larger aspect ratios compared to the lacustrine and full-marine carbonate deposits.

| CONCLUSIONS
The lacustrine deposits forming the Intermediate unit in the Madrid Basin were deposited in a shallow fresh-water lake, with detrital sediments interfingering with carbonate lake sediments at the edges of the lake. Fluctuations in water level created variations in the depositional circumstances as expressed by desiccation cracks, and muds and root cavities created by the plants growing on the margin of the lake. Fresh-water biota incorporate gastropods, ostracods and charophytes that partially infill the root casts. Intraclasts and micritic peloids also formed due to water-level fluctuations and plant root development. Channel bodies with intraclasts or detrital sediments incise the lacustrine carbonates in parts of the lake where the distal alluvial facies prevail.
The sections range from proximal, which is the boundary between the alluvial to the marginal lake facies, to distal, the marginal lake facies closest to the open lake facies. This transition clearly shows up in the lithology and gamma-ray values. At the base of the more proximal sections (LI-1 and CG-1), the distal alluvial to marginal lake facies dominates and the gamma-ray signal is relatively high and not constant, with peaks up to 128.8 API. Towards the distal sites (CA-3 and AR-1), the system is dominated by the marginal lake facies and the gamma-ray signal becomes lower and more constant with values ranging between 2 and 20 API. Hence, the gamma-ray measurements give a clear indication of the facies: high values at the alluvial distal facies, lower values at the marginal lake facies.
The individual facies do not show clear trends in porosity values and the correlation between the permeability and porosity displays a wide range. The permeabilities in the carbonatedominated rocks vary between low permeability for microporous and high permeability for macro-porous carbonates, for example, the sediments showing desiccation cracks and root cavities. However, these pore spaces are often infilled by sparite or microspar reducing the overall permeability. The sandstones, which probably only contain interparticle porosity, and to a lesser extent the litharenites, show a clear porosity-permeability relationship.
The acoustic properties are influenced by many sedimentological features, but the key factors in this dataset are the porosity and the mineralogy. An increase in porosity leads to a decrease in acoustic velocities, while samples characterised by higher carbonate content tend to have higher velocity at any given porosity. The pore geometries probably played a minor role as pore structure is dominated by micro and interparticle porosity. The open lake facies display higher acoustic velocities due to the highest calcite content, few or no detrital components, and a more homogeneous structure with few palustrine features.
Comparison with the petrophysical properties of travertines and marine carbonates demonstrates that the alluvial to lacustrine deposits of the north-east Madrid Basin resemble full marine deposits from a petrophysical point of view and differ significantly from continental travertines as they are less porous, enclose different pore types, and have a different pore type distribution than that known from travertine deposits.