bufr2synop 0.24.0
Functions
bufr2tac_print_temp.c File Reference

file with the code to print the results in case of temp reposrt More...

#include "bufr2tac.h"
Include dependency graph for bufr2tac_print_temp.c:

Go to the source code of this file.

Functions

int print_temp_raw_data (struct temp_raw_data *r)
 Prints for debug a struct temp_raw_data. More...
 
int print_temp_raw_wind_shear_data (struct temp_raw_wind_shear_data *w)
 Prints for debug a struct temp_raw_data. More...
 
size_t print_temp_a_sec1 (char **sec1, size_t lmax, struct temp_chunks *t)
 Prints the section 1 of part A of a TEMP report. More...
 
size_t print_temp_a_sec2 (char **sec2, size_t lmax, struct temp_chunks *t)
 Prints the section 2 of part A of a TEMP report. More...
 
size_t print_temp_a_sec3 (char **sec3, size_t lmax, struct temp_chunks *t)
 Prints the section 3 of part A of a TEMP report. More...
 
size_t print_temp_a_sec4 (char **sec4, size_t lmax, struct temp_chunks *t)
 Prints the section 4 of part A of a TEMP report. More...
 
size_t print_temp_a_sec7 (char **sec7, size_t lmax, struct temp_chunks *t)
 Prints the section 7 of part A of a TEMP report. More...
 
int print_temp_a (struct metreport *m)
 Prints the part A of a TEMP report into a string. More...
 
size_t print_temp_b_sec1 (char **sec1, size_t lmax, struct temp_chunks *t)
 Prints the section 1 of part B of a TEMP report. More...
 
size_t print_temp_b_sec5 (char **sec5, size_t lmax, struct temp_chunks *t)
 Prints the section 5 of part B of a TEMP report. More...
 
size_t print_temp_b_sec6 (char **sec6, size_t lmax, struct temp_chunks *t)
 Prints the section 6 of part B of a TEMP report. More...
 
size_t print_temp_b_sec7 (char **sec7, size_t lmax, struct temp_chunks *t)
 Prints the section 7 of part B of a TEMP report. More...
 
size_t print_temp_b_sec8 (char **sec8, size_t lmax, struct temp_chunks *t)
 Prints the section 8 of part B of a TEMP report. More...
 
int print_temp_b (struct metreport *m)
 Prints the part B of a TEMP report into a string. More...
 
size_t print_temp_c_sec1 (char **sec1, size_t lmax, struct temp_chunks *t)
 Prints the section 1 of part C of a TEMP report. More...
 
size_t print_temp_c_sec2 (char **sec2, size_t lmax, struct temp_chunks *t)
 Prints the section 2 of part C of a TEMP report. More...
 
size_t print_temp_c_sec3 (char **sec3, size_t lmax, struct temp_chunks *t)
 Prints the section 3 of part C of a TEMP report. More...
 
size_t print_temp_c_sec4 (char **sec4, size_t lmax, struct temp_chunks *t)
 Prints the section 4 of part C of a TEMP report. More...
 
size_t print_temp_c_sec7 (char **sec7, size_t lmax, struct temp_chunks *t)
 Prints the section 7 of part C of a TEMP report. More...
 
int print_temp_c (struct metreport *m)
 Prints the part C of a TEMP report into a string. More...
 
size_t print_temp_d_sec1 (char **sec1, size_t lmax, struct temp_chunks *t)
 Prints the section 1 of part D of a TEMP report. More...
 
size_t print_temp_d_sec5 (char **sec5, size_t lmax, struct temp_chunks *t)
 Prints the section 5 of part D of a TEMP report. More...
 
size_t print_temp_d_sec6 (char **sec6, size_t lmax, struct temp_chunks *t)
 Prints the section 6 of part D of a TEMP report. More...
 
size_t print_temp_d_sec7 (char **sec7, size_t lmax, struct temp_chunks *t)
 Prints the section 7 of part D of a TEMP report. More...
 
int print_temp_d (struct metreport *m)
 Prints the part D of a TEMP report into a string. More...
 
int print_temp_report (struct metreport *m)
 print the four parts of a decoded TEMP report from a BUFR file into strings More...
 

Detailed Description

file with the code to print the results in case of temp reposrt

Definition in file bufr2tac_print_temp.c.

Function Documentation

◆ print_temp_a()

int print_temp_a ( struct metreport m)

Prints the part A of a TEMP report into a string.

Parameters
mpointer to struct metreport where are both target and source

If OK returns 0, otherwise 1

Definition at line 346 of file bufr2tac_print_temp.c.

347{
348 char *c = &(m->alphanum[0]);
349 size_t used = 0;
350 size_t lmax = sizeof(m->alphanum);
351 struct temp_chunks *t = &m->temp;
352
353
354 // Needs time extension
355 if ( t->a.e.YYYY[0] == 0 || t->a.e.YYYY[0] == '0')
356 {
357 return 1;
358 }
359
361 {
362 used += print_wigos_id ( &c, lmax, m );
363 }
364
365 if ( m->print_mask & PRINT_BITMASK_GEO )
366 {
367 used += print_geo ( &c, lmax, m );
368 }
369
370 used += print_temp_a_sec1 ( &c, lmax - used, t );
371 used += print_temp_a_sec2 ( &c, lmax - used, t );
372 used += print_temp_a_sec3 ( &c, lmax - used, t );
373 used += print_temp_a_sec4 ( &c, lmax - used, t );
374 used += print_temp_a_sec7 ( &c, lmax - used, t );
375 used += snprintf ( c, lmax - used, "=" );
376 return 0;
377}
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.
Definition: bufr2tac.h:208
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.
Definition: bufr2tac.h:214
size_t print_temp_a_sec2(char **sec2, size_t lmax, struct temp_chunks *t)
Prints the section 2 of part A of a TEMP report.
size_t print_temp_a_sec4(char **sec4, size_t lmax, struct temp_chunks *t)
Prints the section 4 of part A of a TEMP report.
size_t print_temp_a_sec1(char **sec1, size_t lmax, struct temp_chunks *t)
Prints the section 1 of part A of a TEMP report.
size_t print_temp_a_sec3(char **sec3, size_t lmax, struct temp_chunks *t)
Prints the section 3 of part A of a TEMP report.
size_t print_temp_a_sec7(char **sec7, size_t lmax, struct temp_chunks *t)
Prints the section 7 of part A of a TEMP report.
char alphanum[REPORT_LENGTH]
Definition: bufr2tac.h:321
struct temp_chunks temp
Definition: bufr2tac.h:318
int print_mask
Definition: bufr2tac.h:312
Store the whole TEMP report.
Definition: mettemp.h:511
struct temp_c c
Definition: mettemp.h:517
struct met_datetime t
Definition: mettemp.h:513

