AtmosModel.cpp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. extern "C" {
  2. #include <grass/gis.h>
  3. #include <grass/glocale.h>
  4. }
  5. #include "common.h"
  6. #include "AtmosModel.h"
  7. void AtmosModel::tropic()
  8. {
  9. static const float z1[34] =
  10. {
  11. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  12. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f,
  13. 22.f, 23.f, 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  14. };
  15. static const float p1[34] =
  16. {
  17. 1013.f, 904.f, 805.f, 715.f, 633.f, 559.f, 492.f, 432.f, 378.f,
  18. 329.f, 286.f, 247.f, 213.f, 182.f, 156.f, 132.f, 111.f, 93.7f,
  19. 78.9f, 66.6f, 56.5f, 48.f, 40.9f, 35.f, 30.f, 25.7f, 12.2f, 6.f,
  20. 3.05f, 1.59f, .854f, .0579f, 3e-4f, 0.f
  21. };
  22. static const float t1[34] =
  23. {
  24. 300.f, 294.f, 288.f, 284.f, 277.f, 270.f, 264.f, 257.f, 250.f,
  25. 244.f, 237.f, 230.f, 224.f, 217.f, 210.f, 204.f, 197.f, 195.f,
  26. 199.f, 203.f, 207.f, 211.f, 215.f, 217.f, 219.f, 221.f, 232.f,
  27. 243.f, 254.f, 265.f, 270.f, 219.f, 210.f, 210.f
  28. };
  29. static const float wh1[34] =
  30. {
  31. 19.f, 13.f, 9.3f, 4.7f, 2.2f, 1.5f, .85f, .47f, .25f, .12f, .05f,
  32. .017f, .006f, .0018f, .001f, 7.6e-4f, 6.4e-4f, 5.6e-4f, 5e-4f,
  33. 4.9e-4f, 4.5e-4f, 5.1e-4f, 5.1e-4f, 5.4e-4f, 6e-4f, 6.7e-4f,
  34. 3.6e-4f, 1.1e-4f, 4.3e-5f, 1.9e-5f, 6.3e-6f, 1.4e-7f, 1e-9f, 0.f
  35. };
  36. static const float wo1[34] =
  37. {
  38. 5.6e-5f, 5.6e-5f, 5.4e-5f, 5.1e-5f, 4.7e-5f, 4.5e-5f,
  39. 4.3e-5f, 4.1e-5f, 3.9e-5f, 3.9e-5f, 3.9e-5f, 4.1e-5f, 4.3e-5f, 4.5e-5f,
  40. 4.5e-5f, 4.7e-5f, 4.7e-5f, 6.9e-5f, 9e-5f, 1.4e-4f, 1.9e-4f, 2.4e-4f,
  41. 2.8e-4f, 3.2e-4f, 3.4e-4f, 3.4e-4f, 2.4e-4f, 9.2e-5f, 4.1e-5f, 1.3e-5f,
  42. 4.3e-6f, 8.6e-8f, 4.3e-11f, 0.f
  43. };
  44. /* model: tropical mc clatchey */
  45. for (int i = 0; i < 34; i++)
  46. {
  47. z[i] = z1[i];
  48. p[i] = p1[i];
  49. t[i] = t1[i];
  50. wh[i] = wh1[i];
  51. wo[i] = wo1[i];
  52. }
  53. }
  54. void AtmosModel::midsum()
  55. {
  56. static const float z1[34] =
  57. {
  58. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  59. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f, 23.f,
  60. 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  61. };
  62. static const float p1[34] =
  63. {
  64. 1013.f, 902.f, 802.f, 710.f, 628.f, 554.f, 487.f, 426.f,
  65. 372.f, 324.f, 281.f, 243.f, 209.f, 179.f, 153.f, 130.f, 111.f, 95.f,
  66. 81.2f, 69.5f, 59.5f, 51.f, 43.7f, 37.6f, 32.2f, 27.7f, 13.2f, 6.52f,
  67. 3.33f, 1.76f, .951f, .0671f, 3e-4f, 0.f
  68. };
  69. static const float t1[34] =
  70. {
  71. 294.f, 290.f, 285.f, 279.f, 273.f, 267.f, 261.f, 255.f,
  72. 248.f, 242.f, 235.f, 229.f, 222.f, 216.f, 216.f, 216.f, 216.f, 216.f,
  73. 216.f, 217.f, 218.f, 219.f, 220.f, 222.f, 223.f, 224.f, 234.f, 245.f, 258.f,
  74. 270.f, 276.f, 218.f, 210.f, 210.f
  75. };
  76. static const float wh1[34] =
  77. {
  78. 14.f, 9.3f, 5.9f, 3.3f, 1.9f, 1.f, .61f, .37f, .21f, .12f,
  79. .064f, .022f, .006f, .0018f, .001f, 7.6e-4f, 6.4e-4f, 5.6e-4f, 5e-4f,
  80. 4.9e-4f, 4.5e-4f, 5.1e-4f, 5.1e-4f, 5.4e-4f, 6e-4f, 6.7e-4f, 3.6e-4f,
  81. 1.1e-4f, 4.3e-5f, 1.9e-5f, 1.3e-6f, 1.4e-7f, 1e-9f, 0.f
  82. };
  83. static const float wo1[34] =
  84. {
  85. 6e-5f, 6e-5f, 6e-5f, 6.2e-5f, 6.4e-5f, 6.6e-5f, 6.9e-5f,
  86. 7.5e-5f, 7.9e-5f, 8.6e-5f, 9e-5f, 1.1e-4f, 1.2e-4f, 1.5e-4f, 1.8e-4f,
  87. 1.9e-4f, 2.1e-4f, 2.4e-4f, 2.8e-4f, 3.2e-4f, 3.4e-4f, 3.6e-4f, 3.6e-4f,
  88. 3.4e-4f, 3.2e-4f, 3e-4f, 2e-4f, 9.2e-5f, 4.1e-5f, 1.3e-5f, 4.3e-6f,
  89. 8.6e-8f, 4.3e-11f, 0.f
  90. };
  91. /* model: midlatitude summer mc clatchey */
  92. for (int i = 0; i < 34; i++)
  93. {
  94. z[i] = z1[i];
  95. p[i] = p1[i];
  96. t[i] = t1[i];
  97. wh[i] = wh1[i];
  98. wo[i] = wo1[i];
  99. }
  100. }
  101. void AtmosModel::midwin()
  102. {
  103. static const float z1[34] =
  104. {
  105. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  106. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f, 23.f,
  107. 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  108. };
  109. static const float p1[34] =
  110. {
  111. 1018.f, 897.3f, 789.7f, 693.8f, 608.1f, 531.3f, 462.7f,
  112. 401.6f, 347.3f, 299.2f, 256.8f, 219.9f, 188.2f, 161.f, 137.8f, 117.8f,
  113. 100.7f, 86.1f, 73.5f, 62.8f, 53.7f, 45.8f, 39.1f, 33.4f, 28.6f, 24.3f,
  114. 11.1f, 5.18f, 2.53f, 1.29f, .682f, .0467f, 3e-4f, 0.f
  115. };
  116. static const float t1[34] =
  117. {
  118. 272.2f, 268.7f, 265.2f, 261.7f, 255.7f, 249.7f, 243.7f,
  119. 237.7f, 231.7f, 225.7f, 219.7f, 219.2f, 218.7f, 218.2f, 217.7f, 217.2f,
  120. 216.7f, 216.2f, 215.7f, 215.2f, 215.2f, 215.2f, 215.2f, 215.2f, 215.2f,
  121. 215.2f, 217.4f, 227.8f, 243.2f, 258.5f, 265.7f, 230.7f, 210.2f, 210.f
  122. };
  123. static const float wh1[34] =
  124. {
  125. 3.5f, 2.5f, 1.8f, 1.2f, .66f, .38f, .21f, .085f, .035f,
  126. .016f, .0075f, .0069f, .006f, .0018f, .001f, 7.6e-4f, 6.4e-4f, 5.6e-4f,
  127. 5e-4f, 4.9e-4f, 4.5e-4f, 5.1e-4f, 5.1e-4f, 5.4e-4f, 6e-4f, 6.7e-4f,
  128. 3.6e-4f, 1.1e-4f, 4.3e-5f, 1.9e-5f, 6.3e-6f, 1.4e-7f, 1e-9f, 0.f
  129. };
  130. static const float wo1[34] =
  131. {
  132. 6e-5f, 5.4e-5f, 4.9e-5f, 4.9e-5f, 4.9e-5f, 5.8e-5f,
  133. 6.4e-5f, 7.7e-5f, 9e-5f, 1.2e-4f, 1.6e-4f, 2.1e-4f, 2.6e-4f, 3e-4f,
  134. 3.2e-4f, 3.4e-4f, 3.6e-4f, 3.9e-4f, 4.1e-4f, 4.3e-4f, 4.5e-4f, 4.3e-4f,
  135. 4.3e-4f, 3.9e-4f, 3.6e-4f, 3.4e-4f, 1.9e-4f, 9.2e-5f, 4.1e-5f, 1.3e-5f,
  136. 4.3e-6f, 8.6e-8f, 4.3e-11f, 0.f
  137. };
  138. /* model: midlatitude winter mc clatchey */
  139. for (int i = 0; i < 34; i++)
  140. {
  141. z[i] = z1[i];
  142. p[i] = p1[i];
  143. t[i] = t1[i];
  144. wh[i] = wh1[i];
  145. wo[i] = wo1[i];
  146. }
  147. }
  148. void AtmosModel::subsum()
  149. {
  150. static const float z1[34] =
  151. {
  152. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  153. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f, 23.f,
  154. 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  155. };
  156. static const float p1[34] =
  157. {
  158. 1010.f, 896.f, 792.9f, 700.f, 616.f, 541.f, 473.f, 413.f,
  159. 359.f, 310.7f, 267.7f, 230.f, 197.7f, 170.f, 146.f, 125.f, 108.f, 92.8f,
  160. 79.8f, 68.6f, 58.9f, 50.7f, 43.6f, 37.5f, 32.27f, 27.8f, 13.4f, 6.61f,
  161. 3.4f, 1.81f, .987f, .0707f, 3e-4f, 0.f
  162. };
  163. static const float t1[34] =
  164. {
  165. 287.f, 282.f, 276.f, 271.f, 266.f, 260.f, 253.f, 246.f,
  166. 239.f, 232.f, 225.f, 225.f, 225.f, 225.f, 225.f, 225.f, 225.f, 225.f,
  167. 225.f, 225.f, 225.f, 225.f, 225.f, 225.f, 226.f, 228.f, 235.f, 247.f, 262.f,
  168. 274.f, 277.f, 216.f, 210.f, 210.f
  169. };
  170. static const float wh1[34] =
  171. {
  172. 9.1f, 6.f, 4.2f, 2.7f, 1.7f, 1.f, .54f, .29f, .13f, .042f,
  173. .015f, .0094f, .006f, .0018f, .001f, 7.6e-4f, 6.4e-4f, 5.6e-4f, 5e-4f,
  174. 4.9e-4f, 4.5e-4f, 5.1e-4f, 5.1e-4f, 5.4e-4f, 6e-4f, 6.7e-4f, 3.6e-4f,
  175. 1.1e-4f, 4.3e-5f, 1.9e-5f, 6.3e-6f, 1.4e-7f, 1e-9f, 0.f
  176. };
  177. static const float wo1[34] =
  178. {
  179. 4.9e-5f, 5.4e-5f, 5.6e-5f, 5.8e-5f, 6e-5f, 6.4e-5f,
  180. 7.1e-5f, 7.5e-5f, 7.9e-5f, 1.1e-4f, 1.3e-4f, 1.8e-4f, 2.1e-4f, 2.6e-4f,
  181. 2.8e-4f, 3.2e-4f, 3.4e-4f, 3.9e-4f, 4.1e-4f, 4.1e-4f, 3.9e-4f, 3.6e-4f,
  182. 3.2e-4f, 3e-4f, 2.8e-4f, 2.6e-4f, 1.4e-4f, 9.2e-5f, 4.1e-5f, 1.3e-5f,
  183. 4.3e-6f, 8.6e-8f, 4.3e-11f, 0.f
  184. };
  185. /* model: subarctique summer mc clatchey */
  186. for (int i = 0; i < 34; i++)
  187. {
  188. z[i] = z1[i];
  189. p[i] = p1[i];
  190. t[i] = t1[i];
  191. wh[i] = wh1[i];
  192. wo[i] = wo1[i];
  193. }
  194. }
  195. void AtmosModel::subwin()
  196. {
  197. static const float z1[34] =
  198. {
  199. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  200. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f, 23.f,
  201. 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  202. };
  203. static const float p1[34] =
  204. {
  205. 1013.f, 887.8f, 777.5f, 679.8f, 593.2f, 515.8f, 446.7f,
  206. 385.3f, 330.8f, 282.9f, 241.8f, 206.7f, 176.6f, 151.f, 129.1f, 110.3f,
  207. 94.31f, 80.58f, 68.82f, 58.75f, 50.14f, 42.77f, 36.47f, 31.09f, 26.49f,
  208. 22.56f, 10.2f, 4.701f, 2.243f, 1.113f, .5719f, .04016f, 3e-4f, 0.f
  209. };
  210. static const float t1[34] =
  211. {
  212. 257.1f, 259.1f, 255.9f, 252.7f, 247.7f, 240.9f, 234.1f,
  213. 227.3f, 220.6f, 217.2f, 217.2f, 217.2f, 217.2f, 217.2f, 217.2f, 217.2f,
  214. 216.6f, 216.f, 215.4f, 214.8f, 214.1f, 213.6f, 213.f, 212.4f, 211.8f,
  215. 211.2f, 216.f, 222.2f, 234.7f, 247.f, 259.3f, 245.7f, 210.f, 210.f
  216. };
  217. static const float wh1[34] =
  218. {
  219. 1.2f, 1.2f, .94f, .68f, .41f, .2f, .098f, .054f, .011f,
  220. .0084f, .0055f, .0038f, .0026f, .0018f, .001f, 7.6e-4f, 6.4e-4f, 5.6e-4f,
  221. 5e-4f, 4.9e-4f, 4.5e-4f, 5.1e-4f, 5.1e-4f, 5.4e-4f, 6e-4f, 6.7e-4f,
  222. 3.6e-4f, 1.1e-4f, 4.3e-5f, 1.9e-5f, 6.3e-6f, 1.4e-7f, 1e-9f, 0.f
  223. };
  224. static const float wo1[34] =
  225. {
  226. 4.1e-5f, 4.1e-5f, 4.1e-5f, 4.3e-5f, 4.5e-5f, 4.7e-5f,
  227. 4.9e-5f, 7.1e-5f, 9e-5f, 1.6e-4f, 2.4e-4f, 3.2e-4f, 4.3e-4f, 4.7e-4f,
  228. 4.9e-4f, 5.6e-4f, 6.2e-4f, 6.2e-4f, 6.2e-4f, 6e-4f, 5.6e-4f, 5.1e-4f,
  229. 4.7e-4f, 4.3e-4f, 3.6e-4f, 3.2e-4f, 1.5e-4f, 9.2e-5f, 4.1e-5f, 1.3e-5f,
  230. 4.3e-6f, 8.6e-8f, 4.3e-11f, 0.f
  231. };
  232. /* model: subarctique winter mc clatchey */
  233. for (int i = 0; i < 34; i++)
  234. {
  235. z[i] = z1[i];
  236. p[i] = p1[i];
  237. t[i] = t1[i];
  238. wh[i] = wh1[i];
  239. wo[i] = wo1[i];
  240. }
  241. }
  242. void AtmosModel::us62()
  243. {
  244. static const float z1[34] =
  245. {
  246. 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f,
  247. 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f, 19.f, 20.f, 21.f, 22.f, 23.f,
  248. 24.f, 25.f, 30.f, 35.f, 40.f, 45.f, 50.f, 70.f, 100.f, 99999.f
  249. };
  250. static const float p1[34] =
  251. {
  252. 1013.f, 898.6f, 795.f, 701.2f, 616.6f, 540.5f, 472.2f,
  253. 411.1f, 356.5f, 308.f, 265.f, 227.f, 194.f, 165.8f, 141.7f, 121.1f,
  254. 103.5f, 88.5f, 75.65f, 64.67f, 55.29f, 47.29f, 40.47f, 34.67f, 29.72f, 25.49f,
  255. 11.97f, 5.746f, 2.871f, 1.491f, .7978f, .0552f, 3.008e-4f, 0.f
  256. };
  257. static const float t1[34] =
  258. {
  259. 288.1f, 281.6f, 275.1f, 268.7f, 262.2f, 255.7f, 249.2f,
  260. 242.7f, 236.2f, 229.7f, 223.2f, 216.8f, 216.6f, 216.6f, 216.6f, 216.6f,
  261. 216.6f, 216.6f, 216.6f, 216.6f, 216.6f, 217.6f, 218.6f, 219.6f, 220.6f,
  262. 221.6f, 226.5f, 236.5f, 253.4f, 264.2f, 270.6f, 219.7f, 210.f, 210.f
  263. };
  264. static const float wh1[34] =
  265. {
  266. 5.9f, 4.2f, 2.9f, 1.8f, 1.1f, .64f, .38f, .21f, .12f,
  267. .046f, .018f, .0082f, .0037f, .0018f, 8.4e-4f, 7.2e-4f, 6.1e-4f, 5.2e-4f,
  268. 4.4e-4f, 4.4e-4f, 4.4e-4f, 4.8e-4f, 5.2e-4f, 5.7e-4f, 6.1e-4f, 6.6e-4f,
  269. 3.8e-4f, 1.6e-4f, 6.7e-5f, 3.2e-5f, 1.2e-5f, 1.5e-7f, 1e-9f, 0.f
  270. };
  271. static const float wo1[34] =
  272. {
  273. 5.4e-5f, 5.4e-5f, 5.4e-5f, 5e-5f, 4.6e-5f, 4.6e-5f,
  274. 4.5e-5f, 4.9e-5f, 5.2e-5f, 7.1e-5f, 9e-5f, 1.3e-4f, 1.6e-4f, 1.7e-4f,
  275. 1.9e-4f, 2.1e-4f, 2.4e-4f, 2.8e-4f, 3.2e-4f, 3.5e-4f, 3.8e-4f, 3.8e-4f,
  276. 3.9e-4f, 3.8e-4f, 3.6e-4f, 3.4e-4f, 2e-4f, 1.1e-4f, 4.9e-5f, 1.7e-5f,
  277. 4e-6f, 8.6e-8f, 4.3e-11f, 0.f
  278. };
  279. /* model: us standard 62 mc clatchey */
  280. for (int i = 0; i < 34; i++)
  281. {
  282. z[i] = z1[i];
  283. p[i] = p1[i];
  284. t[i] = t1[i];
  285. wh[i] = wh1[i];
  286. wo[i] = wo1[i];
  287. }
  288. }
  289. void AtmosModel::parse()
  290. {
  291. cin >> idatm;
  292. cin.ignore(numeric_limits<int>::max(),'\n'); /* read the rest of the scraps, like comments */
  293. uw = 0.;
  294. uo3 = 0.;
  295. switch(idatm)
  296. {
  297. case 0: us62(); break;
  298. case 1: tropic(); break;
  299. case 2: midsum(); break;
  300. case 3: midwin(); break;
  301. case 4: subsum(); break;
  302. case 5: subwin(); break;
  303. case 6: us62(); break;
  304. case 7:
  305. {
  306. /* read input */
  307. for(int i = 0; i < 34; i++)
  308. {
  309. cin >> z[i];
  310. cin >> p[i];
  311. cin >> t[i];
  312. cin >> wh[i];
  313. cin >> wo[i];
  314. cin.ignore(numeric_limits<int>::max(),'\n'); /* read the rest of the scraps, like comments */
  315. }
  316. break;
  317. }
  318. case 8:
  319. {
  320. cin >> uw;
  321. cin >> uo3;
  322. cin.ignore(numeric_limits<int>::max(),'\n'); /* read the rest of the scraps, like comments */
  323. us62();
  324. break;
  325. }
  326. default: G_warning(_("Unknown atmospheric model!"));
  327. }
  328. }
  329. /* --- atmospheric model ---- */
  330. void AtmosModel::print()
  331. {
  332. static const string head(" atmospheric model description ");
  333. static const string line(" ----------------------------- ");
  334. Output::Begin(); Output::Repeat(22,' '); Output::Print(head); Output::End();
  335. Output::Begin(); Output::Repeat(22,' '); Output::Print(line); Output::End();
  336. if(idatm < 7)
  337. {
  338. static const string atmid[7] = {
  339. string("no absorption computed "),
  340. string("tropical (uh2o=4.12g/cm2,uo3=.247cm-atm)"),
  341. string("midlatitude summer (uh2o=2.93g/cm2,uo3=.319cm-atm)"),
  342. string("midlatitude winter (uh2o=.853g/cm2,uo3=.395cm-atm)"),
  343. string("subarctic summer (uh2o=2.10g/cm2,uo3=.480cm-atm)"),
  344. string("subarctic winter (uh2o=.419g/cm2,uo3=.480cm-atm)"),
  345. string("us standard 1962 (uh2o=1.42g/cm2,uo3=.344cm-atm)")
  346. };
  347. Output::Begin();
  348. Output::Repeat(10,' ');
  349. Output::Print(" atmospheric model identity : ");
  350. Output::End();
  351. Output::Begin();
  352. Output::Repeat(15,' ');
  353. Output::Print(atmid[idatm]);
  354. Output::End();
  355. }
  356. else if(idatm == 7)
  357. {
  358. Output::Begin();
  359. Output::Print(" atmospheric model identity : ");
  360. Output::End();
  361. Output::Begin();
  362. Output::Repeat(12, ' ');
  363. Output::Print(" user defined atmospheric model ");
  364. Output::End();
  365. Output::Begin();
  366. Output::Repeat(12, ' ');
  367. Output::Print("*altitude *pressure *temp. *h2o dens. *o3 dens. ");
  368. Output::End();
  369. for(int i = 0; i < 34; i++)
  370. {
  371. Output::Begin();
  372. Output::Repeat(12, ' ');
  373. ostringstream s;
  374. s.setf(ios::fixed, ios::floatfield);
  375. s << setprecision(4);
  376. s << setw(9) << z[i] << " ";
  377. s << setw(9) << p[i] << " ";
  378. s << setw(9) << t[i] << " ";
  379. s << setw(9) << wh[i] << " ";
  380. s << setw(9) << wo[i] << " ";
  381. s << ends;
  382. Output::Print(s.str());
  383. Output::End();
  384. }
  385. }
  386. else
  387. {
  388. Output::Begin();
  389. Output::Repeat(10, ' ');
  390. Output::Print(" atmospheric model identity : ");
  391. Output::End();
  392. Output::Begin();
  393. Output::Repeat(12, ' ');
  394. ostringstream s1;
  395. s1.setf(ios::fixed, ios::floatfield);
  396. s1 << setprecision(3);
  397. s1 << " user defined water content : uh2o=" << setw(9) << uw << " g/cm2 ";
  398. Output::Print(s1.str());
  399. Output::End();
  400. Output::Begin();
  401. Output::Repeat(12, ' ');
  402. ostringstream s2;
  403. s2.setf(ios::fixed, ios::floatfield);
  404. s2 << setprecision(3);
  405. s2 << " user defined ozone content : uo3 =" << setw(9) << uo3 << " cm-atm";
  406. Output::Print(s2.str());
  407. Output::End();
  408. }
  409. Output::Begin(); Output::End();
  410. }
  411. AtmosModel AtmosModel::Parse()
  412. {
  413. AtmosModel atms;
  414. atms.parse();
  415. return atms;
  416. }