#!/usr/bin/env ruby

=begin

表題: AGUforAPE NetCDF submitted PCMDI のお絵描き

履歴: 2004/02/13 yukiko@ep.sci.hokudai.ac.jp

irb_command: load "~/tmp/ape-data/lib/ape-view.rb"
irbrc: ~/.irbrc

=end

# ----------------------------------------------
# local load path

# $: << '/home/yukiko/tmp/ape-data/lib'

# ----------------------------------------------
# 必要なライブラリ, モジュールの読み込み

require "getopts"
require "numru/netcdf"
module NumRu
  class NetCDFVar
    alias put scaled_put
    alias get scaled_get
  end
end

require "numru/ggraph"
require "./colorbar"
include NumRu
include NMath

# ----------------------------------------------
# GPhys メソッド追加定義

def GGraph.annotate(str_ary) # GGraph の annotate メソッド再定義

  charsize = 0.7 * DCL.uzpget('rsizec1')
  dvx = 0.01
  dvy = charsize*1.5
  raise TypeError,"Array expected" if ! str_ary.is_a?(Array)
  vxmin,vxmax,vymin,vymax = DCL.sgqvpt
  vx = 0.66 
  vy = 0.12 - charsize/2
  str_ary.each{|str|
    DCL::sgtxzv(vx,vy,"[ #{str} ]",charsize,0,-1,1)
    vy -= dvy
  }
  nil
end

# inspect がうるさかったので, 表示を短くする
class GrADS_Gridded
  def inspect
    "GrADS_Gridded:"+path
  end
end

class GPhys

  # 座標, データ操作ログ記録関数の定義 (Grid.lost_axes 参照)
  def add_lost_axes( lost )
    GPhys.new( @grid.copy.add_lost_axes( lost.to_a ), @data)
  end
  def set_lost_axes( lost )
    GPhys.new( @grid.copy.set_lost_axes( lost.to_a ), @data)
  end

  # rename 再定義 (gphys class の値を返す)
  def rename(name)
    GPhys.new(@grid,@data.copy.rename(name))
  end

  # attribute 変更再定義 (gphys class の値を返す)
  def set_att(name,val)
    GPhys.new(@grid,@data.copy.set_att(name,val))
  end

  # 経度 180 度回転
  def lon_lotate

    # 軸の回転 (180 度引き算)
#    lon = VArray.new(@grid.axis("lon").pos.val-180).rename("lon")
    lon = VArray.new(@grid.axis(0).pos.val-180).rename("lon").
      put_att("units",@grid.axis(0).pos.get_att("units"))
    lon = Axis.new().set_pos(lon)
    @grid = @grid.change_axis(0, lon)

#    lat = VArray.new(@grid.axis(1).pos.val).rename("lat")
#    lat = Axis.new().set_pos(lat)
#    @grid = @grid.change_axis(1, lat)

    # データの回転
    dim = @data.val.shape[0]
    data_val =  @data.copy.val
    data_val[0..dim/2-1, false] = @data.val[dim/2..dim-1, false]
    data_val[dim/2..dim-1, false] = @data.val[0..dim/2-1, false]
    data = @data.copy
    data.val = (data_val)

    # gphys class の値を返す
    GPhys.new( @grid, data )

  end

  def gts2p(ps,p_table=nil)

    # p 座標
    if  p_table == nil then 
      p_table = [
	1000.0, 925.0, 850.0, 700.0, 600.0, 
	500.0, 400.0, 300.0, 250.0, 200.0, 
	150.0, 100.0, 70.0, 50.0, 30.0, 20.0, 10.0 ]
    end

    # 大きい順に並べる
    p_table = NArray.to_na(p_table)
    p_table[-1..0] = p_table.sort[0..-1]

    sigma_table = @grid.copy.axis(2).pos.val
    sigma_data = @data.val
    imax = sigma_data.shape[0]
    jmax = sigma_data.shape[1]
    kmax = p_table.size

    p_data = NArray.sfloat(imax,jmax,kmax).fill(0)

    ps = ps.data.val

    imax.times{ |i|
      jmax.times{ |j|

	# 内挿, 外挿
	kmax.times{ |k|
	  
	  # 求めたい p 座標のちょっと上層の点を探す
	  num = 0
	  sigma_table.size.times{ |num|
	    break if ps[i,j] * sigma_table[num] < p_table[k]	  
	  }
	  
	  # 内挿, 外挿
	  if num == 0 then  # (sigma[min]*ps) < p_table[k]
	    p_data[i,j,k] = sigma_data[i,j,0]
	    # 外挿
	    # sigma_data[i,j,num] ; σ座標, 求めたい p 座標のちょっと上層の点
	    # sigma_data[i,j,num-1] ; σ座標, 求めたい p 座標のちょっと下層の点
#	    p1 = sigma_table[1] * ps[i,j]
#	    p2 = sigma_table[0] * ps[i,j]
#	    p_data[i,j,k] = 
#	      sigma_data[i,j,0] -
#	      ( sigma_data[i,j,1] - sigma_data[i,j,0] ) *
#	      Math.log( p_table[k] / p2 ) * Math.log( p1 / p2 )
	  elsif num == (p_table.size-1) then  # (sigma[max]*ps) > p_table[k]
	    # 外挿
	    p_data[i,j,k] = sigma_data[i,j,p_table.size-1]
	  else 	
	    # 内挿
	    # sigma_data[i,j,num] ; σ座標, 求めたい p 座標のちょっと上層の点
	    # sigma_data[i,j,num-1] ; σ座標, 求めたい p 座標のちょっと下層の点
	    p1 = sigma_table[num] * ps[i,j]
	    p2 = sigma_table[num-1] * ps[i,j]
	    p_data[i,j,k] = 
	      sigma_data[i,j,num-1] +
	      ( sigma_data[i,j,num] - sigma_data[i,j,num-1] ) *
	      Math.log( p_table[k] / p2 ) * Math.log( p1 / p2 )
	  end
	}    
      }
    }

    g0 = @grid.copy.axis(0)
    g1 = @grid.copy.axis(1)
    g2 = VArray.new(p_table).rename("plev")
    g2 = Axis.new().set_pos(g2)
    grid = Grid.new(g0,g1,g2)

    p_data = VArray.new(p_data).rename(@data.name)
    gphys = GPhys.new(grid,p_data)

    return gphys
  end


