# -*- coding: euc-jp -*-
require "numru/ggraph"
include NumRu

#files = /thermal-moist_H2O-gAll_Sfc_rank(\d\d\d\d\d\d).nc/
files = 'thermal-moist_H2O-gAll_Sfc.nc'
gphys1  = GPhys::IO.open(files, 'H2O-gAll_Sfc')
files = 'thermal-moist_H2O-gAll_Sfc.nc'
gphys2  = GPhys::IO.open(files, 'H2O-gAll_Sfc')
files = 'thermal-moist_H2O-gAll_Sfc_z24km.nc'
gphys3  = GPhys::IO.open(files, 'H2O-gAll_Sfc')
files = 'thermal-moist_H2O-gAll_Sfc_z36km.nc'
gphys4  = GPhys::IO.open(files, 'H2O-gAll_Sfc')
files = 'thermal-moist_H2O-gAll_Sfc_z48km.nc'

#DCL.gropn(1)
DCL.gropn(2)
#DCL.sldiv('y',1,3)
DCL.sgpset('lfull',true)
DCL.sgpset('lcntl',false)
DCL.uzfact(0.7)
#DCL.uzfact(0.3)
#GGraph.set_fig( 'viewport'=>[0.25,0.7,0.15,0.6] )
# アスペクト比をそれっぽくする
GGraph.set_fig( 'viewport'=>[0.1,0.85,0.15,0.6] )
#GGraph.set_fig( 'viewport'=>[0.1,0.85,0.2,0.45] )

#gphysdisp0 = -gphys
gphysdisp0 = gphys1
gphysdisp0 = gphysdisp0.mean( 'y' )
gphysdisp0 = gphysdisp0.mean( 'x' )
gphysdisp1  = gphysdisp0
#gphysdisp  = gphysdisp.cut( 't'=>0..4320000.0e0 )

gphysdisp0 = gphys2
gphysdisp0 = gphysdisp0.mean( 'y' )
gphysdisp0 = gphysdisp0.mean( 'x' )
gphysdisp2  = gphysdisp0

gphysdisp0 = gphys3
gphysdisp0 = gphysdisp0.mean( 'y' )
gphysdisp0 = gphysdisp0.mean( 'x' )
gphysdisp3  = gphysdisp0

gphysdisp0 = gphys4
gphysdisp0 = gphysdisp0.mean( 'y' )
gphysdisp0 = gphysdisp0.mean( 'x' )
gphysdisp4  = gphysdisp0

#GGraph.set axes('xtickint' => value1, 'xlabelint' => value2)
GGraph.line( gphysdisp4, true, 'min' => 2.70e-2, 'max' => 4.0e-2, 'type'=>1 )  # 48 km
GGraph.line( gphysdisp3, false, 'min' => 2.70e-2, 'max' => 4.0e-2, 'type'=>2 ) # 36 km
GGraph.line( gphysdisp1, false, 'min' => 2.70e-2, 'max' => 4.0e-2, 'type'=>3 ) # 30 km
GGraph.line( gphysdisp2, false, 'min' => 2.70e-2, 'max' => 4.0e-2, 'type'=>4 ) # 24 km

DCL.grcls
