> 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.1-precipitation/1-3.1.1-occurrence-of-wet-or-dry-day.md).

# 1:3.1.1 Occurrence of Wet or Dry Day

With the first-order Markov-chain model, the probability of rain on a given day is conditioned on the wet or dry status of the previous day. A wet day is defined as a day with 0.1 mm of rain or more.

The user is required to input the probability of a wet day on day $$i$$ given a wet day on day $$i-1,Pi-1(W/W)$$, and the probability of a wet day on day $$i$$ given a dry day on day $$i-1,P\_i(W/D)$$, for each month of the year. From these inputs the remaining transition probabilities can be derived:

$$P\_i(D/W)=1-P\_i(W/W)$$                                                                                                                            1:3.1.1

$$P\_i(W/W)=1-P\_i(W/D)$$                                                                                                                            1:3.1.2

where $$P\_i(D/W)$$ is the probability of a dry day on day $$i$$ given a wet day on day $$i-1$$ and $$P\_i(D/D)$$ is the probability of a dry day on day $$i$$ given a dry day on day $$i-1$$.

To define a day as wet or dry, SWAT+ generates a random number between 0.0 and 1.0. This random number is compared to the appropriate wet-dry probability, $$P\_i(W/W)$$ or $$P\_i(W/D)$$. If the random number is equal to or less than the wet-dry probability, the day is defined as wet. If the random number is greater than the wet-dry probability, the day is defined as dry.
