This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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/ ===============================================================================