References metreport::alphanum, temp_chunks::c, PRINT_BITMASK_GEO, PRINT_BITMASK_WIGOS, print_geo(), metreport::print_mask, print_temp_a_sec1(), print_temp_a_sec2(), print_temp_a_sec3(), print_temp_a_sec4(), print_temp_a_sec7(), print_wigos_id(), temp_chunks::t, and metreport::temp.

Referenced by print_temp_report().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_temp_a_sec1()

size_t print_temp_a_sec1 ( char **  sec1,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 1 of part A of a TEMP report.

Parameters
sec1the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec1

Definition at line 145 of file bufr2tac_print_temp.c.

146{
147 size_t used = 0;
148 char *c = *sec1;
149
150 used += snprintf ( c + used, lmax - used, "%s", t->t.datime );
151
152 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s1.MiMi, t->a.s1.MjMj );
153
154 if ( t->a.s1.D_D[0] && t->a.s1.II[0] == 0 )
155 {
156 used += snprintf ( c + used, lmax - used, " %s", t->a.s1.D_D );
157 }
158
159 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s1.YYGG, t->a.s1.id );
160
161 // print IIiii
162 if ( t->a.s1.II[0] )
163 {
164 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s1.II, t->a.s1.iii );
165 }
166 else
167 {
168 if ( t->a.s1.LaLaLa[0] )
169 {
170 used += snprintf ( c + used, lmax - used, " 99%s", t->a.s1.LaLaLa );
171 }
172 else
173 {
174 used += snprintf ( c + used, lmax - used, " 99///" );
175 }
176
177 if ( t->a.s1.Qc[0] && t->a.s1.LoLoLoLo[0] )
178 {
179 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s1.Qc, t->a.s1.LoLoLoLo );
180 }
181 else
182 {
183 used += snprintf ( c + used, lmax - used, " /////" );
184 }
185
186 if ( t->a.s1.MMM[0] && t->a.s1.Ula[0] && t->a.s1.Ulo[0] )
187 {
188 used += snprintf ( c + used, lmax - used, " %s%s%s", t->a.s1.MMM, t->a.s1.Ula, t->a.s1.Ulo );
189 }
190
191 if ( t->a.s1.h0h0h0h0[0] )
192 {
193 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s1.h0h0h0h0, t->a.s1.im );
194 }
195 }
196
197 *sec1 = c + used;
198 return used;
199}
char datime[16]
Definition: metcommon.h:63
struct temp_acd_sec1 s1
Definition: mettemp.h:455
char MiMi[4]
Definition: mettemp.h:310
char h0h0h0h0[6]
Definition: mettemp.h:327
char YYGG[8]
Definition: mettemp.h:315
char LoLoLoLo[6]
Definition: mettemp.h:323
char MMM[4]
Definition: mettemp.h:324
char II[4]
Definition: mettemp.h:317
char LaLaLa[4]
Definition: mettemp.h:321
char D_D[10]
Definition: mettemp.h:314
char id[2]
Definition: mettemp.h:316
char Ulo[2]
Definition: mettemp.h:326
char MjMj[4]
Definition: mettemp.h:311
char im[2]
Definition: mettemp.h:328
char Qc[2]
Definition: mettemp.h:322
char Ula[2]
Definition: mettemp.h:325
char iii[4]
Definition: mettemp.h:318
struct temp_a a
Definition: mettemp.h:515

References temp_chunks::a, temp_acd_sec1::D_D, met_datetime::datime, temp_acd_sec1::h0h0h0h0, temp_acd_sec1::id, temp_acd_sec1::II, temp_acd_sec1::iii, temp_acd_sec1::im, temp_acd_sec1::LaLaLa, temp_acd_sec1::LoLoLoLo, temp_acd_sec1::MiMi, temp_acd_sec1::MjMj, temp_acd_sec1::MMM, temp_acd_sec1::Qc, temp_a::s1, temp_chunks::t, temp_acd_sec1::Ula, temp_acd_sec1::Ulo, and temp_acd_sec1::YYGG.

Referenced by print_temp_a().

Here is the caller graph for this function:

◆ print_temp_a_sec2()

size_t print_temp_a_sec2 ( char **  sec2,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 2 of part A of a TEMP report.

Parameters
sec2the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec2

Definition at line 211 of file bufr2tac_print_temp.c.

212{
213 size_t i;
214 size_t used = 0;
215 char *c = *sec2;
216
217 //Surface level
218 used += snprintf ( c + used, lmax - used, " 99%s", t->a.s2.lev0.PnPnPn );
219 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s2.lev0.TnTnTan, t->a.s2.lev0.DnDn );
220 used += snprintf ( c + used, lmax - used, " %s", t->a.s2.lev0.dndnfnfnfn );
221
222 for ( i = 0; i < t->a.s2.n ; i++ )
223 {
224 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s2.std[i].PnPn, t->a.s2.std[i].hnhnhn );
225 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s2.std[i].TnTnTan, t->a.s2.std[i].DnDn );
226 used += snprintf ( c + used, lmax - used, " %s", t->a.s2.std[i].dndnfnfnfn );
227 }
228
229 *sec2 = c + used;
230 return used;
231}
struct temp_main_level_data lev0
Definition: mettemp.h:365
size_t n
Definition: mettemp.h:364
struct temp_std_level_data std[TEMP_NSTAND_MAX]
Definition: mettemp.h:366
struct temp_a_sec2 s2
Definition: mettemp.h:456
char dndnfnfnfn[8]
Definition: mettemp.h:252
char dndnfnfnfn[8]
Definition: mettemp.h:265

References temp_chunks::a, temp_main_level_data::DnDn, temp_std_level_data::DnDn, temp_main_level_data::dndnfnfnfn, temp_std_level_data::dndnfnfnfn, temp_std_level_data::hnhnhn, temp_a_sec2::lev0, temp_a_sec2::n, temp_std_level_data::PnPn, temp_main_level_data::PnPnPn, temp_a::s2, temp_a_sec2::std, temp_main_level_data::TnTnTan, and temp_std_level_data::TnTnTan.

Referenced by print_temp_a().

Here is the caller graph for this function:

◆ print_temp_a_sec3()

