<?xml version="1.0"?>

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:dt="urn:schemas-microsoft-com:datatypes"
  targetNamespace="http://www-sdd.fsl.noaa.gov/MADIS/hydrologicalSurfaceData"
  xmlns="http://www-sdd.fsl.noaa.gov/MADIS/hydrologicalSurfaceData"
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified">

 <xsd:element name="mesonet">
  <xsd:annotation>
   <xsd:documentation xml:lang="en">
     This Schema was developed for use with the MADIS hydrological data
     For more information about MADIS hydrological data see: 
       http://www-sdd.fsl.noaa.gov/MADIS/madis_sfc.html
     For more information about MADIS see: http://www-sdd.fsl.noaa.gov/MADIS/
   </xsd:documentation> 
  </xsd:annotation>
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="record" minOccurs="0" maxOccurs="unbounded" type="recAttrib">
    </xsd:element>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="recAttrib">
   <xsd:annotation>
    <xsd:documentation xml:lang="en">
       Attributes
         var=Variable Definitions
           A list of the "var" variables is below.  For more information see: 
             http://www-sdd.fsl.noaa.gov/MADIS/hydro_variable_list.html
            var="V-PCP5M"  - Accumulated Precip - 5m - m
            var="V-PCP1H"  - Accumulated Precip - 1h - m
            var="V-PCP3H"  - Accumulated Precip - 3h - m
            var="V-PCP6H"  - Accumulated Precip - 6h - m
            var="V-PCP12H" - Accumulated Precip - 12h - m
            var="V-PCP24H" - Accumulated Precip - 24h - m
            var="V-RIVFLO" - River Flow - (m**3)/s
            var="V-RIVSTG" - River Stage - m
   
         shef_id=Site Name
         elev=Site Elevation
         lat=Site Latitude
         lon=Site Longitude
         ObTime=Observation Time In UTC In "dateTime" Format
         provider=Data Provider
         data_value=Data Value
   
         Quality Control :: For more information see: 
           http://www-sdd.fsl.noaa.gov/MADIS/madis_sfc_qc.html
       
            Quality Control Data Descriptor Values
              No QC available:
                QCD="Z" -  Preliminary, No QC Available
              Automated QC checks:
                where level 1 = validity
                      level 2 = internal consistency, temporal consistency,
                      level 3 = spatial consistency check
                QCD="C" - Coarse Pass, Passed Level 1
                QCD="S" - Screened, Passed Levels 1 And 2
                QCD="V" - Verified, Passed Levels 1, 2, And 3
                QCD="X" - Rejected/Erroneous, Failed Level 1
                QCD="Q" - Questioned, Passed Level 1, Failed 2 Or 3
              Subjective intervention:
                QCD="G" - Subjective Good
                QCD="B" - Subjective Bad
              Interpolated/Corrected observations:
                QCD="T" - Virtual Temperature Could Not Be Calculated, Air Temperature Passing All QC Checks Has Been Returned
            QCA="XXX" - Quality Control Applied
            QCR="XXX" - Quality Control Results
    </xsd:documentation> 
   </xsd:annotation>
  <xsd:complexContent>
   <xsd:extension base="xsd:anyType">
     <xsd:attribute name="var" dt:type="xs:nmtoken" dt:values="PCP12H PCP1H PCP24H PCP3H PCP5M PCP6H RIVFLO RIVSTG"/>
     <xsd:attribute name="shef_id" dt:type="xs:nmtoken"/>
     <xsd:attribute name="elev" dt:type="xs:float"/>
     <xsd:attribute name="lat" dt:type="xs:float"/>
     <xsd:attribute name="lon" dt:type="xs:float"/>
     <xsd:attribute name="ObTime" dt:type="xs:dateTime"/>
     <xsd:attribute name="provider" dt:type="xs:nmtoken"/>
     <xsd:attribute name="data_value" dt:type="xs:float"/>
     <xsd:attribute name="QCD" dt:type="xs:nmtoken" dt:values="Z C S V X Q G B T"/>
     <xsd:attribute name="QCA" dt:type="xs:int"/>
     <xsd:attribute name="QCR" dt:type="xs:int"/>
   </xsd:extension>
  </xsd:complexContent>
 </xsd:complexType>
</xsd:schema> 

