diff --git a/samples/BUFR3_local_satellite.bufr.tmpl b/samples/BUFR3_local_satellite.bufr.tmpl new file mode 100644 index 000000000..16ab06b35 Binary files /dev/null and b/samples/BUFR3_local_satellite.bufr.tmpl differ diff --git a/samples/BUFR4_local_satellite.bufr.tmpl b/samples/BUFR4_local_satellite.bufr.tmpl new file mode 100644 index 000000000..07107d032 Binary files /dev/null and b/samples/BUFR4_local_satellite.bufr.tmpl differ 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");