end

# ----------------------------------------------
# Ape NetCDF お絵描き基本 ? クラス (他の NetCDF は読めないと思う…)

class  Ape 

  # class method ------------------------------------------

  def Ape.help

    print  <<EOF

  ==========================================================
   class Ape のメソッド (lib-ape-view.rb) 
  ---------------------------------------------------------
   * Ape.new(file): 
   * p(name)
   * plot(gphys)
   * go(var), gphys_open(var)
   * no, netcdf_open
   * l, var_list
  ==========================================================

EOF

  end

   def Ape.set
     print "\n  ==========================================================\n"
     print "   $nc.size = #{$nc.size}, $gropn = #{$gropn}, $cont_flag = #{$cont_flag}\n" 
     print "  ----------------------------------------------------------\n"
     print "   $tone_hash  = " ; p $tone_hash
     print "  ----------------------------------------------------------\n"
     print "   $cont_hash  = " ; p $cont_hash
     print "  ----------------------------------------------------------\n"
     print "   $cbar_conf  = " ; p $cbar_conf
     print "  ==========================================================\n"
  end

  # method -----------------------------------------------

  def initialize(file)
    if file.is_a?(Fixnum)
      Ape.file_name_get unless $nc.is_a?(Array)
      puts $nc[file]
      @file = $nc[file] 
    else
      @file = file
    end
  end

  def help
    Ape.help
  end

  def set
    Ape.set
  end

  def var_list
    if @file =~ /.nc$/ then
      file = NetCDF.open(@file)
    elsif @file =~ /.ctl$/ then
      file = GrADS_Gridded.open(@file)
    end
    print "=========================\n"
    file.var_names.each{ |name|
      print name, " (" 
      file.var(name).dim_names.size.times{ |num|
	print file.var(name).dim_names[num]
	print ", " unless num+1 == file.var(name).dim_names.size
      }
      print ")\n"
    }
    print "=========================\n"
    return file
  end

  def gphys_open(var)
    if @file.to_s =~ /.nc$/ then 
      if @file.is_a?(Array) && @file.to_a.size == 1 then
	GPhys::NetCDF_IO.open(@file.to_s, var) 
      else 
	GPhys::NetCDF_IO.open(@file, var) 
      end
    elsif @file.to_s =~ /.ctl$/ then 
      GPhys::GrADS_IO.open(@file,var)
    end
  end

  def netcdf_open
    if @file =~ /.nc$/ then 
      NetCDF.open(@file)
    elsif @file =~ /.ctl$/ then 
      GrADS_Gridded.open(@file)
    end
  end

  def plot(gphys, gphys_u=nil, gphys_v=nil)
    gropn(1) if $gropn == nil
    
    if gphys.class == Array
      plot_set(gphys[0]) 
    else 
      plot_set(gphys) 
    end
    
    if gphys.class == Array then
      plot_line_main(gphys)
    elsif gphys_u == nil || gphys_v == nil then
      plot_main(gphys)
    else
      plot_main(gphys, gphys_u, gphys_v )
    end

    # タイトルを標準出力へ
    if gphys.class == Array then
      if  gphys[0].data.get_att("ape_name") then
	puts "#{gphys[0].name} (#{gphys[0].data.get_att("ape_name")})"
      end
    elsif gphys.data.get_att("ape_name") then
      puts "#{gphys.name} (#{gphys.data.get_att("ape_name")})"
    end

  end

  def plot_line(gphys_array)
    gropn(1) if $gropn == nil
    plot_set(gphys_array[0]) 
    plot_line_main(gphys_array)
    # タイトルを標準出力へ
    puts "#{gphys_array[0].name} (#{gphys_array[0].data.get_att("ape_name")})"
  end

  def gropn(num)

    if num == 1     # 標準出力
