I had the following METAR report from Mt. Washington (Home of the World's Worst Weather
TM).
017/09/20 13:51 KMWN 201351Z 09023KT 100SM BCFG BKN/// FEW/// FEW000 FEW140 BKN180 BKN200 11/09 RMK BCFG FEW000 TPS LWR BKN045 TPS LWR BKN056 BCFG INTMT
What I'm seeing is that the Saratoga decoding code gets stuck at the "BKN///" and doesn't properly parse the remaining cloud details or the temp/dew point.
There is code at the beginning of mtr_conditions() that strips out any occurrences of "///":
$metar = preg_replace('|///|is',' ',$metar); // remove strange standalone slashes
I've found at one reference that says "(cloud condition)///" means "height not measured".
http://sto.iki.fi/metar/In any case, this bit should at worst just be ignored, and this is what happens if I try one of the online METAR decoders.
The debug dump instead shows the code getting stuck on the standalone "BKN":
<!-- calling 'mtr_get_conditions' part='BCFG' ptr=6 grp=7 -->
<!-- conditions='' on entry -->
<!-- mtr_get_conditions part='BCFG' -->
<!-- calling 'mtr_get_conditions' part='BKN' ptr=7 grp=7 -->
<!-- conditions='Patches of Fog ' on entry -->
<!-- calling 'mtr_get_cloud_cover' part='BKN' ptr=7 grp=8 -->
<!-- get cloud cover 'BKN' -->
<!-- calling 'mtr_get_temperature' part='BKN' ptr=7 grp=9 -->
<!-- calling 'mtr_get_altimeter' part='BKN' ptr=7 grp=10 -->
In mtr_get_cloud_cover(), what happens is that if a numeric height isn't found immediately after the cloud condition code, it assumes it is no longer a cloud condition and bumps up the "group" pointer. What needs to happen is to recognize that it is a cloud condition and either ignore it or add it to the cloud details as "height not reported" or something like that.
I'll mess around with a fix...