小抄

官方版小抄:Quick Reference Card

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

===============================================
Fname = "demo.nc"
Rfile = addfile(Fname,"r")
VAR1 = Rfile->VAR1
VAR1@units = "K/s"
===============================================
fils = systemfunc("ls ./bw49/wrfout*")+".nc"
ncFile = addfiles(fils,"r")
VAR2 = ncFile[:]->VAR2
VAR3 = ncFile[:]->VAR3(:,100:200,:)
===============================================
print(VAR)
printVarSummary(VAR)
===============================================
iLoop=0
do while(iLoop.le.10)
XXX
iLoop=iLoop+1
end do
===============================================
if(True) then
YYY
end if
===============================================
system("/bin/rm -f "+OutName)
ncdf = addfile("./tempVar/"+OutName,"c")
ncdf->VAR = VAR
===============================================
aMatrix = new((/64,5/),"float")
aList = (/"bw42","bw43","bw44","bw45","bw46"/)
aSeries = (/1,3,5/)
aCombine = "this is "+"an example"

write_matrix(MeanProfile,"5f30.20",False)
sf1P = mask(sf1,conform(sf1,(sf1&lon.ge.180),1),True)

VAR_avg1 = dim_avg_n_Wrap(VAR,3)
VARavgDim = dimsizes(VAR_avg1)

uv2sfvpf(mu1,mv1,sf1,vp)

print(ismissing(x))
===============================================
system (“/usr/bin/rm YILU.pdf”)
wks_type                        = "pdf"
wks_type@wkPaperWidthF          = 5.
wks_type@wkPaperHeightF         = 5.
wks                             = gsn_open_wks(wks_type,"YILU")
gsn_define_colormap(wks, "BlueWhiteOrangeRed")
print("File: "+"YILU"+".pdf")
===============================================
res = True
res@gsnMaximize = True
res@gsnPaperOrientation = "Portrait"
res@gsnDraw
res@gsnFrame
res@gsnSpreadColors = True
res@gsnSpreadColorEnd = -3

res@tmXBMode = "Explicit"
res@tmXBValues = ispan(0,10,1)*4
res@tmXBLabels = "" + res@tmXBValues/4.
res@tmYLMode = "Explicit"
res@tmYLValues = ispan(1,25,1)*8-1
res@tmYLLabels = "" + (res@tmYLValues+1)*16./64.

res@tiMainString
res@gsnRightString
res@gsnLeftString
res@tiXAxisString
res@tiYAxisString

res@cnFillOn
res@cnLinesOn
res@cnLineLabelsOn
res@cnInfoLabelOn
res@lbOrientation = "Vertical"
res@gsnContourZeroLineThicknessF
res@gsnContourNegLineDashPattern

res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = ispan(0,80,4)-40

res@cnLevelSelectionMode = "ManualLevels"
res@cnMaxLevelValF = 20
res@cnMinLevelValF = 10
res@cnLevelSpacingF = 2

res@cnFillPalette = "BlueRed"
res@cnFillColors = (/0,3,4,5,6,7/)
res@cnLineColor = "13"
res@cnMonoFillColor = True
res@cnMonoFillPattern = False
res@cnMonoFillScale = True
res@cnFillPatterns = (/-1,-1,17/)
res@cnFillScaleF = 0.5

res@mpMinLatF
res@mpMaxLatF
res@mpMinLonF
res@mpMaxLonF
res@mpCenterLonF
res@mpOutlineDrawOrder = "PostDraw"
res@mpGridAndLimbOn
res@mpGridLatSpacingF

res_v@vcGlyphStyle = "CurlyVector"
res_v@vcMinDistanceF = 0.017
res_v@vcRefLengthF = 0.045
res_v@vcRefMagnitudeF = 20.0

res@trYReverse

 symMinMaxPlt            (PlotVar2,20,False,resS2)

===============================================
plot = gsn_csm_contour_map_ce (wks,mu1,res_U1)
plot = gsn_csm_vector_map_ce (wks,mu1,mv1,res_v1)
plot = gsn_csm_contour (wks,VARave2(bottom_top|:,Time|:),res)
plot = gsn_csm_xy (wks,jTime,VAR_avg3,res)
plot = gsn_csm_streamline_map_ce(wks,um,vm,res)
===============================================
res@gsnDraw = False
res@gsnFrame = False
res_pn@gsnMaximize = True
res_pn@gsnPaperOrientation = "Portrait"
 res_pn@gsnPanelRowSpec          = True
 res_pn@gsnPanelScalePlotIndex   = 1
plot = new(6,graphic)
plot(0) =
plot(1) =
gsn_panel(wks,plot,(/3,2/),res_pn)
===============================================
res@gsnDraw = False
res@gsnFrame = False
plot_a =
plot_b =
overlay(plot_a,plot_b)
draw(plot_a)
frame(wks)
===============================================

print("All done.")
end

沒有留言:

張貼留言