def days_since_rain(p, prev, threshold=0):
  """Compute consecutive number of days without/little rain.

  Parameters
  ----------
  p : array
    rainfall amount in open over previous 24 hours [mm].
  prev : array
    Previous number of consecutive days without rain.
    prev_start = 0.0
  threshold: scalar 
    Threshold for dry days

  Returns
  -------
  array
    Number of days without rain at current timestep.
  """
  if p > threshold:
    return 0
  else:
    return prev + 1