#!/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'
#$: << '/home/yukiko/eva01/work11/ape/lib'
$: << '/home/yukiko/work/ape/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
  vy = 0.20 - 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
	DCL.sgpset('LCLIP', false) 
      plot_line_main(gphys)
    else 
      if gphys.name =~ /_spct$/ || gphys.name =~ /_spct_mono$/   
#	DCL.sgpset('LCLIP', true) 
	DCL.sgpset('LCLIP', false) 
	plot_spct_bunsan(gphys)
      elsif gphys_u == nil || gphys_v == nil then
	DCL.sgpset('LCLIP', false) 
	plot_main(gphys)
      else
	DCL.sgpset('LCLIP', false) 
	plot_main(gphys, gphys_u, gphys_v )
      end
    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")})"
    else
      puts "#{gphys.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  
      GGraph.set_fig('viewport'=>[0.10,0.80,0.28,0.63]) # 縦横比は 2 : 1  
      DCL.uzfact(0.6)                                   # 文字の大きさ倍
    end

    GGraph.set_fig("yrev"=>"units:hPa,units:Pa,units:millibars,long_name:sigma,long_name:pressure_level,standard_name:atmosphere_simga_coordinate,standard_name:atmosphere_simga_coordinate_half_level,long_name:model_level_number,axis:Z,positive:down,standard_name:atmosphere_simga_pressure_coordinate")# 軸の反転条件

    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 軸単位を書く位置

    DCL.uzpset('RSIZEC0',0.014)   # file lavel moji takasa
    DCL.uzpset('INDEXL0',1)       # file lavel moji index

    # 風 (u,-sigdot) ベクトル

    DCL::ugpset('LNRMAL', false)
#    DCL::ugrset('VXULOC', 0.85)
#    DCL::ugrset('VYULOC', 0.23)

    DCL::ugrset('VXULOC', 0.82)
    DCL::ugrset('VYULOC', 0.28)

    $colorbar_hash = {
      'vlength'=>0.2,
      "vwidth"=>0.015,
      'labelintv'=>1,
      'voff'=>0.02,
      'vcent'=> 0.50, 
      'charfact' => 1.0,
      "constwidth" => true
    }

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

    # conposite tuom の設定
#    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 || gphys.name =~ /gt_/

      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

=begin
    if gphys.name == "tr_tppn_mono" || gphys.name == "tr_tppn_30day_2_mono"
# T39L48_eml = (-90,175), (100,53)
# T159L48_eml = (-180,178), (65,87)
# T159L48_eml_zoom = (0,110), (81,70)
# T159L48_eml_zoom = (0,178), (75.5,89)
      grid =
	Axis.new().
	set_pos( VArray.new(NArray[0,110]).rename("lon") )
      grid = Grid.new(grid)
      $hojyosen = VArray.new(NArray[81,70]).rename("hojyosen") 
      $hojyosen = GPhys.new( grid, $hojyosen )
      puts "tr_tppn_mono_hojyosen"
      GGraph.line( $hojyosen, false, "index"=> 9 )
      grid =
	Axis.new().
	set_pos( VArray.new(NArray[0,178]).rename("lon") )
      grid = Grid.new(grid)
      $hojyosen = VArray.new(NArray[75.5,89]).rename("hojyosen") 
      $hojyosen = GPhys.new( grid, $hojyosen )
      puts "tr_tppn_mono_hojyosen"
      GGraph.line( $hojyosen, false, "index"=> 9 )
    end
=end

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

    # タイトル
    DCL::uzinit 
    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
    DCL::uzinit 
    $file_label = "#{@file}@#{gphys.name}"  if $file_label == "filename"
    DCL.uxpttl("t", 0, $file_label, 1.0)

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

#    $file_label = "filename" if $file_label == "#{@file}@#{gphys.name}"  

  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
    line_type_ary  = Array.new
    name_ary       = Array.new

    $line_color = $line_hash
    $line_color.store("index", 12)
    line_index_ary.push(12)

# mono 用
#    $line_color = $line_hash
#    $line_color.store("index", 14)
#    $line_color.store("type", 1)
#    line_index_ary.push(12)

    line_type_ary.push(1)
    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", 92)  # 水色
	  line_index_ary.push(92)
	elsif num == 6
	  $line_color = $line_hash
	  $line_color.store("index", 742)  # 橙
	  line_index_ary.push(742)
	elsif num == 7
	  $line_color = $line_hash
	  $line_color.store("index", 102)  # ぴんく
	  line_index_ary.push(102)
	else 
	  $line_color = $line_hash
	  $line_color.store("index", (num*10 +12))
	  line_index_ary.push(num*10 +12)
	end
	line_type_ary.push(1)

=begin
mono 用
	if num == 1
	  line_type_ary.push(3)
	  line_index_ary.push(12)
	  $line_color = $line_hash
	  $line_color.store("index", 14)
	  $line_color.store("type", 3)
	elsif num == 2
	  line_type_ary.push(4)
	  line_index_ary.push(12)
	  $line_color = $line_hash
	  $line_color.store("index", 14)
	  $line_color.store("type", 4)
	end
=end

	name_ary.push(gphys_array[num].data.get_att("line_name"))
	GGraph.line( gphys_array[num], false, $line_color ) 

      end
    }

    # タイトル
    DCL::uzinit 
    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
    DCL::uzinit 
    DCL.uxpttl("t", 0, $file_label, 1.0)

    __show_line_index(name_ary,line_index_ary, line_type_ary)
#    __line_index(name_ary,line_index_ary) 

  end
=begin
  #  ラインインデックスの種類を表示
  def __show_line_index(str_ary,line_index_ary, line_type_ary, x=0.15, y=0.1)
    charsize = 0.8 * DCL.uzpget('rsizec1')
    len = 0.04     # 線の長さ
    dvx = 0.03
    dvy = charsize*1.6
    
    raise TypeError,"Array expected" if ! str_ary.is_a?(Array)
    vxmin,vxmax,vymin,vymax = DCL.sgqvpt
    vx = 0.15
    vy = 0.13 - charsize/2
#    vx = x
#    vy = y - charsize/2
    str_ary.size.times{|num|
      DCL::sgplzv([vx, vx + len],[vy, vy], line_type_ary[num],
		  line_index_ary[num])
      DCL::sgtxzv(vx + len + 0.01 ,vy,str_ary[num],
                  charsize, 0, -1, 13 )
      vy -= dvy
      if num == 3
        vx = 0.34
        vy = 0.13 - charsize/2
      elsif num == 7
        vx = 0.53
        vy = 0.13 - charsize/2
      end
    }

    nil
  end
