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

file1 = 'odaka1998_1_Km.nc'
file2 = 'odaka1998_2_Km.nc'
file3 = 'odaka1998_3_Km.nc'
file4 = 'odaka1998_4_Km.nc'
varname = 'Km'
ltime = 172800.0

var = GPhys::IO.open([file1,file2,file3], varname)
time  = GPhys::IO.open([file1,file2,file4], '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( 'landscape'=>true, 'tickintv'=>10 )
#end

# <Close DCL>
DCL.grcls
