~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to imagery/i.atcorr/AtmosModel.cpp

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

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