#!/usr/bin/env ruby require "numru/netcdf" require "numru/dcl" require "numru/ggraph" require "getoptlong" include NumRu parser = GetoptLong.new parser.set_options( ### global option ### ['--delt', GetoptLong::REQUIRED_ARGUMENT], ['--time', GetoptLong::REQUIRED_ARGUMENT], ['--num', GetoptLong::REQUIRED_ARGUMENT], ['--max', GetoptLong::REQUIRED_ARGUMENT], ['--min', GetoptLong::REQUIRED_ARGUMENT], ['--zlev', GetoptLong::REQUIRED_ARGUMENT], ['--xlev', GetoptLong::REQUIRED_ARGUMENT], ['--spc', GetoptLong::REQUIRED_ARGUMENT], ['--aspect', GetoptLong::REQUIRED_ARGUMENT], ['--noinfo', GetoptLong::NO_ARGUMENT], ['--lin', GetoptLong::NO_ARGUMENT], ['--density', GetoptLong::NO_ARGUMENT], ['--dump', GetoptLong::NO_ARGUMENT] ) begin parser.each_option do |name, arg| eval "$OPT_#{name.sub(/^--/, '').gsub(/-/, '_')} = '#{arg}'" end rescue exit(1) end if ( $OPT_noinfo ) infosw = false else infosw = true end ### ### 値の取得 ### file1 = "obratmos_jupiter_x1_441.0K-2.0d6Pa.nc" file2 = "obratmos_jupiter_x5_432.0K-2.0d6Pa.nc" file3 = "obratmos_jupiter_x10_421.0K-2.0d6Pa.nc" var = "stab" Stab1 = GPhys::IO.open(file1,var) Stab2 = GPhys::IO.open(file2,var) Stab3 = GPhys::IO.open(file3,var) if ( $OPT_max ) maximum = $OPT_max.to_f else maximum = 1.5e-4 end if ( $OPT_min ) minimum = $OPT_min.to_f else minimum = 1.0e-7 end p maximum, minimum ### ### 図の作成 ### DCL::swpset('IWIDTH', 600 ) DCL::swpset('IHEIGHT', 600 ) DCL.sgpset('lfull',true) DCL.sgpset('lfprop',true) DCL.sglset('lclip',true) DCL.sgpset('lcntl', false) DCL.udpset('lmsg',false) if ( $OPT_dump ) DCL.gropn( 2 ) else DCL.gropn( 4 ) end GGraph.set_fig('viewport'=>[0.1, 0.85, 0.1, 0.85]) DCL::uzfact(0.75) DCL::slmgn(0.01, 0.01, 0.035, 0.01) GGraph.set_axes('ytitle'=>'Pressure','xtitle'=>'Stability') GGraph.set_axes('xunits'=>'s^-2','yunits'=>'Pa') GGraph.set_fig( 'itr'=> 2) GGraph.line( Stab3, true, 'exchange'=>true, # 'title' => 'Stability', 'title' => '', 'annotate'=>infosw, 'index'=> 23, 'type' => 1 , 'max'=> maximum, 'min'=> minimum ) GGraph.line( Stab2, false, 'exchange'=>true, 'index'=> 32, 'type' => 1 ) GGraph.line( Stab1, false, 'exchange'=>true, 'index'=> 42, 'type' => 1 ) DCL.grcls if ($OPT_dump) convert = '~sugiyama/work/deepconv/arare4/tools/dcmodel-dclps2png.rb' pngfile = "oboro-plot_x1-5-10.png" output1 = 'psselect 1 dcl.ps > dcl2.ps' output2 = convert+" dcl2.ps "+pngfile system( output1 ) system( output2 ) end