common.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef MY_COMMON_H
  2. #define MY_COMMON_H
  3. /* Includes */
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <iostream> /* ??? */
  7. #include <fstream>
  8. #include <string>
  9. #include <cmath>
  10. #include <limits>
  11. #include <iomanip>
  12. #include "Output.h"
  13. using namespace std;
  14. #ifndef M_PI
  15. #define M_PI 3.1415926535897932384626433832795
  16. #endif /* M_PI */
  17. #define M_PI2 6.283185307179586476925286766559
  18. #define MIN(X,Y) ((X) <= (Y) ? (X) : (Y))
  19. #define ROUND(X) ((X) - (int)(X) < 0.5 ? (int)(X) : (int)((X)+1))
  20. const long int nt = 26;
  21. /* Constants */
  22. const float sigma = 0.056032f;
  23. const float delta = 0.0279f;
  24. const float xacc = 1.e-06f;
  25. const float step = 0.0025f;
  26. /* Globals */
  27. /* not sure what the name stands for */
  28. struct Sixs_sos
  29. {
  30. float phasel[10][83];
  31. float cgaus[83];
  32. float pdgs[83];
  33. };
  34. struct Sixs_aer
  35. {
  36. float ext[10];
  37. float ome[10];
  38. float gasym[10];
  39. float phase[10];
  40. };
  41. struct Sixs_aerbas
  42. {
  43. float bdm_ph[10][83]; /* background desert model... */
  44. float bbm_ph[10][83]; /* biomass burning model... */
  45. float stm_ph[10][83]; /* stratospherique aerosol model... */
  46. float dust_ph[10][83]; /* dust model */
  47. float wate_ph[10][83]; /* water model */
  48. float ocea_ph[10][83]; /* ocean model */
  49. float soot_ph[10][83]; /* soot model */
  50. float usr_ph[10][83]; /* user defined model from size distribution */
  51. float (*ph)[10][83]; /* pointer to current active model */
  52. };
  53. struct Sixs_trunc
  54. {
  55. float pha[83];
  56. float betal[81];
  57. };
  58. struct Sixs_disc
  59. {
  60. float roatm[3][10];
  61. float dtdir[3][10];
  62. float dtdif[3][10];
  63. float utdir[3][10];
  64. float utdif[3][10];
  65. float sphal[3][10];
  66. float wldis[10];
  67. float trayl[10];
  68. float traypl[10];
  69. };
  70. extern Sixs_sos sixs_sos;
  71. extern Sixs_aer sixs_aer;
  72. extern Sixs_aerbas sixs_aerbas;
  73. extern Sixs_trunc sixs_trunc;
  74. extern Sixs_disc sixs_disc;
  75. #endif /* MY_COMMON_H */