[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Latest Decoders package 3.0.7+



On Fri, 4 Feb 2005, David Larson wrote:

> Robb,
>
> There seems to be a problem with the dewpoint processing in the decoders
> package (since the dawn of time, perhaps) ... The metar2nc script leaves
> the TD variable as undefined, and therefore it is processed as "missing"
> when the dewpoint is "00".
>
>         # get temperature and dew point
>         if( s#^(M)?(\d{2})/(M)?(\d{2})?\s+## ) {
>             $T = $2 ;
>             $T *= -1 if( $1 ) ;
>             $TD = $4 if( $4 ) ;
>             $TD *= -1 if( $3 ) ;
>         }
David,

you are correct, TD of value 0 fails to get set with the current code.
your fix seems reasonable, i'll fix it and make another release.

thanks,
robb...


>
> The solution is to change the code to use if( defined($4) ) because
> otherwise a zero value is not considered true and therefore the
> assignment to TD does not occur.
>
> Let me know if you have a better way to handle this.
> Dave
>

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================