size_t print_temp_a_sec3 ( char **  sec3,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 3 of part A of a TEMP report.

Parameters
sec3the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec3

Definition at line 242 of file bufr2tac_print_temp.c.

243{
244 size_t i;
245 size_t used = 0;
246 char *c = *sec3;
247
248 if ( t->a.s3.n == 0 )
249 {
250 used += snprintf ( c + used, lmax - used, " 88999" );
251 }
252 else
253 {
254 for ( i = 0; i < t->a.s3.n ; i++ )
255 {
256 used += snprintf ( c + used, lmax - used, " 88%s", t->a.s3.trop[i].PnPnPn );
257 used += snprintf ( c + used, lmax - used, " %s%s", t->a.s3.trop[i].TnTnTan, t->a.s3.trop[i].DnDn );
258 used += snprintf ( c + used, lmax - used, " %s", t->a.s3.trop[i].dndnfnfnfn );
259 }
260 }
261
262 *sec3 = c + used;
263 return used;
264
265}
struct temp_ac_sec3 s3
Definition: mettemp.h:457
struct temp_main_level_data trop[TEMP_NTROP_MAX]
Definition: mettemp.h:386
size_t n
Definition: mettemp.h:385

References temp_chunks::a, temp_main_level_data::DnDn, temp_main_level_data::dndnfnfnfn, temp_ac_sec3::n, temp_main_level_data::PnPnPn, temp_a::s3, temp_main_level_data::TnTnTan, and temp_ac_sec3::trop.

Referenced by print_temp_a().

Here is the caller graph for this function:

◆ print_temp_a_sec4()

size_t print_temp_a_sec4 ( char **  sec4,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 4 of part A of a TEMP report.

Parameters
sec4the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec1

Definition at line 276 of file bufr2tac_print_temp.c.

277{
278 size_t i;
279 size_t used = 0;
280 char *c = *sec4;
281
282 if ( t->a.s4.n == 0 )
283 {
284 used += snprintf ( c + used, lmax - used, " 77999" );
285 }
286 else
287 {
288 for ( i = 0; i < t->a.s4.n ; i++ )
289 {
290 if ( t->a.s4.windx[i].no_last_wind )
291 {
292 used += snprintf ( c + used, lmax - used, " 77%s", t->a.s4.windx[i].PmPmPm );
293 }
294 else
295 {
296 used += snprintf ( c + used, lmax - used, " 66%s", t->a.s4.windx[i].PmPmPm );
297 }
298 used += snprintf ( c + used, lmax - used, " %s", t->a.s4.windx[i].dmdmfmfmfm );
299
300 if ( t->a.s4.windx[i].vbvb[0] && t->a.s4.windx[i].vava[0] )
301 {
302 used += snprintf ( c + used, lmax - used, " 4%s%s", t->a.s4.windx[i].vbvb, t->a.s4.windx[i].vava );
303 }
304 }
305 }
306
307 *sec4 = c + used;
308 return used;
309
310}
struct temp_ac_sec4 s4
Definition: mettemp.h:458
struct temp_max_wind_data windx[TEMP_NMAXWIND_MAX]
Definition: mettemp.h:396
size_t n
Definition: mettemp.h:395
char PmPmPm[4]
Definition: mettemp.h:275
char dmdmfmfmfm[8]
Definition: mettemp.h:276

References temp_chunks::a, temp_max_wind_data::dmdmfmfmfm, temp_ac_sec4::n, temp_max_wind_data::no_last_wind, temp_max_wind_data::PmPmPm, temp_a::s4, temp_max_wind_data::vava, temp_max_wind_data::vbvb, and temp_ac_sec4::windx.

Referenced by print_temp_a().

Here is the caller graph for this function:

◆ print_temp_a_sec7()

size_t print_temp_a_sec7 ( char **  sec7,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 7 of part A of a TEMP report.

Parameters
sec7the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec7

Definition at line 321 of file bufr2tac_print_temp.c.

322{
323 size_t used = 0;
324 char *c = *sec7;
325
326 used += snprintf ( c + used, lmax - used, " 31313" );
327 used += snprintf ( c + used, lmax - used, " %s%s%s", t->a.s7.sr, t->a.s7.rara, t->a.s7.sasa );
328 used += snprintf ( c + used, lmax - used, " 8%s%s", t->a.s7.GG, t->a.s7.gg );
329
330 if ( t->a.s7.TwTwTw[0] )
331 {
332 used += snprintf ( c + used, lmax - used, " 9%s%s", t->a.s7.sn, t->a.s7.TwTwTw );
333 }
334
335 *sec7 = c + used;
336 return used;
337}
struct temp_sec7 s7
Definition: mettemp.h:459
char rara[4]
Definition: mettemp.h:406
char sn[2]
Definition: mettemp.h:410
char TwTwTw[4]
Definition: mettemp.h:411
char sr[2]
Definition: mettemp.h:405
char sasa[4]
Definition: mettemp.h:407
char GG[4]
Definition: mettemp.h:408
char gg[4]
Definition: mettemp.h:409

References temp_chunks::a, temp_sec7::GG, temp_sec7::gg, temp_sec7::rara, temp_a::s7, temp_sec7::sasa, temp_sec7::sn, temp_sec7::sr, and temp_sec7::TwTwTw.

Referenced by print_temp_a().

Here is the caller graph for this function:

◆ print_temp_b()

int print_temp_b ( struct metreport m)

Prints the part B of a TEMP report into a string.

Parameters
mpointer to struct metreport where are both target and source

If OK returns 0, otherwise 1

Definition at line 600 of file bufr2tac_print_temp.c.

601{
602 char *c = &(m->alphanum2[0]);
603 size_t used = 0;
604 size_t lmax = sizeof(m->alphanum);
605 struct temp_chunks *t = &m->temp;
606
607
608 // Needs time extension
609 if ( t->b.e.YYYY[0] == 0 || t->b.e.YYYY[0] == '0')
610 {
611 return 1;
612 }
613
615 {
616 used += print_wigos_id ( &c, lmax, m );
617 }
618
619 if ( m->print_mask & PRINT_BITMASK_GEO )
620 {
621 used += print_geo ( &c, lmax, m );
622 }
623
624 used += print_temp_b_sec1 ( &c, lmax - used, t );
625 used += print_temp_b_sec5 ( &c, lmax - used, t );
626 used += print_temp_b_sec6 ( &c, lmax - used, t );
627 used += print_temp_b_sec7 ( &c, lmax - used, t );
628 used += print_temp_b_sec8 ( &c, lmax - used, t );
629 used += snprintf ( c, lmax - used, "=" );
630 return 0;
631}
size_t print_temp_b_sec5(char **sec5, size_t lmax, struct temp_chunks *t)
Prints the section 5 of part B of a TEMP report.
size_t print_temp_b_sec6(char **sec6, size_t lmax, struct temp_chunks *t)
Prints the section 6 of part B of a TEMP report.
size_t print_temp_b_sec8(char **sec8, size_t lmax, struct temp_chunks *t)
Prints the section 8 of part B of a TEMP report.
size_t print_temp_b_sec7(char **sec7, size_t lmax, struct temp_chunks *t)
Prints the section 7 of part B of a TEMP report.
size_t print_temp_b_sec1(char **sec1, size_t lmax, struct temp_chunks *t)
Prints the section 1 of part B of a TEMP report.
char alphanum2[REPORT_LENGTH]
Definition: bufr2tac.h:323

References metreport::alphanum, metreport::alphanum2, temp_chunks::c, PRINT_BITMASK_GEO, PRINT_BITMASK_WIGOS, print_geo(), metreport::print_mask, print_temp_b_sec1(), print_temp_b_sec5(), print_temp_b_sec6(), print_temp_b_sec7(), print_temp_b_sec8(), print_wigos_id(), temp_chunks::t, and metreport::temp.

Referenced by print_temp_report().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_temp_b_sec1()

size_t print_temp_b_sec1 ( char **  sec1,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 1 of part B of a TEMP report.

Parameters
sec1the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec1

Definition at line 388 of file bufr2tac_print_temp.c.

389{
390 size_t used = 0;
391 char *c = *sec1;
392
393 used += snprintf ( c + used, lmax - used, "%s", t->t.datime );
394
395 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s1.MiMi, t->b.s1.MjMj );
396
397 if ( t->b.s1.D_D[0] && t->a.s1.II[0] == 0 )
398 {
399 used += snprintf ( c + used, lmax - used, " %s", t->b.s1.D_D );
400 }
401
402 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s1.YYGG, t->b.s1.a4 );
403
404 // print IIiii
405 if ( t->b.s1.II[0] )
406 {
407 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s1.II, t->b.s1.iii );
408 }
409 else
410 {
411 if ( t->b.s1.LaLaLa[0] )
412 {
413 used += snprintf ( c + used, lmax - used, " 99%s", t->b.s1.LaLaLa );
414 }
415 else
416 {
417 used += snprintf ( c + used, lmax - used, " 99///" );
418 }
419
420 if ( t->b.s1.Qc[0] && t->b.s1.LoLoLoLo[0] )
421 {
422 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s1.Qc, t->b.s1.LoLoLoLo );
423 }
424 else
425 {
426 used += snprintf ( c + used, lmax - used, " /////" );
427 }
428
429 if ( t->b.s1.MMM[0] && t->b.s1.Ula[0] && t->b.s1.Ulo[0] )
430 {
431 used += snprintf ( c + used, lmax - used, " %s%s%s", t->b.s1.MMM, t->b.s1.Ula, t->b.s1.Ulo );
432 }
433
434 if ( t->b.s1.h0h0h0h0[0] )
435 {
436 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s1.h0h0h0h0, t->b.s1.im );
437 }
438 }
439
440 *sec1= c + used;
441 return used;
442}
char Qc[2]
Definition: mettemp.h:349
char MMM[4]
Definition: mettemp.h:351
char II[4]
Definition: mettemp.h:344
char D_D[10]
Definition: mettemp.h:341
char Ulo[2]
Definition: mettemp.h:353
char h0h0h0h0[6]
Definition: mettemp.h:354
char im[2]
Definition: mettemp.h:355
char iii[4]
Definition: mettemp.h:345
char LaLaLa[4]
Definition: mettemp.h:348
char a4[2]
Definition: mettemp.h:343
char YYGG[8]
Definition: mettemp.h:342
char Ula[2]
Definition: mettemp.h:352
char MjMj[4]
Definition: mettemp.h:338
char LoLoLoLo[6]
Definition: mettemp.h:350
char MiMi[4]
Definition: mettemp.h:337
struct temp_b_sec1 s1
Definition: mettemp.h:470
struct temp_b b
Definition: mettemp.h:516

