Oct 01, 2020

Public workspaceCoccidioides_soil_habitat_model

  • 1Kaitlin Benedict, Brendan R. Jackson, Orion Z. McCotter
Icon indicating open access to content
QR code linking to this content
Document CitationRobert Dobos 2020. Coccidioides_soil_habitat_model. protocols.io https://dx.doi.org/10.17504/protocols.io.bh6gj9bw
Manuscript citation:
Dobos RR, Benedict K, Jackson BR, McCotter OZ (2021) Using soil survey data to model potential Coccidioides soil habitat and inform Valley fever epidemiology. PLoS ONE 16(2): e0247263. doi: 10.1371/journal.pone.0247263
License: This is an open access document distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Created: July 01, 2020
Last Modified: October 01, 2020
Document Integer ID: 38824
Disclaimer
DISCLAIMER – FOR INFORMATIONAL PURPOSES ONLY; USE AT YOUR OWN RISK

The protocol content here is for informational purposes only and does not constitute legal, medical, clinical, or safety advice, or otherwise; content added to protocols.io is not peer reviewed and may not have undergone a formal approval of any kind. Information presented in this protocol should not substitute for independent professional judgment, advice, diagnosis, or treatment. Any action you take or refrain from taking using or relying upon the information presented here is strictly at your own risk. You agree that neither the Company nor any of the authors, contributors, administrators, or anyone else associated with protocols.io, can be held responsible for your use of the information contained in or linked to this protocol or any of our Sites/Apps and Services.
Download cocci_model_description.pdfcocci_model_description.pdf

A. Introduction

The model that is used to predict the suitability of soils as a habitat for the saprophytic stage of Coccidioides (both immitis and posadasii) is a rule-based fuzzy logic system within the interpretations generator of the National Soil Information System (NASIS). The NASIS is a collection of databases and applications that is used to collect, store, and serve the soil survey database of the United States. The United States Department of Agriculture, Natural Resources Conservation Service, Soil and Plant Sciences Division curates this data. The information includes the tabular data for the soils and map units as well as the spatial data that shows where each map unit is found.The tabular and spatial databases each have a transactional version that is edited daily and changing constantly and is therefore not suited for informing USDA programs or public access. To inform programs and for public use, a yearly posting of data is used. This digital database is the Soil Survey Geographic Database, better known as SSURGO. This data is publicly available through a variety of web applications, primarily Web Soil Survey (Fortner and Price, 2012). The soil interpretations generator is associated with the tabular transactional database and is therefore only fully accessible to NRCS soil scientists and National Cooperative Soil Survey cooperators. However, some limited access can be found at:


A rule based fuzzy logic system considers the effect of an independent variable on a dependent variable.The system is “fuzzy”, not because the input data is imprecise, but rather because the thresholds are often somewhat vague in their impact.For cocci, we have estimated the thresholds as shown in Table 1.




Soil or Site PropertyNot Suitable HabitatPossible HabitatIdeal Habitat
Electrical Conductivity (dS/m, 0-30cm depth)<0.50.5 to 10>10
Sodium Absorption Ratio (0 to 30cm depth)<1010 to 50>50
Gypsum Content (percent by weight 0-30cm depth)<22 to 15>15
Soil Reaction (pH) (0 to 30 cm depth)<88 to 9>9
Mean Annual Precipitation, Xeric (mm/year)<50 or >80050 to 400 or 450 to 800400 to 450
Mean Annual Precipitation (Non-xeric) (mm/year)< 30 or >80030 to 190 or 220 to 800190 to 220
Mean Annual Air Temperature (Xeric) (degrees C)<10 or >3010 to 15 or 18 to 3015 to 18
Mean Annual Air Temperature (Non-xeric) (degrees C)<12 or >3012 to 17 or 20 to 3017 to 20
Near-surface Anaerobic Conditions 1) Number of months per year with ponding 2) Number of months per year with saturation within 30cm of the soil surface>=109 to 2<2
Land Surface ShapeLinear or convexConcave
Organic Carbon Content (kg/m2) (0 to 30 cm depth)<3>=3
Water Retention Difference (cm/cm) (weighted average 0 to 30cm)<22 to 10>10
Table 1. Criteria table showing the thresholds for major soil and climatic properties.

A base rule has been created to quantify the impact of each of these features on the growth of cocci. The optimal environment is taken as what would be found the “Lower Sonoran Life Zone”, primarily. The characteristics of other highly endemic areas, such as Kern County, California are used as well.


B. The Major Base Rules

1. Electrical Conductivity (EC)

Electrical conductivity (dS/m) is a measure of soluble salts in soils. A weighted average of the EC in the soil depth from 0 to 30cm is mapped against the membership function depicted in Figure 1.1.


Figure 1.1 – Electrical conductivity membership function for the cocci model
If the EC returned by the property script (presented in Appendix 1.1) is 0.5 dS/m or less, the membership value is 0, indicating a non-membership in the set of soils where cocci may exist. If the EC is 10 or more, the membership value is 1, indicating a full membership in the set of soils salty enough for cocci to exist.

The membership value from Figure 1.1 is next sent to the base rule that deals with electrical conductivity, Figure 1.2. The blue oval represents an item known as an “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 1.1

Figure 1.2 – The EC base rule for the cocci model
In this base rule, the hedge, shown in the grey square, will return a 0 if the output from the evaluation is null. This happens if the EC data is not available.

2.Sodium Absorption Ratio (SAR)

Sodium adsorption ratio (SAR) is a measure of the amount of sodium relative to calcium and magnesium in the water extracted from a saturated soil paste.SAR is a metric for sodium-dominated saltiness in soils and may give a clue to cocci habitat. A weighted average of the SAR in the soil depth from 0 to 30cm is mapped against the membership function depicted in Figure 2.1.

Figure 2.1 – SAR membership function for the cocci model
If the SAR returned by the property script (presented in Appendix 1.2) is 10 or less, the membership value is 0, indicating a non-membership in the set of soils where cocci may exist. If the SAR is 50 or more, the membership value is 1, indicating a full membership in the set of soils sodic enough for cocci to exist.
The membership value from Figure 2.1 is next sent to the base rule that deals with (SAR), Figure 2.2. The blue oval represents an item known as an “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 2.1. In this base rule, the hedge, shown in the grey square, will return a 0 if the output from the evaluation is null. This happens if the SAR data is not available.

