;************************************************* ; demonstrates the plotting of magnetic variables ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "./gsn_csm.ncl" load "$HAO_NCL_LIB/hao_contrib.ncl" ;************************************************ begin ;************************************************ ; before the data can be plotted, there is a ; sequence of things that have to be done to it: ;************************************************ in = addfile("/chewy/d/murphys/files/mag_june95_migdisdi_wmc.nc","r") x = mag2latlon(in->jmr) u = mag2latlon(in->kqphi) v = mag2latlon(in->kqlam) t2plt = 7 mtime = (/in->mtime/) ut = (/mtime(t2plt,1)/) ; no ut on file ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("ps" ,"polar") ; open a ps file gsn_define_colormap(wks,"BlWhRe") ; choose colormap res = True ; plot mods desired res@gsnPolar = "NH" ; choose hemisphere res@mpMinLatF = 60 ; mpMaxLatF for NH res@cnFillOn = True ; add color res@gsnSpreadColors = True ; use full range of color map res@lbLabelAutoStride = True ; nice lb labels res@lbOrientation = "vertical" ; vertical label bar res@tiMainString = " day= "+ mtime(t2plt,0)+","+mtime(t2plt,1)+","+\ mtime(t2plt,2) +" (mag coords)" ; these resources must exist when plotting on magnetic coordinates res@mpOutlineOn = False res@mpFillOn = False res@gsnAddCyclic = False res@mpGridAndLimbOn = False ; turn off lat/lon lines ; set explict contour levels res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = 0.00000001*ispan(-10,10,2) res@gsnPolarUT = ut ; turn on local time res@gsnPolarTime = True ; ditto x&lon = x&lon-71 res@gsnScalarContour = True ; contours desired res@cnFillDrawOrder = "Draw" ; draw on top of map res@vcVectorDrawOrder = "PostDraw" ; draw vectors last res@vcRefMagnitudeF = 5e-02 ; define vector ref mag res@vcRefLengthF = 0.02 ; define length of vec ref res@vcMinDistanceF = 0.03 ; thin vectors res@vcRefAnnoString2On = True ; turn on vec ref string res@vcRefAnnoString2 = u@units ; string for ref vec res@vcRefAnnoArrowLineColor = "black" ; change ref vector color res@vcRefAnnoArrowUseVecColor = False ; don't use vec color for ref res@vcLineArrowColor = "white" ; change vector color res@vcGlyphStyle = "CurlyVector" ; turn on curley vectors plot = gsn_csm_vector_scalar_map_polar(wks,u(t2plt,:,:),v(t2plt,:,:),\ x(t2plt,:,:),res) end