References temp_chunks::c, met_datetime::t, and temp_chunks::t.

Referenced by print_temp_b().

Here is the caller graph for this function:

◆ print_temp_b_sec5()

size_t print_temp_b_sec5 ( char **  sec5,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 5 of part B of a TEMP report.

Parameters
sec5the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec5

Definition at line 453 of file bufr2tac_print_temp.c.

454{
455 size_t used = 0;
456 size_t i;
457 char *c = *sec5;
458
459 for ( i = 0; i < t->b.s5.n && i < TEMP_NMAX_POINTS ; i++ )
460 {
461 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s5.th[i].nini, t->b.s5.th[i].PnPnPn );
462 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s5.th[i].TnTnTan, t->b.s5.th[i].DnDn );
463 }
464
465 *sec5 = c + used;
466 return used;
467}
#define TEMP_NMAX_POINTS
maximum number of significant points
Definition: mettemp.h:138
struct temp_bd_sec5 s5
Definition: mettemp.h:471
size_t n
Definition: mettemp.h:420
struct temp_th_point th[TEMP_NMAX_POINTS]
Definition: mettemp.h:421
char nini[4]
Definition: mettemp.h:287
char TnTnTan[4]
Definition: mettemp.h:289
char PnPnPn[4]
Definition: mettemp.h:288
char DnDn[4]
Definition: mettemp.h:290

References temp_chunks::c, temp_chunks::t, and TEMP_NMAX_POINTS.

Referenced by print_temp_b().

Here is the caller graph for this function:

◆ print_temp_b_sec6()