=end  
=begin

  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
=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
  
  def mkdump(gphys, gphys_u=nil, gphys_v=nil)
    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 = "#{$file_label}_#{gphys.name}.gif"
    `rm dcl_* tmp.pnm`  
    plot(gphys)
    `for file in *.xwd;do xwdtopnm ${file} | pnmcut 2 2 904 654 > tmp.pnm;done`
#    `for file in *.xwd;do xwdtopnm ${file} | pnmcut 2 2 840 630 > tmp.pnm;done`
    `ppmtogif tmp.pnm > #{$fig_path}#{file_name}`
    `rm dcl_* tmp.pnm`  

    $file_name = $pre_file

  end

=begin
  # gif ファイル作成 (dump のタイミングがよくわからん)
  def mkdump(gphys, gphys_u=nil, gphys_v=nil)
    gropn(3) if $gropn == nil
    if gphys.name =~ /_spct$/ 
      plot_spct_bunsan(gphys)
    else      
      if gphys_u == nil || gphys_v == nil then
	plot(gphys)
      else
	plot(gphys, gphys_u, gphys_v)
      end
    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
=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)
    
    rmiss = DCL.glpget('rmiss')
    # トーンパターンのデフォルト
    patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
    
    # トーンレベルのデフォルト: ((最大値 - 最小値) / 8 )
    levels = Array.new
    dx = (gphys.max.val - gphys.min.val)/7 ;  x  = gphys.min.val 
#    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
    }
    
    levels[0]  = rmiss
    levels[-1] = rmiss

    # コンター, トーンセット
    $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
    $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
      'line_type'=> line_type }

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

    # 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 
      NumRu::DCL.udpset("LMSG",false)
    else
      $tone_flag = true
      NumRu::DCL.udpset("LMSG",true)
    end

    # 初期化
    $fig_set_hash = {"window" => nil}
    $line_hash = { 'exchange'=>false, 'index'=>3 }
    DCL::ugrset('UXUNIT', -999)
    DCL::ugrset('UYUNIT', -999)
#    DCL::ugrset('VXULOC', -999)
#    DCL::ugrset('VYULOC', -999)
    
