38 used += snprintf ( c + used, lmax - used,
"%s%s%s%s%s", cl->
e.
YYYY, cl->
e.
MM, cl->
e.
DD, cl->
e.
HH, cl->
e.
mm );
41 used += snprintf ( c + used, lmax - used,
" CLIMAT" );
44 used += snprintf ( c + used, lmax - used,
" %s%s", cl->
s0.
MM, cl->
s0.
JJJ );
50 used += snprintf ( c + used, lmax - used,
" %s%s", cl->
s0.
II, cl->
s0.
iii );
71 used += snprintf ( c + used, lmax - used,
" 111" );
75 used += snprintf ( c + used, lmax - used,
" 1%s", cl->
s1.
PoPoPoPo );
80 used += snprintf ( c + used, lmax - used,
" 2%s", cl->
s1.
PPPP );
85 if ( cl->
s1.
TTT[0] == 0 )
87 strcpy ( cl->
s1.
s,
"/" );
88 strcpy ( cl->
s1.
TTT,
"///" );
94 used += snprintf ( c + used, lmax - used,
" 3%s%s%s", cl->
s1.
s, cl->
s1.
TTT, cl->
s1.
ststst );
101 strcpy ( cl->
s1.
sx,
"/" );
106 strcpy ( cl->
s1.
sn,
"/" );
114 used += snprintf ( c + used, lmax - used,
" 5%s", cl->
s1.
eee );
123 if ( cl->
s1.
Rd[0] == 0 )
125 strcpy ( cl->
s1.
Rd,
"/" );
127 if ( cl->
s1.
nrnr[0] == 0 )
129 strcpy ( cl->
s1.
nrnr,
"//" );
131 used += snprintf ( c + used, lmax - used,
" 6%s%s%s", cl->
s1.
R1R1R1R1, cl->
s1.
Rd, cl->
s1.
nrnr );
144 used += snprintf ( c + used, lmax - used,
" 7%s%s", cl->
s1.
S1S1S1, cl->
s1.
pspsps );
149 if ( cl->
s1.
mpmp[0] == 0 )
151 strcpy ( cl->
s1.
mpmp,
"//" );
153 if ( cl->
s1.
mtmt[0] == 0 )
155 strcpy ( cl->
s1.
mtmt,
"//" );
157 if ( cl->
s1.
mtx[0] == 0 )
159 strcpy ( cl->
s1.
mtx,
"/" );
161 if ( cl->
s1.
mtn[0] == 0 )
163 strcpy ( cl->
s1.
mtn,
"/" );
165 used += snprintf ( c + used, lmax - used,
" 8%s%s%s%s", cl->
s1.
mpmp, cl->
s1.
mtmt, cl->
s1.
mtx, cl->
s1.
mtn );
171 if ( cl->
s1.
meme[0] == 0 )
173 strcpy ( cl->
s1.
meme,
"//" );
175 if ( cl->
s1.
mrmr[0] == 0 )
177 strcpy ( cl->
s1.
mrmr,
"//" );
179 if ( cl->
s1.
msms[0] == 0 )
181 strcpy ( cl->
s1.
msms,
"//" );
183 used += snprintf ( c + used, lmax - used,
" 9%s%s%s", cl->
s1.
meme, cl->
s1.
mrmr, cl->
s1.
msms );
201 size_t used = 0, used0 = 0;
206 used += snprintf ( c + used, lmax - used,
" 222" );
214 if ( cl->
s2.
YbYb[0] == 0 )
216 strcpy ( cl->
s2.
YbYb,
"//" );
218 if ( cl->
s2.
YcYc[0] == 0 )
220 strcpy ( cl->
s2.
YcYc,
"//" );
222 used += snprintf ( c + used, lmax - used,
" 0%s%s", cl->
s2.
YbYb, cl->
s2.
YcYc );
227 used += snprintf ( c + used, lmax - used,
" 1%s", cl->
s2.
PoPoPoPo );
232 used += snprintf ( c + used, lmax - used,
" 2%s", cl->
s2.
PPPP );
237 if ( cl->
s2.
s[0] == 0 )
239 strcpy ( cl->
s2.
s,
"/" );
241 if ( cl->
s2.
TTT[0] == 0 )
243 strcpy ( cl->
s2.
TTT,
"///" );
250 used += snprintf ( c + used, lmax - used,
" 3%s%s%s", cl->
s2.
s, cl->
s2.
TTT, cl->
s2.
ststst );
255 if ( cl->
s2.
sx[0] == 0 )
257 strcpy ( cl->
s2.
sx,
"/" );
263 if ( cl->
s2.
sn[0] == 0 )
265 strcpy ( cl->
s2.
sn,
"/" );
277 used += snprintf ( c + used, lmax - used,
" 5%s", cl->
s2.
eee );
286 if ( cl->
s2.
nrnr[0] == 0 )
288 strcpy ( cl->
s2.
nrnr,
"//" );
290 used += snprintf ( c + used, lmax - used,
" 6%s%s", cl->
s2.
R1R1R1R1, cl->
s2.
nrnr );
295 used += snprintf ( c + used, lmax - used,
" 7%s", cl->
s2.
S1S1S1 );
300 if ( cl->
s2.
ypyp[0] == 0 )
302 strcpy ( cl->
s2.
ypyp,
"//" );
304 if ( cl->
s2.
ytyt[0] == 0 )
306 strcpy ( cl->
s2.
ytyt,
"//" );
313 used += snprintf ( c + used, lmax - used,
" 8%s%s%s", cl->
s2.
ypyp, cl->
s2.
ytyt, cl->
s2.
ytxytx );
318 if ( cl->
s2.
yeye[0] == 0 )
320 strcpy ( cl->
s2.
yeye,
"//" );
322 if ( cl->
s2.
yryr[0] == 0 )
324 strcpy ( cl->
s2.
yryr,
"//" );
326 if ( cl->
s2.
ysys[0] == 0 )
328 strcpy ( cl->
s2.
ysys,
"//" );
331 used += snprintf ( c + used, lmax - used,
" 9%s%s%s", cl->
s2.
yeye, cl->
s2.
yryr, cl->
s2.
ysys );
357 size_t used0 = 0, used = 0;
362 used += snprintf ( c + used, lmax - used,
" 333" );
368 if ( ( cl->
s3.
T25[0] && strcmp ( cl->
s3.
T25,
"00" ) ) ||
369 ( cl->
s3.
T30[0] && strcmp ( cl->
s3.
T30,
"00" ) )
372 if ( cl->
s3.
T25[0] == 0 )
374 strcpy ( cl->
s3.
T25,
"//" );
376 if ( cl->
s3.
T30[0] == 0 )
378 strcpy ( cl->
s3.
T30,
"//" );
380 used += snprintf ( c + used, lmax - used,
" 0%s%s", cl->
s3.
T25, cl->
s3.
T30 );
384 ( cl->
s3.
T35[0] && strcmp ( cl->
s3.
T35,
"00" ) ) ||
385 ( cl->
s3.
T40[0] && strcmp ( cl->
s3.
T40,
"00" ) )
388 if ( cl->
s3.
T35[0] == 0 )
390 strcpy ( cl->
s3.
T35,
"//" );
392 if ( cl->
s3.
T40[0] == 0 )
394 strcpy ( cl->
s3.
T40,
"//" );
396 used += snprintf ( c + used, lmax - used,
" 1%s%s", cl->
s3.
T35, cl->
s3.
T40 );
400 ( cl->
s3.
Tn0[0] && strcmp ( cl->
s3.
Tn0,
"00" ) ) ||
401 ( cl->
s3.
Tx0[0] && strcmp ( cl->
s3.
Tx0,
"00" ) )
404 if ( cl->
s3.
Tn0[0] == 0 )
406 strcpy ( cl->
s3.
Tn0,
"//" );
408 if ( cl->
s3.
Tx0[0] == 0 )
410 strcpy ( cl->
s3.
Tx0,
"//" );
412 used += snprintf ( c + used, lmax - used,
" 2%s%s", cl->
s3.
Tn0, cl->
s3.
Tx0 );
415 if ( ( cl->
s3.
R01[0] && strcmp ( cl->
s3.
R01,
"00" ) ) ||
416 ( cl->
s3.
R05[0] && strcmp ( cl->
s3.
R05,
"00" ) )
420 if ( cl->
s3.
R01[0] == 0 )
422 strcpy ( cl->
s3.
R01,
"//" );
424 if ( cl->
s3.
R05[0] == 0 )
426 strcpy ( cl->
s3.
R05,
"//" );
428 used += snprintf ( c + used, lmax - used,
" 3%s%s", cl->
s3.
R01, cl->
s3.
R05 );
431 if ( ( cl->
s3.
R10[0] && strcmp ( cl->
s3.
R10,
"00" ) ) ||
432 ( cl->
s3.
R50[0] && strcmp ( cl->
s3.
R50,
"00" ) )
436 if ( cl->
s3.
R10[0] == 0 )
438 strcpy ( cl->
s3.
R10,
"//" );
440 if ( cl->
s3.
R50[0] == 0 )
442 strcpy ( cl->
s3.
R50,
"//" );
444 used += snprintf ( c + used, lmax - used,
" 4%s%s", cl->
s3.
R10, cl->
s3.
R50 );
447 if ( ( cl->
s3.
R100[0] && strcmp ( cl->
s3.
R100,
"00" ) ) ||
452 if ( cl->
s3.
R100[0] == 0 )
454 strcpy ( cl->
s3.
R100,
"//" );
456 if ( cl->
s3.
R150[0] == 0 )
458 strcpy ( cl->
s3.
R150,
"//" );
460 used += snprintf ( c + used, lmax - used,
" 5%s%s", cl->
s3.
R100, cl->
s3.
R150 );
463 if ( ( cl->
s3.
s00[0] && strcmp ( cl->
s3.
s00,
"00" ) ) ||
464 ( cl->
s3.
s01[0] && strcmp ( cl->
s3.
s01,
"00" ) )
467 if ( cl->
s3.
s00[0] == 0 )
469 strcpy ( cl->
s3.
s00,
"//" );
471 if ( cl->
s3.
s01[0] == 0 )
473 strcpy ( cl->
s3.
s01,
"//" );
475 used += snprintf ( c + used, lmax - used,
" 6%s%s", cl->
s3.
s00, cl->
s3.
s01 );
478 if ( ( cl->
s3.
s10[0] && strcmp ( cl->
s3.
s10,
"00" ) ) ||
479 ( cl->
s3.
s50[0] && strcmp ( cl->
s3.
s50,
"00" ) )
483 if ( cl->
s3.
s10[0] == 0 )
485 strcpy ( cl->
s3.
s10,
"//" );
487 if ( cl->
s3.
s50[0] == 0 )
489 strcpy ( cl->
s3.
s50,
"//" );
491 used += snprintf ( c + used, lmax - used,
" 7%s%s", cl->
s3.
s10, cl->
s3.
s50 );
495 ( cl->
s3.
f10[0] && strcmp ( cl->
s3.
f10,
"00" ) ) ||
496 ( cl->
s3.
f20[0] && strcmp ( cl->
s3.
f20,
"00" ) ) ||
497 ( cl->
s3.
f30[0] && strcmp ( cl->
s3.
f30,
"00" ) )
500 if ( cl->
s3.
f10[0] == 0 )
502 strcpy ( cl->
s3.
f10,
"//" );
504 if ( cl->
s3.
f20[0] == 0 )
506 strcpy ( cl->
s3.
f20,
"//" );
508 if ( cl->
s3.
f30[0] == 0 )
510 strcpy ( cl->
s3.
f30,
"//" );
512 used += snprintf ( c + used, lmax - used,
" 8%s%s%s", cl->
s3.
f10, cl->
s3.
f20, cl->
s3.
f30 );
516 ( cl->
s3.
V1[0] && strcmp ( cl->
s3.
V1,
"00" ) ) ||
517 ( cl->
s3.
V2[0] && strcmp ( cl->
s3.
V2,
"00" ) ) ||
518 ( cl->
s3.
V3[0] && strcmp ( cl->
s3.
V3,
"00" ) )
521 if ( cl->
s3.
V1[0] == 0 )
523 strcpy ( cl->
s3.
V1,
"//" );
525 if ( cl->
s3.
V2[0] == 0 )
527 strcpy ( cl->
s3.
V2,
"//" );
529 if ( cl->
s3.
V3[0] == 0 )
531 strcpy ( cl->
s3.
V3,
"//" );
533 used += snprintf ( c + used, lmax - used,
" 9%s%s%s", cl->
s3.
V1, cl->
s3.
V2, cl->
s3.
V3 );
558 size_t used0 = 0, used = 0;
563 used += snprintf ( c + used, lmax - used,
" 444" );
571 if ( cl->
s4.
sx[0] == 0 )
573 strcpy ( cl->
s4.
sx,
"/" );
575 if ( cl->
s4.
Txd[0] == 0 )
577 strcpy ( cl->
s4.
Txd,
"///" );
579 if ( cl->
s4.
yx[0] == 0 )
581 strcpy ( cl->
s4.
yx,
"//" );
583 used += snprintf ( c + used, lmax - used,
" 0%s%s%s", cl->
s4.
sx, cl->
s4.
Txd, cl->
s4.
yx );
588 if ( cl->
s4.
sn[0] == 0 )
590 strcpy ( cl->
s4.
sn,
"/" );
592 if ( cl->
s4.
Tnd[0] == 0 )
594 strcpy ( cl->
s4.
Tnd,
"///" );
596 if ( cl->
s4.
yn[0] == 0 )
598 strcpy ( cl->
s4.
yn,
"//" );
600 used += snprintf ( c + used, lmax - used,
" 1%s%s%s", cl->
s4.
sn, cl->
s4.
Tnd, cl->
s4.
yn );
605 if ( cl->
s4.
sax[0] == 0 )
607 strcpy ( cl->
s4.
sax,
"/" );
609 if ( cl->
s4.
Tax[0] == 0 )
611 strcpy ( cl->
s4.
Tax,
"///" );
613 if ( cl->
s4.
yax[0] == 0 )
615 strcpy ( cl->
s4.
yax,
"//" );
617 used += snprintf ( c + used, lmax - used,
" 2%s%s%s", cl->
s4.
sax, cl->
s4.
Tax, cl->
s4.
yax );
622 if ( cl->
s4.
san[0] == 0 )
624 strcpy ( cl->
s4.
san,
"/" );
626 if ( cl->
s4.
Tan[0] == 0 )
628 strcpy ( cl->
s4.
Tan,
"///" );
630 if ( cl->
s4.
yan[0] == 0 )
632 strcpy ( cl->
s4.
yan,
"//" );
634 used += snprintf ( c + used, lmax - used,
" 3%s%s%s", cl->
s4.
san, cl->
s4.
Tan, cl->
s4.
yan );
643 if ( cl->
s4.
yx[0] == 0 )
645 strcpy ( cl->
s4.
Tan,
"//" );
647 used += snprintf ( c + used, lmax - used,
" 4%s%s", cl->
s4.
RxRxRxRx, cl->
s4.
yr );
652 if ( cl->
s4.
iw[0] == 0 )
654 strcpy ( cl->
s4.
iw,
"/" );
660 if ( cl->
s4.
yfx[0] == 0 )
662 strcpy ( cl->
s4.
yfx,
"//" );
664 used += snprintf ( c + used, lmax - used,
" 5%s%s%s", cl->
s4.
iw, cl->
s4.
fxfxfx, cl->
s4.
yfx );
669 if ( cl->
s4.
Dts[0] == 0 )
671 strcpy ( cl->
s4.
Dts,
"//" );
673 if ( cl->
s4.
Dgr[0] == 0 )
675 strcpy ( cl->
s4.
Dgr,
"//" );
677 used += snprintf ( c + used, lmax - used,
" 6%s%s", cl->
s4.
Dts, cl->
s4.
Dgr );
682 if ( cl->
s4.
iw[0] == 0 )
684 strcpy ( cl->
s4.
iy,
"/" );
686 if ( cl->
s4.
GxGx[0] == 0 )
688 strcpy ( cl->
s4.
GxGx,
"///" );
690 if ( cl->
s4.
GnGn[0] == 0 )
692 strcpy ( cl->
s4.
GnGn,
"//" );
694 used += snprintf ( c + used, lmax - used,
" 7%s%s%s", cl->
s4.
iy, cl->
s4.
GxGx, cl->
s4.
GnGn );
726 if ( cl->
e.
YYYY[0] == 0 || cl->
e.
YYYY[0] ==
'0' || cl->
e.
MM[0] == 0 )
755 c += snprintf ( c, lmax - used,
" NIL" );
757 snprintf ( c, lmax - used - 1,
"=" );
Include header file for binary bufr2tac.
size_t print_wigos_id(char **wid, size_t lmax, struct metreport *m)
#define PRINT_BITMASK_WIGOS
Bit mask to member print_mask in struct metreport to print WIGOS Identifier.
size_t print_geo(char **geo, size_t lmax, struct metreport *m)
#define PRINT_BITMASK_GEO
Bit mask to member print_mask in struct metreport to print geographic position.
size_t print_climat_sec3(char **sec3, size_t lmax, struct climat_chunks *cl)
Prints the climat section 3.
size_t print_climat_sec1(char **sec1, size_t lmax, struct climat_chunks *cl)
Prints the climat section 1.
size_t print_climat_sec4(char **sec4, size_t lmax, struct climat_chunks *cl)
Prints the climat section 4.
size_t print_climat_sec2(char **sec2, size_t lmax, struct climat_chunks *cl)
Prints the climat section 2.
int print_climat_report(struct metreport *m)
prints a climat into a string
size_t print_climat_sec0(char **sec0, size_t lmax, struct climat_chunks *cl)
Prints the climat section 0 (header)
#define CLIMAT_SEC4
mask bit meaning section 4 of climat is solicited to or parsed with success
#define CLIMAT_SEC3
mask bit meaning section 3 of climat is solicited to or parsed with success
#define CLIMAT_SEC2
mask bit meaning section 2 of climat is solicited to or parsed with success
#define CLIMAT_SEC1
mask bit meaning section 1 of climat is solicited to or parsed with success
#define SYNOP_SEC1
mask bit meaning section 1 or synop is solicited to or parsed with success
#define SYNOP_SEC3
mask bit meaning section 3 or synop is solicited to or parsed with success
#define SYNOP_SEC2
mask bit meaning section 2 or synop is solicited to or parsed with success
contains all possible substrings from a synop report is parsed with success
all the information for a meteorological report in WMO text format from a BUFR file
char alphanum[REPORT_LENGTH]
struct climat_chunks climat