anchor.diff:          !    spawn_cutoff: The size of the minimum spawning event allowed, in
           !        the encoded representation. Events smaller than this will be
           !        stochastically rounded up to this value or down to zero.
  +        !    pspawn: Encoded spawning probability.
           ! In/Out:
  -        !    pspawn: Encoded spawning probability.
           !    rng: random number generator.
           ! Returns:
           !    nspawn: number of successful spawning events from given pspawn.
  
positive.code:         use const, only: p, int_p
  
          integer(int_p), intent(in) :: spawn_cutoff
          real(p), intent(inout) :: pspawn
          type(dSFMT_t), intent(inout) :: rng
  
          integer(int_p) :: nspawn
  
          if (pspawn < spawn_cutoff) then
  
  
negative.code:             ! If pspawn is > 1, then we spawn floor(pspawn) as a minimum and
              ! then spawn a particle with probability pspawn-floor(pspawn).
              nspawn = int(pspawn, int_p)
              padd = pspawn - nspawn
  
              if (padd > get_rand_close_open(rng)) nspawn = nspawn + 1_int_p
  
          end if
  
  