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/"
24 filename1 = "fort.194"
25 data1a=asciiread(dira+filename1,(/nrow,ncol/),"float")
26 data1b=asciiread(dirb+filename1,(/nrow,ncol/),"float")
29 filename2 = "fort.195"
30 data2a=asciiread(dira+filename2,(/nrow,ncol/),"float")
31 data2b=asciiread(dirb+filename2,(/nrow,ncol/),"float")
34 filename3 = "fort.196"
35 data3a=asciiread(dira+filename3,(/nrow,ncol/),"float")
36 data3b=asciiread(dirb+filename3,(/nrow,ncol/),"float")
39 filename4 = "fort.197"
40 data4a=asciiread(dira+filename4,(/nrow,ncol/),"float")
41 data4b=asciiread(dirb+filename4,(/nrow,ncol/),"float")
43 y1 = new((/2,nrow/),float)
44 y2 = new((/2,nrow/),float)
45 y3 = new((/2,nrow/),float)
46 y4 = new((/2,nrow/),float)
47 x = new((/nrow/),float)
49 y1(0,:) = resolution * data1a(:,1)
50 y1(1,:) = resolution * data1b(:,1)
51 y2(0,:) = resolution * data2a(:,1)
52 y2(1,:) = resolution * data2b(:,1)
53 y3(0,:) = resolution * data3a(:,1)
54 y3(1,:) = resolution * data3b(:,1)
55 y4(0,:) = resolution * data4a(:,1)
56 y4(1,:) = resolution * data4b(:,1)
58 ;************************************************
60 ;************************************************
61 wks = gsn_open_wks (works,"gen_be_lengthscales") ; open workstation
63 res = True ; plot mods desired
64 res@trXMinF = 1.0 ; min value on x-axis
65 res@trXMaxF = nrow ; max value on x-axis
66 res@trYMinF = 0.0 ; min value on y-axis
67 res@tiXAxisString = "Vertical Mode" ; Label for the X axis
68 res@tiYAxisString = "Lengthscale (km)" ; Label for the Y axis
69 res@xyLineThicknesses = (/4.0,4.0,4.0,4.0/) ; make 2nd lines thicker
70 res@xyLineColors = (/"red","blue","green","purple"/) ; change line color
71 res@xyDashPatterns = (/0,4,2,3,4/) ; choose dash patterns
72 res@tiMainFont = "Helvetica" ; Font for title
73 res@tiXAxisFont = "Helvetica" ; Font for X axis label
74 res@tiYAxisFont = "Helvetica" ; Font for Y axis label
75 res@xyMarkLineModes = (/"MarkLines","MarkLines","MarkLines","MarkLines","MarkLines","MarkLines"/)
76 res@xyMarkers = (/3,4,3,4,5/) ; (none, dot, asterisk)
77 res@xyMarkerColors = res@xyLineColors ; Marker colors
78 res@xyMarkerSizeF = 0.02 ; Marker size (default is 0.01)
79 res@tiXAxisFontHeightF = 0.03 ; Change the font size.
80 res@tiYAxisFontHeightF = 0.03
81 ; res@xyLabelMode = "Custom" ; Label XY curves.
82 res@xyLineLabelFontHeightF = 0.03 ; Font size and color
83 res@xyLineLabelFontColor = 2 ; for line labels
85 res@lgPerimOn = False ; turn off box around
86 res@lgLabelFontHeightF = .02 ; label font height
87 res@xyExplicitLegendLabels = (/label1,label2,"50km","m=5"/) ; create explicit labels
88 res@pmLegendDisplayMode = "Always" ; turn on legend
89 res@pmLegendSide = "Bottom" ; Change location of
90 res@pmLegendParallelPosF = 0.75 ; move units right
91 res@pmLegendOrthogonalPosF = -1.2 ; move units down
92 res@pmLegendWidthF = 0.2 ; Change width and
93 res@pmLegendHeightF = 0.2 ; height of legend.
95 plts = new (4,"graphic")
97 res@gsnDraw = False ; (a) do not draw
98 res@gsnFrame = False ; (b) do not advance 'frame'
100 res@tiMainString = var1 ; add title
101 res@trYMaxF = max(y1) ; max value on y-axis
102 plts(0) = gsn_csm_xy (wks,x,y1,res) ; create plot
104 res@tiMainString = var2 ; add title
105 res@trYMaxF = max(y2) ; max value on y-axis
106 plts(1) = gsn_csm_xy (wks,x,y2,res) ; create plot
108 res@tiMainString = var3 ; add title
109 res@trYMaxF = max(y3) ; max value on y-axis
110 plts(2) = gsn_csm_xy (wks,x,y3,res) ; create plot
112 res@tiMainString = var4 ; add title
113 res@trYMaxF = max(y4) ; max value on y-axis
114 plts(3) = gsn_csm_xy (wks,x,y4,res) ; create plot
116 ;************************************************
117 ; create panel: panel plots have their own set of resources
118 ;************************************************
119 resP = True ; modify the panel plot
120 ; resP@txString = directory
121 ; resP@gsnMaximize = True ; maximize panel area
122 resP@gsnPanelRowSpec = True ; specify 1 top, 2 lower level
123 gsn_panel(wks,plts,(/2,2/),resP) ; now draw as one plot