size_t print_temp_b_sec6 ( char **  sec6,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 6 of part B of a TEMP report.

Parameters
sec6the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec6

Definition at line 478 of file bufr2tac_print_temp.c.

479{
480 size_t i;
481 size_t used = 0;
482 char *c = *sec6;
483
484 used += snprintf ( c + used, lmax - used, " 21212" );
485
486 for ( i = 0; i < t->b.s6.n && i < TEMP_NMAX_POINTS ; i++ )
487 {
488 used += snprintf ( c + used, lmax - used, " %s%s", t->b.s6.wd[i].nini, t->b.s6.wd[i].PnPnPn );
489 used += snprintf ( c + used, lmax - used, " %s", t->b.s6.wd[i].dndnfnfnfn );
490 }
491
492 *sec6 = c + used;
493 return used;
494}
struct temp_bd_sec6 s6
Definition: mettemp.h:472
size_t n
Definition: mettemp.h:430
struct temp_wind_point wd[TEMP_NMAX_POINTS]
Definition: mettemp.h:431
char PnPnPn[4]
Definition: mettemp.h:300
char dndnfnfnfn[8]
Definition: mettemp.h:301
char nini[4]
Definition: mettemp.h:299

References temp_chunks::c, temp_chunks::t, and TEMP_NMAX_POINTS.

Referenced by print_temp_b().

Here is the caller graph for this function:

◆ print_temp_b_sec7()

size_t print_temp_b_sec7 ( char **  sec7,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 7 of part B of a TEMP report.

Parameters
sec7the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec7

Definition at line 505 of file bufr2tac_print_temp.c.

506{
507 size_t used = 0;
508 char *c = *sec7;
509
510 used += snprintf ( c + used, lmax - used, " 31313" );
511 used += snprintf ( c + used, lmax - used, " %s%s%s", t->b.s7.sr, t->b.s7.rara, t->b.s7.sasa );
512 used += snprintf ( c + used, lmax - used, " 8%s%s", t->b.s7.GG, t->b.s7.gg );
513
514 if ( t->b.s7.TwTwTw[0] )
515 {
516 used += snprintf ( c + used, lmax - used, " 9%s%s", t->b.s7.sn, t->b.s7.TwTwTw );
517 }
518
519 *sec7 = c + used;
520 return used;
521}
struct temp_sec7 s7
Definition: mettemp.h:473

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_b().

Here is the caller graph for this function:

◆ print_temp_b_sec8()

size_t print_temp_b_sec8 ( char **  sec8,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 8 of part B of a TEMP report.

Parameters
sec8the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec8

Definition at line 532 of file bufr2tac_print_temp.c.

533{
534 size_t used = 0;
535 char *c = *sec8;
536
537 if ( t->b.s8.h[0] )
538 {
539 used += snprintf ( c + used, lmax - used, " 41414 " );
540 if ( t->b.s8.Nh[0] )
541 {
542 used += snprintf ( c + used, lmax - used, "%s", t->b.s8.Nh );
543 }
544 else
545 {
546 used += snprintf ( c + used, lmax - used, "/" );
547 }
548
549 if ( t->b.s8.Cl[0] )
550 {
551 used += snprintf ( c + used, lmax - used, "%s", t->b.s8.Cl );
552 }
553 else
554 {
555 used += snprintf ( c + used, lmax - used, "/" );
556 }
557
558 if ( t->b.s8.h[0] )
559 {
560 used += snprintf ( c + used, lmax - used, "%s", t->b.s8.h );
561 }
562 else
563 {
564 used += snprintf ( c + used, lmax - used, "/" );
565 }
566
567 if ( t->b.s8.Cm[0] )
568 {
569 used += snprintf ( c + used, lmax - used, "%s", t->b.s8.Cm );
570 }
571 else
572 {
573 used += snprintf ( c + used, lmax - used, "/" );
574 }
575
576 if ( t->b.s8.Ch[0] )
577 {
578 used += snprintf ( c + used, lmax - used, "%s", t->b.s8.Ch );
579 }
580 else
581 {
582 used += snprintf ( c + used, lmax - used, "/" );
583 }
584
585 //used += snprintf ( c + used, lmax - used, " %s%s%s%s%s", t->b.s8.Nh, t->b.s8.Cl, t->b.s8.h, t->b.s8.Cm, t->b.s8.Ch );
586 }
587
588 *sec8 = c + used;
589 return used;
590}
char Cm[2]
Definition: mettemp.h:443
char h[2]
Definition: mettemp.h:442
char Ch[2]
Definition: mettemp.h:444
char Cl[2]
Definition: mettemp.h:441
char Nh[2]
Definition: mettemp.h:440
struct temp_b_sec8 s8
Definition: mettemp.h:474

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_b().

Here is the caller graph for this function:

◆ print_temp_c()

int print_temp_c ( struct metreport m)

Prints the part C of a TEMP report into a string.

Parameters
mpointer to struct metreport where are both target and source

If OK returns 0, otherwise 1

Definition at line 838 of file bufr2tac_print_temp.c.

839{
840 char *c = &(m->alphanum3[0]);
841 size_t used = 0;
842 size_t lmax = sizeof(m->alphanum);
843 struct temp_chunks *t = &m->temp;
844
845
846 // Needs time extension
847 if ( t->c.e.YYYY[0] == 0 || t->c.e.YYYY[0] == '0')
848 {
849 return 1;
850 }
851
853 {
854 used += print_wigos_id ( &c, lmax, m );
855 }
856
857 if ( m->print_mask & PRINT_BITMASK_GEO )
858 {
859 used += print_geo ( &c, lmax, m );
860 }
861
862 used += print_temp_c_sec1 ( &c, lmax - used, t );
863 used += print_temp_c_sec2 ( &c, lmax - used, t );
864 used += print_temp_c_sec3 ( &c, lmax - used, t );
865 used += print_temp_c_sec4 ( &c, lmax - used, t );
866 used += print_temp_c_sec7 ( &c, lmax - used, t );
867 used += snprintf ( c, lmax - used, "=" );
868 return 0;
869}
size_t print_temp_c_sec2(char **sec2, size_t lmax, struct temp_chunks *t)
Prints the section 2 of part C of a TEMP report.
size_t print_temp_c_sec4(char **sec4, size_t lmax, struct temp_chunks *t)
Prints the section 4 of part C of a TEMP report.
size_t print_temp_c_sec7(char **sec7, size_t lmax, struct temp_chunks *t)
Prints the section 7 of part C of a TEMP report.
size_t print_temp_c_sec1(char **sec1, size_t lmax, struct temp_chunks *t)
Prints the section 1 of part C of a TEMP report.
size_t print_temp_c_sec3(char **sec3, size_t lmax, struct temp_chunks *t)
Prints the section 3 of part C of a TEMP report.
char alphanum3[REPORT_LENGTH]
Definition: bufr2tac.h:325

References metreport::alphanum, metreport::alphanum3, temp_chunks::c, PRINT_BITMASK_GEO, PRINT_BITMASK_WIGOS, print_geo(), metreport::print_mask, print_temp_c_sec1(), print_temp_c_sec2(), print_temp_c_sec3(), print_temp_c_sec4(), print_temp_c_sec7(), print_wigos_id(), temp_chunks::t, and metreport::temp.

Referenced by print_temp_report().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_temp_c_sec1()

size_t print_temp_c_sec1 ( char **  sec1,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 1 of part C of a TEMP report.

Parameters
sec1the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec1

Definition at line 643 of file bufr2tac_print_temp.c.

644{
645 size_t used = 0;
646 char *c = *sec1;
647
648 used += snprintf ( c + used, lmax - used, "%s", t->t.datime );
649
650 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s1.MiMi, t->c.s1.MjMj );
651
652 if ( t->c.s1.D_D[0] && t->a.s1.II[0] == 0 )
653 {
654 used += snprintf ( c + used, lmax - used, " %s", t->c.s1.D_D );
655 }
656
657 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s1.YYGG, t->c.s1.id );
658
659 // print IIiii
660 if ( t->c.s1.II[0] )
661 {
662 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s1.II, t->c.s1.iii );
663 }
664 else
665 {
666 if ( t->c.s1.LaLaLa[0] )
667 {
668 used += snprintf ( c + used, lmax - used, " 99%s", t->c.s1.LaLaLa );
669 }
670 else
671 {
672 used += snprintf ( c + used, lmax - used, " 99///" );
673 }
674
675 if ( t->c.s1.Qc[0] && t->c.s1.LoLoLoLo[0] )
676 {
677 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s1.Qc, t->c.s1.LoLoLoLo );
678 }
679 else
680 {
681 used += snprintf ( c + used, lmax - used, " /////" );
682 }
683
684 if ( t->c.s1.MMM[0] && t->c.s1.Ula[0] && t->c.s1.Ulo[0] )
685 {
686 used += snprintf ( c + used, lmax - used, " %s%s%s", t->c.s1.MMM, t->c.s1.Ula, t->c.s1.Ulo );
687 }
688
689 if ( t->c.s1.h0h0h0h0[0] )
690 {
691 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s1.h0h0h0h0, t->c.s1.im );
692 }
693 }
694
695 *sec1 = c + used;
696 return used;
697}
struct temp_acd_sec1 s1
Definition: mettemp.h:485

References temp_chunks::c, met_datetime::t, and temp_chunks::t.

Referenced by print_temp_c().

Here is the caller graph for this function:

◆ print_temp_c_sec2()

