A simple approach for the study of the relationship between temperature and precipitation

The relationship between temperature and precipitation is not simple. Several physical processes can determine whether this relationship is positive or negative, depending on the geographic location and the season. This paper proposes new indices for studying this relationship at a seasonal level, based on daily data of accumulated precipitation and mean temperature: the Rt(T75) index is defined as the percentage of precipitation corresponding to warm days in the year t, and Rt(T25) the one corresponding to cold days. The so-called contribution index is defined as the measurement and extent in which the Rt(T25) and Rt(T75) indices contribute to each interval of percentage precipitation values. To synthesize the behavior of these indices, the index IRt = Rt(T75) − Rt(T25) is proposed and compared to the ITt index, defined as the difference between the average temperature of wet days and that of dry days. These indices are analyzed for four meteorological stations that represent the main climatic domains of the Iberian Peninsula from 1951 to 2019. The results show a negative relationship between temperatures and precipitation, except for the two westernmost stations in winter. The role of atmospheric circulation in this result, particularly the NAO, EA, and WeMO teleconnection patterns, is discussed. Finally, future avenues of research are proposed.


Introduction
We can consider mean temperature as a continuous variable, well represented from the statistical point of view by the normal distribution function. Precipitation, on the other hand, is a discontinuous and intermittent variable, and, although we can construct "continuous" variables such as the amount of precipitation accumulated in a specific time interval, its statistical representation is more appropriate using other distribution functions, such as the gamma, the log-normal, or the negative exponential distributions (Horton et al. 2001). These differences are compounded by the variety of physical processes that affect their interdependence. The fundamental relationship between temperature and precipitation results from the laws of thermodynamics, including the Clausius-Clapeyron law, the transfer of sensible heat and latent heat during phase changes of water within clouds and the land surface, and the radiative properties of the different subsystems of the climate system (Trenberth 2011). The relationship between mean surface temperature and precipitation varies according to geographic location (latitudinal zone, distance to the sea, height above sea level), season, and type of climate (Du et al. 2013): in summer, clouds associated with precipitation reduce incident solar radiation on the land surface, which, together with increased evapotranspiration, generally results in a decrease in surface temperature. In contrast, the emission of longwave radiation emitted by clouds can increase the surface temperature in winter. These factors explain the appearance of a negative relationship in summer and a positive one in winter, especially in mid-latitudes. In addition, other factors may influence this relationship, such as surface pressure, wind intensity, and atmospheric circulation (Berg et al. 2015).
In terms of impacts, the covariability of temperatures and precipitation may be more important than changes in one or the other variable considered individually (Hao et al. 2013). Temperature is one of the best-studied climate variables, while our ability to understand precipitation is limited due to the complex interactions between multiple factors. Therefore, characterizing the covariability between the two variables can improve our understanding of rainfall behavior and the collective impact of both variables .
Different methods have been proposed in the literature to address this problem: Beniston (2009) used the quantile approximation of the joint distribution of both variables to define climatic modes (warm/dry, warm/wet, cold/dry, and cold/wet) and characterizes extreme events. A similar methodology was used by Morán-Tejada et al. (2013) to study the climatic extremes of mountainous regions in the Iberian Peninsula (IP) and by López-Moreno et al. (2011) to study the influence of the NAO in mountainous regions of the Mediterranean basin. Other studies have focused on analyzing the behavior of precipitation extremes and their relationship with temperatures (Dobrinsky et al. 2018;Chen et al. 2021;Pinskwar 2022). Several authors have used copula analysis to study the interdependence between the two variables (Lazoglou and Anagnostopoulou 2019;Dong et al. 2021). Others have employed bivariate distribution function analysis to understand some of the causal relationships: Hao et al. (2020) compared the joint bivariate Gaussian distribution of temperature and precipitation on a global scale and monthly resolution with the conditional distribution given different ENSO states, and Rodrigo (2021) used composite analysis to study the behavior of the seasonal correlation coefficients between temperature and precipitation of the IP under the combined action of the EA and NAO patterns. Isaac and Stuart (1992) proposed the simple TPI index to estimate temperature-precipitation relationships in Canada. This index is defined as the percentage of precipitation occurring at daily temperatures lower than the median of the temperature series. A percentage lower than 50% indicates that precipitation and warm days occur together, while the opposite would occur with percentages higher than 50%. This index is advantageous because it can be applied to stations with a climatic record limited to the magnitudes of mean daily temperature and total daily precipitation (Stuart and Isaac 1994). Du et al. (2013) compared TPI and Pearson correlation coefficients between precipitation and temperature in Northeast China, obtaining similar results using both methods. A similar exercise was conducted by Crhová and Holtanová (2018) for the European continent. In this instance, the TPI index was defined for each month as the percentage of precipitation falling on days with temperature above the median value so that in those cases where TPI > 50% (more than 50% of precipitation occurring on days with temperature above the median value), the temperature-precipitation ratio is positive. The results are negative in the opposite case (TPI < 50%, more than 50% of precipitation occurs on days with temperatures below the median value).
The TPI index is a simple method used to characterize the relationship between temperature and precipitation, but it provides little information on the behavior of this relationship in the case of extreme values. Therefore, this paper presents a modified version of this index, splitting it into two, to express the percentage of precipitation on both cold days and warm days. The objective is to describe the positive or negative character of the temperature-precipitation relationship and quantify this relationship and the contribution to it of cold and warm days. Four meteorological stations representative of different climatic domains in the PI are used to analyze the applicability of these new indices. The geographical position of the PI, located in a transition region between mid-latitudes and subtropical latitudes, between the Atlantic Ocean and the Mediterranean Sea, as well as its complex orography, make it a particularly interesting region for climate studies. Indeed, it has been cataloged as a climatic change hot spot (Giorgi, 2008). Section 2 presents the data used and describes the methodology applied. The results are presented and discussed in Sect. 3, and finally, Sect. 4 summarizes the conclusions obtained and future research perspectives.