Figure 2.2 – The SAR base rule for the cocci model
3. Gypsum Content

Gypsum (CaSO4·2H2O) is commonly found in some soils in dry areas. The presence of gypsum indicates an accumulation of water-soluble salts. Thus, gypsum in this context is being used as a metric for calcium dominated saltiness in soils and may give a clue to cocci habitat. The maximum gypsum content found in the soil from 0 to 30cm is mapped against the membership function depicted in Figure 3.1.

Figure 3.1 – The gypsum content membership function for the cocci model
If the gypsum content returned by the property script (presented in Appendix 1.3) is 2 percent or less, the membership value is 0, indicating a non-membership in the set of soils where cocci may exist. If the gypsum content is 15 percent or more, the membership value is 1, indicating a full membership in the set of soils salty enough for cocci to exist.

The membership value from Figure 3.1 is next sent to the base rule that deals with gypsum content, Figure 3.2. The blue oval represents the item known as an “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 3.1. This base rule employs two hedges, shown in the grey squares. The “not null and” hedge will return a zero if the output from the evaluation is null. This happens if the gypsum data is not available. The “power” hedge will find the square root of the membership value returned by the evaluation. This will decrease the impact of gypsum content because less is known about how gypsum affects cocci.

Figure 3.2 – Gypsum content base rule for the cocci model
4. Soil Reaction

Soil reaction is simply the 1:1 water pH of the soil. Soil pH higher than seven indicates an alkaline environment. Soils of the Lower Sonoran Life Zone and other dry areas are typically elevated in pH, which in this context is being used as a metric for a variety of conditions, such as salt content. Soil reaction is correlated with salinity and also is related to many soil processes, such as micronutrient availability. The minimum pH found in the soil from 0 to 30cm is mapped against the membership function depicted in Figure 4.1.

Figure 4.1 – The minimum soil reaction membership function for the cocci model
If the minimum soil reaction returned by the property script (presented in Appendix 1.4) is 8 or lower, the membership value is 0, indicating a non-membership in the set of soils where cocci is expected to exist. If the soil reaction is 9 or higher, the membership value is 1, indicating a full membership in the set of soils alkaline enough for cocci to exist.

The membership value from Figure 4.1 is next sent to the base rule that deals with soil reaction, Figure 4.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 4.1. This base rule employs one hedge, shown in the grey square.The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the soil reaction data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 4.2 – The soil reaction minimum base rule for the cocci model
5. Mean Annual Precipitation (Xeric)

Mean annual precipitation, while perhaps not the most diagnostic precipitation metric, is the only one available in the transactional database. Cocci exists in two basic climates. One is the Mediterranean (xeric) climate characterized by cool winters and hot, dry summers like Kern County, California. The other is the aridic climate having some summer precipitation like Maricopa County, Arizona. The timing and the amount of precipitation influences the degree of climatic suitability for the two species of cocci. The mean annual precipitation found for the soil is mapped against the membership function depicted in Figure 5.1 to obtain the membership value.

Figure 5.1 - The xeric mean annual precipitation (mm) membership function for the cocci model
If the mean annual precipitation returned by the property script (presented in Appendix 1.5) is 0 mm, the membership value is 0, indicating a non-membership in the set of soils where cocci is expected to exist. If the mean annual precipitation (in a xeric climate) is around 400 mm, the membership value is 1, indicating a full membership in the set of soils having optimal precipitation in a xeric climate. Precipitation amounts over 400 mm are expected to become less favorable until at about 800 mm, one does not expect to find cocci and the membership value drops to 0.

The membership value from Figure 5.1 is next sent to the base rule that deals with precipitation in a xeric climate, Figure 5.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 5.1. This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the mean annual precipitation data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 5.2 – The xeric mean annual precipitation base rule for the cocci model
6. Mean Annual Precipitation (Aridic)

Mean annual precipitation, while perhaps not the most diagnostic precipitation metric, is the only one available in the transactional database. The rainfall pattern differences between a Mediterranean climate (xeric) characterized by cool winters and hot, dry summers and the aridic climate having a more even annual distribution of precipitation makes a difference in how much or how little rainfall influences the habitat for the two species of cocci. The mean annual precipitation found for the soil is mapped against the membership function depicted in Figure 6.1 to obtain the membership value.

Figure 6.1 - The aridic mean annual precipitation (mm) membership function for the cocci model
If the mean annual precipitation returned by the property script (presented in Appendix 1.5) is 0 mm, the membership value is 0, indicating a non-membership in the set of soils where cocci is expected to exist. If the mean annual precipitation (in an aridic climate) is around 190 mm, the membership value is 1, indicating a full membership in the set of soils having optimal precipitation in an aridic climate. Precipitation amounts over 190 mm are expected to become less favorable until at about 800 mm, one does not expect to find cocci and the membership value drops to 0.

The membership value from Figure 6.1 is next sent to the base rule that deals with precipitation in an aridic climate, Figure 6.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 6.1. This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the mean annual precipitation data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 6.2 – The aridic mean annual precipitation base rule for the cocci model
7. Mean Annual Air Temperature (Xeric)

Mean annual air temperature, while perhaps not the most diagnostic temperature metric, is the only one available in the transactional database. The air temperature, in conjunction with rainfall pattern differences between a Mediterranean climate (xeric) characterized by cool winters and hot, dry summers and the aridic climate having a more even annual distribution of precipitation makes a difference in how much or how little heat is needed to evaporate rainfall which, in turn, influences the habitat for the two species of cocci. The mean annual air temperature found for the soil is mapped against the membership function depicted in Figure 7.1 to obtain the membership value.

Figure 7.1 - The xeric mean annual air temperature (degrees C) membership function for the cocci model
If the mean annual air temperature returned by the property script (presented in Appendix 1.6) is below 10 degrees C, the membership value is 0, indicating a non-membership in the set of soils where cocci is expected to exist. If the mean annual air temperature (in a xeric climate) is 15 to 18 degrees C, the membership value is 1, indicating a full membership in the set of soils having optimal mean annual air temperature in a xeric climate. Mean annual air temperatures over 19 degrees C are expected to become less favorable until at about 30 degrees C, one does not expect to find cocci and the membership value drops to 0.

The membership value from Figure 7.1 is next sent to the base rule that deals with mean annual air temperature in a xeric climate, Figure 7.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 7.1. This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the mean annual air temperature data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 7.2 – The xeric mean annual air temperature base rule for the cocci model
8. Mean Annual Air Temperature (Aridic)