size_t print_temp_c_sec2 ( char **  sec2,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 2 of part C of a TEMP report.

Parameters
sec2the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec2

Definition at line 708 of file bufr2tac_print_temp.c.

709{
710 size_t i;
711 size_t used = 0;
712 char *c = *sec2;
713
714 for ( i = 0; i < t->c.s2.n ; i++ )
715 {
716 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s2.std[i].PnPn, t->c.s2.std[i].hnhnhn );
717 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s2.std[i].TnTnTan, t->c.s2.std[i].DnDn );
718 used += snprintf ( c + used, lmax - used, " %s", t->c.s2.std[i].dndnfnfnfn );
719 }
720
721 *sec2 = c + used;
722 return used;
723
724}
size_t n
Definition: mettemp.h:375
struct temp_std_level_data std[TEMP_NSTAND_MAX]
Definition: mettemp.h:376
struct temp_c_sec2 s2
Definition: mettemp.h:486

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_c().

Here is the caller graph for this function:

◆ print_temp_c_sec3()

size_t print_temp_c_sec3 ( char **  sec3,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 3 of part C of a TEMP report.

Parameters
sec3the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec3

Definition at line 735 of file bufr2tac_print_temp.c.

736{
737 size_t i;
738 size_t used = 0;
739 char *c = *sec3;
740
741 if ( t->c.s3.n == 0 )
742 {
743 used += snprintf ( c + used, lmax - used, " 88999" );
744 }
745 else
746 {
747 for ( i = 0; i < t->c.s3.n ; i++ )
748 {
749 used += snprintf ( c + used, lmax - used, " 88%s", t->c.s3.trop[i].PnPnPn );
750 used += snprintf ( c + used, lmax - used, " %s%s", t->c.s3.trop[i].TnTnTan, t->c.s3.trop[i].DnDn );
751 used += snprintf ( c + used, lmax - used, " %s", t->c.s3.trop[i].dndnfnfnfn );
752 }
753 }
754
755 *sec3 = c + used;
756 return used;
757
758}
struct temp_ac_sec3 s3
Definition: mettemp.h:487

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_c().

Here is the caller graph for this function:

◆ print_temp_c_sec4()

size_t print_temp_c_sec4 ( char **  sec4,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 4 of part C of a TEMP report.

Parameters
sec4the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec4

Definition at line 769 of file bufr2tac_print_temp.c.

770{
771 size_t i;
772 size_t used = 0;
773 char *c = *sec4;
774
775 if ( t->c.s4.n == 0 )
776 {
777 used += snprintf ( c + used, lmax - used, " 77999" );
778 }
779 else
780 {
781 for ( i = 0; i < t->c.s4.n ; i++ )
782 {
783 if ( t->c.s4.windx[i].no_last_wind )
784 {
785 used += snprintf ( c + used, lmax - used, " 77%s", t->c.s4.windx[i].PmPmPm );
786 }
787 else
788 {
789 used += snprintf ( c + used, lmax - used, " 66%s", t->c.s4.windx[i].PmPmPm );
790 }
791 used += snprintf ( c + used, lmax - used, " %s", t->c.s4.windx[i].dmdmfmfmfm );
792 if ( t->c.s4.windx[i].vbvb[0] && t->c.s4.windx[i].vava[0] )
793 {
794 used += snprintf ( c + used, lmax - used, " 4%s%s", t->c.s4.windx[i].vbvb, t->c.s4.windx[i].vava );
795 }
796 }
797 }
798
799 *sec4 = c + used;
800 return used;
801
802}
struct temp_ac_sec4 s4
Definition: mettemp.h:488

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_c().

Here is the caller graph for this function:

◆ print_temp_c_sec7()

size_t print_temp_c_sec7 ( char **  sec7,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 7 of part C of a TEMP report.

Parameters
sec7the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec7

Definition at line 813 of file bufr2tac_print_temp.c.

814{
815 size_t used = 0;
816 char *c = *sec7;
817
818 used += snprintf ( c + used, lmax - used, " 31313" );
819 used += snprintf ( c + used, lmax - used, " %s%s%s", t->c.s7.sr, t->c.s7.rara, t->c.s7.sasa );
820 used += snprintf ( c + used, lmax - used, " 8%s%s", t->c.s7.GG, t->c.s7.gg );
821
822 if ( t->c.s7.TwTwTw[0] )
823 {
824 used += snprintf ( c + used, lmax - used, " 9%s%s", t->c.s7.sn, t->c.s7.TwTwTw );
825 }
826
827 *sec7 = c + used;
828 return used;
829}
struct temp_sec7 s7
Definition: mettemp.h:489

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_c().

Here is the caller graph for this function:

◆ print_temp_d()

int print_temp_d ( struct metreport m)

Prints the part D of a TEMP report into a string.

Parameters
mpointer to struct metreport where are both target and source

If OK returns 0, otherwise 1

Definition at line 1022 of file bufr2tac_print_temp.c.

1023{
1024 char *c = &(m->alphanum4[0]);
1025 size_t used = 0;
1026 size_t lmax = sizeof(m->alphanum);
1027 struct temp_chunks *t = &m->temp;
1028
1029 // Needs time extension
1030 if ( t->d.e.YYYY[0] == 0 || t->d.e.YYYY[0] == '0')
1031 {
1032 return 1;
1033 }
1034
1036 {
1037 used += print_wigos_id ( &c, lmax, m );
1038 }
1039
1040 if ( m->print_mask & PRINT_BITMASK_GEO )
1041 {
1042 used += print_geo ( &c, lmax, m );
1043 }
1044
1045 used += print_temp_d_sec1 ( &c, lmax - used, t );
1046 used += print_temp_d_sec5 ( &c, lmax - used, t );
1047 used += print_temp_d_sec6 ( &c, lmax - used, t );
1048 used += print_temp_d_sec7 ( &c, lmax - used, t );
1049 used += snprintf ( c, lmax - used, "=" );
1050 return 0;
1051}
size_t print_temp_d_sec5(char **sec5, size_t lmax, struct temp_chunks *t)
Prints the section 5 of part D of a TEMP report.
size_t print_temp_d_sec7(char **sec7, size_t lmax, struct temp_chunks *t)
Prints the section 7 of part D of a TEMP report.
size_t print_temp_d_sec6(char **sec6, size_t lmax, struct temp_chunks *t)
Prints the section 6 of part D of a TEMP report.
size_t print_temp_d_sec1(char **sec1, size_t lmax, struct temp_chunks *t)
Prints the section 1 of part D of a TEMP report.
char alphanum4[REPORT_LENGTH]
Definition: bufr2tac.h:327

References metreport::alphanum, metreport::alphanum4, temp_chunks::c, PRINT_BITMASK_GEO, PRINT_BITMASK_WIGOS, print_geo(), metreport::print_mask, print_temp_d_sec1(), print_temp_d_sec5(), print_temp_d_sec6(), print_temp_d_sec7(), print_wigos_id(), temp_chunks::t, and metreport::temp.

Referenced by print_temp_report().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_temp_d_sec1()

size_t print_temp_d_sec1 ( char **  sec1,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 1 of part D of a TEMP report.

Parameters
sec1the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec1

Definition at line 880 of file bufr2tac_print_temp.c.

881{
882 size_t used = 0;
883 char *c = *sec1;
884
885 used += snprintf ( c + used, lmax - used, "%s", t->t.datime );
886
887 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s1.MiMi, t->d.s1.MjMj );
888
889 if ( t->d.s1.D_D[0] && t->a.s1.II[0] == 0 )
890 {
891 used += snprintf ( c + used, lmax - used, " %s", t->d.s1.D_D );
892 }
893
894 used += snprintf ( c + used, lmax - used, " %s/", t->d.s1.YYGG );
895
896 // print IIiii
897 if ( t->d.s1.II[0] )
898 {
899 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s1.II, t->d.s1.iii );
900 }
901 else
902 {
903 if ( t->d.s1.LaLaLa[0] )
904 {
905 used += snprintf ( c + used, lmax - used, " 99%s", t->d.s1.LaLaLa );
906 }
907 else
908 {
909 used += snprintf ( c + used, lmax - used, " 99///" );
910 }
911
912 if ( t->d.s1.Qc[0] && t->d.s1.LoLoLoLo[0] )
913 {
914 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s1.Qc, t->d.s1.LoLoLoLo );
915 }
916 else
917 {
918 used += snprintf ( c + used, lmax - used, " /////" );
919 }
920
921 if ( t->d.s1.MMM[0] && t->d.s1.Ula[0] && t->d.s1.Ulo[0] )
922 {
923 used += snprintf ( c + used, lmax - used, " %s%s%s", t->d.s1.MMM, t->d.s1.Ula, t->d.s1.Ulo );
924 }
925
926 if ( t->d.s1.h0h0h0h0[0] )
927 {
928 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s1.h0h0h0h0, t->d.s1.im );
929 }
930 }
931
932 *sec1 = c + used;
933 return used;
934}
struct temp_d d
Definition: mettemp.h:518
struct temp_acd_sec1 s1
Definition: mettemp.h:500

