1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 | <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 | <title>txt2ropp converter</title>
|
---|
15 | </head>
|
---|
16 |
|
---|
17 |
|
---|
18 | <body style="background-color: rgb(255, 255, 204); color: rgb(0, 0, 0);" alink="#ee0000" link="#0000ee" vlink="#551a8b">
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 | <h1 style="background-color: rgb(255, 255, 204); color: rgb(51, 51, 255);">TXT to ROPP converter</h1>
|
---|
23 |
|
---|
24 |
|
---|
25 |
|
---|
26 | This page descibes the logic of the txt2ropp routine, written by Hans
|
---|
27 | Gleisner (DMI), in<br>
|
---|
28 |
|
---|
29 |
|
---|
30 |
|
---|
31 | <br>
|
---|
32 |
|
---|
33 |
|
---|
34 |
|
---|
35 | <span style="font-weight: bold;"> /data/nwp1/idculv/ROPP/ropp_src/branches/dev/Share/hw_grib2ropp/hgl_script/txt2ropp.</span><br>
|
---|
36 |
|
---|
37 |
|
---|
38 |
|
---|
39 | <br>
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 | <br>
|
---|
44 |
|
---|
45 |
|
---|
46 |
|
---|
47 | <font size="+1"><span style="font-weight: bold; color: rgb(51, 51, 255);">Interface:</span></font><br>
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | <br style="font-family: Courier New,Courier,monospace;">
|
---|
52 | <br style="font-family: Courier New,Courier,monospace;">
|
---|
53 | <span style="font-family: Courier New,Courier,monospace;">!----------------------------------------------------------------------------------------!</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
54 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
55 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
56 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
57 | NAME
|
---|
58 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
59 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
60 | asc2ropp
|
---|
61 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
62 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
63 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
64 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
65 | DESCRIPTION
|
---|
66 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
67 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
68 | Read data from one or several OCC/ASCII files and store in a
|
---|
69 | ROPP/netCDF file. !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
70 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
71 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
72 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
73 | DEPENDENCIES
|
---|
74 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
75 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
76 | module
|
---|
77 | rom_num
|
---|
78 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
79 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
80 | module
|
---|
81 | rom_io
|
---|
82 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
83 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
84 | module
|
---|
85 | ropp_io
|
---|
86 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
87 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
88 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
89 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
90 | SYNOPSIS
|
---|
91 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
92 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
93 | asc2ropp ascfile [-o
|
---|
94 | roppfile]
|
---|
95 | &
|
---|
96 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
97 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
98 | [-obsdir
|
---|
99 | obsdir]
|
---|
100 | &
|
---|
101 | ! </span><br style="font-family: Courier New,Courier,monospace;">
|
---|
102 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
103 | [-bgrfile
|
---|
104 | bgrfile]
|
---|
105 | &
|
---|
106 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
107 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
108 | [-outfile
|
---|
109 | outfile]
|
---|
110 | &
|
---|
111 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
112 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
113 | [-datdir
|
---|
114 | datadir]
|
---|
115 | &
|
---|
116 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
117 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
118 | [-obs |
|
---|
119 | -bgr]
|
---|
120 | &
|
---|
121 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
122 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
123 | [-sil]
|
---|
124 | [-h]
|
---|
125 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
126 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
127 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
128 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
129 | ARGUMENTS
|
---|
130 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
131 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
132 | <ascfile>
|
---|
133 | Name of input files (without prefix or suffix when
|
---|
134 | converting !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
135 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
136 | OCC/ASCII files to ROPP/netCDF
|
---|
137 | files).
|
---|
138 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
139 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
140 | -o <roppfile> Name of output
|
---|
141 | files (without prefix & suffix when converting !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
142 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
143 | OCC/ASCII files to ROPP/netCDF
|
---|
144 | files).
|
---|
145 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
146 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
147 | -obsdir <obsdir> Directory where the input
|
---|
148 | observed data files are located. !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
149 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
150 | -bgrfile <bgrfile> Input ASCII
|
---|
151 | file.
|
---|
152 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
153 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
154 | -outfile <outfile> Output netCDF
|
---|
155 | file.
|
---|
156 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
157 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
158 | -datdir <datadir> Root directory to the O, B, and
|
---|
159 | GSM-96 data
|
---|
160 | directories. !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
161 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
162 | -obs
|
---|
163 | Convert observed profile data from the OCC
|
---|
164 | software.
|
---|
165 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
166 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
167 | -bgr
|
---|
168 | Convert ECMWF profile
|
---|
169 | data.
|
---|
170 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
171 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
172 | -sil
|
---|
173 | Execute
|
---|
174 | silently.
|
---|
175 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
176 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
177 | -h
|
---|
178 | Help.
|
---|
179 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
180 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
181 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
182 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
183 | NOTES
|
---|
184 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
185 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
186 | Already existing output files will be
|
---|
187 | overwritten.
|
---|
188 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
189 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
190 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
191 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
192 | AUTHOR
|
---|
193 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
194 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
195 | Hans Gleisner
|
---|
196 | (hgl@dmi.dk)
|
---|
197 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
198 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
199 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
200 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
201 | VERSION
|
---|
202 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
203 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
204 | 01-Mar-2012
|
---|
205 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
206 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
207 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
208 | <span style="font-family: Courier New,Courier,monospace;">! CODE
|
---|
209 | DESCRIPTION:
|
---|
210 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
211 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
212 | Language: Fortran
|
---|
213 | 90
|
---|
214 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
215 | <span style="font-family: Courier New,Courier,monospace;">!
|
---|
216 | !</span><br style="font-family: Courier New,Courier,monospace;">
|
---|
217 | <span style="font-family: Courier New,Courier,monospace;">!----------------------------------------------------------------------------------------!</span><br style="font-family: monospace;">
|
---|
218 | <font style="font-family: Courier;" size="+1"></font><br style="font-family: Courier;">
|
---|
219 |
|
---|
220 |
|
---|
221 |
|
---|
222 | The output outfile from grib2txt is the input bgrfile to txt2ropp. <br>
|
---|
223 | <br>
|
---|
224 | <br>
|
---|
225 |
|
---|
226 |
|
---|
227 |
|
---|
228 | <span style="font-weight: bold; color: rgb(51, 51, 255);">Steps:</span><br>
|
---|
229 |
|
---|
230 |
|
---|
231 |
|
---|
232 | <br>
|
---|
233 |
|
---|
234 |
|
---|
235 |
|
---|
236 | 1) Specifying -bgrfile sets inputBGR=.true.<br>
|
---|
237 |
|
---|
238 |
|
---|
239 |
|
---|
240 | <br>
|
---|
241 | 2) Call readfile_BGR. This reads time, location, {Z0, P0, LSmask,
|
---|
242 | NmodLevs, P(i), T(i), q(i)} from the ascii input, which is in a known
|
---|
243 | format. <span style="color: rgb(255, 0, 0);">For ROPP, we may prefer to use namelists.</span> <br>
|
---|
244 | <br>
|
---|
245 | readfile_BGR also reads level coeffs Ak and Bk from files. <span style="color: rgb(255, 0, 0);">Since these are known from the GRIB file, we should probably write them out from grib2txt and read them in with txt2ropp. </span><br>
|
---|
246 | <br>
|
---|
247 | It also defines the ROprof structure BGRprof, whose Lev2b substructure it then populates with the injested values, thus:<br>
|
---|
248 | <br>
|
---|
249 | BGRprof%occ_id = 'nnnn'<br>
|
---|
250 | <br>
|
---|
251 | BGRprof%Lev2b%press = Pmod<br>
|
---|
252 | BGRprof%Lev2b%temp = Tmod<br>
|
---|
253 | BGRprof%Lev2b%shum = Qmod<br>
|
---|
254 | BGRprof%Lev2b%meteo_qual = 100.0d0<br>
|
---|
255 | BGRprof%Lev2c%geop_sfc = Z0mod<br>
|
---|
256 | BGRprof%Lev2c%press_sfc = P0mod<br>
|
---|
257 | BGRprof%Lev2c%press_sfc_qual = 100.0d0<br>
|
---|
258 | BGRprof%Lev2d%level_type = "ECMWF"<br>
|
---|
259 | BGRprof%Lev2d%level_coeff_a = ak<br>
|
---|
260 | BGRprof%Lev2d%level_coeff_b = bk<br>
|
---|
261 | <br>
|
---|
262 | BGRprof%GEOref%lat = lat<br>
|
---|
263 | BGRprof%GEOref%lon = lon<br>
|
---|
264 | <br>
|
---|
265 | BGRprof%bg%source = "ECMWF"<br>
|
---|
266 | BGRprof%bg%year = year <br>
|
---|
267 | BGRprof%bg%month = month<br>
|
---|
268 | BGRprof%bg%day = day<br>
|
---|
269 | BGRprof%bg%hour = hour<br>
|
---|
270 | BGRprof%bg%minute = minute<br>
|
---|
271 | BGRprof%bg%fcperiod = fcast <br>
|
---|
272 | <br>
|
---|
273 | BGRprof%PCD = 0<br>
|
---|
274 | BGRprof%PCD = ibset(BGRprof%PCD, PCD_offline)<br>
|
---|
275 | BGRprof%PCD = ibset(BGRprof%PCD, PCD_occultation)<br>
|
---|
276 | <br>
|
---|
277 | 3) There's a check that we have 60, 91, or 126 levels in the
|
---|
278 | file. (We must have, or it wouldn't have been able to find the Aks and
|
---|
279 | Bks.) We don't need this for ROPP, because we'll hold the Aks and
|
---|
280 | Bks in the ascii file. <br>
|
---|
281 | <br>
|
---|
282 | 4) Call writefile_BGR_ropp(outfile, BGRdata, 0). This is
|
---|
283 | basically a call to ropp_io_write(BGRdata, BGRfile, ranchk=.false.,
|
---|
284 | ierr=ierr).<br>
|
---|
285 | <br>
|
---|
286 | <br>
|
---|
287 |
|
---|
288 | <br>
|
---|
289 |
|
---|
290 | <span style="font-weight: bold; color: rgb(51, 51, 255);">Example:</span><br>
|
---|
291 |
|
---|
292 | <br>
|
---|
293 |
|
---|
294 | cd /data/nwp1/idculv/ROPP/ropp_src/branches/dev/Share/ic_grib2ropp/hgl_script/txt2ropp<br>
|
---|
295 |
|
---|
296 | <br>
|
---|
297 |
|
---|
298 | ./compile_asc2ropp.bash<br>
|
---|
299 |
|
---|
300 | <br>
|
---|
301 | ./asc2ropp.x \<br>
|
---|
302 | -bgr \<br>
|
---|
303 | -bgrfile '/data/nwp1/idculv/ROPP/ropp_src/branches/dev/Share/ic_grib2ropp/hgl_script/grib2txt/example1.out' \<br>
|
---|
304 | -datdir '/net/data/nwp1/idculv/ROPP/ropp_src/branches/dev/Share/ic_grib2ropp/hgl_script/ancillary' \<br>
|
---|
305 | -outfile 'example1.nc'<br>
|
---|
306 | <br>
|
---|
307 |
|
---|
308 | produces:<br>
|
---|
309 |
|
---|
310 | <br>
|
---|
311 |
|
---|
312 | /net/data/nwp1/idculv/ROPP/ropp_src/branches/dev/Share/ic_grib2ropp/hgl_script/txt2ropp<br>
|
---|
313 | idculv@eld037:> ncks -H -ddim_lev2b,0,4 -vpress,temp,shum example1.nc<br>
|
---|
314 | dim_unlim[0] dim_lev2b[0] press[0]=1005.936 <br>
|
---|
315 | dim_unlim[0] dim_lev2b[1] press[1]=1003.05 <br>
|
---|
316 | dim_unlim[0] dim_lev2b[2] press[2]=999.052 <br>
|
---|
317 | dim_unlim[0] dim_lev2b[3] press[3]=993.804 <br>
|
---|
318 | dim_unlim[0] dim_lev2b[4] press[4]=987.317 <br>
|
---|
319 | <br>
|
---|
320 | dim_unlim[0] dim_lev2b[0] shum[0]=8.83387 <br>
|
---|
321 | dim_unlim[0] dim_lev2b[1] shum[1]=8.92123 <br>
|
---|
322 | dim_unlim[0] dim_lev2b[2] shum[2]=8.99149 <br>
|
---|
323 | dim_unlim[0] dim_lev2b[3] shum[3]=9.07474 <br>
|
---|
324 | dim_unlim[0] dim_lev2b[4] shum[4]=9.11437 <br>
|
---|
325 | <br>
|
---|
326 | dim_unlim[0] dim_lev2b[0] temp[0]=286.18 <br>
|
---|
327 | dim_unlim[0] dim_lev2b[1] temp[1]=286.13 <br>
|
---|
328 | dim_unlim[0] dim_lev2b[2] temp[2]=286 <br>
|
---|
329 | dim_unlim[0] dim_lev2b[3] temp[3]=285.83 <br>
|
---|
330 | dim_unlim[0] dim_lev2b[4] temp[4]=285.79 <br>
|
---|
331 | <br>
|
---|
332 | <br>
|
---|
333 | idculv@eld037:> ncks -H -ddim_lev2d,0,4 -vlevel_coeff_a,level_coeff_b example1.nc<br>
|
---|
334 | dim_unlim[0] dim_lev2d[0] level_coeff_a[0]=0 <br>
|
---|
335 | dim_unlim[0] dim_lev2d[1] level_coeff_a[1]=3.16e-05 <br>
|
---|
336 | dim_unlim[0] dim_lev2d[2] level_coeff_a[2]=0.0657563 <br>
|
---|
337 | dim_unlim[0] dim_lev2d[3] level_coeff_a[3]=0.542083 <br>
|
---|
338 | dim_unlim[0] dim_lev2d[4] level_coeff_a[4]=1.62043 <br>
|
---|
339 | <br>
|
---|
340 | dim_unlim[0] dim_lev2d[0] level_coeff_b[0]=1 <br>
|
---|
341 | dim_unlim[0] dim_lev2d[1] level_coeff_b[1]=0.99763 <br>
|
---|
342 | dim_unlim[0] dim_lev2d[2] level_coeff_b[2]=0.994204 <br>
|
---|
343 | dim_unlim[0] dim_lev2d[3] level_coeff_b[3]=0.989153 <br>
|
---|
344 | dim_unlim[0] dim_lev2d[4] level_coeff_b[4]=0.982238 <br>
|
---|
345 | <br>
|
---|
346 | idculv@eld037:> ncks -H -vgeop_sfc,press_sfc example1.nc<br>
|
---|
347 | dim_unlim[0] geop_sfc[0]=-1.43 <br>
|
---|
348 | <br>
|
---|
349 | dim_unlim[0] press_sfc[0]=1007.13 <br>
|
---|
350 | <br>
|
---|
351 | Which all looks OK.<br>
|
---|
352 |
|
---|
353 | <br>
|
---|
354 |
|
---|
355 | <br>
|
---|
356 |
|
---|
357 | <span style="font-weight: bold; color: rgb(51, 51, 255);">Aspects relevant to ROPP implementation:</span><br>
|
---|
358 |
|
---|
359 | <br>
|
---|
360 | 1) Need to be able to read from general ascii file input, not just
|
---|
361 | those produced by grib2txt. Maybe namelists? For same
|
---|
362 | reason, need to read Ak and Bk. Perhaps we could default all
|
---|
363 | these, and allow the user to overwrite them all. <br>
|
---|
364 |
|
---|
365 | 2) Don't need the GRIB API as an external library, like netCDF or
|
---|
366 | BUFR, for this.<br>
|
---|
367 | 3) No need to worry about the orog etc: can assume the user can produce geopotential on model levels. <br>
|
---|
368 | 4) Any need to cope with more than one ascii file at a time?
|
---|
369 | Might be simpler not to bother, and to advise users to use ncrcat
|
---|
370 | or ncecat to combine into a multifile. (Need to check this works.)<br>
|
---|
371 | 5) Some overlaps with gfz2ropp. <br>
|
---|
372 | 6) I suggest we start with this, and then we'll know better what output we should produce with grib2txt.<br>
|
---|
373 |
|
---|
374 | 7) Natural place to put it: ropp_io/tools/text2ropp.<br>
|
---|
375 |
|
---|
376 | <br>
|
---|
377 |
|
---|
378 |
|
---|
379 |
|
---|
380 | <br>
|
---|
381 |
|
---|
382 |
|
---|
383 |
|
---|
384 | <hr style="width: 100%; height: 2px;"><span style="font-style: italic;">Last updated </span><span style="font-weight: bold; font-style: italic;">24th
|
---|
385 | September 2012</span><span style="font-style: italic;">
|
---|
386 | by </span><a style="font-style: italic;" href="mailto:ian.culverwell@metoffice.gov.uk">ian.culverwell@metoffice.gov.uk</a><br>
|
---|
387 |
|
---|
388 |
|
---|
389 |
|
---|
390 | <br>
|
---|
391 |
|
---|
392 |
|
---|
393 |
|
---|
394 | </body>
|
---|
395 | </html>
|
---|