anchor.diff:      let testGebco() =
           ignore // TODO
   
  -module Test =
  -    let simpleReadWriteTest() = 
  -        let fileName = @"D:\temp\testSimpleReadWrite.sbg" // *.sbg simple binary grid
  -        let initial = [None;Some(Int32.MinValue+1);Some(Int32.MaxValue);None;Some(0);Some(1);Some(-1);None;Some(2);Some(213);None]
  -
  -        SimpleReadWrite.writeValues fileName initial
  -        let expected = Seq.concat ([[initial.[4];initial.[3];initial.[4];initial.[4];initial.[2]];initial])
  -        let actual = SimpleReadWrite.readValues fileName (Seq.concat [[4L;3L;4L;4L;2L];[0L..(initial.LongCount()-1L)]])
  -        let result = Seq.zip actual expected |> Seq.forall (fun (a, b) -> a = b)
  -        printfn "Simple read write test returned %b" result
  -
  -    let memoryMappedReadTest() =
  -        let fileName = @"D:\temp\testSimpleReadWrite.sbg" // *.sbg simple binary grid
  -        let initial = [None;Some(Int32.MinValue+1);Some(Int32.MaxValue);None;Some(0);Some(1);Some(-1);None;Some(2);Some(213);None]
  -        let expected = Seq.concat ([[initial.[4];initial.[3];initial.[4];initial.[4];initial.[2]];initial])
  -        let actual = MemoryMappedSimpleRead.readValues fileName (Seq.concat [[4L;3L;4L;4L;2L];[0L..(initial.LongCount()-1L)]])
  -        let result = Seq.zip actual expected |> Seq.forall (fun (a, b) -> a = b)
  -        printfn "Memory mapped read test returned %b" result
   
       let runall() =
           simpleReadWriteTest()
           memoryMappedReadTest()
  -        SbgReader.testSmallMarspec()
  -        SbgReader.testAllMarspec10m()
  -Test.runall()
  -        
  -
  -        +        testSmallMarspec()
  +        testAllMarspec10m()
  +
  +Test.runall()
positive.code: 
  module SparseReadWrite = 
      open BitMap
      let writeBitMap fileName (map:bitmap []) =
          use writer = new BinaryWriter(File.Open(fileName, FileMode.OpenOrCreate))
          let nrows = map.Length
  
negative.code:         use writer = new BinaryWriter(File.Open(fileName, FileMode.OpenOrCreate))
          values |> Seq.iter (fun v -> if v.IsSome then writer.Write(v.Value))
  
      let write filenameWithoutExtension bitmap values =
          writeBitMap (Path.ChangeExtension(filenameWithoutExtension, bitmapExtension)) bitmap
          let valuesPath = (Path.ChangeExtension(filenameWithoutExtension, valuesExtension))
          writeValues valuesPath values
      
      let readBitMap bitMapFileName = 
          use reader = new BinaryReader(File.Open(bitMapFileName, FileMode.Open, FileAccess.Read, FileShare.Read))
          let nrows = reader.ReadInt32()
          let ncols = reader.ReadInt32()
          let createRowBitMap i = BitMap.init ncols (fun i -> reader.ReadBoolean())
          let map = Array.init nrows createRowBitMap
          map
  
      let readValue (map:bitmap []) (reader:BinaryReader)  cellIndex =
          match BitMap.sparseIndex map cellIndex with
          | Some(index) -> SimpleReadWrite.readValue reader index
          | None -> None
          
      let readValues valuesFileName indices = 
          let map = readBitMap (Path.ChangeExtension(valuesFileName, bitmapExtension))
          use reader = new BinaryReader(File.Open(valuesFileName, FileMode.Open, FileAccess.Read, FileShare.Read))
          // Use list or array to force creation of values (otherwise reader gets disposed before the values are read)
          let values = 
              indices
              |> List.ofSeq
              |> List.map (readValue map reader)
          values
  
  module AsciiProvider = 
  