;---------------------------------------------------------------------- ; Read and create a timeseries plot of a variable read off a HadISD ; dataset from the UK Met Office Hadley Centre. ; ; This file was downloaded from RDA (search on 463.4). ; ; Description found at: ; http://rda.ucar.edu/datasets/ds463.4/index.html#!description ; ; See hadley_timeseries_plot_subset.ncl for a script that plots ; a subset of the time range. ;---------------------------------------------------------------------- load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl" begin ;---Open file and read data dir = "../Data/" filename = "hadisd.1.0.2.2013f.724957-99999.nc" a = addfile(dir+filename,"r") var_name = "temperatures" ; Name of Variable to plot var = a->$var_name$ ; 296096 time steps var = where(var.eq.var@flagged_value,var@_FillValue,var) if(var_name.eq."temperatures") var = 1.8 * var + 32. ; Convert temperature to Fahrenheit var@units = "degF" end if ;---Look at the variable to make sure it looks okay printVarSummary(var) printMinMax(var,0) wks = gsn_open_wks("x11","hadisd_plot_" + var_name + "_ncl") ;---Set some plot options res = True res@vpWidthF = 0.8 ; timeseries plots are usually res@vpHeightF = 0.3 ; wider than they are high res@gsnMaximize = True ; maximize plot in frame res@tiYAxisString = "" res@tiMainString = var@long_name + " (" + var@units + ")" res@tiMainFontHeightF = 0.02 ;---Create an XY plot plot = gsn_csm_xy(wks,var&time,var,res) end