References temp_chunks::c, met_datetime::t, and temp_chunks::t.

Referenced by print_temp_d().

Here is the caller graph for this function:

◆ print_temp_d_sec5()

size_t print_temp_d_sec5 ( char **  sec5,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 5 of part D of a TEMP report.

Parameters
sec5the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec5

Definition at line 945 of file bufr2tac_print_temp.c.

946{
947 size_t i;
948 size_t used = 0;
949 char *c = *sec5;
950
951 for ( i = 0; i < t->d.s5.n && i < TEMP_NMAX_POINTS ; i++ )
952 {
953 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s5.th[i].nini, t->d.s5.th[i].PnPnPn );
954 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s5.th[i].TnTnTan, t->d.s5.th[i].DnDn );
955 }
956
957 *sec5 = c + used;
958 return used;
959}
struct temp_bd_sec5 s5
Definition: mettemp.h:501

References temp_chunks::c, temp_chunks::t, and TEMP_NMAX_POINTS.

Referenced by print_temp_d().

Here is the caller graph for this function:

◆ print_temp_d_sec6()

size_t print_temp_d_sec6 ( char **  sec6,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 6 of part D of a TEMP report.

Parameters
sec6the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec6

Definition at line 970 of file bufr2tac_print_temp.c.

971{
972 size_t i;
973 size_t used = 0;
974 char *c = *sec6;
975
976 used += snprintf ( c + used, lmax - used, " 21212" );
977
978 for ( i = 0; i < t->d.s6.n && i < TEMP_NMAX_POINTS ; i++ )
979 {
980 used += snprintf ( c + used, lmax - used, " %s%s", t->d.s6.wd[i].nini, t->d.s6.wd[i].PnPnPn );
981 used += snprintf ( c + used, lmax - used, " %s", t->d.s6.wd[i].dndnfnfnfn );
982 }
983
984 *sec6 = c + used;
985 return used;
986}
struct temp_bd_sec6 s6
Definition: mettemp.h:502

References temp_chunks::c, temp_chunks::t, and TEMP_NMAX_POINTS.

Referenced by print_temp_d().

Here is the caller graph for this function:

◆ print_temp_d_sec7()

size_t print_temp_d_sec7 ( char **  sec7,
size_t  lmax,
struct temp_chunks t 
)

Prints the section 7 of part D of a TEMP report.

Parameters
sec7the pointer where to print section
lmaxmax length permited
tpointer to s atruct temp_chunks where the parse results are set

returns the string sec7

Definition at line 997 of file bufr2tac_print_temp.c.

998{
999 size_t used = 0;
1000 char *c = *sec7;
1001
1002 used += snprintf ( c + used, lmax - used, " 31313" );
1003 used += snprintf ( c + used, lmax - used, " %s%s%s", t->d.s7.sr, t->d.s7.rara, t->d.s7.sasa );
1004 used += snprintf ( c + used, lmax - used, " 8%s%s", t->d.s7.GG, t->d.s7.gg );
1005
1006 if ( t->d.s7.TwTwTw[0] )
1007 {
1008 used += snprintf ( c + used, lmax - used, " 9%s%s", t->d.s7.sn, t->d.s7.TwTwTw );
1009 }
1010
1011 *sec7 = c + used;
1012 return used;
1013}
struct temp_sec7 s7
Definition: mettemp.h:503

References temp_chunks::c, and temp_chunks::t.

Referenced by print_temp_d().

Here is the caller graph for this function:

◆ print_temp_raw_data()

int print_temp_raw_data ( struct temp_raw_data r)

Prints for debug a struct temp_raw_data.

Parameters
rthe pointer of struct to print

This is used mainly for debug

Definition at line 33 of file bufr2tac_print_temp.c.

34{
35 size_t i;
36
37 printf ( "raw points %lu\n", r->n );
38 for ( i = 0; i < r->n ; i++ )
39 {
40 if ( r->raw[i].T != MISSING_REAL &&
41 r->raw[i].Td != MISSING_REAL &&
42 r->raw[i].dd != MISSING_REAL &&
43 r->raw[i].ff != MISSING_REAL )
44 printf ( "i=%3ld, dt=%4d, flags=%08X, P=%6.1lf, h=%6.0lf, dlat=%7.4lf, dlon=%7.4lf, T=%6.1lf, Td=%6.1lf, dd=%03.0lf, ff=%5.1lf\n",
45 i, r->raw[i].dt, r->raw[i].flags, r->raw[i].p * 0.01, r->raw[i].h, r->raw[i].dlat, r->raw[i].dlon,
46 r->raw[i].T - 273.15, r->raw[i].Td - 273.15, r->raw[i].dd, r->raw[i].ff );
47 else
48 {
49 printf ( "i=%3ld, dt=%4d, flags=%08X, P=%6.1lf, h=%6.0lf, dlat=%7.4lf, dlon=%7.4lf, ",
50 i, r->raw[i].dt, r->raw[i].flags, r->raw[i].p * 0.01, r->raw[i].h, r->raw[i].dlat, r->raw[i].dlon );
51 if ( r->raw[i].T != MISSING_REAL )
52 {
53 printf ( "T=%6.1lf, ", r->raw[i].T - 273.15 );
54 }
55 else
56 {
57 printf ( "T= ///./, " );
58 }
59
60 if ( r->raw[i].Td != MISSING_REAL )
61 {
62 printf ( "T=%6.1lf, ", r->raw[i].Td - 273.15 );
63 }
64 else
65 {
66 printf ( "Td= ///./, " );
67 }
68
69 if ( r->raw[i].dd != MISSING_REAL )
70 {
71 printf ( "dd=%03.0lf, ", r->raw[i].dd );
72 }
73 else
74 {
75 printf ( "dd=///, " );
76 }
77
78 if ( r->raw[i].dd != MISSING_REAL )
79 {
80 printf ( "ff=%5.1lf\n", r->raw[i].ff );
81 }
82 else
83 {
84 printf ( "ff= //./\n" );
85 }
86 }
87 }
88 return 0;
89}
#define MISSING_REAL
The missing default value for real values.
Definition: bufrdeco.h:78
struct temp_raw_point_data raw[TEMP_NMAX_POINTS *4]
Definition: mettemp.h:215
size_t n
Definition: mettemp.h:214

References temp_raw_point_data::dd, temp_raw_point_data::dlat, temp_raw_point_data::dlon, temp_raw_point_data::dt, temp_raw_point_data::ff, temp_raw_point_data::flags, temp_raw_point_data::h, MISSING_REAL, temp_raw_data::n, temp_raw_point_data::p, temp_raw_data::raw, temp_raw_point_data::T, and temp_raw_point_data::Td.

◆ print_temp_raw_wind_shear_data()

int print_temp_raw_wind_shear_data ( struct temp_raw_wind_shear_data w)

Prints for debug a struct temp_raw_data.

Parameters
wthe pointer of struct to print

Used in debug stage

Definition at line 98 of file bufr2tac_print_temp.c.

99{
100 size_t i;
101
102 printf ( "raw share wind points %lu\n", w->n );
103 for ( i = 0; i < w->n ; i++ )
104 {
105 if ( w->raw[i].ws_blw != MISSING_REAL && w->raw[i].ws_abv != MISSING_REAL )
106 printf ( "i=%3ld, dt=%4d, flags=%08X, P=%6.1lf, dlat=%7.4lf, dlon=%7.4lf, ws_blw=%5.1lf, ws_abv=%5.1lf\n",
107 i, w->raw[i].dt, w->raw[i].flags, w->raw[i].p * 0.01, w->raw[i].dlat, w->raw[i].dlon,
108 w->raw[i].ws_blw, w->raw[i].ws_abv );
109 else
110 {
111 printf ( "i=%3ld, dt=%4d, flags=%08X, P=%6.1lf, dlat=%7.4lf, dlon=%7.4lf, ",
112 i, w->raw[i].dt, w->raw[i].flags, w->raw[i].p * 0.01, w->raw[i].dlat, w->raw[i].dlon );
113
114 if ( w->raw[i].ws_blw != MISSING_REAL )
115 {
116 printf ( "ws_blw=%5.1lf, ", w->raw[i].ws_blw );
117 }
118 else
119 {
120 printf ( "ws_blw= ///./, " );
121 }
122
123 if ( w->raw[i].ws_abv != MISSING_REAL )
124 {
125 printf ( "ws_abv=%5.1lf\n", w->raw[i].ws_abv );
126 }
127 else
128 {
129 printf ( "ws_abv= ///./\n" );
130 }
131 }
132 }
133 return 0;
134}
struct temp_raw_wind_shear_point raw[TEMP_NMAX_POINTS]
Definition: mettemp.h:240

References temp_raw_wind_shear_point::dlat, temp_raw_wind_shear_point::dlon, temp_raw_wind_shear_point::dt, temp_raw_wind_shear_point::flags, MISSING_REAL, temp_raw_wind_shear_data::n, temp_raw_wind_shear_point::p, temp_raw_wind_shear_data::raw, temp_raw_wind_shear_point::ws_abv, and temp_raw_wind_shear_point::ws_blw.

◆ print_temp_report()

int print_temp_report ( struct metreport m)

print the four parts of a decoded TEMP report from a BUFR file into strings

Parameters
mpointer to a struct metreport in which alphanumeric string members stores the reults

Definition at line 1058 of file bufr2tac_print_temp.c.

1059{
1060 // It is required that al lesat a standard level where decoded in SEC A
1061 if ( m->temp.a.mask & TEMP_SEC_2 )
1062 {
1063 print_temp_a ( m );
1064 }
1065
1066 // It is required a significant TH or wind poind for sec B
1067 if ( m->temp.b.mask & ( TEMP_SEC_5 | TEMP_SEC_6 ) )
1068 {
1069 print_temp_b ( m );
1070 }
1071
1072 // It is required a standard level for SEC C
1073 if ( m->temp.c.mask & TEMP_SEC_2 )
1074 {
1075 print_temp_c ( m );
1076 }
1077
1078 // It is required a significant TH or wind poind for sec B
1079 if ( m->temp.d.mask & ( TEMP_SEC_5 | TEMP_SEC_6 ) )
1080 {
1081 print_temp_d ( m );
1082 }
1083
1084 return 0;
1085}
int print_temp_d(struct metreport *m)
Prints the part D of a TEMP report into a string.
int print_temp_a(struct metreport *m)
Prints the part A of a TEMP report into a string.
int print_temp_c(struct metreport *m)
Prints the part C of a TEMP report into a string.
int print_temp_b(struct metreport *m)
Prints the part B of a TEMP report into a string.
#define TEMP_SEC_6
mask bit meaning sec 6 of a part of TEMP report parsed with success
Definition: mettemp.h:89
#define TEMP_SEC_5
mask bit meaning sec 5 of a part of TEMP report parsed with success
Definition: mettemp.h:83
#define TEMP_SEC_2
mask bit meaning sec 2 of a part of TEMP report parsed with success
Definition: mettemp.h:65
int mask
Definition: mettemp.h:453
int mask
Definition: mettemp.h:468
int mask
Definition: mettemp.h:483
int mask
Definition: mettemp.h:498

References temp_chunks::a, temp_chunks::b, temp_chunks::c, temp_chunks::d, temp_a::mask, temp_b::mask, temp_c::mask, temp_d::mask, print_temp_a(), print_temp_b(), print_temp_c(), print_temp_d(), metreport::temp, TEMP_SEC_2, TEMP_SEC_5, and TEMP_SEC_6.

Referenced by parse_subset_sequence().

Here is the call graph for this function:
Here is the caller graph for this function: