# Title: Ruby script drawing contour map for deepconv/arare5 output data 
#
# History: 2011/09/27 (Masatsugu Odaka)
#
require "numru/ggraph"
include NumRu

file1 = 'odaka1998_11_Km.nc'

varname = 'Km'
ltime = 864000.0

var = GPhys::IO.open(file1, varname)
time  = GPhys::IO.open(file1, 't').val

GGraph.set_linear_tone_options( 'min'=>0, 'max'=>150, 'interval'=>2 )  

# <Open DCL>
DCL.swlset( 'ldump', true )
DCL.gropn(4)
GGraph.set_fig('viewport'=>[0.1,0.8,0.4,0.6])

#for i in 0...time.length do
# <Drawing data by GGraph>
#  GGraph.tone( var.cut(true,100,true,time[i]) )

  GGraph.tone( var.cut(true,100,true,ltime) )
  GGraph.color_bar( 'tickintv'=>10, 'landscape'=>true )
#end

# <Close DCL>
DCL.grcls