#      DCL.swpset('LALT', true) 
      DCL.swpset('IPOSX', 5) ; DCL.swpset('IPOSY',5)  
      DCL.gropn(1)
    elsif num == 2  # ps に落す
      DCL.swpset('LSEP',true); DCL.gropn(2) 
    else            # dump する
      DCL.swpset('LDUMP', true) 
      DCL.swpset('LWAIT',false) ; DCL.swpset('LWAIT1',false)  
      DCL.swpset('IPOSX', 50) ; DCL.swpset('IPOSY',50)  
      DCL.gropn(1)
    end

    # 二度開かないようにするためのフラグ
    $gropn = num

    # viewport, フォント等の設定
    if num == 2
      GGraph.set_fig('viewport'=>[0.10,0.80,0.25,0.60]) 
      DCL.uzfact(0.7) 
    else
      GGraph.set_fig('viewport'=>[0.13,0.83,0.23,0.58]) # 縦横比は 2 : 1  
      DCL.uzfact(0.6)                                   # 文字の大きさ倍
    end

    GGraph.set_fig("yrev"=>"units:hPa,units:Pa,long_name:sigma")# 軸の反転条件
    DCL.sgpset('lcorner',false)    # コーナーマークはつけない
    DCL.slmgn(0.0, 0.0, 0.0, 0.0)  # 描画マージン指定
    DCL.sgpset('lfprop',true)      # プロポーショナルフォントを使う
    DCL.sgpset('lfull',true)       # 全画面表示
    DCL.sgpset('lcntl', false)     # アンダーバーは普通に表示
    DCL.uscset('cyspos', 'B' )      # y 軸単位を書く位置


    # 風 (u,-sigdot) ベクトル
    DCL::ugpset('LNRMAL', false)
    DCL::ugrset('VXULOC', 0.85)
    DCL::ugrset('VYULOC', 0.23)

=begin
# 下のコンタートーン決め打ちメソッドで定義
#    DCL::uglset('LUNIT', true)
#    DCL::ugpstx('VXUNIT', 0.05)
#    DCL::ugpstx('VYUNIT', 0.05)

    # conposite tuv の設定
#    DCL::ugrset('XFACT1', 3*10E-6*100)
#    DCL::ugrset('YFACT1', 6.0/100)
#    DCL::ugrset('VXUNIT', 0.05)
#    DCL::ugrse(t'VYUNIT', 0.05)

    # Hosaka ps の風ベクトル