Mean annual air temperature, while perhaps not the most diagnostic temperature metric, is the only one available in the transactional database. The air temperature, in conjunction with rainfall pattern differences between a Mediterranean climate (xeric) characterized by cool winters and hot, dry summers and the aridic climate having a more even annual distribution of precipitation makes a difference in how much or how little heat is needed to evaporate rainfall which, in turn, influences the habitat for the two species of cocci. The mean annual air temperature found for the soil is mapped against the membership function depicted in Figure 8.1 to obtain the membership value.

Figure 8.1 - The aridic mean annual air temperature (degrees C) membership function for the cocci model
If the mean annual air temperature returned by the property script (presented in Appendix 1.6) is below 12 degrees C, the membership value is 0, indicating a non-membership in the set of soils where cocci is expected to exist. If the mean annual air temperature (in a xeric climate) is 12 to 17 degrees C, the membership value is 1, indicating a full membership in the set of soils having optimal mean annual air temperature in a xeric climate. Mean annual air temperatures over 17 degrees C are expected to become less favorable until at about 30 degrees C, one does not expect to find cocci and the membership value drops to 0.

The membership value from Figure 8.1 is next sent to the base rule that deals with mean annual air temperature in a xeric climate, Figure 8.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 8.1.This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the mean annual air temperature data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 8.2 – The aridic mean annual air temperature base rule for the cocci model
9. Water and Spore Gathering Surface

The shape of the land surface seems to affect where cocci may be found. Concave surfaces, as along streams, act to collect water and spores on the surface and tend, by subsurface flow, concentrate salts in arid areas. A simple calculation to quantify the nature of the land surface is employed.

Figure 9.1 - The water and spore gathering surface membership function for the cocci model
If the rating of the ability of the soil surface to gather water and spores returned by the property script (presented in Appendix 1.7) is 0, the membership value is set at 0.7. Thus, a soil cannot be made a non-member of the set of soils where cocci can exist based solely on the landform shape. As the shape becomes more concave, the membership value increases until a slope that is concave both up and down as well as across returns a membership value of 1.

Figure 9.2 – The water and spore gathering surface base rule for the cocci model
The membership value from Figure 9.1 is next sent to the base rule that deals with water and spore gathering surfaces.In Figure 9.2. The blue oval represents the item known as the “Evaluation” since its function is to evaluate data. The evaluation contains the membership function depicted by Figure 9.1. This base rule employs two hedges, represented by the grey squares. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the slope shape data is null as is the case for a non-soil area or an incompletely populated soil component. The “somewhat” hedge finds the square root of the membership value. This modified value is sent to the higher rules.

10. Near Surface Saturation

Since cocci is an aerobic fungus, it is assumed that long periods of soil saturation will be detrimental to its growth. This model considers saturation due to a water table at or near the surface and ponding as being possible causes of anaerobic soil conditions.

Figure 10.1 - The cumulative near surface saturation membership function (units are number of months having saturation within 30cm of the soil surface) for the cocci model
The results from the property script presented in Appendix 1.8 are mapped against this membership function. A soil that is not thought to be saturated within 30 cm of the surface is a full member of the set of soils dry enough for cocci and the membership value is 1. Wetter soils are rated with progressively lower membership values. A soil that is saturated for 12 months returns a membership value of 0.1. The membership value is not made to go to zero because a soil may have microrelief that may cause a portion of the land surface to be dry enough for cocci to grow.

Some soils may also be covered with non-moving, or ponded, water for some time during the year. Figure 10.2 depicts the membership function used to rate cumulative long ponding. The results from the property script presented in Appendix 1.9 are evaluated by this membership function. A soil that is not ponded during the year is a full member of the set of soils that are not ponded, and the membership value is 1. As the frequently of ponding and its duration increases, soils are rated with progressively lower membership values. A soil that is ponded for 12 months returns a membership value of 0.

Figure 10.2 - The cumulative months with frequent or occasional ponding of long duration membership function (units are number of months having ponding) for the cocci model
Figure 10.3 – The near surface saturation base rule for the cocci model
This base rule considers the membership values produced by the two evaluations (blue ovals) and modified by the two hedges (grey squares). The “null not rated” hedge requires that the membership values be present in order for the soil to receive a rating.The two evaluations are linked to an operator, represented by the yellow circle. The “and” operator will cause the lower of the two membership values to be sent to the next level of rules. The effect of using the lower value is that the least suitable condition is reported.

11. Organic Carbon Content

Since Coccidioides is a saprophyte, organic carbon must be available for it to live in the soil. The spatial distribution of organic carbon is notoriously spotty in nature, so local areas of much higher or lower organic carbon content, while known to exist, are difficult to quantify. The organic carbon content, in kilograms per square meter, returned by the property script (presented in Appendix 1.10) is mapped against the membership function in Figure 11.1. The membership value can not be less than 0.7, which means that a soil may not be a non-member of the set of soils suitable cocci habitat based solely on its reported organic carbon content.

Figure 11.1 - The organic carbon content membership function for the cocci model
The organic carbon content base rule considers the membership value from the evaluation (blue oval). This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the organic carbon content data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 11.2 – The organic carbon content base rule for the cocci model
12. Water Retention Difference

Water retention difference (WRD) is the amount of water the soil can hold between 15 and 1/3 bars. The frame of reference is limited to the upper 30cm of soil. The fungus needs to have some water available for growth. The water retention difference (in percent by volume) returned by the property script shown in Appendix 1.11 is mapped against the membership function shown in Figure 12.1.

Soils that are unable to hold water are non-members of the set of soils able to be habitat for cocci while soils holding eleven percent or more are full members of the set.

Figure 12.1 – The water retention difference membership function
The water retention difference base rule considers the membership value from the evaluation (blue oval). This base rule employs one hedge, shown in the grey square. The “null not rated” hedge will return a null value and a rating of “not rated” if the output from the evaluation is null. This happens if the water retention difference data is null as is the case for a non-soil area or an incompletely populated soil component.

Figure 12.2 – The water retention difference base rule of the cocci model
C. The Accessory Base Rules

The Accessory Base Rules are parts of the climatic rule which will be described later. The intent of these base rules is to capture local conditions that may enable a soil at the fringe, or somewhat beyond, of climatic suitability to support a population of cocci, at least in some years, given suitable soil conditions.

13. Albedo

