load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ; read in data ncols = 9 ; -10:2.5:10 Latitude nrows = 33 ; 80:2.5:160E Longitude data = asciiread ("djfOLR.txt", (/nrows,ncols/), "float") data_U = asciiread ("uwnd1.txt", (/nrows,ncols/), "float") data_V = asciiread ("vwnd1.txt", (/nrows,ncols/), "float") lon = fspan( 80,160, nrows) lon!0 = "lon" lon@units = "degrees_east" lat = fspan(-10, 10, ncols) lat!0 = "lat" lat@units = "degrees_north" data!0 = "lon" data!1 = "lat" data&lon = lon data&lat = lat data@long_name = "DJF" ; data@units = "W m-2" data_U!0 = "lon" data_U!1 = "lat" data_U&lon = lon data_U&lat = lat ; data_U@long_name = "zonal winds" ; data_U@units = "m/s" data_V!0 = "lon" data_V!1 = "lat" data_V&lon = lon data_V&lat = lat ; data_V@long_name = "meridional wind" ; data_V@units = "m/s" ; printVarSummary(data) wks = gsn_open_wks("ps" ,"juky_overlay_test") gsn_define_colormap(wks,"BlueDarkRed18") ; for contour plot of OLR data res = True ; plot mods desired res@gsnMaximize = True ; make ps, pdf, eps large res@gsnSpreadColors = True ; use full range of color map res@gsnPaperOrientation = "portrait" res@cnFillOn = True ; turn on color fill res@cnLinesOn = False ; turn of contour lines res@cnLineLabelsOn = False ; turn of contour line labels ;res@cnLevelSpacingF = 0.5 ; contour spacing res@lbLabelAutoStride = True res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels res@pmLabelBarOrthogonalPosF = .25 res@cnLevelSelectionMode = "ManualLevels" ; Set contour levels res@cnMinLevelValF = 190 ; the same for each plot. res@cnMaxLevelValF = 280 ; res@cnLevelSpacingF = 2 res@gsnAddCyclic = False ; data already has cyclic point res@mpMinLatF = -10 ; range to zoom in on res@mpMaxLatF = 10. res@mpMinLonF = 80. res@mpMaxLonF = 160. res@txFontHeightF = 0.014 ; resize the text res@lbLabelFontHeightF = 0.012 ;res@tiMainString = "Test" res@gsnMajorLatSpacing = 10 res@gsnMajorLonSpacing = 10 res@lbOrientation = "Vertical" res@lbPerimOn = False res@pmLabelBarDisplayMode = "Always" res@pmLabelBarWidthF = 0.1 res@lbTitleOn = True res@lbTitleString = "W m-2" res@lbTitlePosition = "Top" res@lbTitleOffsetF = 0.13 plot_olr = gsn_csm_contour_map_ce(wks,data(lat|:,lon|:), res) ; for wind vcres = True ; plot mods desired vcres@gsnFrame = False ; so we can draw time stamp vcres@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector up ; vcres@vcMinAnnoExplicitMagnitudeF = 5.0 vcres@vcMinAnnoString1 = "5 m/s" vcres@vcMinAnnoString2On = False vcres@vcRefMagnitudeF = 5.0 vcres@vcRefLengthF = 0.045 ; define length of vec ref vcres@vcGlyphStyle = "CurlyVector" ; turn on curly vectors vcres@vcMinDistanceF = 0.017 vcres@gsnAddCyclic = False vector_wind = gsn_csm_vector(wks,data_U(lat|:,lon|:),data_V(lat|:,lon|:),vcres) overlay(plot_olr,vector_wind) ; draw(plot) frame(wks) maximize_output(wks,True) end