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

file1 = '../BS1998_VelX.nc'
varname = 'VelX'

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

var_square = var**2
var_square_root = var_square**0.5
var_square_root_mean = var_square_root.average('x').average('y')

# <Open DCL>
DCL.swlset( 'ldump', true )
DCL.gropn(2)

str = (0).to_s

GGraph.line( var_square_root_mean.cut(true,0), 
             true, 'exchange'=>true ,
             'index'=>2, 'type'=>1, 'label'=>str,
             'max'=>10.0, 'min'=>0.0)    

for i in 1..10 do

time = 3600*i*2

str = (i*2).to_s

GGraph.line( var_square_root_mean.cut(true,time), 
             false, 'exchange'=>true ,
             'index'=>2, 'type'=>1, 'label'=>str,
             'max'=>10.0, 'min'=>0.0)    

end

# <Close DCL>
DCL.grcls