#    DCL::ugpset('XFACT1', 0.02)
#    DCL::ugpset('YFACT1', 0.02)
#    DCL::ugrset('VXUNIT', 0.05)
#    DCL::ugrset('VYUNIT', 0.05)
=end

  end

  def plot_main(gphys, gphys_u=nil, gphys_v=nil)

    # attribute の long_name を消す (タイトル描画位置の都合)
    if gphys.data.get_att("long_name")
      gphys = gphys.set_att("long_name","")
    end

    GGraph.set_fig($fig_set_hash)

    # 描画
    if gphys.axnames.size == 1
      GGraph.line( gphys, true, $line_hash )
    elsif  $tone_flag == false
      GGraph.contour( gphys, true, $cont_hash )
    elsif $tone_hash['levels'][0] == $tone_hash['levels'][1] 
      GGraph.tone( gphys, true ) 
      GGraph.contour( gphys, false ) unless $cont_flag == false
    else
      GGraph.tone( gphys, true , $tone_hash ) 
      GGraph.contour( gphys, false, $cont_hash ) unless $cont_flag == false
    end

    # タイトル
    tani = "(#{gphys.data.get_att("units")})"
    DCL::uxsttl("t", tani , -1.0 )
    if  gphys.data.get_att("ape_name") then
      DCL::uxmttl("t", gphys.data.get_att("ape_name").gsub("_", " "), -1.0 ) 
    end

    # nc ファイル名
    if $gropn == 2
      charsize = 0.79 - $file_label.size * 0.0115 
      DCL::sgtxzv(charsize,0.62,$file_label,0.8 * DCL.uzpget('rsizec1'),0,-1,1)
    else
      charsize = 0.81 - $file_label.size * 0.0095 
      DCL::sgtxzv(charsize,0.6,$file_label,0.8 * DCL.uzpget('rsizec1'),0,-1,1) 
    end

    # 風 (u,-sigdot) ベクトル
    DCL::ugvect( gphys_u, gphys_v ) unless gphys_u == nil || gphys_v == nil 

    # トーンバー
    unless gphys.axnames.size == 1
      unless $tone_hash['levels'][0] == $tone_hash['levels'][1] 
	DCL::Util::color_bar($cbar_conf)  unless $tone_flag == false
      end
    end

  end


  def plot_line_main(gphys_array)
    
    # attribute の long_name を消す (タイトル描画位置の都合)
    if gphys_array[0].data.get_att("long_name")
      gphys_array[0] = gphys_array[0].set_att("long_name","")
    end

    GGraph.set_fig($fig_set_hash)
    
    line_index_ary = Array.new; name_ary = Array.new

    $line_color = $line_hash
    $line_color.store("index", 11)
    line_index_ary.push(11)
    name_ary.push(gphys_array[0].data.get_att("line_name"))
    
    # 描画
    GGraph.line( gphys_array[0], true, $line_color )
    gphys_array.size.times{ |num|
      unless num == 0
	if num == 4
	  $line_color = $line_hash
	  $line_color.store("index", 91)  # 水色
	  line_index_ary.push(91)
	else 
	  $line_color = $line_hash
	  $line_color.store("index", (num*10 +11))
	  line_index_ary.push(num*10 +11)
	end
	name_ary.push(gphys_array[num].data.get_att("line_name"))
	GGraph.line( gphys_array[num], false, $line_color ) 
      end
    }

    # タイトル
    tani = "(#{gphys_array[0].data.get_att("units")})"
    DCL::uxsttl("t", tani , -1.0 )
    if  gphys_array[0].data.get_att("ape_name") then
      DCL::uxmttl("t", gphys_array[0].data.get_att("ape_name").
		  gsub("_", " "), -1.0 ) 
    end

    # nc ファイル名
    if $gropn == 2
      charsize = 0.79 - $file_label.size * 0.0115 
      DCL::sgtxzv(charsize,0.62,$file_label,0.8 * DCL.uzpget('rsizec1'),0,-1,1)
    else
      charsize = 0.81 - $file_label.size * 0.0095 
      DCL::sgtxzv(charsize,0.6,$file_label,0.8 * DCL.uzpget('rsizec1'),0,-1,1) 
    end

    __line_index(name_ary,line_index_ary) 

  end

  def __line_index(str_ary,line_index_ary) 
    charsize = 0.7 * DCL.uzpget('rsizec1')
    dvx = 0.01
    dvy = charsize*1.5
    raise TypeError,"Array expected" if ! str_ary.is_a?(Array)
    vxmin,vxmax,vymin,vymax = DCL.sgqvpt
    vx = 0.15
    vy = 0.12 - charsize/2
    str_ary.size.times{|num|
      DCL::sgtxzv(vx,vy,"--- #{str_ary[num]}", 
		  charsize, 0, -1,line_index_ary[num])
      vy -= dvy
      if num == 3
	vx = 0.30
	vy = 0.12 - charsize/2
      end
    }
    nil
  end

  # ファイルのクローズ
  def grcls
    unless $gropn == nil
      DCL::grcls ; $gropn = nil   
    end
  end

  # ps ファイル出力
  def mkps(gphys, gphys_u=nil, gphys_v=nil)
    'rm dcl*.ps'
    gropn(2) if $gropn == nil
    if gphys_u == nil || gphys_v == nil then
      plot(gphys)
    else
      plot(gphys, gphys_u, gphys_v)
    end

    gphys = gphys[0]  if gphys.class == Array
      

    #    file_name = "#{File.basename(@file, ".nc")}_#{gphys.name}.ps"
#    file_name = "#{$file_label}_#{gphys.name}.eps"
    file_name = "#{$file_label}_#{gphys.name}.ps"
    `mv dcl*.ps  #{$fig_path}#{file_name}` 

