# -*- coding: euc-jp -*-

# 蒸発量を計算するスクリプト
# (x 平均, 時間平均)

require "numru/ggraph"
include NumRu

x1 = 0
x2 = 512000
#x2 = 500 * 1000 - 500 * 10
z1 = 0
z2 = 30000

files = /thermal-moist_H2O-g_SfcMassFlux_rank(\d\d\d\d\d\d).nc/
gphys  = GPhys::IO.open(files, 'H2O-g_SfcMassFlux')

# アスペクト比をそれっぽくする
#GGraph.set_fig( 'viewport'=>[0.1,0.85,0.15,0.6] ) 
GGraph.set_fig( 'viewport'=>[0.1,0.85,0.2,0.45] )

tmin = 86400 * 21
tmax = 86400 * 50

gphysdisp0 = gphys
#gphysdisp0 = gphys1 * gphys2
gphysdisp0 = gphysdisp0.cut( 'y'=> 100 )
gphysdisp0 = gphysdisp0.mean( 'x' )
#gphysdisp0 = gphysdisp0.cut( 't'=>867600..4320000 )
gphysdisp0 = gphysdisp0.cut( 't'=>0..tmax )
#gphysdisp0 = gphysdisp0.cut( 't'=>tmin..tmax )
gphysdisp0 = gphysdisp0.mean( 't' )
gphysdisp  = gphysdisp0
 
p gphysdisp.val
#p ( gphysdisp / 30000 ).val
