The main objective of this research work was to evaluate the current and future geographical environmental space of Q. ilex and P. halepensis plantations, as well as to analyze the use of agroforestry components based on afforestation techniques in degraded agricultural areas in the context of climate change in Andalusia Spain. Current survival was evaluated under current and foreseeable future climate change scenarios and by using Species Distribution Models (SDMs).For this purpose, the Geographic Information System, and the presence/absence database ofQ. ilex and P. halepensis, obtained from the Andalusian Forest Surveillance Network (RED SEDA), and the third National Forest Inventory of Spain were used. (IFN3); data on the presence and survival of afforestation with Holm oak and Aleppo pine in agricultural lands and environmental information in the form of a "raster" at a spatial resolution of 2000 and 200 m 2 were used. It was found that 25-38% of the Q. ilexandP. halepensis plantations planted between 1993 and 2000 were established in the optimal area of occurrence (probability of occurrence> 70%), but only 12,3% (Q. ilex) and 22,9% (P. halepensis) simultaneously presented an acceptable survival rate (> 50%).Furthermore, the volume of the environmental space defined by Q. ilex decreased, while that defined by P. halepensis remained constant in future climate change projections. The potential of SDMs to predict the survival rate distribution of Q. ilex and P. halepensis and to assess the future stability of each of these species has been confirmed. In the worst case, ~ 5% of Q. ilex and ~ 33% of P. halepensis in the planted area would withstand climate change.On the other hand, robust allometric models were determined to estimate the general carbon biomass and SOC stocks as a function of the height and diameter of Ceratonia siliqua trees obtained from field data. Measurements of individual trees were obtained derived from Low density ALS and dbh and SOC were also quantified, since dbh is the most reliable variable for estimating biomass; finally the total C stocks in the carob tree plantation were estimated and mapped. The values obtained for tree biomass in foliage, roots, branches, and stems for carob trees were 5,35, 17,06, 14,53 and 9,52%, respectively. The combination of allometric models allowed calculating the total C stock in the Ceratonia siliqua plantation with precision and at a lower cost than with field inventories.Finally, the landscape fragmentation processes associated with afforestation in agricultural lands between 1990 and 2018 in two localities in southern Spain (Andevalo and Guadix) were studied using the land cover databases of Andalusia (1990 and, The PatchAnalyst-ARCgis and Getis-Ord Gi analysis fragmentation metrics were calculated to quantify changes in ecosystem