#    `dclpsrmcm dcl*.ps | dclpsrot > tmp.ps`
#    `eps2eps tmp.ps  #{$fig_path}#{file_name}` 
#    `rm tmp.ps dcl*.ps`

  end
  
  # gif ファイル作成 (dump のタイミングがよくわからん)
  def mkdump(gphys, gphys_u=nil, gphys_v=nil)
    'rm *.xwd *.pnm'
    gropn(3) if $gropn == nil
    
    if gphys_u == nil || gphys_v == nil then
      plot(gphys)
    else
      plot(gphys, gphys_u, gphys_v)
    end

    gphys = gphys[0]     if gphys.class == Array
    
    $file_name = $pre_file
    #    $file_name = "#{$file_label}_#{gphys.name}.gif"
    `xwdtopnm dcl*xwd | pnmcut 2 2 904 654  > tmp.pnm`
#    `xwdtopnm dcl*xwd  > tmp.pnm`
   `ppmtogif tmp.pnm > #{$fig_path}#{$file_name}`
    `rm tmp.pnm  *xwd `
    $pre_file = "#{$file_label}_#{gphys.name}.gif"
#    $pre_file = $dump_name if $dump_name
    $dump_name = nil

  end

  # $nc[Array] に nc, grads ファイル名代入
  def Ape.file_name_get
    $nc = Array.new
    num = 0
    Dir.foreach("./") { |item|
      if item =~ /.nc$/ || item =~ /.ctl$/
	$nc.push(item)
	print "$nc[#{num}] #{item}\n"
	num = num + 1 
      else
	print "#{item}\n"
      end
    }
  end

  # トーン, コンターパターンのデフォルト設定
  def plot_def(gphys)
    
    # トーンパターンのデフォルト
    patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
    
    # トーンレベルのデフォルト: ((最大値 - 最小値) / 8 )
    levels = Array.new
    dx = (gphys.max - gphys.min)/7 ;  x  = gphys.min 
    8.times{ |num| ; levels.push(x) ;  x = dx + x }
    levels[7] = levels[7] + dx ; levels[0] = levels[0] - dx
    levels = NArray.to_na(levels)
    7.times{ |num| 
      if levels[num] < 0 && levels[num+1] > 0 
	if levels[num].abs < levels[num+1].abs
	  levels = levels - levels[num]
	else
	  levels = levels - levels[num+1]
	end
      end
    }
    
    # カラーバーセットのデフォルト: colorbar.rb 参照
    $cbar_conf = {
      "levels"=>levels, 
      "colors"=>patterns,
      "eqlev"=>true, 
      "nobound"=>0, 
      "tick1"=>20,"tick2"=>1
    }
    
    
    # コンターラベルのデフォルト: (トーンレベル/2 )
    # GPhys のコンター決め打ちオプションが言うこと聞いてくれないので, 
    # なんだか無茶なことをしてる. 
    x  = levels[0]
    cont_lev  = Array.new
    line_type = Array.new
    (levels.size*2).times{ |num|
      if num % 2 == 0 
	cont_lev.push(levels[num/2])
      else
	cont_lev.push(levels[num/2]+dx/2)
      end
      if cont_lev[num] < 0
	line_type.push(3) 
      else
	line_type.push(1)
      end
    }

    label = Array.new
    cont_lev.size.times{ |num|
      label[num] = format("%#.3g", cont_lev[num]).to_s 
      label[num] = "" unless num % 2 == 0
    }
    
    # コンター, トーンセット
    $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
    $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
      'line_type'=> line_type }

    # ラインセット
    $line_hash = { 'exchange'=>false }

    # window セット
    $fig_set_hash = { "window" => nil }

  end

  def cont_lev_set(levels)
    # コンターラベルのデフォルト: (トーンレベル/2 )
    # GPhys のコンター決め打ちオプションが言うこと聞いてくれないので, 
    # なんだか無茶なことをしてる. 
    x  = levels[0]
    dx = levels[3] -levels[2]
    cont_lev  = Array.new
    line_type = Array.new
    (levels.size*2).times{ |num|
      if num % 2 == 0 
	cont_lev.push(levels[num/2])
      else
	cont_lev.push(levels[num/2]+dx/2)
      end
      if cont_lev[num] < 0
	line_type.push(3) 
      else
	line_type.push(1)
      end
    }

    label = Array.new
    cont_lev.size.times{ |num|
      label[num] = format("%#.3g", cont_lev[num]).to_s 
      label[num] = "" unless num % 2 == 0
    }
    return cont_lev, line_type, label
  end

  # トーン, コンターパターンの設定 (変数固有)
  def plot_set(gphys)

    # コンターを描かない条件
    if gphys.name =~ /tr_/ || gphys.name =~ /horinout/  
      $cont_flag = false 
    else
      $cont_flag = true
    end

    # トーンを描かない条件
    if gphys.name == "comp_point"
      $tone_flag = false 
    else
      $tone_flag = true
    end

    # 初期化
    $fig_set_hash = {"window" => nil}
    $line_hash = { 'exchange'=>false }

