ncompete.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ///////////////////////////////////////////////////////////////////////////////////////
  2. /// \file ncompete.h
  3. /// \brief Distribution of N among individuals according to supply, demand and
  4. /// the individuals' uptake strength
  5. ///
  6. /// \author David Wårlind
  7. /// $Date: 2014-09-09 10:49:13 +0200 (mar, 09 sep 2014) $
  8. ///
  9. ///////////////////////////////////////////////////////////////////////////////////////
  10. #ifndef LPJ_GUESS_NCOMPETE_H
  11. #define LPJ_GUESS_NCOMPETE_H
  12. #include <vector>
  13. /// Represents an individual competing for nitrogen uptake
  14. /** Contains what the ncompete function below needs to know about
  15. * an individual in order to do the distribution of N.
  16. */
  17. struct NCompetingIndividual {
  18. /// This individual's N demand
  19. double ndemand;
  20. /// A meassure of this individual's uptake strength
  21. double strength;
  22. /// Output from ncompete - fraction of the demand satisfied by the distribution
  23. double fnuptake;
  24. };
  25. /// Distributes N among individuals according to supply, demand and uptake strength
  26. /** Grasses should get at least 5% and no
  27. * individual should get more than 100% of its nitrogen demand.
  28. */
  29. void ncompete(std::vector<NCompetingIndividual>& individuals,
  30. double nmass_avail);
  31. #endif // LPJ_GUESS_NCOMPETE_H