Albedo is an indication of the reflectance of a surface. The values range from 0 to 1, with 0 being very low reflectance and 1 being very high reflectance. A sol having lower albedo will absorb more solar radiation than a soil having high albedo and will thus warm faster and get hotter. The output from the property script shown in Appendix 1.12 is mapped against the membership function in Figure 13.1. Soils having a membership value of 1 are full members of the set of solar-warmed soils whereas soils having the 0.1 membership are partial members. Soils cannot be complete non-members of the set of solar-warmed soils.

Figure 13.1 – The albedo membership function of the cocci model
The membership value produced by the evaluation, depicted by the blue oval is sent by the base rule into the upper sub-rules, which will be described later. The hedge (grey square) in this case “not null and” will return a zero if the albedo is null.

Figure 13.2 – The albedo base rule of the cocci model
14. Slope Gradient

The slope gradient of a surface is its inclination measured in percent slope, which is the rise over the run times 100. Soils having a slope gradient from 10 to 15 percent are full members of the set of soils that are warmed by rhe sun. Flat-lying soils and steep soils are partial members.The data evaluated is extracted from the transactional database using the property script in Appendix 1.13.

Figure 14.1 – The heat loading slope gradient membership function
Figure 14.2 – The heat loading slope gradient base rule of the cocci model
The hedge, in this case, “null or” will cause a 1 to be sent to the next level rule if the evaluation returns a null.

15. Slope Aspect Factor

The aspect of a slope is the direction it faces. North is zero degrees while south is 180 degrees. South aspecting slopes tend to be warmer than north aspecting slopes. The property script, found in Appendix 1.14, that this base rule uses performs a calculation to simplify the mapping of the slope aspect factor by the slope aspect factor membership function, Figure 15.1. This property calculates an aspect factor ranging from 0 to 1, with south facing aspects ranking 1. Slope aspects less than 80 degrees or more than 280 degrees rank 0.

Figure 15.1 – The valley fever aspect factor membership function of the cocci model
Figure 15.2 – The aspect factor base rule of the cocci model
The hedges (grey squares) in the case of the “not null and” will cause a 0 to be sent to the next rule if the aspect factor membership function is null, while the “multiply(1) hedge is a place holder.

16. The Xeric Surface Temperature Limiter

Above a certain point, solar heating of a surface becomes excessive. The xeric surface temperature limiter works in xeric environments to limit the membership value of slope heating factors. The script calculates the ratio of the reported high of mean annual air temperature and 16 degrees, which is just over the xeric optimum. The results of the property script shown in Appendix 1.15 are mapped against the membership function given in Figure 16.1.

Figure 16.1 – The xeric air temperature limiter membership function for the cocci model
The membership value returned to the next level of rules is not changed by any hedges, but if the temperature is null, the soil will not rate, due to insufficient data.

Figure 16.2 – The xeric air temperature limiter base rule for the cocci model

17. Non-xeric Surface Temperature Limiter

This base rule is similar to the xeric surface temperature limiter, except it works in non-xeric or aridic climates. Above a certain point, solar heating of a surface becomes excessive. The non-xeric surface temperature limiter works in non-xeric environments to limit the membership value of slope heating factors. The script calculates the ratio of the reported high of mean annual air temperature and 18.5 degrees, which is just over the non-xeric optimum. The results of the property script shown in Appendix 1.16 are mapped against the membership function given in Figure 17.1.


Figure 17.1 – The non-xeric air temperature limiter membership function for the cocci model
The membership value returned to the next level of rules is not changed by any hedges, but if the temperature is null, the soil will not rate, due to insufficient data.

Figure 17.2 – The non-xeric air temperature limiter base rule for the cocci model
D. Sub-rules

When needed, base rules can be assembled into sub-rules to quantify the combined effects of several variables on what is essentially one feature or process.

18. The Slope Heating Factor Sub-rule

This sub-rule combines the effects of albedo, slope gradient, and slope aspect base rules (green rectangles in Figure 18) to index how the reflectance and orientation of a slope might influence its heating from solar radiation. In this sub-rule, the product of the three membership values of the three variables is found, as is indicated by the product operator (yellow circle). This sub-rule is in turn a part of the climatic sub-rule.

Figure 18 – The slope heating factor sub-rule
19. The Soil Climatic Sub-rule

This sub-rule combines the effects of mean annual precipitation, mean annual air temperature, and the slope heating factors for a soil to derive an index of how suitable the climate setting is for Coccidioides spp.

Figure 19 – The climatic sub-rule of the cocci model
In this sub-rule, the items in the upper half of the diagram are dealing with xeric climates while the lower half deals with non-xeric climates. Whether a soil exists in a xeric climate or not is determined by the evaluations “Xeric biologic climate true” and “Xeric biologic climate false”. The property script given in Appendix 1.17 is evaluated. A one is returned when the condition is true and a zero when the condition is false.

Moving from right to left, the products of the membership values for the heating factors and the temperature limiters are found for both xeric and non-xeric climates. These products are added to the membership values produced by the respective air temperature base rules, as indicated by the “sum” operators”. This has the effect of providing an incrementally higher membership value which enhances the climatic membership for soils having marginally suited air temperatures. The effect is significant for south facing slopes having low albedo.

Moving leftward in Figure 19, the product of the membership values of the mean annual air temperature rules, the xeric or non-xeric evaluations, and the mean annual precipitation base rules is found. Since the evaluations return only ones or zeros, the products will be non-zero only for when the correct climate regime for a soil is evaluated. At this point, the membership value returned by the upper half of the rule will be zero for a non-xeric soil and a number between one and zero for a xeric soil. Similarly, the membership value being returned by the bottom half of the rule will be zero for a soil that exists in a xeric climate but some number between one and zero if in a non-xeric climate. The “or” operator indicates the higher of the two membership values will be sent to the parent rule.

20. The Chemical Sub-rule

The membership values derived from the base rules for sodium absorption ratio, electrical conductivity, gypsum content, and soil reaction are considered.

Figure 20 – The chemical sub-rule of the cocci model
The highest of the four membership values, as indicated by the “or” operator, is sent to the parent rule.

A. The Parent Rule

The results from the base rules and sub-rules are collected in the parent rule, as shown in Figure 20.

