;***********Load the ncl internal libraries*********;
load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin


had_data = addfile("had_remap.nc","r")

temp = had_data->temp(time|0,surface|0,lat|:,lon|:)
temp = temp-273.15

lat=had_data->lat
lon=had_data->lon
nlat = dimsizes(lat)
nlon = dimsizes(lon)


wks=gsn_open_wks("ps","temp_test")
gsn_define_colormap (wks,"WhViBlGrYeOrRe")

res                        = True              
res@cnFillOn               = True            
res@cnLinesOn             = False
res@cnLineLabelsOn         = False              
res@cnInfoLabelOn          = False           
res@lbLabelBarOn         = False
res@mpFillOn = False
res@trYReverse = True
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = (/0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30/)
res@gsnSpreadColors = True
res@gsnSpreadColorStart = 20
res@gsnSpreadColorEnd = 85

res@tmXBLabelFontHeightF  = 0.014
res@tmYLLabelFontHeightF  = 0.014
res@gsnCenterStringFontHeightF = 0.024
res@gsnMaximize = True
res@gsnLeftString = ""
res@tmXTOn = False
res@tmYROn = False
res@tiMainString           = ""
res@tiMainFontHeightF      = 0.016             
res@gsnDraw              = False             
res@gsnFrame             = False
res@gsnAddCyclic           = False          

res@tfDoNDCOverlay = True
res@mpPerimOn = True
res@mpDataBaseVersion = "MediumRes"
res@pmTickMarkDisplayMode  = "Always"    
res@mpLimitMode       = "Corners"           
res@mpLeftCornerLatF  = lat(0)
res@mpLeftCornerLonF  = lon(0)
res@mpRightCornerLatF = lat(nlat-1)
res@mpRightCornerLonF = lon(nlon-1)

plot = gsn_csm_contour_map(wks,temp,res)

resP = True
resP@gsnPanelLabelBar = False
resP@gsnFrame = False
resP@gsnMaximize = True
resP@lbOrientation = "Horizontal"
resP@lbLabelAutoStride = True
resP@pmLabelBarWidthF = 0.385
resP@pmLabelBarHeightF = 0.038
resP@lbTitleOn        =  True                
resP@lbTitleString    = ""                
resP@lbTitlePosition  = "Right"        
resP@lbTitleFontHeightF= .011        
resP@lbTitleDirection = "Across"            
resP@lbLabelStride        = 1
resP@pmLabelBarParallelPosF = 0.252
resP@lbLabelFontHeightF  = 0.0098
resP@pmLabelBarOrthogonalPosF = 0.264
resP@gsnPanelRowSpec = True
resP@gsnPanelCenter  = False
resP@txString   = ""
gsn_panel(wks,plot,(/1,1/),resP)

frame(wks)

end

