As a bit of an aside regarding the script and the formulas used to calculate the climates, there's apparently a sort of "official formula" that can be used for the aridity threshold if you want it to be gradual rather than using Köppen's original formulas. Using
this paper as a source, a fellow named Patton originally published a modified formula in 1962 (using inches and fahrenheit as units). Converted into centimetres and degrees celsius (as used in some publications apparently), the formula looks like this:
R(cm) = 2.3*T - 0.64*Pw + 41
Where
R is the aridity threshold,
T is the mean annual temperature, and
Pw is the percentage of rain that falls in the winter half-year. Note that this gives the threshold in
cm, so for our purposes we'd want it converted into
mm:
R(mm) = 23*T - 6.4*Pw + 410