Figure 20 – The parent rule for the cocci in soils model
In this figure, reading from right to left, first are the green rectangles that represent the base rules and sub-rules describing the effect of each site and soil property. Each of these is linked to a grey square which represents a hedge. Hedges allow us to adjust the membership values based on observation. The “Multiply” hedges, since the values are 1, are not changing the numbers, currently. The ”somewhat” hedge calls for a square root of the membership value. This has two basic effects. First, in this particular system, it decreases the weight of those variables, since they are moved closer to 1. Second, the “somewhat” reduces the spread of the membership values. The numbers close to one are not changed much, the numbers closer to zero are increased somewhat, but the general array of the numbers remains unchanged.

The yellow circle is the operator. The operator indicates how the individual rules are to be related to one another. In this case, the product of the membership functions of the base rules is to be found. This is done because if any one of the base rule outputs for a soil is zero, the overall rating for that soil will be zero. The “somewhat” hedge to the left of the operator indicates that a square root function is to again be invoked. This will tighten the distribution of the data without changing the order in which they would sort. The “divide” hedge indicates that all of the non-zero membership values will be increased by a small amount.

References

Edwards P.Q., C.E.Palmer. 1957. Prevalence of sensitivity to coccidioidin, with special reference to specific and nonspecific reactions to coccidioidin and to histoplasmin. Chest;31(1):35-60.

Egeberg, R. O., Elconin, A. E., and Egeberg, M. C. 1964. Effect of salinity and temperature on Coccidioides immitis and three antagonistic soil saprophytes: Journal of Bacteriology, v. 88, n. 2, p. 473 - 476.

Fisher F.S., M. W. Bultman, S. M.Johnson, D. Pappagianis, E. Zaborsky.2007.Coccidioides niches and habitat parameters in the southwestern United States: a matter of scale. Annals of the New York Academy of Science, 1111: 4772.

Fisher, F. S., M. W. Bultman, and D. Pappagianis. 2000.Operational Guidelines (version 1.0) for Geological Fieldwork in Areas Endemic for Coccidioidomycosis (Valley Fever).U.S. Geological Survey Open-File Report 00-348 Version 1.0.

Fortner, J., A. Price. 2012. United States Soil Survey Databases. Chapter 28 in Handbook of Soil Sciences, P. M. Huang, Y. Li, M. E. Sumner, Eds.CRC Press.

Kolivras, K. N., P. S. Johnson, A. C. Comrie, S. R. Yool. 2001. Environmental variability and coccidioidomycosis (valley fever). Aerobiologia 17:31-42.

Maddy, K. T., 1957, Ecological factors of the geographic distribution of Coccidioides immitis: Journal American Veterinarians Association, v. 130, n. 11, p. 475 - 476.

Maddy K.1958.The geographic distribution of Coccidioides immitis and possible ecological implications. Arizona Medicine, 15, 178-188.


Appendix 1 – Property scripts for extracting data from the transactional database

The scripting reported here is written in the Calculations, Validations, Interpretations, and Reports (CVIR) language native to the transactional database.For more information, see:

1.1 - WTD_AVG EC 0-30cm OR ABOVE RESTRICTION

base table component.

# Retrieves the weighted average electrical conductivity from the surface to 30cm or to a restrictive layer. The weighted average EC is for that portion of each horizon in the depth range.

EXEC SQL select hzdept_r, hzdepb_r, ec_l, ec_r, ec_h
FROM component
INNER JOIN chorizon ON chorizon.coiidref=component.coiid
and hzdepb_r > hzdept_r;
SORT BY hzdept_r
AGGREGATE column hzdept_r none, hzdepb_r none, ec_l none, ec_r none, ec_h none.

# Determine the depth to RESTRICTIVE LAYER.
# Determine the LAYER THICKNESS IN RANGE; ABOVE A RESTRICTIVE LAYER.
DERIVE layer_thickness from rv using "NSSC Data":"LAYER THICKNESS IN RANGE; ABOVE VSTR RESTRICT BELOW O" (0,30).
DERIVE depth from rv using "NSSC Data":"DEPTH TO FIRST STR/VSTR CEMENTED BELOW ORGANIC LAYER".
DERIVE o_thickness from rv using "NSSC Pangaea":"THICKNESS OF SURFACE ORGANIC HORIZON".

# Find minimum of restriction depth and 200cm
DEFINE min_depthdepth < 200 and not isnull(depth) ? depth : 200.
DEFINE in_rangeisnull (hzdepb_r) ? hzdepb_r :
(hzdepb_r - o_thickness <= min_depth ? 1 : hzdepb_r - hzdept_r >= min_depth ? 1 : 0).

DEFINE default.

# Find the weighted average EC in the depth 0-30cm.

define low wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, ec_l)), layer_thickness).
define rv wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, ec_r)), layer_thickness).
define high wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, ec_h)), layer_thickness).

1.2 - WTD_AVG SAR 0-30cm OR ABOVE RESTRICTION

base table component.

# Retrieves the weighted average SAR from the surface to 30cm or to a restrictive layer. The weighted average SAR is for that portion of each horizon in the depth range.

EXEC SQL select hzdept_r, hzdepb_r, sar_l, sar_r, sar_h
FROM component, chorizon
WHERE JOIN component to chorizon
and hzdepb_r > hzdept_r;
SORT BY hzdept_r
AGGREGATE columnhzdept_r none, hzdepb_r none, sar_l none, sar_r none, sar_h none.

# Determine the depth to RESTRICTIVE LAYER.
# Determine the LAYER THICKNESS IN RANGE; ABOVE A RESTRICTIVE LAYER.
DERIVE layer_thickness fromrv using "NSSC Data":"LAYER THICKNESS IN RANGE; ABOVE VSTR RESTRICT BELOW O" (0,30).
DERIVE depth from rv using "NSSC Data":"DEPTH TO FIRST STR/VSTR CEMENTED BELOW ORGANIC LAYER".
DERIVE o_thickness from rv using "NSSC Pangaea":"THICKNESS OF SURFACE ORGANIC HORIZON".

# Find minimum of restriction depth and 200cm
DEFINE min_depth depth < 200 and not isnull(depth) ? depth : 200.
DEFINE in_range isnull (hzdepb_r) ? hzdepb_r : (hzdepb_r - o_thickness <= min_depth ? 1 :
hzdepb_r - hzdept_r >= min_depth ? 1 : 0).

