def rain_sum(p, prev):
  """ Compute amount (sum) of consecutive rainfall

  Parameters
  ----------
  p : array
    rainfall amount in open over previous 24 hours [mm].
  prev : array
    Previous sum of consecutive rain.
    prev_start = 0.0

  Returns
  -------
  array
    sum of consecutive rainfall [mm]
  """
  if p == 0:
    return 0
  else:
    return prev + p