From 7b7fa186499d5cc6d3eab38df6513f5ce75c46f0 Mon Sep 17 00:00:00 2001 From: Enrico Fucile Date: Tue, 19 Jul 2016 13:59:56 +0100 Subject: [PATCH] ECC-295 passing test with 139 bufr test data --- samples/BUFR3_local_satellite.bufr.tmpl | Bin 0 -> 289 bytes samples/BUFR4_local_satellite.bufr.tmpl | Bin 0 -> 546 bytes src/grib_dumper_class_fortran.c | 15 +++++++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 samples/BUFR3_local_satellite.bufr.tmpl create mode 100644 samples/BUFR4_local_satellite.bufr.tmpl diff --git a/samples/BUFR3_local_satellite.bufr.tmpl b/samples/BUFR3_local_satellite.bufr.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..16ab06b3585a9c1ac428770830f5c29b7aa018ce GIT binary patch literal 289 zcmbVEF$%&!5S(zzsi-Hm7KeWj>z?ri zE<3|AGdtTuvPZNOz#KTj_R~o;9%&2!tRT`;ZhC;(0_iz*In fj)hQFYgg+K z#T$Bj7Xyyp!}=<$ISy<}YnLg*XTa(MQ#ZH~Ip%2YIVNXo>f8r+H|NpDr`qSnDU>_W zrE~J7b_%SF#kifi9N9|pvLTd6n#md=#;t^<7Sl{{Ucw;OTM155m>V*m0u2&OtW=Z1 h=f<_1E0y?LIY%+m2pS|Lu~LbDuo8bl`HBTCuU~QLSM&e? literal 0 HcmV?d00001 diff --git a/src/grib_dumper_class_fortran.c b/src/grib_dumper_class_fortran.c index 0fd49f5ed..fc231e8c2 100644 --- a/src/grib_dumper_class_fortran.c +++ b/src/grib_dumper_class_fortran.c @@ -598,15 +598,22 @@ static void dump_attributes(grib_dumper* d,grib_accessor* a) static void header(grib_dumper* d,grib_handle* h) { grib_dumper_fortran *self = (grib_dumper_fortran*)d; char sampleName[200]={0}; - long localSectionPresent,edition; + long localSectionPresent,edition,bufrHeaderCentre,isSatellite; + int ret=0; grib_get_long(h,"localSectionPresent",&localSectionPresent); + grib_get_long(h,"bufrHeaderCentre",&bufrHeaderCentre); grib_get_long(h,"edition",&edition); - if (localSectionPresent) - sprintf(sampleName,"BUFR%ld_local.bufr",edition); - else + if (localSectionPresent && bufrHeaderCentre==98 ) { + grib_get_long(h,"isSatellite",&isSatellite); + if (isSatellite) + sprintf(sampleName,"BUFR%ld_local_satellite.bufr",edition); + else + sprintf(sampleName,"BUFR%ld_local.bufr",edition); + } else { sprintf(sampleName,"BUFR%ld.bufr",edition); + } fprintf(self->dumper.out,"! This program has been automatically generated with bufr_dump -Efortran\n"); fprintf(self->dumper.out,"program bufr_create_message\n");