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 ;************************************************
12 works = getenv("GRAPHIC_WORKS")
14 region = getenv("REGION")
15 dir = getenv("BE_DIR")
16 nrow = stringtointeger(getenv("NUM_LEVELS"))
19 y = new((/nrow/),float)
20 x = new((/5,nrow/),float)
29 filename3 = "fort.182"
32 filename4 = "fort.186"
34 data1=asciiread(dir+"/"+filename1,(/nrow,ncol/),"float")
35 data2=asciiread(dir+"/"+filename2,(/nrow,ncol/),"float")
36 data3=asciiread(dir+"/"+filename3,(/nrow,ncol/),"float")
37 data4=asciiread(dir+"/"+filename4,(/nrow,ncol/),"float")
39 ;************************************************
41 ;************************************************
42 wks = gsn_open_wks (works,"gen_be_global_evecs_"+region) ; open workstation
44 res = True ; plot mods desired
45 res@trXMinF = -1.0 ; min value on x-axis
46 res@trXMaxF = 1.0 ; max value on x-axis
47 res@trYMinF = 1.0 ; min value on y-axis
48 res@trYMaxF = nrow ; max value on y-axis
49 res@tiXAxisString = "Eigenvector" ; Label for the X axis
50 res@tiYAxisString = "Model Level" ; Label for the Y axis
51 res@xyLineThicknesses = (/4.0,4.0,4.0,4.0/) ; make 2nd lines thicker
52 res@xyLineColors = (/"black","red","blue","green","purple"/) ; change line color
53 res@xyDashPatterns = (/0,1,2,3,4/) ; choose dash patterns
54 res@tiMainFont = "Helvetica" ; Font for title
55 res@tiXAxisFont = "Helvetica" ; Font for X axis label
56 res@tiYAxisFont = "Helvetica" ; Font for Y axis label
57 res@xyMarkLineModes = (/"MarkLines","MarkLines","MarkLines","MarkLines","MarkLines","MarkLines"/)
58 res@xyMarkers = (/1,2,3,4,5/) ; (none, dot, asterisk)
59 res@xyMarkerColors = res@xyLineColors ; Marker colors
60 res@xyMarkerSizeF = 0.02 ; Marker size (default is 0.01)
61 res@tiXAxisFontHeightF = 0.03 ; Change the font size.
62 res@tiYAxisFontHeightF = 0.03
63 ; res@xyLabelMode = "Custom" ; Label XY curves.
64 res@xyLineLabelFontHeightF = 0.03 ; Font size and color
65 res@xyLineLabelFontColor = 2 ; for line labels
67 res@lgPerimOn = False ; turn off box around
68 res@lgLabelFontHeightF = .02 ; label font height
69 res@xyExplicitLegendLabels = (/"m=1","m=2","m=3","m=4","m=5"/) ; create explicit labels
70 res@pmLegendDisplayMode = "Always" ; turn on legend
71 res@pmLegendSide = "Bottom" ; Change location of
72 res@pmLegendParallelPosF = 0.15 ; move units right
73 res@pmLegendOrthogonalPosF = -0.55 ; move units down
74 res@pmLegendWidthF = 0.2 ; Change width and
75 res@pmLegendHeightF = 0.2 ; height of legend.
77 plts = new (4,"graphic")
79 res@gsnDraw = False ; (a) do not draw
80 res@gsnFrame = False ; (b) do not advance 'frame'
88 res@tiMainString = var1 ; add title
89 plts(0) = gsn_csm_xy (wks,x,y,res) ; create plot
97 res@tiMainString = var2 ; add title
98 plts(1) = gsn_csm_xy (wks,x,y,res) ; create plot
106 res@tiMainString = var3 ; add title
107 plts(2) = gsn_csm_xy (wks,x,y,res) ; create plot
115 res@tiMainString = var4 ; add title
116 plts(3) = gsn_csm_xy (wks,x,y,res) ; create plot
118 ;************************************************
119 ; create panel: panel plots have their own set of resources
120 ;************************************************
121 resP = True ; modify the panel plot
122 ; resP@txString = directory
123 ; resP@gsnMaximize = True ; maximize panel area
124 resP@gsnPanelRowSpec = True ; specify 1 top, 2 lower level
125 gsn_panel(wks,plts,(/2,2/),resP) ; now draw as one plot