> For the complete documentation index, see [llms.txt](https://swatplus.gitbook.io/io-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swatplus.gitbook.io/io-docs/theoretical-documentation/section-1-climate/chapter-1-3-weather-generator/1-3.2-maximum-half-hour-rainfall/1-3.2.2-daily-maximum-half-hour-rain-value.md).

# 1:3.2.2 Daily Maximum Half-Hour Rain Value

The user has the option of using the monthly maximum half-hour rainfall for all days in the month or generating a daily value. <mark style="background-color:red;">The variable sed\_det in the basin input file (codes.bsn) defines which option the user prefers.</mark> The randomness of the triangular distribution used to generated daily values can cause the maximum half-hour rainfall value to jump around. For small plots or microwatersheds in particular, the variability of the triangular distribution is unrealistic.&#x20;

The triangular distribution used to generate the maximum half-hour rainfall fraction requires four inputs: average monthly half-hour rainfall fraction, maximum value for half-hour rainfall fraction allowed in month, minimum value for half-hour rainfall fraction allowed in month, and a random number between 0.0 and 1.0.&#x20;

The maximum half-hour rainfall fraction, or upper limit of the triangular distribution, is calculated from the daily amount of rainfall with the equation:

$$\alpha\_{0.5U}=1-exp(\frac{-125}{R\_{day}+5})$$                                                                                                                                    1:3.2.3

&#x20;where $$\alpha\_{0.5U}$$ is the largest half-hour fraction that can be generated on a given day, and $$R\_{day}$$ is the precipitation on a given day  ($$mm\space H\_2O$$). The minimum half-hour fraction, or lower limit of the triangular distribution, $$\alpha\_{0.5L}$$, is set at 0.02083.&#x20;

The triangular distribution uses one of two sets of equations to generate a maximum half-hour rainfall fraction for the day. If $$rnd\_1\le(\frac{\alpha\_{0.5mon}-\alpha\_{0.5L}}{\alpha\_{0.5U}-\alpha\_{0.5L}})$$   then

$$\alpha\_{0.5}=\alpha\_{0.5mon}*\frac{\alpha\_{0.5L}+\[rnd\_1*(\alpha\_{0.5U}-\alpha\_{0.5L})\*(\alpha\_{0.5mon}-\alpha\_{0.5L})]^{0.5}}{\alpha\_{0.5mean}}$$                                                                             1:3.2.4

If $$rnd\_1>(\frac{\alpha\_{0.5mon}-\alpha\_{0.5L}}{\alpha\_{0.5U}-\alpha\_{0.5L}})$$      then

$$\alpha\_{0.5}=\alpha\_{0.5mon}*(\frac{\alpha\_{0.5U}-(\alpha\_{0.5U}-\alpha\_{0.5mon})*\[\frac{\alpha\_{0.5U}(1-rnd\_1)-\alpha\_{0.5L}(1-rnd\_1)}{\alpha\_{0.5U}-\alpha\_{0.5mon}}]^{0.5}}{\alpha\_{0.5mean}})$$                                                                1:3.2.5

where $$\alpha\_{0.5}$$ is the maximum half-hour rainfall fraction for the day, $$\alpha\_{0.5mon}$$is the average maximum half-hour rainfall fraction for the month, $$rnd\_1$$ is a random number generated by the model each day, $$\alpha\_{0.5L}$$ is the smallest half-hour rainfall fraction that can be generated, $$\alpha\_{0.5U}$$ is the largest half-hour fraction that can be generated, and $$\alpha\_{0.5mean}$$is the average of $$\alpha\_{0.5L}$$, $$\alpha\_{0.5mon}$$, and $$\alpha\_{0.5U}$$.

Table 1:3-2: SWAT+  input variables that pertain to generation of maximum half-hour rainfall.

| Definition                                                                                                                            | Source Name         | Input Name          | Input File                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------- | ------------------------------------------------------------------------------- |
| Code governing calculation of daily maximum half-hour rainfall: 0-generate daily value 1-use monthly maximum half-hour rainfall value | sed\_det (not used) | sed\_det (not used) | [codes.bsn](/io-docs/introduction-1/basin-1/codes.bsn.md)                       |
| $$R\_{0.5x}$$: extreme half-hour rainfall for month  ($$mm\space H\_2O$$)                                                             | rainhmx             | pcp\_hhr            | [weather-wgn.cli](/io-docs/introduction-1/climate/weather-wgn.cli.md)           |
| $$adj\_{0.5\alpha}$$: peak rate adjustment factor                                                                                     | adj\_pkr            | adj\_pkrt           | [parameters.bsn](/io-docs/introduction-1/basin-1/parameters.bsn.md)             |
| average amount of precipitation falling in month ($$mm\space H\_2O$$)                                                                 | pcpmm               | pcp\_ave            | [weather-wgn.cli](/io-docs/introduction-1/climate/weather-wgn.cli.md)           |
| $$days\_{wet}$$: average number of days of precipitation in month ($$\mu\_{mon}$$= PCPMM / PCPD)                                      | pcpd                | pcp\_days           | [weather-wgn.cli](/io-docs/introduction-1/climate/weather-wgn.cli.md)           |
| $$yrs$$: number of years of data used to obtain values for RAINHHMX pcp\_hhr                                                          | rain\_yrs           | yrs                 | [weather-wgn.cli](/io-docs/introduction-1/climate/weather-wgn.cli.md)           |
| $$R\_{day}$$: amount of rain falling on a given day ($$mm\space H\_2O$$)                                                              |                     | pcp                 | [.pcp](/io-docs/introduction-1/climate/pcp.cli-and-precipitation-data-files.md) |
