; ; Experiment with ncl by reading tgcmproc generated netcdf ; file and making some simple contours. ; load "gsn_code.ncl" begin filepath = "/vishnu/d/foster/tgcmvis/tgcmproc/t23_jse.ut12.cdf" cdf_file = addfile(filepath,"r") glat = cdf_file->lat glon = cdf_file->lon plev = cdf_file->lev ; ; float TN(time, lev, lat, lon) ; ; TN:long_name = "NEUTRAL TEMPERATURE" ; ; TN:units = "DEG K" ; ; TN:type = "SCALAR " ; ; TN:nlev = 45 ; ; TN:blev = -17.f ; ; TN:dlev = 0.5f ; ; TN:vtype = "ZP " ; ; zp = 2. tn = cdf_file->TN(0,{zp},:,:) xwks = gsn_open_wks("x11","tgcmvis/ncl") resources = True ; ; Simple monochrome contour: ; MainString = tn@long_name + " (" + tn@units + ")" + " ZP=" + \ sprintf("%.2f",zp) font_height = .020 resources@tiMainString = MainString resources@tiMainFontHeightF = font_height resources@tiXAxisString = "Longitude (deg)" resources@tiXAxisFontHeightF = font_height resources@tiYAxisString = "Latitude (deg)" resources@tiYAxisFontHeightF = font_height resources@sfXArray = glon resources@sfYArray = glat plot = gsn_contour(xwks,tn,resources) ; ; Color fill contour: ; resources@cnFillOn = True resources@pmLabelBarDisplayMode = "Always" resources@lbPerimOn = False setvalues xwks "wkColorMap" : "temp1" ; "wkColorMap" : "uniform" end setvalues ;plot = gsn_contour(xwks,tn,resources) ; ; Vector plot of neutral winds: ; ; float UN(time, lev, lat, lon) ; ; UN:long_name = "NEUTRAL ZONAL WIND" ; ; UN:units = "M/S" ; ; UN:type = "VECTOR " ; ; UN:nlev = 45 ; ; UN:blev = -17.f ; ; UN:dlev = 0.5f ; ; UN:vtype = "ZP " ; ; float VN(time, lev, lat, lon) ; ; VN:long_name = "NEUTRAL MERIDIONAL WIND" ; ; VN:units = "M/S" ; ; VN:type = "VECTOR " ; ; VN:nlev = 45 ; ; VN:blev = -17.f ; ; VN:dlev = 0.5f ; ; VN:vtype = "ZP " ; ;un = cdf_file-> delete(plot) delete(tn) delete(resources) end