1 ; ***********************************************
3 ; ***********************************************
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
6 ;************************************************
8 ;************************************************
10 ;************************************************
14 dira = "/smoke/dmbarker/data/con200/noobs/gen_be.0200-2512/"
15 dirb = "/smoke/dmbarker/data/con200/xwang/gen_be.0200-2512.2006091512/"
21 y1 = new((/2,nrow/),float)
22 y2 = new((/2,nrow/),float)
23 y3 = new((/2,nrow/),float)
24 y4 = new((/2,nrow/),float)
25 x = new((/nrow/),float)
32 data1a=asciiread(dira+filename1,(/nrow,ncol/),"float")
33 data1b=asciiread(dirb+filename1,(/nrow,ncol/),"float")
40 data2a=asciiread(dira+filename2,(/nrow,ncol/),"float")
41 data2b=asciiread(dirb+filename2,(/nrow,ncol/),"float")
46 filename3 = "fort.183"
48 data3a=asciiread(dira+filename3,(/nrow,ncol/),"float")
49 data3b=asciiread(dirb+filename3,(/nrow,ncol/),"float")
54 filename4 = "fort.187"
56 data4a=asciiread(dira+filename4,(/nrow,ncol/),"float")
57 data4b=asciiread(dirb+filename4,(/nrow,ncol/),"float")
61 ;************************************************
63 ;************************************************
64 wks = gsn_open_wks (works,"gen_be_global_evals") ; open workstation
66 res = True ; plot mods desired
67 res@trXMinF = 1.0 ; min value on x-axis
68 res@trXMaxF = nrow ; max value on x-axis
69 res@trYMinF = 0.0 ; min value on y-axis
71 res@tiMainString = "Basic XY plot" ; add title
72 res@tiXAxisString = "Vertical Mode" ; Label for the X axis
73 res@xyLineThicknesses = (/4.0,4.0,4.0,4.0/) ; make 2nd lines thicker
74 res@xyLineColors = (/"red","blue","green","purple"/) ; change line color
75 ; res@trYReverse = True ; reverse Y-axis
76 res@xyDashPatterns = (/0,4,2,3,4/) ; choose dash patterns
77 res@tiMainFont = "Helvetica" ; Font for title
78 res@tiXAxisFont = "Helvetica" ; Font for X axis label
79 res@tiYAxisFont = "Helvetica" ; Font for Y axis label
80 res@xyMarkLineModes = (/"MarkLines","MarkLines","MarkLines","MarkLines","MarkLines","MarkLines"/)
81 res@xyMarkers = (/3,4/) ; (none, dot, asterisk)
82 res@xyMarkerColors = res@xyLineColors ; Marker colors
83 res@xyMarkerSizeF = 0.03 ; Marker size (default is 0.01)
84 res@tiXAxisFontHeightF = 0.03 ; Change the font size.
85 res@tiYAxisFontHeightF = 0.03
86 ; res@xyLabelMode = "Custom" ; Label XY curves.
87 res@xyLineLabelFontHeightF = 0.03 ; Font size and color
88 res@xyLineLabelFontColor = 2 ; for line labels
90 res@lgPerimOn = False ; turn off box around
91 res@lgLabelFontHeightF = .02 ; label font height
92 res@xyExplicitLegendLabels = (/label1,label2,"m=5"/) ; create explicit labels
93 res@pmLegendDisplayMode = "Always" ; turn on legend
94 res@pmLegendSide = "Bottom" ; Change location of
95 res@pmLegendParallelPosF = 0.7 ; move units right
96 res@pmLegendOrthogonalPosF = -1.2 ; move units down
97 res@pmLegendWidthF = 0.2 ; Change width and
98 res@pmLegendHeightF = 0.2 ; height of legend.
100 plts = new (4,"graphic")
102 res@gsnDraw = False ; (a) do not draw
103 res@gsnFrame = False ; (b) do not advance 'frame'
105 res@trYMaxF = max(y1) ; max value on y-axis
106 res@tiMainString = var1 ; add title
107 res@tiYAxisString = "Eigenvalue " + units1 ; Label for the Y axis
108 plts(0) = gsn_csm_xy (wks,x,y1,res) ; create plot
110 res@trYMaxF = max(y2) ; max value on y-axis
111 res@tiMainString = var2 ; add title
112 res@tiYAxisString = "Eigenvalue " + units2 ; Label for the Y axis
113 plts(1) = gsn_csm_xy (wks,x,y2,res) ; create plot
115 res@trYMaxF = max(y3) ; max value on y-axis
116 res@tiMainString = var3 ; add title
117 res@tiYAxisString = "Eigenvalue " + units3 ; Label for the Y axis
118 plts(2) = gsn_csm_xy (wks,x,y3,res) ; create plot
120 res@trYMaxF = max(y4) ; max value on y-axis
121 res@tiMainString = var4 ; add title
122 res@tiYAxisString = "Eigenvalue " + units4 ; Label for the Y axis
123 plts(3) = gsn_csm_xy (wks,x,y4,res) ; create plot
125 ;************************************************
126 ; create panel: panel plots have their own set of resources
127 ;************************************************
128 resP = True ; modify the panel plot
129 ; resP@txString = directory
130 ; resP@gsnMaximize = True ; maximize panel area
131 resP@gsnPanelRowSpec = True ; specify 1 top, 2 lower level
132 gsn_panel(wks,plts,(/2,2/),resP) ; now draw as one plot