37 if ( Tx > 15 && Tx < 34.0 )
41 if ( Tx < 173.205 || Tx > 340.0 )
51 ic = ( int ) ( floor ( 10.0 * ( Tx - 273.15 ) + 0.45 ) );
54 sprintf ( target,
"1%03d", -ic );
58 sprintf ( target,
"0%03d", ic );
72 if ( T < 173.65 || T > 340.0 )
78 ic = ( int ) ( floor ( ( T - 273.15 ) + 0.5 ) );
81 sprintf ( target,
"1%02d", -ic );
85 sprintf ( target,
"%03d", ic );
99 if ( T < 150.0 || T > 340.0 )
105 ic = ( int ) ( floor ( ( T - 273.15 ) + 0.5 ) );
108 sprintf ( target,
"%02d", 50 - ic );
112 sprintf ( target,
"%02d", ic );
126 if ( T < 150.0 || T > 340.0 )
131 ic = ( int ) ( floor ( 100.0 * ( T - 273.15 ) + 0.5 ) );
136 sprintf ( target,
"%04d", ic );
153 sprintf ( target,
"///" );
157 ix = ( int ) ( 10.0 * ( T - 273.15 ) );
168 sprintf ( target,
"%03d", ix );
186 strcpy ( target,
"//" );
197 strcpy ( target,
"//" );
201 ix = ( int ) ( 10.0 * dpd );
205 ix = 50 + ( ix + 5 ) / 10;
207 sprintf ( target,
"%02d", ix );
235 if ( syn->
s1.
TTT[0] == 0 )
239 syn->
s1.
sn1[0] = aux[0];
240 strcpy ( syn->
s1.
TTT, aux + 1 );
244 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
256 syn->
s1.
sn2[0] = aux[0];
261 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
269 if ( syn->
s3.
TxTxTx[0] == 0 && ( s->
itval % ( 3 * 3600 ) ) == 0 )
273 syn->
s3.
snx[0] = aux[0];
278 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
290 syn->
s3.
snx[0] = aux[0];
295 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
304 if ( syn->
s3.
TnTnTn[0] == 0 && ( s->
itval % ( 3 * 3600 ) ) == 0 )
308 syn->
s3.
snn[0] = aux[0];
313 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
325 syn->
s3.
snn[0] = aux[0];
330 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
342 syn->
s2.
sw[0] = aux[0];
347 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
352 if ( strcmp (
"6", syn->
s0.
A1 ) == 0 ||
353 strcmp (
"3", syn->
s0.
A1 ) == 0 ||
354 strcmp (
"2", syn->
s0.
A1 ) == 0
359 strcpy ( syn->
s3.
jjj, aux );
363 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTT()",
"Unspected parse problem" );
365 else if ( strcmp (
"1", syn->
s0.
A1 ) == 0 )
382 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTT()",
"Unspected parse problem" );
387 if ( strcmp (
"2", syn->
s0.
A1 ) == 0 )
397 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTT()",
"Unspected parse problem" );
402 if ( strcmp (
"2", syn->
s0.
A1 ) == 0 )
408 else if ( syn->
s3.
E[0] )
415 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_snTT()",
"Unspected parse problem" );
420 if ( strcmp (
"1", syn->
s0.
A1 ) == 0 )
437 bufr2tac_set_error ( s, 1,
"syn_parse_x12()->kelvin_to_TT()",
"Unspected parse problem" );
439 else if ( strcmp (
"2", syn->
s0.
A1 ) == 0 ||
440 strcmp (
"3", syn->
s0.
A1 ) == 0 )
444 strcpy ( syn->
s3.
jjj, aux );
481 if ( b->
s1.
TTT[0] == 0 )
485 b->
s1.
sn1[0] = aux[0];
486 strcpy ( b->
s1.
TTT, aux + 1 );
490 bufr2tac_set_error ( s, 1,
"buoy_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
501 b->
s1.
sn2[0] = aux[0];
506 bufr2tac_set_error ( s, 1,
"buoy_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
550 strcpy ( c->
s1.
TTT, aux + 1 );
554 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
560 c->
s4.
sax[0] = aux[0];
561 strcpy ( c->
s4.
Tax, aux + 1 );
564 sprintf ( c->
s4.
yax,
"%02d", s->
day );
568 sprintf ( c->
s4.
yax,
"%02d", ( s->
day + 50 ) % 100 );
573 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
580 c->
s4.
san[0] = aux[0];
581 strcpy ( c->
s4.
Tan, aux + 1 );
584 sprintf ( c->
s4.
yan,
"%02d", s->
day );
588 sprintf ( c->
s4.
yan,
"%02d", ( s->
day + 50 ) % 100 );
593 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
598 if ( c->
s2.
TTT[0] == 0 )
603 strcpy ( c->
s2.
TTT, aux + 1 );
607 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
620 c->
s1.
sx[0] = aux[0];
625 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
634 c->
s2.
sx[0] = aux[0];
639 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
651 c->
s1.
sn[0] = aux[0];
656 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
665 c->
s2.
sn[0] = aux[0];
670 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
676 sprintf ( aux,
"%03d", (
int ) ( s->
val * 10.0 + 0.5 ) );
694 c->
s4.
sx[0] = aux[0];
695 strcpy ( c->
s4.
Txd, aux + 1 );
698 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
702 sprintf ( c->
s4.
yx,
"%02d", s->
day );
706 sprintf ( c->
s4.
yx,
"%02d", ( s->
day + 50 ) % 100 );
717 c->
s4.
sn[0] = aux[0];
718 strcpy ( c->
s4.
Tnd, aux + 1 );
721 bufr2tac_set_error ( s, 1,
"climat_parse_x12()->kelvin_to_snTTT()",
"Unspected parse problem" );
725 sprintf ( c->
s4.
yn,
"%02d", s->
day );
729 sprintf ( c->
s4.
yn,
"%02d", ( s->
day + 50 ) % 100 );
761 if ( s->
rep > 0 && s->
r->
n > 0 )
775 if ( s->
rep > 0 && s->
r->
n > 0 )
Include header file for binary bufr2tac.
int bufr2tac_set_error(struct bufr2tac_subset_state *s, int severity, char *origin, char *explanation)
int time_period_duration(struct bufr2tac_subset_state *s)
Get time period duration in seconds.
char * dewpoint_depression_to_DnDn(char *target, double T, double Td)
Set DnDn (dewpoint depression)
char * kelvin_to_TTTT(char *target, double T)
converts a kelvin temperature value into a TTTT string
char * kelvin_to_TTTa(char *target, double T)
Set temperature TTTa.
int climat_parse_x12(struct climat_chunks *c, struct bufr2tac_subset_state *s)
Parse a expanded descriptor with X = 12.
int syn_parse_x12(struct synop_chunks *syn, struct bufr2tac_subset_state *s)
Parse a expanded descriptor with X = 12.
int temp_parse_x12(struct temp_chunks *t, struct bufr2tac_subset_state *s)
Parse a expanded descriptor with X = 12.
int buoy_parse_x12(struct buoy_chunks *b, struct bufr2tac_subset_state *s)
Parse a expanded descriptor with X = 12.
char * kelvin_to_snTTT(char *target, double T)
converts a kelvin temperature value into a snTTT string
char * kelvin_to_TT(char *target, double T)
converts a kelvin temperature value into a TT string
char * kelvin_to_snTT(char *target, double T)
converts a kelvin temperature value into a snTT string
#define MISSING_REAL
The missing default value for real values.
#define DESCRIPTOR_VALUE_MISSING
Bit mask for a missing value in a struct bufr_atom_data.
#define BUOY_SEC1
mask bit meaning section 1 of buoy is solicited to or parsed with success
#define CLIMAT_SEC4
mask bit meaning section 4 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
stores information needed to parse a sequential list of expanded descriptors for a subset
struct bufr_atom_data * a1
struct bufr_atom_data * a
struct bufr_descriptor desc
contains all possible substrings from a synop report is parsed with success
contains all possible substrings from a synop report is parsed with success
contains all possible substrings from a synop report is parsed with success
Store the whole TEMP report.
struct temp_raw_point_data raw[TEMP_NMAX_POINTS *4]