Repository: python-metar/python-metar

Issue:
Unparsed groups in body 'R/SNOCLO'
The [Manual on Codes](https://library.wmo.int/doc_num.php?explnum_id=10235) states

> The state of the runway group shall be replaced by the abbreviation R/SNOCLO when the aerodrome is closed due to extreme deposit of snow. 

Note that there is no runway designator, just the letter "R". However, the runway state regex for parsing the record requires a runway number. This leads to the mentioned error.

Test record:
> METAR EDDC 032220Z 31005KT 5000 -SN BKN008 M01/M01 Q1020 R/SNOCLO 

Discussion:
akrherz: Thanks for this contribution.  This seems good to me, but I am not well versed in METAR runway state encoding.  Will see what others chime in with prior to merging.

Patch:
diff --git a/metar/Metar.py b/metar/Metar.py
index 5ef2d76..e5d113d 100644
--- a/metar/Metar.py
+++ b/metar/Metar.py
@@ -109,12 +109,13 @@ COLOR_RE = re.compile(
     re.VERBOSE,
 )
 RUNWAYSTATE_RE = re.compile(
-    r"""((?P<name>\d\d) | R(?P<namenew>\d\d)(RR?|LL?|C)?/?)
+    r"""((?P<snoclo>R/SNOCLO) |
+        ((?P<name>\d\d) | R(?P<namenew>\d\d)(RR?|LL?|C)?/?)
         ((?P<special> SNOCLO|CLRD(\d\d|//)) |
         (?P<deposit>(\d|/))
         (?P<extent>(\d|/))
         (?P<depth>(\d\d|//))
-        (?P<friction>(\d\d|//)))\s+""",
+        (?P<friction>(\d\d|//))))\s+""",
     re.VERBOSE,
 )
 TREND_RE = re.compile(r"^(?P<trend>TEMPO|BECMG|FCST|NOSIG)\s+")


Test patch:
diff --git a/test/test_metar.py b/test/test_metar.py
index 00bd05f..d6818a1 100644
--- a/test/test_metar.py
+++ b/test/test_metar.py
@@ -556,6 +556,11 @@ def test_290_ranway_state():
     assert report("09SNOCLO").remarks() == ""
     assert report("09CLRD//").remarks() == ""
 
+    assert report("R/SNOCLO").remarks() == ""
+    assert report("R09/CLRD//").remarks() == ""
+
+    assert report("R01R/SNOCLO ").remarks() == ""
+
 
 def test_300_parseTrend():
     """Check parsing of trend forecasts."""