cru_ts30.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ///////////////////////////////////////////////////////////////////////////////////////
  2. /// \file cru_ts30.h
  3. /// \brief Functions for reading the CRU-NCEP data set
  4. ///
  5. /// The binary files contain CRU-NCEP half-degree global historical climate data
  6. /// for 1901-2015.
  7. ///
  8. /// $Date: 2018-02-02 18:01:35 +0100 (ven, 02 fév 2018) $
  9. ///
  10. ///////////////////////////////////////////////////////////////////////////////////////
  11. #ifndef LPJ_GUESS_CRU_TS30_H
  12. #define LPJ_GUESS_CRU_TS30_H
  13. namespace CRU_TS30 {
  14. /// number of years of historical climate
  15. /** CRU-NCEP v7 has 115 years of data (1901-2015) */
  16. const int NYEAR_HIST=115;
  17. /// calendar year corresponding to first year in CRU climate data set
  18. static const int FIRSTHISTYEAR=1901;
  19. /// Determine temp, precip, sunshine & soilcode
  20. bool searchcru(char* cruark,double dlon,double dlat,int& soilcode,
  21. double mtemp[NYEAR_HIST][12],
  22. double mprec[NYEAR_HIST][12],
  23. double msun[NYEAR_HIST][12]);
  24. /// Determine elevation, frs frq, wet frq & DTR
  25. bool searchcru_misc(char* cruark,double dlon,double dlat,int& elevation,
  26. double mfrs[NYEAR_HIST][12],
  27. double mwet[NYEAR_HIST][12],
  28. double mdtr[NYEAR_HIST][12]);
  29. /// Returns CRU data from the nearest cell to (lon,lat) within a given search radius
  30. /** lon and lat are set to the coordinates of the found CRU gridcell, if found */
  31. bool findnearestCRUdata(double searchradius, char* cruark, double& lon, double& lat,
  32. int& scode,
  33. double hist_mtemp1[NYEAR_HIST][12],
  34. double hist_mprec1[NYEAR_HIST][12],
  35. double hist_msun1[NYEAR_HIST][12]);
  36. }
  37. #endif // LPJ_GUESS_CRU_TS30_H