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

timestep  = ARGV[0].to_i

x1 = 0
x2 = 256000
z1 = 0
#z2 = 24000
#z2 = 30000
z2 = 48000
dz = 300
t1 = 0
t2 = 86400 * 50
#t2 = 86400 * 30

files  = "thermal-moist_Exner-ThermExpTerm-DthetaDt.nc"
gphysExnerThermExpTerm = GPhys::IO.open(files, 'ExnerThermExpTerm')

#DCL.gropn(1)
DCL.gropn(2)
#DCL.sldiv('y',1,2)
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.25,0.8,0.10,0.275] )

#xax = gphys1.coord(0)
#zax = gphys1.coord(2)

gphysExnerThermExpTerm = gphysExnerThermExpTerm.mean( 'x' )

#gphysdisp0 = gphysdisp0.mean( 'x' )
#gphysdisp0 = gphysdisp0.mean( 'y' )
#gphysdisp0 = gphysdisp0.cut( 't'=>t1..t2 )
#gphysdisp0 = gphysdisp0.cut( 't'=>0..t2 )
#gphysdisp0 = gphysdisp0 * dt
#gphysdisp0 = gphysdisp0.sum( 't' )
#gphysdisp1  = gphysdisp0

GGraph.line( gphysExnerThermExpTerm, true )
#GGraph.line( gphysSekisanH2OgSfcMassFlux, true, 'min' => 0, 'max' => 300.0, 'type'=>1 )
#GGraph.line( gphysdisp2, false, 'min' => -9.0e-4, 'max' => 0.0, 'type'=>2 )
#GGraph.line( gphysdisp, true )
#GGraph.tone( gphysdisp, true, 'transpose'=>true )
#GGraph.tone( gphysdisp, true, 'transpose'=>true, 
#            'lev'=>[0,0.5e-3,1.0e-3,1.5e-3,2.0e-3,2.5e-3,3.0e-3,3.5e-3,4.0e-3,4.5e-3,5.0e-3,5.5e-3,6.0e-3,6.5e-3,7.0e-3],
#             # レベル＆パターンを陽に指定
#             'pat'=>[10999,12999,15999,20999,25999,30999,35999,40999,55999,65999,70999,75999,80999,90999,95999]
#             'lev'=>[   0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60,  0.65,  0.70, 0.75, 0.80, 0.85,  0.90],
#             'pat'=>[10999,15999,20999,25999,30999,35999,40999,45999,50999,67999,70999,80999,85999,90999]
#)
#GGraph.color_bar
#GGraph.color_bar( 'vlength'=>0.07, 'inffact'=>0.5 )
#GGraph.color_bar( 'vlength'=>0.12, 'inffact'=>1.0 )

DCL.grcls

exit