#When the restriction is at the surface, in_range is never 1, so the weighted average
#calculation fails due to unequal dimensions. If the restriction is at the surface,
#we make depth hzdept_r. We do not want to always make in_range 1, only when the restriction
#depth is 0. Default needs to be dimension 0.
assign layer_thickness depth == 0 ? hzdept_r : layer_thickness.
assign in_range layer_thickness < 0 ? 1 : in_range.
DEFINE default 0*layer_thickness.

# Find the weighted average sar in the depth 0-30.

define low wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, sar_l)), layer_thickness).
define rv wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, sar_r)), layer_thickness).
define high wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, sar_h)), layer_thickness).

1.3 - GYPSUM FROM 0 to 30cm

base table component.

# Get the maximum gypsum content from 0 to 30 cm.

EXEC SQL SELECT gypsum_l, gypsum_h, gypsum_r
FROM component
INNER JOIN chorizon ON chorizon.coiidref=component.coiid
AND hzdept_r <= 30;
AGGREGATE COLUMN gypsum_l max, gypsum_h max, gypsum_r max.

DEFINE rv isnull(gypsum_r) then 0 else gypsum_r.
DEFINE high isnull(gypsum_h) then 0 else gypsum_h.
DEFINE low isnull(gypsum_l) then 0 else gypsum_l.

1.4 - SOIL REACTION 1-1 WATER MINIMUM IN DEPTH 0-30CM

base table component.

# Get minimum pH (1:1 water) in horizons in 0-30cm range

EXEC SQL
SELECT hzdept_r, ph1to1h2o_l, ph1to1h2o_h, ph1to1h2o_r, ph01mcacl2_r, ph01mcacl2_l, ph01mcacl2_h
FROM component, chorizon
WHERE JOIN component to chorizon;
AGGREGATE COLUMN hzdept_r none, ph1to1h2o_l none, ph1to1h2o_h none,
ph1to1h2o_r none, ph01mcacl2_r none, ph01mcacl2_l none, ph01mcacl2_h none.

DERIVE o_thickness from rv using "NSSC Pangaea":"SURFACE ORGANIC HORIZON THICKNESS".

DEFINE acidity_l if isnull(ph1to1h2o_l) then ph01mcacl2_l else ph1to1h2o_l.
DEFINE acidity_r if isnull(ph1to1h2o_r) then ph01mcacl2_r else ph1to1h2o_r.
DEFINE acidity_h if isnull(ph1to1h2o_h) then ph01mcacl2_h else ph1to1h2o_h.

DEFINE nullval.
ASSIGN acidity_l IF hzdept_r > o_thickness + 30 THEN nullval ELSE acidity_l.
ASSIGN acidity_h IF hzdept_r > o_thickness + 30 THEN nullval ELSE acidity_h.
ASSIGN acidity_r IF hzdept_r > o_thickness + 30 THEN nullval ELSE acidity_r.

DEFINE low arraymin(acidity_l).
DEFINE high arraymin(acidity_h).
DEFINE rv arraymin(acidity_r).


1.5 - MEAN ANNUAL PRECIPITATION FROM H&L

base table component.

EXEC SQL
SELECT map_l, map_r, map_h
FROM component;.

DERIVE rv isnull(map_r) ? ((map_l+map_h)/2) : map_r.

1.6 - MEAN ANNUAL AIR TEMPERATURE, FROM H&L

base table component.

EXEC SQL
SELECT mean_annual_air_temperature_r, mean_annual_air_temperature_l, mean_annual_air_temperature_h
from component;.

DEFINE rv isnull(mean_annual_air_temperature_r) ? ((mean_annual_air_temperature_l+mean_annual_air_temperature_h)/2) : mean_annual_air_temperature_r .




1.7 - WATER GATHERING SURFACE SIMPLE

BASE TABLE component.

EXEC SQL
SELECT shapeacross, shapedown, cosurfmorphss.seqnum, cosurfmorphss.cosurfmorssiid, taxorder, slope_r
FROM component, cosurfmorphss, cogeomordesc
WHERE JOIN component TO cogeomordesc AND
JOIN cogeomordesc TO cosurfmorphss;
sort by cosurfmorphss.seqnum, cosurfmorphss.cosurfmorssiid, shapeacross, shapedown
aggregate column cosurfmorphss.seqnum first, cosurfmorphss.cosurfmorssiid first, shapeacross first, shapedown first.

define shpacrosscodename(shapeacross).
define shpupdncodename(shapedown).

DEFINE shape IF ISNULL(shapeacross) then 0 ELSE
IF (CODENAME(shapeacross) matches "concave" AND
CODENAME(shapedown) matches "concave") THEN 3.0 ELSE IF
(CODENAME(shapeacross) matches "concave" AND
CODENAME(shapedown) matches "convex") THEN 1.0 ELSE IF
(CODENAME(shapeacross) matches "concave" AND
CODENAME(shapedown) matches "linear") THEN 2.0 ELSE IF
(CODENAME(shapeacross) matches "linear" AND
CODENAME(shapedown) matches "concave") THEN 2.0 ELSE IF
(CODENAME(shapeacross) matches "linear" AND
CODENAME(shapedown) matches "linear") THEN 1.0 ELSE IF
(CODENAME(shapeacross) matches "linear" AND
CODENAME(shapedown) matches "convex") THEN 1.0 ELSE IF
(CODENAME(shapeacross) matches "convex" AND
CODENAME(shapedown) matches "convex") THEN 0.0 ELSE IF
(CODENAME(shapeacross) matches "convex" AND
CODENAME(shapedown) matches "linear") THEN 0.0 ELSE IF
(CODENAME(shapeacross) matches "convex" AND
CODENAME(shapedown) matches "concave") THEN 1 ELSE 0.0.



DEFINE rv IF ISNULL(shapeacross) then 1.0 ELSE shape.


1.8 - CUMULATIVE NEAR SURFACE SATURATION

base table component.

# Get months that have a wet soil moisture status within 30 cm and count them.

exec sql
select codename(comonth.month) as wet_jan, soimoistdept_r jan_depth, coiid coiid_jan, comonthiid comonthiid_jan, cosoilmoistiid cosoilmoistiid_jan
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "jan";
aggregate column coiid_jan none, jan_depth none.

exec sql
select codename(comonth.month) as wet_feb, soimoistdept_r feb_depth, coiid coiid_feb, comonthiid comonthiid_feb, cosoilmoistiid cosoilmoistiid_feb
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "feb";
aggregate column coiid_feb none, feb_depth none.

