# -*- 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

Adv   = GPhys::IO.open('odaka1998_1_VelZAdv.nc',   'VelZAdv'  )
NDiff = GPhys::IO.open('odaka1998_1_VelZNDiff.nc', 'VelZNDiff')
Turb  = GPhys::IO.open('odaka1998_1_VelZTurb.nc',  'VelZTurb' )
Buoy  = GPhys::IO.open('odaka1998_1_VelZBuoyT.nc', 'VelZBuoyT' )
PGrad = GPhys::IO.open('odaka1998_1_VelZPGrad.nc', 'VelZPGrad' )

time  = GPhys::IO.open(file, 't').val



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

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

  GGraph.line( Adv.cut(5500,100,true,time[i]), \
               true, 'exchange'=>true , 'index'=>22, 'type'=>1, 'label'=>'adv', \
               'title'=>'Verical Momentum Tendency', 'max'=>3.0e-2, 'min'=>-3.0e-2)    # °ÜÎ®

  GGraph.line( Turb.cut(5500,100,true,time[i]),  \
               false, 'exchange'=>true , 'index'=>42, 'type'=>1, 'label'=>'turb', \
               'max'=>3.0e-2, 'min'=>-3.0e-2)    # ÍðÎ®³È»¶

  GGraph.line( NDiff.cut(5500,100,true,time[i]),  \
               false, 'exchange'=>true , 'index'=>32, 'type'=>1, 'label'=>'ndiff', \
               'max'=>3.0e-2, 'min'=>-3.0e-2)    # ¿ôÃÍ³È»¶

  GGraph.line( Buoy.cut(5500,100,true,time[i]),  \
               false, 'exchange'=>true , 'index'=>152, 'type'=>1, 'label'=>'buoy', \
               'max'=>3.0e-2, 'min'=>-3.0e-2)    # ÉâÎÏ

  GGraph.line( PGrad.cut(5500,100,true,time[i]),  \
               false, 'exchange'=>true , 'index'=>12, 'type'=>1, 'label'=>'pgrad', \
               'max'=>3.0e-2, 'min'=>-3.0e-2)    # µ¤°µ·¹ÅÙÎÏ

end
# <Close DCL>
DCL.grcls
