
###
### $BCM$N<hF@(B
###

/.*_(.*)\.nc/ =~ ARGV[0]
H2O   = GPhys::IO.open(ARGV[0], $1).cut('z'=>0..zlev)

/.*_(.*)\.nc/ =~ ARGV[1]
NH4SH = GPhys::IO.open(ARGV[1], $1).cut('z'=>0..zlev)

/.*_(.*)\.nc/ =~ ARGV[2]
NH3   = GPhys::IO.open(ARGV[2], $1).cut('z'=>0..zlev)

 
if ( $OPT_max )
  maximum = $OPT_max.to_f
else
  maximum = 1.5e-3
end

if ( $OPT_min )
  minimum = $OPT_min.to_f
else
  minimum = 1.5e-5
end



###
### $B?^$N:n@.(B
###
WindowOpen( aspect, $OPT_dump, false )

GGraph.set_axes('ytitle'=>'Height','xtitle'=>'')
GGraph.set_axes('xunits'=>'km','yunits'=>'km')

for i in 0..num
  time = time0 + i * deltime
  p time
  DCL::slsttl( "TIME = "+time.to_s,  'B', 0.0, 1.0, 0.02, 1)
  
  # H2O $B1+:.9gHf(B
  if ($OPT_lin) 
    GGraph.tone( H2O.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'nlev'=> 50 ,
                 'max' => maximum, 
                 'min' => 0.0
                 )	
    GGraph.color_bar
  else
    GGraph.tone( H2O.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'levels'=>[1e-8,2e-8,5e-8,1e-7,2e-7,5e-7,1e-6,2e-6,5e-6,1e-5,2e-5,5e-5,1e-4,2e-4,5e-4,1e-3,2e-3,5e-3,1e-2]
                 )	
    GGraph.color_bar( 'constwidth' => true, 'landscape' => true )
  end

  # NH4SH $B1+:.9gHf(B
  if ($OPT_lin) 
    GGraph.tone( NH4SH.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'nlev'=> 50,
                 'max' => maximum, 
                 'min' => 0.0
                 )	
    GGraph.color_bar
  else  
    GGraph.tone( NH4SH.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'levels'=>[1e-8,2e-8,5e-8,1e-7,2e-7,5e-7,1e-6,2e-6,5e-6,1e-5,2e-5,5e-5,1e-4,2e-4,5e-4,1e-3,2e-3,5e-3,1e-2]
                 )	
    GGraph.color_bar( 'constwidth' => true, 'landscape' => true )
  end

  # NH3 $B1+:.9gHf(B
  if ($OPT_lin) 
    GGraph.tone( NH3.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'nlev'=> 50,
                 'max' => maximum,
                 'min' => 0.0
                 )	
    GGraph.color_bar
  else
    GGraph.tone( NH3.cut('t'=>time), 
                 true, 
                 'title' => 'Rain Mixing Ratio [kg/kg]', 
                 'annotate' => infosw,
                 'levels'=>[1e-8,2e-8,5e-8,1e-7,2e-7,5e-7,1e-6,2e-6,5e-6,1e-5,2e-5,5e-5,1e-4,2e-4,5e-4,1e-3,2e-3,5e-3,1e-2]
                 )	
    GGraph.color_bar( 'constwidth' => true, 'landscape' => true  )
  end
#  GGraph.color_bar( 'constwidth' => true, 
#                    'landscape' => true 
#                    )

end

DCL::grcls


if ( $OPT_dump )

  DumpCompPNG( time0, deltime, num )

end

