Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bufr.pm:mergebufrtemp.pl [2015-02-05 07:58:08] pals |
bufr.pm:mergebufrtemp.pl [2015-02-11 12:27:16] pals |
||
---|---|---|---|
Line 124: | Line 124: | ||
my ($ii, | my ($ii, | ||
while ($desc1-> | while ($desc1-> | ||
- | | + | |
if ($desc1-> | if ($desc1-> | ||
# No more pressure levels in message 1, so fetch from message 2 | # No more pressure levels in message 1, so fetch from message 2 | ||
- | | + | |
$i2 += 10; | $i2 += 10; | ||
} elsif ($desc2-> | } elsif ($desc2-> | ||
# No more pressure levels in message 2, so fetch from message 1 | # No more pressure levels in message 2, so fetch from message 1 | ||
- | | + | |
$i1 += 10; | $i1 += 10; | ||
} elsif ($data1-> | } elsif ($data1-> | ||
Line 149: | Line 149: | ||
} elsif ($data1-> | } elsif ($data1-> | ||
# pick the highest pressure, i.e. data1 | # pick the highest pressure, i.e. data1 | ||
- | | + | |
$i1 += 10; | $i1 += 10; | ||
} else { | } else { | ||
# pick the highest pressure, i.e. data2 | # pick the highest pressure, i.e. data2 | ||
- | | + | |
$i2 += 10; | $i2 += 10; | ||
} | } | ||
Line 173: | Line 173: | ||
$data-> | $data-> | ||
while ($nws1 > 0 || $nws2 > 0) { | while ($nws1 > 0 || $nws2 > 0) { | ||
- | | + | |
if ($nws1 == 0) { | if ($nws1 == 0) { | ||
# Fetch from message 2 | # Fetch from message 2 | ||
- | | + | |
$i2 += 7; | $i2 += 7; | ||
$nws2--; | $nws2--; | ||
} elsif ($nws2 == 0) { | } elsif ($nws2 == 0) { | ||
# Fetch from message 1 | # Fetch from message 1 | ||
- | | + | |
$i1 += 7; | $i1 += 7; | ||
$nws1--; | $nws1--; | ||
Line 187: | Line 187: | ||
# see no reason why data1 should differ from data2 here, | # see no reason why data1 should differ from data2 here, | ||
# so we use data1 | # so we use data1 | ||
- | | + | |
$i1 += 7; | $i1 += 7; | ||
$i2 += 7; | $i2 += 7; | ||
Line 193: | Line 193: | ||
} elsif ($data1-> | } elsif ($data1-> | ||
# pick the highest pressure, i.e. data1 | # pick the highest pressure, i.e. data1 | ||
- | | + | |
$i1 += 7; | $i1 += 7; | ||
$nws1--; | $nws1--; | ||
} else { | } else { | ||
# pick the highest pressure, i.e. data2 | # pick the highest pressure, i.e. data2 | ||
- | | + | |
$i2 += 7; | $i2 += 7; | ||
$nws2--; | $nws2--; | ||
Line 225: | Line 225: | ||
sub combine_evss { | sub combine_evss { | ||
my ($evss1, | my ($evss1, | ||
- | my $binary1 = pack " | + | |
- | my $binary2 = pack " | + | my $binary1 = pack " |
- | my $binary = $binary1 | $binary2; # bitwise or | + | my $binary2 = pack " |
- | return unpack " | + | my $binary = $binary1 | $binary2; # bitwise or |
+ | return unpack " | ||
+ | } elsif (defined($evss1)) { | ||
+ | return $evss1; | ||
+ | } else { | ||
+ | return $evss2; | ||
+ | } | ||
} | } | ||
Line 264: | Line 270: | ||
the same as consulting perldoc mergebufrtemp.pl | the same as consulting perldoc mergebufrtemp.pl | ||
- | Options may be abbreviated, | + | Options may be abbreviated, |
To avoid having to use the C< | To avoid having to use the C< |