Removal of Emerging Contaminants as Diclofenac and Caffeine Using Activated Carbon Obtained from Argan Fruit Shells

Activated carbons from argan nutshells were prepared by chemical activation using phosphoric acid H3PO4. This material was characterized by thermogravimetric analysis, infrared spectrometry, and the Brunauer–Emmett–Teller method. The adsorption of two emerging compounds, a stimulant caffeine and an anti-inflammatory drug diclofenac, from distilled water through batch and dynamic tests was investigated. Batch mode experiments were conducted to assess the capacity of adsorption of caffeine and diclofenac from an aqueous solution using the carbon above. Adsorption tests showed that the equilibrium time is 60 and 90 min for diclofenac and caffeine, respectively. The adsorption of diclofenac and caffeine on activated carbon from argan nutshells is described by a pseudo-second-order kinetic model. The highest adsorption capacity determined by the mathematical model of Langmuir is about 126 mg/g for diclofenac and 210 mg/g for caffeine. The thermodynamic parameters attached to the studied absorbent/adsorbate system indicate that the adsorption process is spontaneous and exothermic for diclofenac and endothermic for caffeine.


Introduction
With the continuous increase of human demand for the environment, many pollutants with low content in the environment but with great harm have gradually attracted people's attention, such as anti-inflammatories, antibiotics, etc., which are called emerging contaminants (ECs). ECs are a group of chemical pollutants that have potential threats to human health and the ecological environment. They are very complex organic matters and generally exist in water. ECs usually comes from medicines, personal care products, endocrine-disrupting chemicals, antibiotics, persistent organic pollutants, disinfection byproducts, and other industrial chemicals [1]. These ECs persist in the environment and last for a long time. Previous studies have found more than 30 ECs in untreated wastewater, treated wastewater, urban rainwater, agricultural rainwater, and fresh water. Among them, artificial sweeteners, pharmaceuticals, and personal care products were detected in various water samples [2]. ECs are constantly circulating, migrating, and transforming in environmental media. Although the concentration of these ECs in water is relatively low, they may have potential impacts on the environment and human health through the food chain after being accumulated by organisms [3]. Therefore, how to effectively remove ECs in water has received widespread attention. Acacia mangium wood 100 mg 3 g 61 min 30.9 mg/g [10] Date stone 100 mg 1 g 80 min 28 mg/g [11] Macrophytes 150 mg 1 g 1 h 117.8 mg/g [12] Açaí seed 300 mg 1 g 3 h 176.8 mg/g [13] Pineapple Plant leaves 500 mg 1 g 4 h 152 mg/g [14] Sargassum 20 mg 0.6 g 90 min 221.6 mg/g [15] Pine Wood 120 mg 0.3 g 5 h 362 mg/g [16] Coffee waste 25 mg 0.1 g 30 min 274.2 mg/g [17] Elaeis guineensis 20 mg 0.2 g 5 h 13.5 mg/g [18] Eragrostis Plana Nees leaves 200 mg 0.07 g 1 h 235.5 mg/g [19] Argan nutshells 100 mg 1 g 90 min 210.65 mg/g This work Diclofenac Sycamore ball 150 mg 0.2 g 2 h 178.9 mg/g [20] Pine tree 100 mg 0.8 g 2 h 54.67 mg/g [21] Sugar cane bagasse 50 mg 0.4 g 15 min 315 mg/g [22] Cocoa shell 150 mg 1 g 223 min 63.47 mg/g [23] Tea waste 30 mg 0.3 g 8 h 62.5 mg/g [24] Potato peel waste 50 mg 0.4 g 24 h 68.5 mg/g [25] Olive-waste cakes 50 mg 0.1 g 26 h 56.2 mg/g [26] Pine sawdust-Onopordum acanthium 100 mg 2.4 g 1 h 263.7 mg/g [27] Coconut shell 200 mg 0.5 g 24 h 103 mg/g [28] Peach stones 100 mg 0.12 g 2 h 200 mg/g [9] Orange peels 0.5 mM 0.5 g 24 h 52.2 mg/g [29] Argan nutshells 100 mg 1 g 90 min 126.16 mg/g Present work At present, the methods generally used to remove ECs from water basically include the microbial method [30], electrochemical method [31], adsorption method, membrane process, and chemical oxidation process [32]. Among them, adsorption is extensively accepted because of its advantages such as low cost, high efficiency, and wide processing range. Generally used adsorbents include activated carbon [33][34][35]. The mechanisms of adsorption are usually non-specific which could be employed to eliminate or reduce a large variety of contaminants [36]. Adsorption is a widely acknowledged surface phenomenon which is also a method for equilibrium separation as an effective process for removal of pollutants from the wastewater [37][38][39][40]. Adsorption was observed to be advantageous over other wastewater treatment methods in terms of initial price, simple design, ease of use and non-sensitivity to harmful substances. Adsorption is therefore not allowing hazardous chemicals to form [41][42][43]. Presently, activated carbon is the most widely used adsorbent. It is substantially used to eliminate complex pollutants from wastewater, like dyes and heavy metals [44].
Activated carbon (AC) is a long-known adsorbent distinguished by, among other things, its large specific surface area, porous structure, and thermostability [45]. Activated carbon might be prepared from any solid material containing a high proportion of carbon often by carbonization followed by physical or chemical activation. However, a process combining both steps can be applied [46]. Carbonization is essentially aimed at enriching the material in carbon and creating the first pores, while activation aims at developing a porous structure [47]. Good-quality activated carbons are prepared by plant biomass using orthophosphoric acid H 3 PO 4 as a chemical activating agent [48].
The AC resulting from these treatments acquires an adsorbing [49] and catalyzing capacity [50], which is highly sought after in several fields [46]: the pharmaceutical, food, and automotive industries. AC is widely used in water purification. It allows for the removal of organic (e.g., pesticides) and inorganic (e.g., heavy metals such as Pb) materials [51].
In Morocco, the agricultural activity attached to the production of argan fruit (Argania Spinosa) for oil extraction is rapidly emerging because of developing interest regarding its usages for culinary and cosmetic purposes worldwide. So far, the increased popularity of argan oil has prompted an annual production up to 4000 tons by Morocco, which leaves behind about 80,000 tons of hard shells [64]. The latter is currently considered as an agriculture by-product without any significant economic value and is mainly used by the local population as a domestic combustible [65]. Even more interesting, argan shells are well known by their rich lignocellulosic content [66], with high potential for use as raw material to produce activated carbons.
Indeed, we previously reported successful production of nanoporous activated carbon made from argan shells using optimal preparation conditions following an empirical approach [67]. The purpose of the present work was to initially obtain an activated carbon by chemical activation of argan fruit shells, then to investigate its capacity of adsorption on caffeine and diclofenac. This property is determined by the depollution of various industrial effluents.