#    $cont_flag = true if gphys.name =~ /spct/

    rmiss = DCL.glpget('rmiss')


    if gphys.name == "sst_zonal" || gphys.name == "sst-h1998con_zonal" || gphys.name == "sst-con_zonal" || gphys.name == "sst-con-h1998con_zonal"
      $fig_set_hash = { "window" => 
#	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 273-5,303.0]}
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 250,310.0]}

    elsif gphys.name == "sst"
      levels = NArray[rmiss, 287.5, 290, 292.5, 295, 297.5, 300, rmiss]
      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[rmiss, -2.0 ,-1, 0.0, 0.5 ,1.0, 2.0, rmiss]
      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]}
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 340,345]}

    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_sluw/
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 40] }

    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, "index"=> 2 }

    elsif gphys.name == "ml_u"
      levels = NArray[rmiss, -15, -5, 0, 5, 15, 25, rmiss]
      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[rmiss, -1.5, -0.5, 0, 0.5, 1.5, rmiss]
      patterns = NArray[30999,40999,55999,70999,75999,85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>0.5, 'max'=> 5.0, 'min'=> -5.0}
      $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] = rmiss
      levels[7] = rmiss
      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[rmiss, -0.08, -0.06, -0.04, -0.02, 0, 0.02, rmiss]
      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[rmiss ,0, 5e+4, 10e+4, 15e+4, 20e+4, 25e+4, rmiss]
      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, rmiss]
      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[rmiss, -15e10 ,-10e10, -5e10, 0, 5e10, 10e10, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      cont_lev, line_type, label  = cont_lev_set(levels)
#      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels, 'tonf'=>true }
      $cont_hash = {'levels' => cont_lev, 'index'=> [2,1], 'label'=> label, 
#	'line_type'=> line_type, 'tonf'=>true }
	'line_type'=> line_type }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "ml_mse" || gphys.name == "ml_dse"
#      levels = NArray[rmiss, 3e5 , 3.25e5, 3.5e5, 3.75e5, 4e5, 4.5e5, rmiss]
      levels = NArray[0, 2.75e5, 3e5, 3.25e5, 3.5e5, 3.75e5, 4e5, rmiss]
      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 == "pf_t"
      levels = NArray[rmiss, -3e-5, -1.5e-5, 0, 1.5e-5, 3e-5, 4.5e-5, rmiss]
      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 == "pf_t_cld" || gphys.name == "pf_t_conv"
      levels = NArray[rmiss, -2e-5, -1e-5, 0, 1e-5, 2e-5, 3e-5, rmiss]
      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 == "pf_t_lw" 
      levels = NArray[rmiss, -6e-5, -3e-5, 0, 3e-5, 6e-5, 9e-5, rmiss]
      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 == "pf_t_sw" 
      levels = NArray[rmiss, 0, 1e-5, 2e-5, 3e-5, 4e-5, 5e-5, rmiss]
      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 == "pf_t_turb" 
      levels = NArray[rmiss, -2e-5, -1e-5, 0, 1e-5, 2e-5, 3e-5, rmiss]
      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 == "pf_q" 
      levels = NArray[rmiss, -2e-8, -1e-8, 0, 1e-8, 2e-8, 3e-8, rmiss]
      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 == "pf_q_cld" 
      levels = NArray[rmiss, -10e-9, -5e-9, 0, 5e-9, 10e-9, 15e-9, rmiss]
      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 == "pf_q_conv"  
      levels = NArray[rmiss, -2e-8, -1e-8, 0, 1e-8, 2e-8, 3e-8, rmiss]
      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 == "pf_q_negq"  
      levels = NArray[rmiss, -2e-10, -1e-10, 0, 1e-10, 2e-10, 3e-10, rmiss]
      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 == "pf_q_turb"  
      levels = NArray[rmiss, -4e-8, -2e-8, 0, 2e-8, 4e-8, 6e-8, rmiss]
      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 == "pf_u"  
      levels = NArray[rmiss, -10e-5, -5e-5, 0, 5e-5, 10e-5, 15e-5, rmiss]
      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 == "pf_u_conv" 
      levels = NArray[rmiss, -10e-6, -5e-6, 0, 5e-6, 10e-6, 15e-6, rmiss]
      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 == "pf_u_turb"  || gphys.name == "pf_v_turb"  
      levels = NArray[rmiss, -10e-5, -5e-5, 0, 5e-5, 10e-5, 15e-5, rmiss]
      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 == "pf_v"  
      levels = NArray[rmiss, -10e-5, -5e-5, 0, 5e-5, 10e-5, 15e-5, rmiss]
      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 == "pf_v_conv"  
      levels = NArray[rmiss, -10e-6, -5e-6, 0, 5e-6, 10e-6, 15e-6, rmiss]
      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[rmiss, 150 , 200, 250, 300, 350, 400, rmiss]
      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[rmiss, 50 , 75, 100, 125, 150, 175, rmiss]
      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[rmiss, 185, 200, 215, 230, 245, 260, rmiss]
      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, rmiss]
      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, rmiss]
      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, rmiss]
      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, rmiss]
      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, rmiss]
      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, rmiss]
      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[rmiss, 275, 300, 325, 350, 375, 400, rmiss]
      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[rmiss, 340, 360, 380, 400, 420, 440, rmiss]
      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[rmiss, 50, 75, 100, 125, 150, 170, rmiss]
      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[rmiss, 0, 3, 6, 9, 12, 15, rmiss]
      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[rmiss, 2e-5, 3e-5, 4e-5, 5e-5, 6e-5, 7e-5, rmiss]
      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[rmiss, -0.2, -0.15, -0.1, -0.05, 0, 0.05, rmiss]
      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[rmiss, -0.04, -0.02, 0, 0.02, 0.04, 0.06, rmiss]
      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[rmiss, 1000e2, 1005e2, 1010e2, 1015e2, 1020e2, 1025e2,rmiss]
      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_tppn_zonal_mono/
      $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,"index"=> 2 }

    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, "index"=> 2 }

    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, "index"=> 2 }

    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/ || gphys.name =~ /ml_u_lat0_sigma_zonal/ || gphys.name =~ /zonalmean_u_at_equator/ 
     $line_hash = { 'exchange'=>true,"index"=> 2, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-15, 20, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    elsif gphys.name =~ /ml_dse_lat20_zonal/ || gphys.name =~ /ml_mse_lat20_zonal/
     $line_hash = { 'exchange'=>true,"index"=> 2, "type" => 1  }
      $fig_set_hash = { "window" => 
	[25e4, 50e4, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

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

    elsif gphys.name =~ /pf_t_lwls_lat0_zonal/
      $line_hash = { 'exchange'=>true, "index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
#	[-10e-5, 5e-5, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}
	[-3e-5, 1e-5, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    elsif gphys.name == "tr_tppn" || gphys.name == "tr_tppn_200" ||gphys.name == "tr_tppn_300" ||gphys.name == "tr_tppn_360all" || gphys.name == "tr_tppn_5deg_mean" || gphys.name == "tr_tppn_30day_1" || gphys.name == "tr_tppn_30day_2" || gphys.name == "tr_tppn_30day_3" || gphys.name == "tr_tppn_30day_4" || gphys.name == "tr_tppn_30day_5" || gphys.name == "tr_tppn_30day_6" || gphys.name =~ /tr_tppn_15day/ || gphys.name =~ /tr_cppn/  || gphys.name =~ /tr_dppn/ || gphys.name =~ /comp_point_tr_tppn/
# 塚原カラー
      patterns = NArray[35999, 45999, 55999, 70999, 75999, 85999]
      levels = NArray[0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, rmiss]
      
      if gphys.name =~ /filt$/
        levels = NArray[10.0**(-6), 10.0**(-5.5), 10.0**(-5), 10.0**(-4.5), 10.0**(-4), 10.0**(-3.5), rmiss]
      end
# 青色
#      levels = NArray[0.0000, 0.0001, 0.0002, 0.0006, 1000]
#      patterns = NArray[99001, 40999, 30999, 20999]
      $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_adfilt"  || gphys.name == "tr_tppn_kfilt" || gphys.name == "tr_tppn_gfilt"  || gphys.name == "tr_tppn_kmfilt" || gphys.name == "tr_tppn_kffilt"    
      patterns = NArray[35999, 45999, 55999, 70999, 75999, 85999]
      levels = NArray[10.0**(-6), 10.0**(-5.5), 10.0**(-5), 10.0**(-4.5), 10.0**(-4), 10.0**(-3.5), rmiss]
#      levels = NArray[0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, rmiss]
#      levels[0..-2] = levels[0..-2]*0.2
      $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_adfilt_op"  || gphys.name == "tr_tppn_kfilt_op" || gphys.name == "tr_tppn_gfilt_op"  || gphys.name == "tr_tppn_kmfilt_op" || gphys.name == "tr_tppn_kffilt_op"    
      patterns = NArray[35999, 45999, 55999, 70999, 75999, 85999]
      levels = NArray[0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, rmiss]
#      cont_lev, line_type, label  = cont_lev_set(levels)
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }

    $cont_hash = {
#      "lev"=>[0.0001], 'label'=> [""], "index"=>1 }
      "lev"=>[0.0001], "index"=>1 }

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


    # log
    elsif gphys.name == "tr_tppn_log"
#      patterns =  NArray[20999, 25999, 31999, 34999, 37999, 9999, 99001]
#      levels = exp(NArray[0.0,  0.6, 1.2, 2.4,  3.6, 4.8, 6.0, 20.0])*0.000001
#      levels[0] = -0.01

    patterns = NArray[35999, 45999, 55999, 70999, 75999, 85999]
    levels = NArray[10.0**(-6), 10.0**(-5.5), 10.0**(-5), 10.0**(-4.5), 10.0**(-4), 10.0**(-3.5), rmiss]

##      DCL.sgscmn(13)
#      patterns = NArray[20999, 25999, 31999, 34999, 37999, 9999, 99001]
#      levels = NArray[rmiss,10.0**(-6), 10.0**(-5.5), 10.0**(-5), 10.0**(-4.5), 10.0**(-4), 10.0**(-3.5), rmiss]

      $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" || gphys.name == "tr_tppn_30day_1_mono"|| gphys.name == "tr_tppn_30day_2_mono"
      # Emanuel 用
#      levels = NArray[0.0000, 0.0001, 0.0003, rmiss]
      # 積雲なし用
      levels = NArray[rmiss, 0.0001, 0.0005, rmiss]
#      patterns = NArray[99001,603,999]
      patterns = NArray[99001,613,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
      }

      # W-K plot
    elsif gphys.name == "tr_tppn_sym_spct_mono" 
      levels = NArray[rmiss, 1.2, 1.6, rmiss]
      patterns = NArray[99001,613,999]
#      patterns = NArray[40999, 30999, 20999,17999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }

      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>1,"tick2"=>1, 
      "vx0"=>0.05,
      "vy0"=>0.1,
      "label_size"=>0.015
      }

    elsif gphys.name == "tr_tppn_spct" || gphys.name == "tr_tppn_200_spct" || gphys.name == "tr_tppn_300_spct" || gphys.name == "tr_tppn_5deg_mean_spct" || gphys.name == "tr_tppn_360all_spct" || gphys.name == "tr_tppn_adfilt_spct" || gphys.name == "tr_tppn_kfilt_spct" || gphys.name == "tr_tppn_gfilt_spct" || gphys.name == "tr_tppn_kmfilt_spct" || gphys.name == "tr_tppn_kffilt_spct"  
      levels = NArray[1e-12, 1e-11, 1e-10, 1e-9, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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" || gphys.name == "tr_lw_toa_200_spct" || gphys.name == "tr_lw_toa_300_spct" || gphys.name == "tr_lw_toa_360all_spct"|| gphys.name == "tr_lw_toa_5deg_mean_spct"
      levels = NArray[1e-1, 1, 10, 100, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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" || gphys.name == "tr_om500_200_spct" || gphys.name == "tr_om500_300_spct" || gphys.name == "tr_om500_360all_spct" || gphys.name == "tr_om500_5deg_mean_spct" || gphys.name == "tr_om500s_spct" || gphys.name == "tr_om500s_200_spct" || gphys.name == "tr_om500s_300_spct" || gphys.name == "tr_om500s_360all_spct" || gphys.name == "tr_om500s_5deg_mean_spct"

      levels = NArray[1e-6, 1e-5, 1e-4, 1e-3, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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" || gphys.name == "tr_u250_200_spct" || gphys.name == "tr_u250_300_spct" || gphys.name == "tr_u250_360all_spct" || gphys.name == "tr_u250_5deg_mean_spct" || gphys.name == "tr_u250s_spct" || gphys.name == "tr_u250s_200_spct" || gphys.name == "tr_u250s_300_spct" || gphys.name == "tr_u250s_360all_spct" || gphys.name == "tr_u250s_5deg_mean_spct" || gphys.name == "tr_u170s_spct" || gphys.name == "tr_u170s_200_spct" || gphys.name == "tr_u170s_300_spct" || gphys.name == "tr_u170s_360all_spct" || gphys.name == "tr_u170s_5deg_mean_spct" || gphys.name == "tr_u250s_adfilt_spct"  || gphys.name == "tr_u250s_gfilt_spct" || gphys.name == "tr_u250s_kfilt_spct" || gphys.name == "tr_u250s_kmfilt_spct" || gphys.name == "tr_u250s_kffilt_spct"|| gphys.name == "tr_u150_spct" || gphys.name == "tr_u850_spct" || gphys.name == "tr_u600_spct" || gphys.name == "tr_u925_spct"      

      levels = NArray[1e-3, 1e-2, 1e-1, 1, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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" || gphys.name == "tr_v250_200_spct" || gphys.name == "tr_v250_300_spct" || gphys.name == "tr_v250_360all_spct" || gphys.name == "tr_v250_5deg_mean_spct" || gphys.name == "tr_v250s_spct" || gphys.name == "tr_v250s_200_spct" || gphys.name == "tr_v250s_300_spct" || gphys.name == "tr_v250s_360all_spct" || gphys.name == "tr_v250s_5deg_mean_spct" || gphys.name == "tr_v170s_spct" || gphys.name == "tr_v170s_200_spct" || gphys.name == "tr_v170s_300_spct" || gphys.name == "tr_v170s_360all_spct" || gphys.name == "tr_v170s_5deg_mean_spct"|| gphys.name == "tr_v150_spct" || gphys.name == "tr_v850_spct" || gphys.name == "tr_v600_spct"|| gphys.name == "tr_v925_spct"

      levels = NArray[1e-3, 1e-2, 1e-1, 1, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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" ||gphys.name == "tr_ps_spct" || gphys.name == "tr_mslp_200_spct" || gphys.name == "tr_mslp_300_spct"  || gphys.name == "tr_mslp_360all_spct" || gphys.name == "tr_mslp_5deg_mean_spct"
      levels = NArray[1e+0, 1e+1, 1e+2, 1e+3, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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 == "tr_slh_spct" 
      levels = NArray[1e-2, 1e-1, 1e-0, 1e+1, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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_ssh_spct" 
      levels = NArray[1e-3, 1e-2, 1e-1, 1e-0, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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_q760s_spct" || gphys.name == "tr_q760s_200_spct" || gphys.name == "tr_q760s_300_spct" || gphys.name == "tr_q760s_360all_spct" || gphys.name == "tr_q760s_5deg_mean_spct" || gphys.name == "tr_q850s_spct" || gphys.name == "tr_q850s_200_spct" || gphys.name == "tr_q850s_300_spct" || gphys.name == "tr_q850s_360all_spct" || gphys.name == "tr_q850s_5deg_mean_spct" || gphys.name == "tr_q950s_spct" || gphys.name == "tr_q950s_200_spct" || gphys.name == "tr_q950s_300_spct" || gphys.name == "tr_q950s_360all_spct" || gphys.name == "tr_q950s_5deg_mean_spct" || gphys.name == "tr_q850s_adfilt_spct" || gphys.name == "tr_q850s_gfilt_spct" || gphys.name == "tr_q850s_kfilt_spct" || gphys.name == "tr_q850s_kmfilt_spct" || gphys.name == "tr_q850s_kffilt_spct" || gphys.name == "tr_q925_spct" ||gphys.name == "tr_q850_spct" ||gphys.name == "tr_q700_spct" 
      levels = NArray[1e-10, 1e-9, 1e-8, 1e-7, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
      $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 == "tr_t170s_spct" || gphys.name == "tr_t170s_200_spct" || gphys.name == "tr_t170s_300_spct" || gphys.name == "tr_t170s_360all_spct" || gphys.name == "tr_t170s_5deg_mean_spct" || gphys.name == "tr_t250s_spct" || gphys.name == "tr_t250s_200_spct" || gphys.name == "tr_t250s_300_spct" || gphys.name == "tr_t250s_360all_spct" || gphys.name == "tr_t250s_5deg_mean_spct" || gphys.name == "tr_t570s_spct" || gphys.name == "tr_t570s_200_spct" || gphys.name == "tr_t570s_300_spct" || gphys.name == "tr_t570s_360all_spct" || gphys.name == "tr_t570s_5deg_mean_spct" || gphys.name == "tr_t570s_adfilt_spct" || gphys.name == "tr_t570s_kfilt_spct" || gphys.name == "tr_t570s_gfilt_spct"  || gphys.name == "tr_t570s_kmfilt_spct" || gphys.name == "tr_t570s_kffilt_spct"  || gphys.name == "tr_t250_spct"  || gphys.name == "tr_t150_spct"  || gphys.name == "tr_t600_spct"  
      levels = NArray[1e-4, 1e-3, 1e-2, 1e-1, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
      $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 == "tr_phi170s_spct" || gphys.name == "tr_phi170s_200_spct" || gphys.name == "tr_phi170s_300_spct" || gphys.name == "tr_phi170s_360all_spct" || gphys.name == "tr_phi170s_5deg_mean_spct" || gphys.name == "tr_phi250s_spct" || gphys.name == "tr_phi250s_200_spct" || gphys.name == "tr_phi250s_300_spct" || gphys.name == "tr_phi250s_360all_spct" || gphys.name == "tr_phi250s_5deg_mean_spct"|| gphys.name == "tr_phi250_spct"|| gphys.name == "tr_phi150_spct"|| gphys.name == "tr_phi850_spct"

      levels = NArray[1e-3, 1e-2, 1e-1, 1, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
      $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 == "comp_t_conv_zonal"
      $line_hash = { 'exchange'=>true, "index"=> 3, "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_tuom/
      levels = NArray[rmiss, -1.5, -1, -0.5, 0, 0.5, 1,rmiss]
      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 tuom ベクトル設定
#    DCL::ugrset('XFACT1', 3*10E-6*100)
#    DCL::ugrset('YFACT1', 6.0/100)
#    DCL::ugrset('VXUNIT', 0.05)
#    DCL::ugrset('VYUNIT', 0.05)

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
#      DCL::ugrset('YFACT1', 5.0/100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
#      DCL::ugrset('VXUNIT', 0.05)
#      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_tuom_mono/
      levels = NArray[rmiss, -1.5, -1, -0.5, 0, 0.5, 1,rmiss]
      patterns = NArray[603, 603, 603, 603, 99001, 99001, 99001]
      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 tuom ベクトル設定
#    DCL::ugrset('XFACT1', 3*10E-6*100)
#    DCL::ugrset('YFACT1', 6.0/100)
#    DCL::ugrset('VXUNIT', 0.05)
#    DCL::ugrset('VYUNIT', 0.05)

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
#      DCL::ugrset('XFACT1', 3*10E-6*100)
#      DCL::ugrset('YFACT1', 6.0/100)
      DCL::ugrset('XFACT1', 2*10E-6*100)
#      DCL::ugrset('YFACT1', 5.0/100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
#      DCL::ugrset('VXUNIT', 0.05)
#      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_tvuom/
#      levels = NArray[rmiss, -0.6, -0.3, 0, 0.3, 0.6, 0.9,rmiss]
      levels = NArray[rmiss, -1.5, -1, -0.5, 0, 0.5, 1,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
#      DCL::ugrset('YFACT1', 5.0/100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_quom/
      levels = NArray[rmiss, 0.0, 0.00025, 0.0005, 0.00075, 0.001, 0.00125 ,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
#      DCL::ugrset('YFACT1', 5.0/100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_tconvuom/
      levels = NArray[rmiss, -3e-4, 0, 3e-4, 6e-4, 9e-4, 12e-4,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
#      DCL::ugrset('YFACT1', 5.0/100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_uuom/
      levels = NArray[rmiss, -9, -6, -3, 0, 3, 6, rmiss]
      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 tuom ベクトル設定
      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
      DCL::ugrset('YFACT1', 15.0/100)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)


    elsif gphys.name =~ /comp_tppn/
      levels = NArray[0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, rmiss]
      patterns = NArray[35999, 45999, 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 =~ /comp_tuv570/ || gphys.name =~ /comp_tuv_z8/
      levels = NArray[rmiss, -1.5, -1, -0.5, 0, 0.5, 1,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_phiuv850/ || gphys.name =~ /comp_gphuv_z5/ 
      levels = NArray[rmiss,-20,-10, 0, 10, 20, 30,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_phiuv250/ || gphys.name =~ /comp_gphuv_z12/
      levels = NArray[rmiss,-40,-20, 0, 20, 40, 60,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_psuv/
      levels = NArray[rmiss,-200,-100, 0, 100, 200, 300,rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name =~ /comp_quv850/ || gphys.name =~ /comp_quv_z5/
      levels = NArray[rmiss, -0.002, -0.001, 0, 0.001, 0.002, 0.003, rmiss]
      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
      }

      # 風 (u,-sigdot) ベクトル
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.06)
      DCL::ugrset('VYUNIT', 0.06)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name == "t_conv"
      levels = NArray[rmiss, -2e-4, 0, 2e-4, 4e-4, 6e-4, 8e-4,rmiss]
      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" || gphys.name == "tr_lw_toa_200" || gphys.name == "tr_lw_toa_300"|| gphys.name == "tr_lw_toa_360all" || gphys.name == "tr_lw_toa_5deg_mean"
      levels = NArray[rmiss, -90, -60, -30, 0, 30, 60, rmiss]
      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" || gphys.name == "tr_om500_200" || gphys.name == "tr_om500_300"|| gphys.name == "tr_om500_360all" || gphys.name == "tr_om500_5deg_mean" || gphys.name == "tr_om500s" || gphys.name == "tr_om500s_200" || gphys.name == "tr_om500s_300"|| gphys.name == "tr_om500s_360all" || gphys.name == "tr_om500s_5deg_mean"
      levels = NArray[rmiss, -0.6, -0.4, -0.2, 0, 0.2, 0.4, rmiss]
      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" || gphys.name == "tr_u250_200" || gphys.name == "tr_v250_200" || gphys.name == "tr_u250_300" || gphys.name == "tr_v250_300" || gphys.name == "tr_u250_360all"|| gphys.name == "tr_v250_360all"  || gphys.name == "tr_u250_5deg_mean"  || gphys.name == "tr_v250_5deg_mean" || gphys.name == "tr_u850"|| gphys.name == "tr_v850" || gphys.name =~ /comp_point_tr_u850/ || gphys.name =~ /comp_point_tr_u250/  ||  gphys.name == "tr_u250s" || gphys.name == "tr_v250s" || gphys.name == "tr_u250s_200" || gphys.name == "tr_v250s_200" || gphys.name == "tr_u250s_300" || gphys.name == "tr_v250s_300" || gphys.name == "tr_u250s_360all"|| gphys.name == "tr_v250s_360all"  || gphys.name == "tr_u250s_5deg_mean"  || gphys.name == "tr_v250s_5deg_mean" || gphys.name == "tr_u170s" || gphys.name == "tr_v170s" || gphys.name == "tr_u170s_200" || gphys.name == "tr_v170s_200" || gphys.name == "tr_u170s_300" || gphys.name == "tr_v170s_300" || gphys.name == "tr_u170s_360all"|| gphys.name == "tr_v170s_360all"  || gphys.name == "tr_u170s_5deg_mean"  || gphys.name == "tr_v170s_5deg_mean" || gphys.name == "tr_u150" || gphys.name == "tr_v150" || gphys.name == "tr_u600" || gphys.name == "tr_v600" || gphys.name == "tr_u925" || gphys.name == "tr_v925" 

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

    elsif gphys.name == "tr_u250s_adfilt" || gphys.name == "tr_u250s_kfilt" || gphys.name == "tr_u250s_gfilt"  || gphys.name == "tr_u250s_kmfilt" || gphys.name == "tr_u250s_kffilt"    
      levels = NArray[rmiss, -10, -5, 0, 5, 10, 20, rmiss]
      levels[1..-2] = levels[1..-2]*0.5
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'min'=>-50,'int'=>2.5, 'max'=>70 }
#      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_u250s_adfilt_op" || gphys.name == "tr_u250s_kfilt_op" || gphys.name == "tr_u250s_gfilt_op"  || gphys.name == "tr_u250s_kmfilt_op" || gphys.name == "tr_u250s_kffilt_op"   
      levels = NArray[rmiss, -10, -5, 0, 5, 10, 20, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }

      $cont_hash = {
#        "lev"=>[-0.5,0.5], 'label'=> ["",""], "index"=>1 , 
        "lev"=>[-5,5], "index"=>2 , 
        "line_type" => [3,1] }

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

    elsif gphys.name == "tr_slh" 
      levels = NArray[rmiss, -60, -30, 0, 30, 60, 90, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_ssh" 
      levels = NArray[rmiss, -6, -3, 0, 3, 6, 9, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_q760s" || gphys.name == "tr_q760s_200" || gphys.name == "tr_q760s_300"|| gphys.name == "tr_q760s_360all" || gphys.name == "tr_q760s_5deg_mean" || gphys.name == "tr_q850s" || gphys.name == "tr_q850s_200" || gphys.name == "tr_q850s_300"|| gphys.name == "tr_q850s_360all" || gphys.name == "tr_q850s_5deg_mean" || gphys.name == "tr_q950s" || gphys.name == "tr_q950s_200" || gphys.name == "tr_q950s_300"|| gphys.name == "tr_q950s_360all" || gphys.name == "tr_q950s_5deg_mean" || gphys.name =~ /comp_point_tr_q850/  || gphys.name == "tr_q925"|| gphys.name == "tr_q850"|| gphys.name == "tr_q700"
      levels = NArray[rmiss, -0.002, -0.001, 0, 0.001, 0.002, 0.003, rmiss]

      if gphys.name =~ /filt$/
        levels = NArray[rmiss, -0.001, -0.0005, 0, 0.0005, 0.001, 0.0015, rmiss]
      end
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_q850s_adfilt" || gphys.name == "tr_q850s_kfilt" || gphys.name == "tr_q850s_gfilt" || gphys.name == "tr_q850s_kmfilt" || gphys.name == "tr_q850s_kffilt"  
      levels = NArray[rmiss, -0.002, -0.001, 0, 0.001, 0.002, 0.003, rmiss]
      levels[1..-2] = levels[1..-2]*0.5
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_q850s_adfilt_op" || gphys.name == "tr_q850s_kfilt_op" || gphys.name == "tr_q850s_gfilt_op" || gphys.name == "tr_q850s_kmfilt_op" || gphys.name == "tr_q850s_kffilt_op"  
      levels = NArray[rmiss, -0.002, -0.001, 0, 0.001, 0.002, 0.003, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {
#        "lev"=>[-0.001,0.001], 'label'=> ["",""], "index"=>1,  
        "lev"=>[-0.001,0.001], "index"=>2,  
        "line_type" => [3,1] }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_t170s" || gphys.name == "tr_t170s_200" || gphys.name == "tr_t170s_300"|| gphys.name == "tr_t170s_360all" || gphys.name == "tr_t170s_5deg_mean" || gphys.name == "tr_t250s" || gphys.name == "tr_t250s_200" || gphys.name == "tr_t250s_300"|| gphys.name == "tr_t250s_360all" || gphys.name == "tr_t250s_5deg_mean" || gphys.name == "tr_t570s" || gphys.name == "tr_t570s_200" || gphys.name == "tr_t570s_300"|| gphys.name == "tr_t570s_360all" || gphys.name == "tr_t570s_5deg_mean" || gphys.name =~ /comp_point_tr_t570/ || gphys.name == "tr_t250" || gphys.name == "tr_t150" || gphys.name == "tr_t600"  
      levels = NArray[rmiss, -1, -0.5, 0, 0.5, 1, 1.5, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_t570s_adfilt" || gphys.name == "tr_t570s_kfilt" || gphys.name == "tr_t570s_gfilt"  || gphys.name == "tr_t570s_kmfilt" || gphys.name == "tr_t570s_kffilt"    
      levels = NArray[rmiss, -1, -0.5, 0, 0.5, 1, 1.5, rmiss]
      levels[1..-2] = levels[1..-2]*0.5
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name == "tr_t570s_adfilt_op" || gphys.name == "tr_t570s_kfilt_op" || gphys.name == "tr_t570s_gfilt_op"  || gphys.name == "tr_t570s_kmfilt_op" || gphys.name == "tr_t570s_kffilt_op"    
      levels = NArray[rmiss, -1, -0.5, 0, 0.5, 1, 1.5, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {
#        "lev"=>[-0.05,0.05], 'label'=> ["",""], "index"=>1 ,
        "lev"=>[-0.5,0.5],  "index"=>2 ,
        "line_type" => [3,1] }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "tr_phi170s" || gphys.name == "tr_phi170s_200" || gphys.name == "tr_phi170s_300"|| gphys.name == "tr_phi170s_360all" || gphys.name == "tr_phi170s_5deg_mean" || gphys.name == "tr_phi250s" || gphys.name == "tr_phi250s_200" || gphys.name == "tr_phi250s_300"|| gphys.name == "tr_phi250s_360all" || gphys.name == "tr_phi250s_5deg_mean" || gphys.name == "tr_phi250" || gphys.name == "tr_phi150" || gphys.name == "tr_phi850" 
      levels = NArray[rmiss, -20, -10, 0, 10, 20, 30, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }

    elsif gphys.name =~ /comp_point_tr_t250/ 
      levels = NArray[rmiss, -2, -1, 0, 1, 2, 3, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'min'=>-10,'int'=>2.5, 'max'=>10 }
#      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>0,
	"tick1"=>20,"tick2"=>1
      }


    elsif gphys.name == "tr_mslp" ||gphys.name == "tr_ps" || gphys.name == "tr_mslp_200" || gphys.name == "tr_mslp_300" || gphys.name == "tr_mslp_360all" || gphys.name == "tr_mslp_5deg_mean"
      levels = NArray[rmiss, -450, -300, -150, 0, 150, 300, rmiss]
      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[rmiss,-0.3,-0.2,-0.1, 0, 0.1, 0.2,rmiss]
      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[rmiss,-10,-5, 0, 5, 10, 15, rmiss]
      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[rmiss,-10,-5, 0, 5, 10, 15, rmiss]
      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[rmiss,-0.06,-0.04,-0.02, 0, 0.02, 0.04,rmiss]
      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[rmiss, -0.04, 0, 0.04, 0.08, 0.16,0.20, rmiss]
      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[rmiss,-20e-6,-10e-6, 0, 10e-6, 100e-6, 200e-6,rmiss]
      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_lev = [-80e-6,-60e-6,-40e-6,-20e-6,-15e-6,-10e-6,-5e-6, 0, 5e-6, 10e-6, 20e-6, 40e-6, 60e-6,  80e-6, 100e-6, 200e-6]
      label = ["","-6.00e-5","","-2.00e-5","","-1.00e-5","", "0.00","", "1.00e-5", "2.00e-5", "", "", "", "", "", "", "", "1.00e-4", "2.00e-4"]
      line_type  = [3,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1]
      line_index = [2,2,2,2,1,2,1,2,1,2,2,2,2,2,2,2]

      $cont_hash = {'levels' => cont_lev, 'index'=> line_index, '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[rmiss,-20e-6,-10e-6, 0, 10e-6, 20e-6, 30e-6,rmiss]
      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[rmiss,-10,-5, 0, 5, 10, 15,rmiss]
      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[rmiss,-1,-0.5, 0, 0.5, 1, 1.5,rmiss]
      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[rmiss,-10,-5, 0, 5, 10, 15,rmiss]
      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[rmiss, -10,-5, 0, 5, 10, 15,rmiss]
      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[rmiss, -20,-10, 0, 10, 20, 30,rmiss]
      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[rmiss, -10e-6,-5e-6, 0, 5e-6, 10e-6, 15e-6,rmiss]
      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[rmiss, -2,0, 2, 4, 6,8,rmiss]
      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[rmiss,-0.030,-0.015, 0, 0.015, 0.030, 0.045,rmiss]
      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[rmiss,-0.03,-0.02,-0.01, 0, 0.01, 0.02,rmiss]
      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[rmiss,-200,-100, 0, 100, 200, 300,rmiss]
      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[rmiss,-200,-100, 0, 100, 200, 300,rmiss]
      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)

      # Hosaka ps の風ベクトル (単位ベクトル有り)
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.02)
      DCL::ugpstx('YFACT1', 0.02)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name == "sh_phiuv850_anm" 
      levels = NArray[rmiss,-200,-100, 0, 100, 200, 400,rmiss]
      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)

      # Hosaka ps の風ベクトル (単位ベクトル有り)
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.01)
      DCL::ugpstx('YFACT1', 0.01)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name == "sh_phiuv250_anm" 
      levels = NArray[rmiss,-400,-200, 0, 200, 400, 600,rmiss]
      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)

      # Hosaka ps の風ベクトル (単位ベクトル有り)
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.005)
      DCL::ugpstx('YFACT1', 0.005)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUOFF', 0.01)


    elsif gphys.name == "sh_tuv500_anm" 
      levels = NArray[rmiss,-0.6,-0.3, 0, 0.3, 0.6, 0.9,rmiss]
      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)

      # Hosaka ps の風ベクトル (単位ベクトル有り)
      DCL::uglset('LNRMAL', false)
      DCL::ugrstx('XFACT1', 0.005)
      DCL::ugpstx('YFACT1', 0.005)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUOFF', 0.01)

    elsif gphys.name == "ml_tuom_anm" 
      levels = NArray[rmiss,-0.6,-0.3, 0, 0.3, 0.6, 0.9, rmiss]
      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/10)
#      DCL::ugrset('VXUNIT', 0.05)
#      DCL::ugrset('VYUNIT', 0.05)

      # Hosaka ps の風ベクトル (単位ベクトル有り)
      DCL::uglset('LNRMAL', false)
      DCL::ugrset('XFACT1', 2*10E-6*100)
      DCL::ugrset('YFACT1', 20.0/100)
      DCL::uglset('LUNIT', true)
      DCL::ugrset('VXUNIT', 0.05)
      DCL::ugrset('VYUNIT', 0.05)
      DCL::ugrset('VXUOFF', 0.01)
      
    elsif gphys.name == "t_conv_zonal"
      $line_hash = { 'exchange'=>true,"index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-1e-4, 1e-4, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}


    elsif gphys.name == "tr_test_spct"
      levels = NArray[1e-2,1e-1, 1, 10, 100 ]
#      levels = NArray[1e-13, 1e-12, 1e-11, 1e-10, 1e-9 ]
#      patterns = NArray[30999, 40999, 70999, 85999]
      patterns = NArray[40999, 30999, 20999,17999]
      $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 == "noaa_olr"
      $cont_flag = false 
      levels = NArray[0, 150, 200, 250 ]
      patterns = NArray[20999, 30999, 40999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>50, 'max'=>250 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>1,
	"tick1"=>7,"tick2"=>1
      }
#      $fig_set_hash = { "window" => 
#	[ 0.0,360.0, gphys.axis(1).pos.val.max, gphys.axis(1).pos.val.min]}


    elsif gphys.name == "tr_tppn_yamadami"  || gphys.name == "tr_tppn_blue"  
#      levels = NArray[0.00001, 0.0001, 0.001, 1000]
#      levels = NArray[0.0001, 0.001, 0.01, 1000]
      levels = NArray[0.0000, 0.0001, 0.0002, 0.0006, 1000]
      patterns = NArray[99001, 40999, 30999, 20999]
      $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
      }
#      $fig_set_hash = { "window" => 
#	[ 0.0,360.0, gphys.axis(1).pos.val.max, gphys.axis(1).pos.val.min]}

    elsif gphys.name == "tr_tppn_log_spct" 
      levels = NArray[1e-12, 1e-11, 1e-10, 1e-9, rmiss ]
      patterns = NArray[40999, 30999, 20999,17999]
#      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
      }

      # W-K plot
    elsif gphys.name == "tr_tppn_sym_spct" || gphys.name == "tr_lw_toa_sym_spct" || gphys.name == "tr_om500_sym_spct" || gphys.name == "tr_u250_sym_spct" || gphys.name == "tr_v250_sym_spct" || gphys.name == "tr_mslp_sym_spct" || gphys.name == "tr_ps_sym_spct" || gphys.name == "tr_t250_sym_spct" || gphys.name == "tr_t170_sym_spct" || gphys.name == "tr_t570_sym_spct" || gphys.name == "tr_q950_sym_spct" || gphys.name == "tr_q850_sym_spct" || gphys.name == "tr_q760_sym_spct" || gphys.name == "tr_u250_sym_spct" ||  gphys.name == "tr_u170_sym_spct" || gphys.name == "tr_v250_sym_spct" ||  gphys.name == "tr_v170_sym_spct" || gphys.name == "tr_phi250_sym_spct" ||  gphys.name == "tr_phi170_sym_spct" || gphys.name == "tr_tppn_sym_bgw_spct"

      levels = NArray[1.2, 1.4, 1.6, 2.0, rmiss]
      patterns = NArray[40999, 30999, 20999,17999]
#      patterns = NArray[40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>0.4,'int'=>0.4, 'max'=>2 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    elsif gphys.name == "tr_tppn_asym_spct" || gphys.name == "tr_lw_toa_asym_spct" || gphys.name == "tr_om500_asym_spct" || gphys.name == "tr_u250_asym_spct" || gphys.name == "tr_v250_asym_spct" || gphys.name == "tr_mslp_asym_spct" || gphys.name == "tr_ps_asym_spct" || gphys.name == "tr_t250_asym_spct" || gphys.name == "tr_t170_asym_spct" || gphys.name == "tr_t570_asym_spct" || gphys.name == "tr_q950_asym_spct" || gphys.name == "tr_q850_asym_spct" || gphys.name == "tr_q760_asym_spct" || gphys.name == "tr_u250_asym_spct" ||  gphys.name == "tr_u170_asym_spct" || gphys.name == "tr_v250_asym_spct" ||  gphys.name == "tr_v170_asym_spct" || gphys.name == "tr_phi250_asym_spct" ||  gphys.name == "tr_phi170_asym_spct"  
      levels = NArray[0.1, 0.3, 0.5, 0.7, rmiss]
      patterns = NArray[40999, 30999, 20999,17999]
#      patterns = NArray[40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
#      $cont_hash = {'min'=>0.4,'int'=>0.4, 'max'=>2 }
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }

    # AGCM5 condensation heating
    elsif gphys.name == "agcm_qcnd"
      $line_hash = { 'exchange'=>true,"index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-1e-5, 5e-5, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    # AGCM5 longwave heating
    elsif gphys.name == "agcm_qrad" || gphys.name == "agcm_qradl"
      $line_hash = { 'exchange'=>true,"index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-30e-6, 5e-6, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    # AGCM5 eastward wind
    elsif gphys.name == "agcm_u" 
      $line_hash = { 'exchange'=>true,"index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
	[-30, 5, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}

    # AGCM5 precipitation flux
    elsif gphys.name == "agcm_rain"
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.min, gphys.axis(0).pos.val.max, 0, 100e-6] }

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

    elsif gphys.name == "tr_rh_test"
      $line_hash = { 'exchange'=>false, "index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
	[gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min,0e0, 10e-6]}

    elsif gphys.name =~ /ml_rhq_lat0/
    $line_hash = { 'exchange'=>true,"index"=> 2, "type" => 1  }
    $fig_set_hash = { "window" =>
      [-1e0, 1e0, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}


=begin
    elsif gphys.name =~ /tr_rh007/
      levels = NArray[rmiss, -0.5, -0.1, 0, 0.1, 0.5, 1.0, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
        "levels"=>levels,
        "colors"=>patterns,
        "eqlev"=>true,
        "nobound"=>0,
        "tick1"=>20,"tick2"=>1
      }

    elsif gphys.name =~ /tr_q007/
      levels = NArray[rmiss, -0.5, -0.1, 0, 0.1, 0.5, 1.0, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
        "levels"=>levels,
        "colors"=>patterns,
        "eqlev"=>true,
        "nobound"=>0,
        "tick1"=>20,"tick2"=>1
      }
=end

=begin
    elsif gphys.name =~ /tr_rh/
      levels = NArray[rmiss, -0.06, -0.03, 0, 0.03, 0.06, 0.09, rmiss]
      patterns = NArray[30999, 35999, 40999, 55999, 70999, 75999, 85999]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cbar_conf = {
        "levels"=>levels,
        "colors"=>patterns,
        "eqlev"=>true,
        "nobound"=>0,
        "tick1"=>20,"tick2"=>1
      }
=end

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

    elsif gphys.name =~ /pf_q_zonal/
      $line_hash = { 'exchange'=>true, "index"=> 3, "type" => 1  }
      $fig_set_hash = { "window" => 
#	[-5e-8, 5e-8, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}
	[-10e-8, 10e-8, gphys.axis(0).pos.val.max, gphys.axis(0).pos.val.min]}


    elsif gphys.name == "tr_tppn_visual" 
      patterns = NArray[7999, 45999, 55999, 65999, 80999, 85999, 95999]
      levels = NArray[rmiss,0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, rmiss]
      $tone_hash = { 'patterns'=> patterns, 'levels'=>levels }
      $cont_hash = {'int'=>0.5}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true,
#	"nobound"=>2,
	"nobound"=>2,
	"tick1"=>7,"tick2"=>1
      }


=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, 'tonf'=>true}
      $cbar_conf = {
	"levels"=>levels, 
	"colors"=>patterns,
	"eqlev"=>true, 
	"nobound"=>2, 
	"tick1"=>7,"tick2"=>1
      }

=end

    else
      plot_def(gphys)
    end
    
  end
  
end





