Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bufr.pm:sortbufrtemp.pl [2015-02-25 11:56:50] pals |
bufr.pm:sortbufrtemp.pl [2022-05-31 09:29:31] (current) |
||
---|---|---|---|
Line 126: | Line 126: | ||
} | } | ||
- | | + | |
+ | if ($descriptors_unexpanded | ||
if ($verbose > 0 && $isub == 1) { | if ($verbose > 0 && $isub == 1) { | ||
print " | print " | ||
print " contained in bulletin with ahl $ahl" if $ahl; | print " contained in bulletin with ahl $ahl" if $ahl; | ||
- | print " since unexpanded descriptors did not start with 309052\n"; | + | print " since unexpanded descriptors did not start with 309052 |
} | } | ||
next; | next; | ||
Line 141: | Line 142: | ||
my @plevels; # array of references to the 10 data values of | my @plevels; # array of references to the 10 data values of | ||
# one pressure level | # one pressure level | ||
- | my $i1 = 29; | + | my $i_eddrf |
+ | my $i1 = $i_eddrf; | ||
while ($desc-> | while ($desc-> | ||
my @record = @$data[$i1 .. $i1+9]; | my @record = @$data[$i1 .. $i1+9]; | ||
Line 147: | Line 149: | ||
push @plevels, \@record; | push @plevels, \@record; | ||
} elsif ($verbose > 2) { | } elsif ($verbose > 2) { | ||
- | print " | + | print " |
. " in subset $isub in Message number $imsg"; | . " in subset $isub in Message number $imsg"; | ||
print " in $ahl" if $ahl; | print " in $ahl" if $ahl; | ||
Line 166: | Line 168: | ||
} | } | ||
my ($new_data, $new_desc) | my ($new_data, $new_desc) | ||
- | = get_sorted_data($data, | + | = get_sorted_data($data, |
$subset_data[$isub] = $new_data; | $subset_data[$isub] = $new_data; | ||
$subset_desc[$isub] = $new_desc; | $subset_desc[$isub] = $new_desc; | ||
Line 184: | Line 186: | ||
## missing) | ## missing) | ||
sub get_sorted_data { | sub get_sorted_data { | ||
- | my ($data, | + | my ($data, |
my ($new_data, | my ($new_data, | ||
# Section 4 up to where pressure level data starts is unaltered | # Section 4 up to where pressure level data starts is unaltered | ||
- | for my $ii (0 .. 27) { | + | for my $ii (0 .. $i_eddrf-2) { |
$new_desc-> | $new_desc-> | ||
$new_data-> | $new_data-> | ||
Line 194: | Line 196: | ||
# Then handle pressure levels (and eddrf) | # Then handle pressure levels (and eddrf) | ||
- | $new_desc-> | + | $new_desc-> |
- | $new_data-> | + | $new_data-> |
my $eddrf = 0; # extended delayed descriptor replication factor | my $eddrf = 0; # extended delayed descriptor replication factor | ||
Line 240: | Line 242: | ||
$eddrf++; | $eddrf++; | ||
- | $new_data-> | + | $new_data-> |
# Section 4 after pressure level data is unaltered | # Section 4 after pressure level data is unaltered | ||
Line 325: | Line 327: | ||
Will extract from <bufr file> all BUFR TEMPs (recognized by unexpanded | Will extract from <bufr file> all BUFR TEMPs (recognized by unexpanded | ||
- | descriptors in section 3 starting with 309052), sorting the pressure | + | descriptors in section 3 starting with 309052 |
- | levels and merging duplicate pressure levels (having same pressure, | + | pressure |
- | time and location coordinates) into one single level, printing to | + | pressure, time and location coordinates) into one single level, |
- | STDOUT unless C< | + | printing to STDOUT unless C< |
- | pressure will be removed. | + | missing |
Execute without arguments for Usage, with option C< | Execute without arguments for Usage, with option C< | ||
Line 344: | Line 346: | ||
n>=1: prints which BUFR messages were actually altered, | n>=1: prints which BUFR messages were actually altered, | ||
and which messages were removed because unexpanded | and which messages were removed because unexpanded | ||
- | descriptors did not start with 309052 | + | descriptors did not start with 309052 |
n>=2: prints at which pressure level sorting | n>=2: prints at which pressure level sorting | ||
breaks, or first duplicate level encountered | breaks, or first duplicate level encountered | ||
Line 357: | Line 359: | ||
combined with option --outfile | combined with option --outfile | ||
| | ||
- | the same as consulting perldoc | + | the same as consulting perldoc |
Options may be abbreviated, | Options may be abbreviated, |