exec sql
select codename(comonth.month) as wet_mar, soimoistdept_r mar_depth, coiid coiid_mar, comonthiid comonthiid_mar, cosoilmoistiid cosoilmoistiid_mar
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "mar";
aggregate column coiid_mar none, mar_depth none.

exec sql
select codename(comonth.month) as wet_apr, soimoistdept_r apr_depth, coiid coiid_apr, comonthiid comonthiid_apr, cosoilmoistiid cosoilmoistiid_apr
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "apr";
aggregate column coiid_apr none, apr_depth none.

exec sql
select codename(comonth.month) as wet_may, soimoistdept_r may_depth, coiid coiid_may, comonthiid comonthiid_may, cosoilmoistiid cosoilmoistiid_may
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "may";
aggregate column coiid_may none, may_depth none.

exec sql
select codename(comonth.month) as wet_jun, soimoistdept_r jun_depth, coiid coiid_jun, comonthiid comonthiid_jun, cosoilmoistiid cosoilmoistiid_jun
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "jun";
aggregate column coiid_jun none, jun_depth none.

exec sql
select codename(comonth.month) as wet_jul, soimoistdept_r jul_depth, coiid coiid_jul, comonthiid comonthiid_jul, cosoilmoistiid cosoilmoistiid_jul
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "jul";
aggregate column coiid_jul none, jul_depth none.


exec sql
select codename(comonth.month) as wet_aug, soimoistdept_r aug_depth, coiid coiid_aug, comonthiid comonthiid_aug, cosoilmoistiid cosoilmoistiid_aug
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "aug";
aggregate column coiid_aug none, aug_depth none.

exec sql
select codename(comonth.month) as wet_sep, soimoistdept_r sep_depth, coiid coiid_sep, comonthiid comonthiid_sep, cosoilmoistiid cosoilmoistiid_sep
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "sep";
aggregate column coiid_sep none, sep_depth none.

exec sql
select codename(comonth.month) as wet_oct, soimoistdept_r oct_depth, coiid coiid_oct, comonthiid comonthiid_oct, cosoilmoistiid cosoilmoistiid_oct
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "oct";
aggregate column coiid_oct none, oct_depth none.

exec sql
select codename(comonth.month) as wet_nov, soimoistdept_r nov_depth, coiid coiid_nov, comonthiid comonthiid_nov, cosoilmoistiid cosoilmoistiid_nov
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "nov";
aggregate column coiid_nov none, nov_depth none.

exec sql
select codename(comonth.month) as wet_dec, soimoistdept_r dec_depth, coiid coiid_dec, comonthiid comonthiid_dec, cosoilmoistiid cosoilmoistiid_dec
from component, outer (comonth, cosoilmoist)
where join component to comonth and
join comonth to cosoilmoist and
soimoiststat = "wet" and soimoistdept_r <= 30 and codename(comonth.month) imatches "dec";
aggregate column coiid_dec none, dec_depth none.

define counter 0.
assign counter isnull(jan_depth) ? 0 : 1.
assign counter isnull(feb_depth) ? counter : counter +1.
assign counter isnull(mar_depth) ? counter : counter +1.
assign counter isnull(apr_depth) ? counter : counter +1.
assign counter isnull(may_depth) ? counter : counter +1.
assign counter isnull(jun_depth) ? counter : counter +1.
assign counter isnull(jul_depth) ? counter : counter +1.
assign counter isnull(aug_depth) ? counter : counter +1.
assign counter isnull(sep_depth) ? counter : counter +1.
assign counter isnull(oct_depth) ? counter : counter +1.
assign counter isnull(nov_depth) ? counter : counter +1.
assign counter isnull(dec_depth) ? counter : counter +1.

define depth 0.
assign depth isnull(jan_depth) ? 0 : jan_depth.
assign depth isnull(feb_depth) ? depth : depth+feb_depth.
assign depth isnull(mar_depth) ? depth : depth+mar_depth.
assign depth isnull(apr_depth) ? depth : depth+apr_depth.
assign depth isnull(may_depth) ? depth : depth+may_depth.
assign depth isnull(jun_depth) ? depth : depth+jun_depth.
assign depth isnull(jul_depth) ? depth : depth+jul_depth.
assign depth isnull(aug_depth) ? depth : depth+aug_depth.
assign depth isnull(sep_depth) ? depth : depth+sep_depth.
assign depth isnull(oct_depth) ? depth : depth+oct_depth.
assign depth isnull(nov_depth) ? depth : depth+nov_depth.
assign depth isnull(dec_depth) ? depth : depth+dec_depth.

define rv counter.



1.9 - MONTHS WITH FREQUENT OR OCCASIONAL LONG PONDING

base table component.

# Get months when ponding frequency is "frequent" or "occasional" and duration is long or very long.

EXEC SQL
SELECT comonth.month
FROM component, comonth
WHERE JOIN component to comonth and (pondfreqcl in ("frequent", "occasional"))
and ponddurcl in ("long", "very long");.

# Sum months where ponding frequency is where ponding frequency is "frequent" or "occasional".
DEFINE ponding isnull(comonth.month) ? 0 : 1.
DEFINE low arraysum(ponding).
DEFINE high arraysum(ponding).
DEFINE rv arraysum(ponding).


1.10 - ORGANIC CARBON IN KG/M2 TO 30CM

base table component.

# Calculates the organic carbon content in kg/m2 for any portion of the soil in the depths 0 to 30 cm or to a restrictive layer.

EXEC SQL
SELECT hzdept_r, hzdepb_r,om_r, dbthirdbar_r, dbtenthbar_r
FROM component
INNER JOIN chorizon ON chorizon.coiidref=component.coiidand hzdept_r < hzdepb_r;
sort by hzdept_r, hzdepb_r
aggregate columndbthirdbar_rnone,dbtenthbar_r none, om_r none.

# Determine the volume percent of fine < 2mm in diameter.
DERIVE fine_p from rv using "FINE EARTH % BY VOLUME".

define om not isnull (om_r) ? om_r : 0.
define db_r not isnull (dbthirdbar_r) ? dbthirdbar_r : not isnull (dbtenthbar_r) ? dbtenthbar_r : 1.45.
define oc_r 58*(om * db_r * (fine_p/100)).

# Determine the LAYER THICKNESS IN RANGE; ABOVE A RESTRICTIVE LAYER.
DERIVE layer_thickness from rv using "NSSC Pangaea":"LAYER THICKNESS IN RANGE; ABOVE A RESTRICTIVE LAYER" (0,30).

