require "numru/ggraph"
include NumRu

#DCL.gropn(2)
DCL.gropn(4)

#gphys1 = GPhys::IO.open('arare-earth_PotTemp.nc', 'PotTemp')
gphys1 = GPhys::IO.open('../../netCDF/thermal-moist_VelX.nc', 'VelX')
#gphys2 = GPhys::IO.open('arare-earth_BasicZ.nc', 'PotTempBasicZ')

###--- 引き数を置き変える ---###
tn = ARGV[0].to_i
dt = ARGV[1].to_i

###--- 定数の設定確認 ---###
#print tn
#printf ("\n")
#print dt     #, tmin, tmax
#printf ("\n")

###--- Draw with contour ---###
#  GGraph.contour( ( ( gphys1 ).cut(true, true, tn*dt  ) + gphys2 )  -  ( ( gphys1 ).cut(true, true, tn*dt ).mean( 'x' ) + ( gphys2 ).mean( 'x' ) ) )

###--- Fix the tone level ---###
  # 今関さんスクリプト (温位の絵をかく用) からぱくってきたもの
#  GGraph.set_tone_levels( 'levels'=>[-12.0,-9.0,-7.0,-5.0,-3.0,-2.0,-1.0,0,1.0,2,3.0,5.0,7.0,9.0,11.2],'patterns'=>[11999,13999,15999,20999,27999,39999,50999,69999,73999,76999,79999,86999,92999,96999,98999] )
#  GGraph.set_tone_levels( 'levels'=>[-24.0,-18.0,-14.0,-10.0,-6.0,-4.0,-2.0,0,2.0,4.0,6.0,10.0,14.0,18.0,24.0],'patterns'=>[11999,13999,15999,20999,27999,39999,50999,69999,73999,76999,79999,86999,92999,96999,98999] )
  GGraph.set_tone_levels(
   'levels'=>[-20.0,-16.0,-12.0,-8.0,-4.0,-2.0,0,2.0,4.0,8.0,12.0,16.0,20.0],
   'patterns'=>[11999,13999,15999,20999,27999,39999,50999,69999,73999,76999,79999,86999,92999,96999] )

###--- Draw with tone ---###
  DCL.sgpset('lcntl', false)
#  GGraph.tone( ( ( gphys1 ).cut(true, true, tn*dt) + gphys2 )  -  ( ( gphys1 ).cut(true, true, tn*dt).mean( 'x' ) + ( gphys2 ).mean( 'x' ) ) )
  GGraph.tone( ( gphys1 ).cut(true, y=100, true, tn*dt) )
#  GGraph.tone( ( gphys1 ).cut(true, y=100, true, t=0) )

###--- Draw side tone var ---###
GGraph.color_bar("landscape"=>false,'labelintv'=>3)

DCL.grcls