Data
The database used in this study comprises daily precipitation amounts and daily mean temperatures for four Spanish localities between 1951 and 2019. Figure 1 shows the locations of the stations. Data were extracted from the European Climate Assessment & Dataset Project (ECA&D available at https:// www. ecad. eu/ daily data/ index. php; Klein-Tank et al. 2002). The four stations selected represent the different climatic regimes of the PI (Martín Vide and Olcina, 2001): A Coruña on the north coast (43°22′N, 8°25′W, 67 m above sea level), dominated by the influence of the Atlantic Ocean, Fig. 1 Map with the four meteorological stations studied with maximum precipitation in winter, minimum in summer, abundant cloudiness, and high environmental humidity; Madrid in the Central Plateau (40°24′N, 3°40′W, 679 m), with maximum precipitation in winter and spring, minimum in summer, frequent frosts in winter, and high summer maximum temperatures; Seville to the SW in the Guadalquivir river basin (37°25′N, 5°53′W, 31 m), with maximum precipitation in winter, minimum in summer, and very high summer temperatures; and Valencia on the Mediterranean coast (39°28′N, 0°22′W, 11 m), with maximum rainfall in autumn, often torrential, and minimum in summer. The data were studied on a seasonal scale. The seasons of the year were defined in the usual way: winter (December, January, February), spring (March, April, May), summer (June, July, August), and autumn (September, October, November).
Monthly data from the East Atlantic (EA) and North Atlantic Oscillation (NAO) patterns (Climate Prediction Center, available at http:// www. ncep. noaa. gov/ teled oc) and the West Mediterranean Oscillation pattern (WeMO, available at http:// cru. aec. uk) were also used. The monthly data were averaged for each season to obtain a seasonal index.

Methods
We define a warm (cold) day if T i > T 75 (< T 25 ), where T 25 and T 75 are the quartiles of the daily mean temperature of the reference period 1971-2000 (Table 1). This 30-year period was chosen following WMO recommendations for establishing climatological normals and considering that it is the central period of the total study period, from 1951 to 2019.
Then, for each season of year t, the R t (T 25 ) and R t (T 75 ) indices were defined as the percentage of precipitation corresponding to cold (c) and warm (h) days, respectively. Formally, R i is the daily rainfall for each day i of year t. The values of R t (T 25 ) and R t (T 75 ) are within the range of values (in %) U = [0, 100]. Empirical distribution functions show whether the relationship between temperatures and precipitation is positive (R t (T 75 ) > R t (T 25 )) or negative (R t (T 75 ) < R t (T 25 )). The study is focused on the analysis of the sets A = {Rt(T 25 ); t = 1, 2,…, n} and D = {R t (T 75 ); t = 1, 2,…, n} where n is the total number of years in the series. Analysis of the empirical distribution functions of these sets shows (as we shall see) that these sets are not disjoint, i.e., A ∩ D ≠ ∅. Given a certain value of the percentage of R t can correspond to both the sets, that is, cold days (A) and warm days (D). We can where N A (R) and N D (R) are the number of elements of A and D, and N(R) is the total number of elements with percentage R. C A (R) and C D (R), therefore, measure the contribution to the percentage of precipitation R of cold and warm days, respectively (this is a definition analogous to that used to distinguish the contribution to total precipitation from convective precipitation and large-scale frontal precipitation (Kumari et al. 2021). The following are deemed in this paper to be "contribution indices." It is defined as 0 ≤ C j ≤ 1 (j = A, D). If, for example, for a given interval R, C A (R) = 0.3 and C D (R) = 0.7, this result is interpreted in terms of that interval of R being more probable when there are warm days (contribution 0.7) than cold days (contribution 0.3). As many C j indices can be determined as intervals, we define them in the temperature series. For this work, four subsets were defined with their corresponding contribution indices, C A for cold days (T i < T 25 ), C B for cool days (T 25 ≤ T i < T 50 ), C C for mild days (T 50 ≤ T i ≤ T 75 ), and C D para warm days (T i > T 75 ), with T 50 being the median of the daily temperature series of the reference period and taking into account that ∑ j C j (R) = 1. We are particularly interested in the difference between cold and warm days. Comparison between sets A and D can be made using these contribution indices. The fact that A ∩ D ≠ ∅ raises the need to study the intersection between both sets. Thus, we find that: If it is possible to find disjoint sets, these will be given by A − (A ∩ D) for cold days and D − (D ∩ A) for warm days (note that the intersection is commutative, i.e., A ∩ D = D ∩ A). The contribution index for cold days is as follows: and similarly for warm days. The R percentages that do not occur on warm days may be found by considering that C A-A∩B (R) ≠ 0 (C D-D∩A (R) ≠ 0 for percentages not occurring on cold days, note that expression (6) does not exclude the possibility of intersections with sets B and C, corresponding to cool and mild days, respectively). Thus, we can characterize not only whether the relationship is positive or negative but also the range of percentage values in which this relationship occurs.
To synthesize the behavior of these indices, we define the IR t index as: Therefore, IR t > 0 indicates a positive relationship, and IRt < 0 a negative relationship between temperatures and precipitation. This index is compared to the TPI index for each meteorological station and season.
Analogously, we define the IT t index as: where T wt and T dt are, respectively, the mean temperatures of the wet (R i > 1 mm) and dry (R i = 0) days of year t. Also analogous to the case of IR t , a positive (negative) value of IT t indicates a positive (negative) relationship between both variables. Figure 2 shows the empirical distribution functions of the R t (T 25 ) and R t (T 75 ) indices for the four selected stations

R t (T 25 ) and R t (T 75 ) indices
Empirical distribution functions of the indices R t (T 25 ) (blue) and R t (T 75 ) (red) for a A Coruña, b Madrid, c Seville, and d Valencia during winter. As expected, both distribution functions show a decreasing behavior, except for the R t (T 25 ) in Valencia, which shows a uniform behavior, with slight variation between R = 0 and R = 100%. This result shows that the precipitation percentages during cold days can cover the whole possible range of R values in the Mediterranean station, while the contribution of warm days is limited to the lowest percentages of precipitation. In this station, the relationship between temperatures and precipitation is negative, with values practically null from R = 20% for warm days. In A Coruña and Seville, both located in the western half of the Peninsula, the relationship is positive, with higher R t (T 75 ) values above this percentage.
On the other hand, Madrid, located in the central plateau of the IP, shows a very similar behavior of both indices, indicating it is a transition station between the western and the Mediterranean stations. Figure 3 shows the contribution indices of the four stations, where these results are more clearly seen: in A Coruña with significant contribution to R t (T 75 ); in Seville, the contribution of R t (T 75 ) predominates except in the case of higher values of R, which indicates a more complex relationship. In the case of Valencia and Madrid, the main contribution  [0, 10], [30,40] corresponds to R t (T 25 ) for the highest percentages of precipitation. Table 2 shows the intervals corresponding to cold and warm days. Where the relationship is positive (A Coruña), the contribution of warm days covers a wide range of R values, while the opposite occurs in stations where the relationship is negative (Madrid and Valencia) as it is limited to the lower R value intervals. Figure 4 shows the contribution indices corresponding to spring (due to space limitations, the distribution functions corresponding to spring, summer, and autumn are not shown), with a clear predominance of the R t (T 25 ) index for all R values except the lowest percentages (between 0 and 20%, Table 2) in the four stations studied. Similar results are found for summer and autumn (Figs. 5 and 6, Table 2). Special mention should be made of the case of Valencia in autumn, where the contribution of warm days is not negligible for the interval of R (%) = (30, 40). We will discuss this result in a later subsection.
The results show a negative relationship between precipitation and temperature in the four localities studied and in the year's four seasons, except in winter's two westernmost stations (A Coruña, Seville). This result corresponds, in general terms, with what is expected in mid-latitudes, although the cases of A Coruña and Seville in winter merit further research. Table 3 shows the basic statistics of the IR t index for the four locations under study and the four seasons of the year. As a consequence of the results found in the previous subsection, negative index values are found in the four seasons and in the four locations studied, except in winter for A Coruña and Seville, where the mean value of the IR t index, as well as the median, are positive. In addition, the 95% confidence interval for the mean value is also shifted toward positive values in both cases. However, the standard deviation is very high, indicating the wide variability of the index, as is also reflected in the coefficient of variation and the range, which covers practically all possible values between − 100 and + 100%. Table 4 shows the Spearman correlation coefficients of the IR t index with the TPI index. The results show coefficients with high correlation, significant at a 95% confidence level. The IR t index, whose definition is based on the distribution functions of cold and warm days, and developed using half of the data (lower and upper quartiles of temperature) as the TPI index (based on the median), but the resulting information, as we can see, is very similar. Figure 7 shows some examples of this relationship. It can be seen how TPI values above (below) 50% correspond to positive (negative) values of the IR t index.

IR t and IT t indices
We can also compare the IR t index with the IT t index. In principle, the information provided by both indices is different: IR t shows the sign of the temperature-precipitation relationship conditional on extreme temperature values, while IT t shows the sign of this relationship conditional on the frequency of dry and rainy days. Consequently, IR t expresses the influence of temperature on precipitation, while IT t expresses the influence of precipitation on temperature. How and to what extent temperature changes if precipitation does, or vice versa, is a problem that deserves thorough investigation (Du et al. 2013). Table 5 shows the basic statistics of the IT t index . If we compare these results with those corresponding to the IR t index, we see that the range of variability and the values of the coefficient of variation of IT t are, in general terms, lower than those of IR t. According to this interpretation, the influence of temperature on precipitation is more significant than that of precipitation on temperature. However, the results obtained are equivalent (Table 6 shows the Spearman correlation coefficients between the two indices), with IT t showing a negative relationship, except again in A Coruña and Seville in winter, where the relationship is positive.

The role of atmospheric circulation: NAO, EA, and WeMO patterns
We now ask ourselves what factors influence the IR t index to be positive in winter in A Coruña and Seville. We hypothesize that atmospheric circulation can modify the relationship between temperatures and precipitation, altering the negative relationship based on the laws of thermodynamics.
To test this hypothesis, we studied the possible influence of the EA and NAO circulation indices. The EA pattern is characterized by a low-pressure center located to the west of Ireland at approximately 55°N and 20-35°W (Hall and Hanna 2018), so that the positive phase of the EA causes advection of moist and relatively warm air masses from the south and southwest over the IP, leading to increased temperatures and precipitation. In the negative phase, the behavior is the opposite. Numerous studies report a strong relationship between the EA index and temperature variations in the IP throughout the year (see, for example, Ríos-Cornejo   . 2015). The NAO is defined by the meridional dipole of sea level pressure between the Icelandic Low and the Azores High (Hurrell et al. 2003). Its role in the precipitation variability of the western sector of the IP is well known (see, for example, López-Bustins et al. 2008): the positive phase determines the predominance of anticyclonic conditions and low precipitation, while the negative phase is related to the advection of Atlantic squalls that increase precipitation, especially in winter.
In this work, a monthly average of the EA and NAO indices obtained a seasonal index for the analysis period, 1951-2019. To determine the different phases (positive or negative) of the index, the median of each index (EA m and NAO m ) was determined, defining the EA phases as follows: This was also done for the NAO phases. Although this criterion includes "normal" and extreme values of the index in each phase, it facilitates subsets with sufficient data to allow statistical approximations.
Next, the winter IR t index at the stations of interest was divided into two "composite" subsets, IR t (EA +) and IR t (EA −), comprising the set of IR t values corresponding to the positive and negative phases, respectively, of the teleconnection pattern. The aim is to apply the same methodology applied previously to these subsets, thus quantifying the contribution to each possible IR t value range, from [− 100%, − 90%] to (+ 90%, + 100%]. We can also determine the intersection between both subsets IN = IR t (EA +) ∩ IR t (EA −), and determine the contribution of each phase separately, applying relation (6) to the sets IR(EA +)-IN and IR(EA −)-IN (analogously for the NAO index). The results for the winter series of A Coruña and Seville are shown in Fig. 8. The influence of the EA pattern, which shows the relationship between the positive (negative) IR t values and the EA + (EA −) phase, is evident, verifying our hypothesis; i.e., the advection of warm and humid air masses during the positive phase of the EA determines that the relationship between temperatures and precipitation is positive at these stations. In contrast, the opposite relationship occurs in the case of the negative phase of the EA. Indeed, the correlation coefficients between IR t and winter EA t are positive and significant at the 95% confidence level (+ 0.65 and + 0.40 for A Coruña and Seville, respectively). The results for Madrid and Valencia (not shown) are similar, but in these cases, the influence of EA does not seem sufficient to counteract the predominant negative relationship, from which it can be deduced that the influence of EA is more significant toward the west of the Peninsula. As for the NAO, the results are less conclusive: the positive phase of the NAO is associated with lower precipitation and higher daily maximum temperatures (Merino et al. 2018), with which the NAO + phase would be related to a negative IR t index, as can be seen in the case of Seville, where the main contributions to negative IR values are related to the positive phase of the NAO. In contrast, the negative phase of the NAO, with cyclonic conditions and overcast skies, would be associated with higher precipitation and daily minimum temperatures, resulting in a positive relationship. The fact that we are working here with mean temperatures (and not with maximums and minimums) may explain the less conclusive results in the case of the NAO, with contributions to positive and negative values of both phases. In the case of A Coruña, this last result is even more evident, probably due to the lesser influence that the NAO pattern exerts over the northwestern area of the PI (López-Bustins et al. 2008).
The case of Valencia, on the Mediterranean coast, is particularly interesting. In every season, the mean value of the IR t and IT t indices is negative (Tables 3 and 5), reflecting the conditions of the Mediterranean. However, in autumn, the magnitude of these indices is lower than in other seasons. The critical role of convective rainfall in autumn in this area is well known (Ruiz-Leo et al. 2013), so an increase in temperatures would increase precipitation of this type, resulting in a positive relationship or, at least, in lessening the negative relationship between temperatures and precipitation (Rodrigo, 2019). In addition, this behavior could be intensified by atmospheric circulation so that the advection of warm and humid air masses from the Mediterranean could contribute to this behavior.
The WeMO index (Martín-Vide and López-Bustins, 2006) can be used to study this problem. The positive phase of the index is characterized by a high pressure center over the southwestern quadrant of the IP and a low pressure center over the Ligurian Gulf, while the negative phase shows the opposite pattern. Consequently, the positive phase implies advection from the NW, while the negative phase implies advection from the SE. The flows associated with the negative phase of the WeMO would lead to increased precipitation in the eastern IP due to the advection of maritime and relatively warmer air from the Mediterranean. It would, therefore, contribute positively to the relationship between temperatures and precipitation. On the other hand, the positive phase of the WeMO would lead to the advection of cold and humid air from the Atlantic and, therefore, a negative relationship.
In this case, we proceeded in the same way as in the previous cases, establishing the positive and negative phases of the WeMO index based on the median value for the total period of analysis. Subsequently, Valencia's autumn IR t index values were split into two subsets, IR t (WeMO +) and IR t (WeMO −), and the contribution to IR values of both subsets was studied. The result is shown in Fig. 9. The predominance of the negative (positive) phase of WeMO to the contribution of the positive (negative) IR values is observed. The results are not as evident as in the winter EA cases presented above (the correlation coefficient between the WeMO and the IR t indices, in this instance, is − 0.38, significant at the 95% confidence level, reflecting a certain influence of this factor). Therefore, other possible causal factors should be considered.

Fuzzy sets
In the study of the IR t index, we have divided this set into two subsets, IR t (EA +) and IR t (EA −), according to the phase (positive or negative) of the circulation index. It is found that the intersection of these subsets is non-empty, i.e., IR t (EA +) ∩ IR t (EA −) ≠ ∅; i.e., we can find similar percentage values in the two phases of the circulation pattern. According to our definition of the contribution index, we have that C IR(EA+) (IR) + C IR(EA−) (IR) = 1, i.e., C IR(EA+) (IR) = 1 − C IR(EA−) (IR ) , ∀ IR ∈ [− 100, 100]; both sets are complementary, but their intersection is not the empty set. Consequently, the contradiction principle of classical logic, according to which the intersection of two complementary subsets must be the empty set, is not verified, implying that we can interpret these as fuzzy sets and the contribution index as the membership function associated with these sets. The interpretation of the values of the contribution index as a measure of the "possibility" that a certain value of the variable belongs to one set or another is along these lines (Zadeh 1978). According to this interpretation, relation (5) is one of the basic t-norms for the intersection of two fuzzy sets (Klement et al. 2013). There are different methods to compare fuzzy sets; one of them is the possibility, defined as: In our case, if we identify x with the class mark of each of the IR t intervals, A with IR t (EA +), B with IR t (EA −), and the contribution indices with the membership function, we obtain as a result 0.3 in A Coruña (for x = − 5%), 0.4 in Madrid (for x = − 5%), and 0.5 in Seville (for x = − 55%, − 25%, and + 45%), and in Valencia (for x = − 65%). The possibility provides the maximum value of the membership function of the intersection between the two sets under comparison, and the value of x for which it occurs, thus measuring to what degree the two sets overlap.  We see how the lowest value is obtained for A Coruña, for x = − 5% (i.e., when the contributions of the warm and cold days are very similar), so this is the meteorological station where the differences between the two EA phases are the greatest, and, consequently, the most influenced by the EA phases, a physically plausible result given the geographical location of this station. Fuzzy logic is a suitable method for modeling systems that are complex, non-univocal, or imprecise, and has been used in many meteorological studies (see, for example, Bardossy et al. 2002;Asklany et al. 2011;Rahman 2020;Silver et al. 2020;Ferreira Filho and Pessoa 2022). Therefore, it offers an interesting possibility to address the study of our problem, which will be explored in future works.

Conclusions
The main aim of this work has been to present a set of indices that attempt to explain, in a simple way, the complex relationships between precipitation and temperature at a seasonal level, based on daily data for each variable. The R t (T 25 ) and R t (T 75 ) indices have been defined to express the percentage of precipitation corresponding to the cold and warm days of a specific season. The contribution of cold and warm days to each of these percentages has been quantified using what we have called the contribution index. The IR t index has been defined, which expresses the difference between the two indices. This index has shown good agreement with the TPI index and the IT t index, which expresses the difference between the average temperature of rainy and dry days.
The application of these indices and the contribution index to four meteorological stations in the PI has allowed us to investigate the role of atmospheric circulation by studying its relationship with the EA, NAO, and WeMO patterns, analyzing how these circulation patterns modulate the negative relationship between both variables.
These results suggest extending this methodology to other stations and geographical areas to study the spatial variability of the defined indices, as well as to meteorological stations in other climatic zones and other countries to verify their usefulness and limitations. We can also use the daily maximum and minimum temperatures to deepen our understanding of some of the results (e.g., the influence of the NAO index). Furthermore, from a methodological point of view, we can identify the contribution index with the membership function associated with fuzzy sets and apply the fuzzy logic methodology to the problem posed. These will be the objectives of future works.