Materials
The argan nutshells studied were collected in September 2020 in the rural area of the region of Tafraout (29 •  from Argan trees that grow spontaneously but do not benefit from any valuation. Figure 1 shows the initial samples of argan fruit.

Materials
The argan nutshells studied were collected in September 2020 in the rural area of the region of Tafraout (29°43′11.1″ N 8°58′51.7″ W), southeast Morocco. These are waste fruits from Argan trees that grow spontaneously but do not benefit from any valuation. Figure  1 shows the initial samples of argan fruit. Caffeine anhydrous 98.5% (Caf) was supplied by PanReac AppliChem and diclofenac sodium 98% (Dic) was purchased from Acros Organics. Their chemical structure and other properties are shown in Table 2.  Caffeine anhydrous 98.5% (Caf) was supplied by PanReac AppliChem and diclofenac sodium 98% (Dic) was purchased from Acros Organics. Their chemical structure and other properties are shown in Table 2.

Materials
The argan nutshells studied were collected in September 2020 in the rural area of the region of Tafraout (29°43′11.1″ N 8°58′51.7″ W), southeast Morocco. These are waste fruits from Argan trees that grow spontaneously but do not benefit from any valuation. Figure  1 shows the initial samples of argan fruit.

Preparation of the Activated Carbon
The preparation process of the AC (Figure 1) has two steps: carbonization and activation. In the first step, argan was crushed and sieved to get a particle size ranging be-

Preparation of the Activated Carbon
The preparation process of the AC (Figure 1) has two steps: carbonization and activation. In the first step, argan was crushed and sieved to get a particle size ranging between 80 and 100 µm. Then it was washed with distilled water and dried at 60 • C for 24 h. In the second step, the chemical impregnation was done in a round-bottom flask reactor, where 60 g of argan reacted with an H 3 PO 4 solution 85% (1:3) for 24 h at an ambient temperature of 25 • C. After impregnation, the solid was filtered under a vacuum to remove the excess phosphoric acid. Then the argan's powder was pyrolyzed at 575 • C for 90 min in a muffle furnace (PR Series Hobersal). Furthermore, the carbon was completely washed with ultra-pure water in order to remove the remaining phosphoric acid until reaching a pH of (6.5). Finally, the samples were dried in the oven at 105 • C for 24 h.

Characterization of the Activated Carbon
Thermogravimetric analysis (TGA) was used to estimate the temperature distribution at which the nutshell of argan responds under a latent climate. Thermal analyses were done with STD 2960 TA and SDT Q600 instruments under a nitrogen flow of 100 mL/min. The temperature ramp of 10 • C/min from room temperature to 800 • C was utilized during the analyses.
The surface functionalities were investigated with FT-IR spectroscopy. A Thermo IS5 Nicolet (USA) spectrophotometer was used for obtaining FT-IR spectra and acquired from 400 to 4000 cm −1 at room temperature (16 scans and spectral resolution of 4 cm −1 ); the peak positions were determined using Origin software (Version 2021b). Origin Lab Corporation, Northampton, MA, USA.
The textural properties of activated carbons were determined from nitrogen adsorption at 196 • C using a Micrometrics ASAP 2420 (V2.09). Specific surface areas (S BET ) were determined by applying the Brunauer-Emmett-Teller (BET) equation to the isotherms. Additionally, the total pore volume (V TP ), which corresponds to the N 2 volume adsorbed at a relative pressure (P/P • ) of 0.95, was calculated. The volume of the micropores (V µP ) and external surface area (S EXT ) were determined using the t-plot method. The external volume (V EXT ) was calculated using the difference between V TP and V µP . The average pore diameter (D AP ) was calculated using the 4V TP /S BET ratio.

Adsorptions Experiments
Adsorption is a surface phenomenon in which only the adsorbent surface is concerned, and adsorbate should not penetrate inside the structure of the adsorbent. Figure 2 depicts the adsorption process. Batch adsorption experiments were performed on IKA Magnetic stirrers (RO 15) with a Digiterm 100 microprocessor-controlled digital immersion thermostat and thermostatic circulating bath. In addition, a magnetic bar was added to stir the solution and a weight circle was added to avoid floating. In order to obtain the adsorption equilibrium time, the evolution of the adsorbate concentration was studied by adding 1 g of activated carbon to Batch adsorption experiments were performed on IKA Magnetic stirrers (RO 15) with a Digiterm 100 microprocessor-controlled digital immersion thermostat and thermostatic circulating bath. In addition, a magnetic bar was added to stir the solution and a weight circle was added to avoid floating. In order to obtain the adsorption equilibrium time, the evolution of the adsorbate concentration was studied by adding 1 g of activated carbon to adsorbate solutions (Co = 100 mg/L) in 50 mL-flask. The experiments were carried out at controlled shaking (200 rpm) and temperature (30 • C) until reaching equilibrium.
The amount of adsorbed compound at equilibrium time, which represents the adsorption capacity, Qe (mg/g), and Qt is the amount of adsorbed compound at random time t, can be determined by the next expressions: where Co, Ct, and Ce (mg/L) are the absorbate concentrations at beginning, at time t, and at equilibrium, respectively; V is the volume of solution (L) and W is the weight of adsorbent (g). When the adsorption equilibrium was reached, the adsorbent was removed from the solution by filtration with syringe filters (0.45 µm) and the residual adsorbate concentration was analyzed by a VWR UV-1600PC spectrophotometer. All experiments were carried out at a natural pH of the adsorbate solution at the maximum absorbance wavelength (λmax) of 300 nm for diclofenac and 290 nm for caffeine. The obtained data were adjusted to the Langmuir and Freundlich isotherm models. The kinetic models of pseudo-first order and pseudo-second order were evaluated.

Adsorption Kinetic
The mechanism through which adsorbate particles bind to the absorbent surface is adsorption. Through column or section configuration, the adsorption process is achieved. Kinetic studies are a curve (or line) which characterizes the speed of persistence or transfer of a solution at a given adsorbent dosage, temperature, and pH with an aqueous atmosphere to phase boundaries. Two major processes occur in adsorption: physical adsorption and chemical adsorption. Physical adsorption is due to poor attraction forces (van der Waals), whereas chemical adsorption requires the creation of a tight bond that facilitates the activation of atoms in between the solvent and the substrate [68,69].
Pseudo-first-order kinetic model is a simple kinetic model which describes the process of adsorption and is the pseudo-first-order equation suggested by Lagergren [70,71].
where Qe (mg/g) is the amount of the contaminants adsorbed at equilibrium, Qt (mg/g) is the amount of Dic and Caf adsorbed at time t (min), k 1 (L/min) is the rate constant of the pseudo-first-order adsorption. Pseudo-second-order kinetic model is the kinetic equation that was developed for the adsorption process [72]. The equations are given below: where Qe (mg/g) is the amount of the contaminants adsorbed at equilibrium, Qt (mg/g) is the amount of Dic and Caf adsorbed at time t (min), k 2 (g/mg. min) is the rate constant of the second-order adsorption.

Adsorption Isotherms
Any adsorption system's isotherm is an equation which relates to the amount of adsorbate on the adsorbent surface and the adsorbent's concentration or partial pressure at constant temperature [73]. The most used adsorption isotherms model contaminants for removal are the Langmuir isotherm, Freundlich isotherm, Temkin isotherm, and BET (Brunauer-Emmett-Teller) isotherm which are used to gain extensive knowledge on the relationships between the adsorbent surface and the adsorbate [74,75]. Two classic isotherm equations, namely Langmuir and Freundlich, were selected in this study to determine the isotherm parameters.
Langmuir adsorption is made up of four assumptions. The adsorbent's surface is homogenous, implying that practically all binding sites are equal. Adsorbed molecules do not encounter each other. The method of adsorption is similar in all situations, where a monolayer is always assumed to be formed. It has been developed to clarify gas-solid adsorption where monolayer adsorption is directly proportionate to the fraction of the adsorbent surface, which is opened, while desorption is proportional to the portion of the adsorbent surface covered. The Langmuir isotherm is given as [76,77].
where Ce is adsorbate's concentration at equilibrium (mg/L), Qm is quantity of molecules adsorbed on the adsorbent's surface at any time (mg/g), and Kl is the Langmuir constant (L/mg). When Ce/Qe is plotted against Ce, a straight line with a slope of 1/Qm and an intercept of 1/Kl Qm is obtained. Freundlich isotherm maintains multi-layer as well as heterogeneous molecular adsorption and gives an interpretation that describes the heterogeneity of the surface, and furthermore, the exponential function of the active site and their energy [78,79]. The mathematical expression of Freundlich isotherm is: where Kf is Freundlich constant or adsorption capacity (L/mg), n represents the extent of heterogeneity in the surface and furthermore characterizes how the adsorbate is distributed on the adsorbent surface. In addition, the exponent (1/n) indicates the absorbent system's favorability and efficiency. As ln (Qe) is plotted against ln (Ce), a straight line with a slope of 1/n and an intercept of ln (Kf) emerges.

Thermodynamic Study of the Adsorption
Thermodynamic parameters, specifically free energy, enthalpy, and entropy changes of adsorption, were assessed utilizing Vant Hoff's equation expressed as follows [80]: where ∆G • is free energy of adsorption (J/mol), ∆H • is change in enthalpy (J/mol), and ∆S • is change in entropy (J/mol/k). Energy and entropy factors must be considered for every adsorption process in terms of deciding whether the process has taken effect spontaneously. Thermodynamic variable measurements are the exact metrics for the functional operation of the method [81,82]. Consequently, if the adsorption rate temperature progresses, (∆H • ) > 0, the mechanism is endothermic, or (∆H • ) < 0, the mechanism is exothermic [83,84].

Characterization of the Activated Carbon
As displayed in Figure 3, the profile of thermogravimetric analysis (TGA) obtained with argan nutshells clearly shows weight loss occurring as function of temperature increase. This profile is likewise of interest regarding the carbonization temperature range needed for the activated carbon production. In concurrence with the writing [85], the first weight loss of 5.9% is credited to the released of moisture content and volatile matter at a temperature range between 20 • C and 100 • C. The second decomposition stage of the profile shows a weight loss of 61.9% at a temperature range of 240 • C to 370 • C and is due to the decomposition of hemicellulose and cellulose. The final stage of the profile exhibited weight loss of 12.6% and is credited to the decomposition of lignin at a temperature above 370 • C. Stabilization of the material was seen near 600 • C and explains the consideration of this temperature for carbonization.
Energy and entropy factors must be considered for every adsorption process in terms of deciding whether the process has taken effect spontaneously. Thermodynamic variable measurements are the exact metrics for the functional operation of the method [81,82]. Consequently, if the adsorption rate temperature progresses, (ΔH°) > 0, the mechanism is endothermic, or (ΔH°) < 0, the mechanism is exothermic [83,84].

Characterization of the Activated Carbon
As displayed in Figure 3, the profile of thermogravimetric analysis (TGA) obtained with argan nutshells clearly shows weight loss occurring as function of temperature increase. This profile is likewise of interest regarding the carbonization temperature range needed for the activated carbon production. In concurrence with the writing [85], the first weight loss of 5.9% is credited to the released of moisture content and volatile matter at a temperature range between 20 °C and 100 °C. The second decomposition stage of the profile shows a weight loss of 61.9% at a temperature range of 240 °C to 370 °C and is due to the decomposition of hemicellulose and cellulose. The final stage of the profile exhibited weight loss of 12.6% and is credited to the decomposition of lignin at a temperature above 370 °C. Stabilization of the material was seen near 600 °C and explains the consideration of this temperature for carbonization. The FT-IR spectrum of AC, displayed in Figure 4, shows characteristic vibration bands of carbonaceous materials [86]. The figure of spectrum FTIR shows the presence of aromatic amines between 1500 to 1600 cm −1 , C-O bonds of Ester between 1210 to 1260 cm −1 , the isopropyl group (CH3)2CH-bonds between 990 to 1050 cm −1 , and C-N bonds of the nitrile derivatives at 834 cm −1 . The FT-IR spectrum of AC, displayed in Figure 4, shows characteristic vibration bands of carbonaceous materials [86]. The figure of spectrum FTIR shows the presence of aromatic amines between 1500 to 1600 cm −1 , C-O bonds of Ester between 1210 to 1260 cm −1 , the isopropyl group (CH 3 ) 2 CH-bonds between 990 to 1050 cm −1 , and C-N bonds of the nitrile derivatives at 834 cm −1 .
The textural properties of the AC were measured by nitrogen physisorption at 77K. It was evident that AC presented the type II physisorption isotherm ( Figure 5) according to IUPAC classification [87], which is characteristic for the microporous materials. The results show that the phosphoric acid obtained the highest specific surface area, highest pore volume, and narrow pore size distribution (Table 3). These properties offer a good potential for the prepared activated carbons to be used as efficient adsorbents.  The textural properties of the AC were measured by nitrogen physisorption at 77K It was evident that AC presented the type II physisorption isotherm ( Figure 5) according to IUPAC classification [87], which is characteristic for the microporous materials. The results show that the phosphoric acid obtained the highest specific surface area, highest pore volume, and narrow pore size distribution (Table 3). These properties offer a good potential for the prepared activated carbons to be used as efficient adsorbents.  We studied the adsorption efficiency of the two emerging contaminants while modifying the contact time 15, 30, 60, 90, 120 and 150 min. Samples for analysis were taken at  The textural properties of the AC were measured by nitrogen physisorption at 77K. It was evident that AC presented the type II physisorption isotherm ( Figure 5) according to IUPAC classification [87], which is characteristic for the microporous materials. The results show that the phosphoric acid obtained the highest specific surface area, highest pore volume, and narrow pore size distribution (Table 3). These properties offer a good potential for the prepared activated carbons to be used as efficient adsorbents.

Effect of Contact Time and Adsorption Kinetic
We studied the adsorption efficiency of the two emerging contaminants while modifying the contact time 15, 30, 60, 90, 120 and 150 min. Samples for analysis were taken at  We studied the adsorption efficiency of the two emerging contaminants while modifying the contact time 15, 30, 60, 90, 120 and 150 min. Samples for analysis were taken at regular time intervals to determine the percent removal of contaminants. The results obtained are shown in Figure 6.  Adsorption kinetics of Caf and Dic showed that they were adsorbed rapidly at the investigated conditions, with equilibration already achieved at 90 min of contact for Dic and 60 min for Caf ( Figure 6).
The absorbance quantity of Dic and Caf at the equilibrium was 82% and 92%, with experimental uptake capacities of 82.60 mg/g and 93.09 mg/g, respectively.
This information indicates that all adsorption data obtained after these times can be considered as obtained under equilibrium conditions. It is necessary to identify the step that governs the overall removal rate in the above adsorption process. The pseudo-firstorder and pseudo-second-order kinetic models were tested to fit the experimental data obtained for Dic and Caf uptake by AC. The kinetic study results are given in Table 4. The kinetic data of Dic and Caf adsorption on AC based on argan nutshells was investigated at temperatures of 30 °C. The best fitting model was defined by the higher determination coefficient (R 2 ). The pseudo-second-order model was the most suitable for the Dic and Caf adsorption on AC based on argan nutshells data because this model has a R 2 value close to 1 compared to pseudo-first-order model. The experimental adsorption capacity for Dic (91.16 mg/g) and for Caf (95.99 mg/g) was also close to the calculated adsorption capacity for Dic (82.60 mg/g) and for Caf (93.09 mg/g) (Figures 7 and 8). This suggests that the adsorption kinetics of emergent contaminants can be well described by the pseudo-second-order kinetic model. This means that the adsorption process is one of chemisorption with various interactions, such as electrostatic attractions, stacking (pistacking interactions (attractive, noncovalent interactions between aromatic rings)), hydrogen-bond formation, and Van der Waals forces between the adsorbent and adsorbate [88]. Adsorption kinetics of Caf and Dic showed that they were adsorbed rapidly at the investigated conditions, with equilibration already achieved at 90 min of contact for Dic and 60 min for Caf ( Figure 6).
The absorbance quantity of Dic and Caf at the equilibrium was 82% and 92%, with experimental uptake capacities of 82.60 mg/g and 93.09 mg/g, respectively.
This information indicates that all adsorption data obtained after these times can be considered as obtained under equilibrium conditions. It is necessary to identify the step that governs the overall removal rate in the above adsorption process. The pseudo-first-order and pseudo-second-order kinetic models were tested to fit the experimental data obtained for Dic and Caf uptake by AC. The kinetic study results are given in Table 4. The kinetic data of Dic and Caf adsorption on AC based on argan nutshells was investigated at temperatures of 30 • C. The best fitting model was defined by the higher determination coefficient (R 2 ). The pseudo-second-order model was the most suitable for the Dic and Caf adsorption on AC based on argan nutshells data because this model has a R 2 value close to 1 compared to pseudo-first-order model. The experimental adsorption capacity for Dic (91.16 mg/g) and for Caf (95.99 mg/g) was also close to the calculated adsorption capacity for Dic (82.60 mg/g) and for Caf (93.09 mg/g) (Figures 7 and 8). This suggests that the adsorption kinetics of emergent contaminants can be well described by the pseudosecond-order kinetic model. This means that the adsorption process is one of chemisorption with various interactions, such as electrostatic attractions, stacking (pi-stacking interactions (attractive, noncovalent interactions between aromatic rings)), hydrogen-bond formation, and Van der Waals forces between the adsorbent and adsorbate [88]. Appl

Adsorption Isotherm
The adsorption isotherm study was done to describe the interactions between Dic and Caf on AC prepared from argan nutshells. It is important for the interpretation of the surface properties, the adsorption capacities of AC, and to complete the adsorption isotherm study that the equilibrium data were fitted to the Langmuir model and the Freundlich model [89,90]. The Langmuir and Freundlich parameters of Dic and Caf adsorption on AC were calculated using Equations (S5) and (S6) in the Supplementary information. The isotherm parameters are listed in Table 5, Based on the comparison of the correlation coefficient (R 2 ) values of Dic and Caf adsorbed on AC (Figures 9 and 10).

Adsorption Isotherm
The adsorption isotherm study was done to describe the interactions between Dic and Caf on AC prepared from argan nutshells. It is important for the interpretation of the surface properties, the adsorption capacities of AC, and to complete the adsorption isotherm study that the equilibrium data were fitted to the Langmuir model and the Freundlich model [89,90]. The Langmuir and Freundlich parameters of Dic and Caf adsorption on AC were calculated using Equations (S5) and (S6) in the Supplementary information. The isotherm parameters are listed in Table 5, Based on the comparison of the correlation coefficient (R 2 ) values of Dic and Caf adsorbed on AC (Figures 9 and 10).

Adsorption Isotherm
The adsorption isotherm study was done to describe the interactions between Dic and Caf on AC prepared from argan nutshells. It is important for the interpretation of the surface properties, the adsorption capacities of AC, and to complete the adsorption isotherm study that the equilibrium data were fitted to the Langmuir model and the Freundlich model [89,90]. The Langmuir and Freundlich parameters of Dic and Caf adsorption on AC were calculated using Equations (S5) and (S6) in the Supplementary information. The isotherm parameters are listed in Table 5, Based on the comparison of the correlation coefficient (R 2 ) values of Dic and Caf adsorbed on AC (Figures 9 and 10).    Table 5, which show contaminants adsorption on the heat-resistant activated Langmuir angle and the calculated values of the parameters.
Based on Table 5, the correlation coefficient of the linear regression equation (R 2 ) of the Langmuir isotherm adsorption model is reasonable for the adsorption of Dic and Caf by activated carbon based on argan nutshells with values of 0.996, and 0.990, respectively. The maximum adsorption capacities (Qm) of Dic and Caf by activated carbon based on Argan nutshells calculated from the Langmuir model are 126.16 mg/g, and 210.65 mg/g, respectively.
When the experimental equilibrium data are appropriately described by the Langmuir model, it is essential to calculate the separation factor [91]. It was originally proposed that the essential characteristics of the Langmuir isotherm model could be indicated in terms of a dimensionless constant separation factor or equilibrium parameter Rl, which is defined as follows: where Rl is a constant separation factor (dimensionless) of a solid-liquid adsorption system, Kl is the Langmuir equilibrium constant, and Co is the initial concentration.
The results show that Rl values for Dic were 0.169 and for Caf 0.266. All of the values between zero and one indicate the suitability of the Langmuir isotherm model for the description of the adsorption process of Dic and Caf.   Table 5, which show contaminants adsorption on the heat-resistant activated Langmuir angle and the calculated values of the parameters.
Based on Table 5, the correlation coefficient of the linear regression equation (R 2 ) of the Langmuir isotherm adsorption model is reasonable for the adsorption of Dic and Caf by activated carbon based on argan nutshells with values of 0.996, and 0.990, respectively. The maximum adsorption capacities (Qm) of Dic and Caf by activated carbon based on Argan nutshells calculated from the Langmuir model are 126.16 mg/g, and 210.65 mg/g, respectively.
When the experimental equilibrium data are appropriately described by the Langmuir model, it is essential to calculate the separation factor [91]. It was originally proposed that the essential characteristics of the Langmuir isotherm model could be indicated in terms of a dimensionless constant separation factor or equilibrium parameter Rl, which is defined as follows: where Rl is a constant separation factor (dimensionless) of a solid-liquid adsorption system, Kl is the Langmuir equilibrium constant, and Co is the initial concentration.
The results show that Rl values for Dic were 0.169 and for Caf 0.266. All of the values between zero and one indicate the suitability of the Langmuir isotherm model for the description of the adsorption process of Dic and Caf.   Table 5, which show contaminants adsorption on the heat-resistant activated Langmuir angle and the calculated values of the parameters.
Based on Table 5, the correlation coefficient of the linear regression equation (R 2 ) of the Langmuir isotherm adsorption model is reasonable for the adsorption of Dic and Caf by activated carbon based on argan nutshells with values of 0.996, and 0.990, respectively. The maximum adsorption capacities (Qm) of Dic and Caf by activated carbon based on Argan nutshells calculated from the Langmuir model are 126.16 mg/g, and 210.65 mg/g, respectively.
When the experimental equilibrium data are appropriately described by the Langmuir model, it is essential to calculate the separation factor [91]. It was originally proposed that the essential characteristics of the Langmuir isotherm model could be indicated in terms of a dimensionless constant separation factor or equilibrium parameter Rl, which is defined as follows: Rl = 1 1 + (Kl * Co) (8) where Rl is a constant separation factor (dimensionless) of a solid-liquid adsorption system, Kl is the Langmuir equilibrium constant, and Co is the initial concentration.
The results show that Rl values for Dic were 0.169 and for Caf 0.266. All of the values between zero and one indicate the suitability of the Langmuir isotherm model for the description of the adsorption process of Dic and Caf. Figure 10 describes the linear equation log (Qe) versus log (Ce), thereby determining the constants Kf and n, as shown in Table 5. Table 5 shows the adsorption process of Dic and Caf on activated carbon based on argan nutshells, according to the Freundlich isotherm model with values of 0.85 and 0.97, respectively. These indicate that the Freundlich isotherm model is not suitable for describing the contaminants adsorption process by the adsorbents.
The results show that n values for Dic were 1.501 and for Caf were 1.076. They were both superior to one, indicating that the adsorption isotherms are poorly modelled by the Freundlich equation.
Furthermore, the Langmuir isotherm model has a higher regression coefficient R 2 than the Freundlich model (Table 5), indicating the Langmuir model provides a better description of AC (based on argan nutshells) adsorption process in Dic and Caf. Therefore, these results suggest monolayer adsorption of AC on the surface of the adsorbent. Table 1 shows a comparison of absorbance capacity of Dic and Caf on various adsorbents reported in the literature, since the absorbance capacity of contaminants adsorbed varies as a function of different parameters (Initial concentration, contact time, etc.). Nevertheless, AC from argan nutshells presented high capacities for Dic and Caf, comparable or even higher than the ones obtained with other activated carbons derived from agricultural waste ( Table 1).
To understand the mechanisms associated with the adsorption of Dic and Caf by the AC from argan nutshells, it is important to evaluate a potential practical application of adsorbents related to the removal of this type of contaminant.
The results presented in Table 6 also highlight that the surface area is not always the important feature in the removal of these adsorbate molecules. ANS CV -98.21% [95] As mentioned before, textural properties were not the main factors in the adsorption of Dic and Caf since the AC obtained from argan nutshells presented a higher surface area and pore volume did not perform better regarding adsorption capacity of Dic and Caf. The large micropores developed on AC from argan nutshells do not provide an optimum size for adsorbates adsorption, which can explain the minor impact of surface area (Table 6). In fact, the role of the microporous network in the interaction with pharmaceutical molecules was previously demonstrated: If the critical dimension of the adsorbate molecule is close to the width of the micropores there will be an enhanced interaction and packing of the molecules [93].

Effect of Temperature and Thermodynamic Study
The effect of temperature on the adsorption phenomenon was studied by varying this parameter from 10 • C to 30 • C using a thermostat bath to maintain the temperature at the desired value. The tests were carried out by stirring 1 g of activated carbon based on argan shells with 100 mg of each contaminant (diclofenac and caffeine) in 1 L of the solution.
Initially, thermodynamic parameters such as Gibbs free energy (∆G • ), enthalpy (∆H • ), and entropy (∆S • ) for diclofenac and caffeine adsorptions were determined by the slope and intercept in Ln(K) versus 1/T plot ( Figure 11) that allowed for calculating the values of ∆H • and ∆S • in both matrices. The results are shown in Table 7.

Effect of Temperature and Thermodynamic Study
The effect of temperature on the adsorption phenomenon was studied by varying this parameter from 10 °C to 30 °C using a thermostat bath to maintain the temperature at the desired value. The tests were carried out by stirring 1 g of activated carbon based on argan shells with 100 mg of each contaminant (diclofenac and caffeine) in 1 L of the solution.
Initially, thermodynamic parameters such as Gibbs free energy (ΔG°), enthalpy (ΔH°), and entropy (ΔS°) for diclofenac and caffeine adsorptions were determined by the slope and intercept in Ln(K) versus 1/T plot ( Figure 11) that allowed for calculating the values of ΔH° and ΔS° in both matrices. The results are shown in Table 7.  The negative values of the three parameters ΔH°, ΔG°, and ΔS° of diclofenac indicate that the reaction is spontaneous and exothermic and that the order of distribution of the contaminant molecules on the adsorbent is large compared to that in solution. Furthermore, an examination of the standard enthalpy values of the adsorption (<40 kJ/mol) shows that it is physisorption. In the case of diclofenac, the negative ΔS° value shows that adsorption occurs with increasing order at the solid-solution interface. The negative values of ΔG° increase with temperature and indicate an increase in disorder during adsorption, and the randomness increases at the solid-solution interface during this binding process. This can be explained by the redistribution of energy between the absorbent and the absorbate.
The positive value of ΔH° confirms the endothermic nature of the adsorption process of caffeine (values lower than 40 Kj/mol). Therefore, the adsorption regarding the matrices occurs by physisorption. Indeed, ΔS° presented positive values, which agrees with a dissociative mechanism. Moreover, the positive value of ΔS° shows the increased randomness at the solid-solution interface during the adsorption. It might display an increment of the degrees of freedom for the caffeine molecules in the solution. Additionally, Table 7 shows more negative ΔG° values as the temperature increased; these indicate that the  The negative values of the three parameters ∆H • , ∆G • , and ∆S • of diclofenac indicate that the reaction is spontaneous and exothermic and that the order of distribution of the contaminant molecules on the adsorbent is large compared to that in solution. Furthermore, an examination of the standard enthalpy values of the adsorption (<40 kJ/mol) shows that it is physisorption. In the case of diclofenac, the negative ∆S • value shows that adsorption occurs with increasing order at the solid-solution interface. The negative values of ∆G • increase with temperature and indicate an increase in disorder during adsorption, and the randomness increases at the solid-solution interface during this binding process. This can be explained by the redistribution of energy between the absorbent and the absorbate.
The positive value of ∆H • confirms the endothermic nature of the adsorption process of caffeine (values lower than 40 Kj/mol). Therefore, the adsorption regarding the matrices occurs by physisorption. Indeed, ∆S • presented positive values, which agrees with a dissociative mechanism. Moreover, the positive value of ∆S • shows the increased randomness at the solid-solution interface during the adsorption. It might display an increment of the degrees of freedom for the caffeine molecules in the solution. Additionally, Table 7 shows more negative ∆G • values as the temperature increased; these indicate that the adsorption process is spontaneous, and spontaneity increases with an increase in temperature.

Statistical Analysis
Results are reported as the means of four replicates. Data obtained were subjected to one-way analysis of variance (ANOVA) for assessing the significance of quantitative changes in the variables as a result of biochar treatments. The statistical analysis was done by the Statistical Package for Social Science (SPSS 23.0).
According to the statistical analysis (Table 8), the effect of the dose shows that there is a significant difference (p > 0.05) between the means of the adsorption capacities of caffeine and diclofenac by the activated carbons from argan nutshells (AC). On the other hand, the statistical analysis of the effect of the initial concentration shows that the test is significant at the 5% level. Furthermore, the statistical analysis of the effect of contact time shows that the test is highly significative at the 1% value; there is a significant difference between the mean adsorption capacities of caffeine and diclofenac by the activated carbons from argan nutshells (AC). Moreover, the statistical analysis of the effect of temperature shows that the highly significant test at the 5% threshold shows a significant difference between the means of adsorption capacities of caffeine and diclofenac by the activated carbons from argan nutshells (AC).

Conclusions
The adsorption experiments show that the argan shells used were very effective in removing emerging contaminants such as diclofenac and caffeine at relatively low concentrations in aqueous medium. Adsorption tests showed that the equilibrium time was 60 and 90 min for Dic and Caf, respectively. The adsorption of Dic and Caf on activated carbon (AC) from argan nutshells is perfectly described by a pseudo-second-order kinetic model. The highest adsorption capacity determined by the mathematical model of Langmuir was about 126 mg/g for Dic and 210 mg/g for Caf. The thermodynamic parameters linked to the studied absorbent/adsorbate system show that the adsorption process is spontaneous and exothermic for diclofenac and endothermic for caffeine. Therefore, the chemical activation of argan shells improves its adsorption capacity. Thus, we can offer an adsorption material at low cost that can possibly contribute to the protection of the environment, especially in the purification of water. The valorization of Moroccan argan shells has been highlighted in this work.