# Nulls in organic carbon are assumed to mean 0.

define ocnot isnull (oc_r) ? oc_r : 0.

# Find the organic carbon weighted ave.
define thickness not isnull (layer_thickness) ? layer_thickness : 0.
define oc_sum arraysum(thickness*oc).
define rv not isnull (oc_sum) ? oc_sum/1000 : 0.



1.11 – WTD_AVG WRD 0-30cm OR ABOVE RESTRICTION

base table component.

# Calculates the water retention difference from 0 to 30 cm or a restrictive layer.
# The weighted average wrd is for that portion of each horizon in the depth range.

EXEC SQL select compname, hzdept_r, hzdepb_r, wthirdbar_l, wthirdbar_r, wthirdbar_h, wfifteenbar_l, wfifteenbar_r, wfifteenbar_h, awc_l, awc_r, awc_h, dbthirdbar_r
FROM component,chorizon
WHERE join component to chorizon
and hzdepb_r > hzdept_r;
SORT BY hzdept_r
AGGREGATE column hzdept_r none, hzdepb_r none, wthirdbar_l none, wthirdbar_r none, wthirdbar_h none, wfifteenbar_l none,
wfifteenbar_r none, wfifteenbar_h none, awc_l none, awc_r none, awc_h none, dbthirdbar_r none.

# Determine the depth to RESTRICTIVE LAYER.
# Determine the LAYER THICKNESS IN RANGE; ABOVE A RESTRICTIVE LAYER.
DERIVElayer_thickness fromrv using "NSSC Data":"LAYER THICKNESS IN RANGE; ABOVE VSTR RESTRICT BELOW O" (0,30).
DERIVE depth from rv using "NSSC Data":"DEPTH TO FIRST STR/VSTR CEMENTED BELOW ORGANIC LAYER".
DERIVE o_thickness from rv using "NSSC Pangaea":"THICKNESS OF SURFACE ORGANIC HORIZON".

ASSIGN dbthirdbar_risnull(dbthirdbar_r) ? 1.33 : dbthirdbar_r.

# Find minimum of restriction depth and 200cm
DEFINE min_depthdepth < 250 and not isnull(depth) ? depth : 150.
DEFINE in_rangeisnull (hzdepb_r) ? hzdepb_r : (hzdept_r - o_thickness <= min_depth ? 1 :
hzdepb_r - hzdept_r >= min_depth ? 1 : 0).

define wrd_lwthirdbar_l - wfifteenbar_l.
define wrd_rwthirdbar_r - wfifteenbar_r.
define wrd_hwthirdbar_h - wfifteenbar_h.

define wrd_alt_l100*(awc_l/dbthirdbar_r).
define wrd_alt_r100*(awc_r/dbthirdbar_r).
define wrd_alt_h100*(awc_h/dbthirdbar_r).

#When the restriction is at the surface, in_range is never 1, so the weighted average
#calculation fails due to unequal dimensions.If the restriction is at the surface,
#we make depth hzdept_r.We do not want to always make in_range 1, only when the restriction
#depth is 0.Default needs to be dimension 0.
assign layer_thicknessdepth == 0 ? hzdept_r : layer_thickness.
assign in_rangelayer_thickness < 0 ? 1 : in_range.
DEFINE default0*layer_thickness.

# Find the weighted average wrd in the depth 0-30cm.

define low1 wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_l)), layer_thickness).
define rv1 wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_r)), layer_thickness).
define high1 wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_h)), layer_thickness).

define low_alt wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_alt_l)), layer_thickness).
define rv_alt wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_alt_r)), layer_thickness).
define high_alt wtavg((if hzdepb_r - o_thickness <=0 THEN default ELSE lookup(1, in_range, wrd_alt_h)), layer_thickness).

define rv isnull(rv1) ? rv_alt : rv1.
define low isnull(low1) ? low_alt : low1.
define high isnull(high1) ? high_alt : high1.


1.12 – ALBEDO

base table component.
#Returns the dry albedo
EXEC SQL
SELECT albedodry_r from component;.
DEFINE rv if isnull(albedodry_r) then 0.13 else albedodry_r.


1.13 - SLOPE

base table component.

EXEC SQL
SELECT slope_l low, slope_h high, slope_r rv from component;.



1.14 - VALLEY FEVER ASPECT FACTOR

#This property calculates an aspect factor ranging from 0 to 1, with south facing aspects ranking 1.#Slope aspect less than 80 degrees or more than 280 degrees rank 0.

base table component.

EXEC SQL
SELECTffd_r, aspectrep, slope_r
from component;.

DEFINE aspect_factorif isnull(aspectrep) then 0 else if
aspectrep >= 0 and aspectrep < 80 then 0 else if
aspectrep >= 80 and aspectrep < 280 then -((aspectrep-180)**2)/9000+1 else 0.
DEFINE rv aspect_factor.


1.15 - XERIC AIR TEMPERATURE CHOPPER, FROM H&L
#Finds the ratio between the mean annual air temperature_h and 16 deg. C. for xeric areas.

base table component.

EXEC SQL
SELECT mean_annual_air_temperature_r, mean_annual_air_temperature_l, mean_annual_air_temperature_hfrom component;.

define reptempisnull(mean_annual_air_temperature_h) ? (mean_annual_air_temperature_r+2) : mean_annual_air_temperature_h.

define rv reptemp/16.

1.16 - NON-XERIC AIR TEMPERATURE CHOPPER, FROM H&L

base table component.

EXEC SQL
SELECTmean_annual_air_temperature_r, mean_annual_air_temperature_l, mean_annual_air_temperature_h
FROM component;.

DEFINE reptempisnull(mean_annual_air_temperature_h) ? (mean_annual_air_temperature_r+2) : mean_annual_air_temperature_h.

DEFINE rv reptemp/18.5.


1.17 - XERIC BIOLOGIC CLIMATE

base table component.

exec sql
select coiid, taxsuborder, taxsubgrp
from component;.

derive xericmlra from rv using "NSSC Data":"XERIC MLRA".

assign taxsuborder codename(taxsuborder).
assign taxsubgrp codename(taxsubgrp).


define rv isnull(taxsuborder) then 0 else if
taxsuborder imatches "xer*" then 1 else if
taxsubgrp imatches "*xer*" then 1 elseif
xericmlra == 1 then 1 else .8.