#    $cont_flag = true if gphys.name =~ /spct/


    if gphys.name == "sst_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 273-5,303.0]}

    elsif gphys.name == "sst"
      levels = NArray[200, 287.5, 290, 292.5, 295, 297.5, 300, 400]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sst_anm"
      levels = NArray[-10.0, -2.0 ,-1, 0.0, 0.5 ,1.0, 2.0, 100.0]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }

      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "gt_sw_toai"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 341.15,341.3]}

    elsif gphys.name == "gt_sw_toar"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 70 ,140] }

    elsif gphys.name == "gt_lw_toa"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 210 ,240] }

    elsif gphys.name == "gt_cld_frac"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0.6 ,1] }

    elsif gphys.name == "gt_cldw"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0.05 ,0.25] }

    elsif gphys.name == "gt_cppn"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 10e-6 ,40e-6] }

    elsif gphys.name == "gt_dppn"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 5e-6 ,30e-6] }

    elsif gphys.name == "gt_tppn"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 20e-6 ,50e-6] }

    elsif gphys.name == "gt_sswi"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 120, 220] }

    elsif gphys.name == "gt_sswr"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 8, 12] }

    elsif gphys.name == "gt_slwd"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 300, 400] }

    elsif gphys.name == "gt_slh"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 50, 120] }

    elsif gphys.name == "gt_ssh"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 20] }

    elsif gphys.name == "gt_evap"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 20e-6, 50e-6] }

    elsif gphys.name == "gt_ps"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 101230, 101350]}
      $line_hash = { 'exchange'=>false }

    elsif gphys.name == "ml_u"
      levels = NArray[-1000, -15, -5, 0, 5, 15, 25, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]

      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_v"
      levels = NArray[-1000, -1.5, -0.5, 0, 0.5, 1.5, 1000]
      patterns = NArray[30999,40999,55999,70999,75999,85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }
      
    elsif gphys.name == "ml_t"
      levels = NArray.int(8).indgen!(0, 20)+180
      levels[0] = 150
      patterns = NArray[25999, 30999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = { 'min'=>180, 'max'=>330, 'int'=>10 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"tick1"=>20,"tick2"=>1
      }
      
    elsif gphys.name == "ml_om"
      levels = NArray[-1000, -0.08, -0.06, -0.04, -0.02, 0, 0.02, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_phi"
      levels = NArray[-5e+4 ,0, 5e+4, 10e+4, 15e+4, 20e+4, 25e+4, 100e+4]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_q"
      levels = NArray[0, 0.002, 0.004, 0.006, 0.008, 0.01, 0.012,1]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_rh"
      levels = NArray[0, 15, 30, 45, 60, 75, 90, 200]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_psi"
      levels = NArray[-100e10, -15e10 ,-10e10, -5e10, 0, 5e10, 10e10, 100e10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sw_toai"
      levels = NArray[0, 150 , 200, 250, 300, 350, 400, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sw_toar"
      levels = NArray[0, 50 , 75, 100, 125, 150, 175, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_lw_toa"
      levels = NArray[0, 185, 200, 215, 230, 245, 260, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cld_frac"
      levels = NArray[0, 0.4 , 0.5, 0.6, 0.7, 0.8,0.9, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cldw"
      levels = NArray[0, 0.15 , 0.2, 0.25, 0.3, 0.35,0.4, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cppn" || gphys.name == "sh_tppn"
      levels = NArray[0, 2e-5, 4e-5 , 6e-5, 8e-5,10e-5,12e-5, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_dppn"
      levels = NArray[0, 2e-5, 2.5e-5 , 3e-5, 3.5e-5, 4e-5, 4.5e-5, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sswi"
      levels = NArray[0, 50, 100, 150, 200, 250, 300, 500]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sswr"
      levels = NArray[0, 4, 6, 8, 10, 12, 14, 50]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_slwd"
      levels = NArray[0, 275, 300, 325, 350, 375, 400, 500]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_slwu"
      levels = NArray[0, 340, 360, 380, 400, 420, 440, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_slh"
      levels = NArray[0, 50, 75, 100, 125, 150, 170, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_ssh"
      levels = NArray[-50, 0, 3, 6, 9, 12, 15, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_evap"
      levels = NArray[-50, 2e-5, 3e-5, 4e-5, 5e-5, 6e-5, 7e-5, 1]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_tauu"
      levels = NArray[-50, -0.2, -0.15, -0.1, -0.05, 0, 0.05, 1]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_tauv"
      levels = NArray[-50, -0.04, -0.02, 0, 0.02, 0.04, 0.06, 1]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_ps"
      levels = NArray[0, 1000e2, 1005e2, 1010e2, 1015e2, 1020e2, 1025e2,1000e3]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sw_toai_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 450] }

    elsif gphys.name == "sh_sw_toar_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 200] }

    elsif gphys.name == "sh_lw_toa_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 150, 300] }

    elsif gphys.name == "sh_cld_frac_zonal" || gphys.name == "sh_cldw_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 1] }

    elsif gphys.name == "sh_cppn_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 25e-5] }

    elsif gphys.name == "sh_dppn_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 10e-5] }

    elsif gphys.name == "sh_tppn_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 30e-5] }

    elsif gphys.name == "sh_sswi_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 340] }

    elsif gphys.name == "sh_sswr_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 15] }

    elsif gphys.name == "sh_slwd_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 230, 450] }

    elsif gphys.name == "sh_slwu_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 310, 470] }

    elsif gphys.name == "sh_slh_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 200] }

    elsif gphys.name == "sh_ssh_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 25] }

    elsif gphys.name == "sh_evap_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 10e-5] }

    elsif gphys.name == "sh_tauu_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, -0.3, 0.2]}
      $line_hash = { 'exchange'=>false }

    elsif gphys.name == "sh_tauv_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, -0.1, 0.1]}
      $line_hash = { 'exchange'=>false }

    elsif gphys.name == "sh_ps_zonal"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 98000, 104000]}
      $line_hash = { 'exchange'=>false }

    elsif gphys.name == "sh_tppn_lat0_anm"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, -5e-5, 30e-5]}

    elsif gphys.name == "sh_slh_lat0_anm"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, -20, 80]}

    elsif gphys.name == "ml_u_lat0_zonal"
      $line_hash = { 'exchange'=>true,"index"=> 1, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-15, 20, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    elsif gphys.name == "tr_tppn"
      levels = NArray[0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 1000]
      patterns = NArray[35999, 45999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_tppn_mono"
#      levels = NArray[0.0001, 0.0002, 0.0004, 1000]
#      patterns = NArray[603,604,999]
      levels = NArray[0.0000, 0.0001, 0.0003, 1000]
      patterns = NArray[99001,603,999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>1,"tick2"=>1, 
      "vx0"=>0.05,
      "vy0"=>0.1,
      "label_size"=>0.015
      }

    elsif gphys.name == "tr_tppn_spct"
      levels = NArray[1e-12, 1e-11, 1e-10, 1e-9, 1e-8 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>1e-10}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_lw_toa_spct"
      levels = NArray[1e-1, 1, 10, 100, 1000 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>10}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_om500_spct"
      levels = NArray[1e-6, 1e-5, 1e-4, 1e-3, 1e-2 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>1e-4}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_u250_spct"
      levels = NArray[1e-3, 1e-2, 1e-1, 1, 10 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>1e-1}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_v250_spct"
      levels = NArray[1e-3, 1e-2, 1e-1, 1, 10 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>1e-1}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_mslp_spct"
      levels = NArray[1e+0, 1e+1, 1e+2, 1e+3, 1e+4 ]
      patterns = NArray[30999, 40999, 70999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>1e+2}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "comp_t_conv_zonal"
      $line_hash = { 'exchange'=>true,"index"=> 1, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-10e-4, 20e-4, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    elsif gphys.name == "comp_tuv"
      levels = NArray[-100, -1.5, -1, -0.5, 0, 0.5, 1,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    # conposite tuv ベクトル設定
    DCL::ugrset('XFACT1', 3*10E-6*100)
    DCL::ugrset('YFACT1', 6.0/100)
    DCL::ugrset('VXUNIT', 0.05)
    DCL::ugrset('VYUNIT', 0.05)

    elsif gphys.name == "comp_t_conv"
      levels = NArray[-1, -3e-4, 0, 3e-4, 6e-4, 9e-4, 12e-4,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_lw_toa"
      levels = NArray[-1000, -90, -60, -30, 0, 30, 60, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_om500"
      levels = NArray[-1000, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_u250" || gphys.name == "tr_v250" 
      levels = NArray[-1000, -10, -5, 0, 5, 10, 20, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_mslp"
      levels = NArray[-1000, -450, -300, -150, 0, 150, 300, 1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sw_toai_anm"
      levels = NArray[-100,-0.3,-0.2,-0.1, 0, 0.1, 0.2,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_sw_toar_anm"
      levels = NArray[-100,-10,-5, 0, 5, 10, 15, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_lw_toa_anm"
      levels = NArray[-100,-10,-5, 0, 5, 10, 15, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cld_frac_anm"
      levels = NArray[-100,-0.06,-0.04,-0.02, 0, 0.02, 0.04, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cldw_anm"
      levels = NArray[-100, -0.04, 0, 0.04, 0.08, 0.16,0.20, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_tppn_anm"
      levels = NArray[-30e-6,-20e-6,-10e-6, 0, 10e-6, 20e-6, 30e-6,10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_cppn_anm" || gphys.name == "sh_dppn_anm"
      levels = NArray[-10,-20e-6,-10e-6, 0, 10e-6, 20e-6, 30e-6,10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "sh_sswi_anm" 
      levels = NArray[-100,-10,-5, 0, 5, 10, 15,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "sh_sswr_anm" 
      levels = NArray[-100,-1,-0.5, 0, 0.5, 1, 1.5,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "sh_slwd_anm" 
      levels = NArray[-100,-10,-5, 0, 5, 10, 15,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_slwu_anm" 
      levels = NArray[-100, -10,-5, 0, 5, 10, 15, 100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_slh_anm" 
      levels = NArray[-100, -20,-10, 0, 10, 20, 30,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_evap_anm" 
      levels = NArray[-100, -10e-6,-5e-6, 0, 5e-6, 10e-6, 15e-6,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_ssh_anm" 
      levels = NArray[-100, -2,0, 2, 4, 6,8,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "sh_tauu_anm" 
      levels = NArray[-100,-0.030,-0.015, 0, 0.015, 0.030, 0.045,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_tauv_anm" 
      levels = NArray[-100,-0.03,-0.02,-0.01, 0, 0.01, 0.02,100]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_ps_anm" 
      levels = NArray[-1000,-200,-100, 0, 100, 200, 300,1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "sh_psuv_anm" 
      levels = NArray[-1000,-200,-100, 0, 100, 200, 300,1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

      # Hosaka ps の風ベクトル
      DCL::ugrstx('XFACT1', 0.02)
      DCL::ugpstx('YFACT1', 0.02)
      DCL::ugpstx('VXUNIT', 0.05)
      DCL::ugpstx('VYUNIT', 0.05)

    elsif gphys.name == "sh_phiuv850_anm" 
      levels = NArray[-1000,-200,-100, 0, 100, 200, 400,1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

      # Hosaka ps の風ベクトル
      DCL::ugpstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::ugpstx('UXUNIT', 5.0)
      DCL::ugpstx('UYUNIT', 5.0)

    elsif gphys.name == "sh_phiuv250_anm" 
      levels = NArray[-1000,-400,-200, 0, 200, 400, 600,1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

      # Hosaka ps の風ベクトル
#      DCL::ugpset('XFACT1', 0.005)
#      DCL::ugpset('YFACT1', 0.005)
#      DCL::ugpset('VXUNIT', 0.05)
#      DCL::ugpset('VYUNIT', 0.05)

      # Hosaka ps の風ベクトル
      DCL::ugpstx('XFACT1', 0.005)
      DCL::ugpstx('YFACT1', 0.005)
      DCL::ugpstx('UXUNIT', 10.0)
      DCL::ugpstx('UYUNIT', 10.0)

    elsif gphys.name == "sh_tuv500_anm" 
      levels = NArray[-10,-0.6,-0.3, 0, 0.3, 0.6, 0.9, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

      # 風ベクトル
      DCL::ugpstx('XFACT1', 0.005)
      DCL::ugpstx('YFACT1', 0.005)
      DCL::ugpstx('UXUNIT', 10.0)
      DCL::ugpstx('UYUNIT', 10.0)

    elsif gphys.name == "ml_tuom_anm" 
      levels = NArray[-10,-0.6,-0.3, 0, 0.3, 0.6, 0.9, 10]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

      # 風ベクトル
      DCL::ugrset('XFACT1', 2*10E-6*100)
      DCL::ugrset('YFACT1', 2.0/100)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      

    elsif gphys.name == "t_conv_zonal"
      $line_hash = { 'exchange'=>true,"index"=> 1, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-1e-4, 1e-4, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

=begin

    elsif gphys.name =~ /horinout/ 
      levels = NArray[-1000,177,266, 354, 443, 532, 620,1000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]

      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name =~ /yot/ 
      levels = NArray[0,0.01,0.1,1,10, 100, 1000, 10000]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]

      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name =~ /ml_psi/
      puts gphys.max, gphys.min
     levels = NArray[gphys.min,-18e+10,-12e+10,-6e+10,0,6e+10,12e+10,gphys.max]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
#      patterns = NArray[30000, 35000, 40000, 55000, 70000, 75000, 85000]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>3e+10}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true, 
	"nobound"=>2, 
	"tick1"=>7,"tick2"=>1
      }
=end

    else
      plot_def(gphys)
    end
    
  end
  
end





