$ srcdump.sh pl.oisst.ncl
aofd165.bio.mie-u.ac.jp
/work1/am/TEACHING/Shourai.Kikou.Yosoku/SST
Fri Jun 17 11:31:02 JST 2016
======================
pl.oisst.ncl
======================
;
; Plot OISST
;
; http://www.ncl.ucar.edu/Support/talk_archives/2009/1870.html
;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
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"
begin
latS = -89
latN = 89
lonL = 0
lonR = 359
diri = "/work4/data/OISST/"
var = "sst"
fili1 = "sst.ltm.1971-2000.nc"
; setfileoption ("nc", "MissingToFillValue", False) ; turn off default behavior
f=addfile(diri+fili1, "r")
lon=f->lon
lat=f->lat
x=f->sst
; xShort = f[:]->$var$(:,{latS:latN},{lonL:lonR})
; fix non standard attributes
; x = short2flt( xShort )
; printVarSummary(xShort)
; x = short2flt( xShort )
printVarSummary( x )
; printMinMax( x, True )
dsizes = new( (/3/),integer)
dsizes = dimsizes(x)
nlat=dsizes(1)
nlon=dsizes(2)
x2D = new( (/nlat,nlon/),float)
x2D(:,:)=x(1,:,:)
x2D(:,:)=0.0
x2D&lat@units = "degrees_north"
x2D&lon@units = "degrees_east"
printVarSummary(x2D)
do i=0,11
do j=0,nlat-1
do k=0,nlon-1
x2D(j,k)=x2D(j,k)+x(i,j,k)
end do ;k
end do ;j
end do ;i
x2D(:,:)=x2D(:,:)*0.01/12.0
wks = gsn_open_wks("ps","OISST_1971-2000")
gsn_define_colormap(wks,"BlueDarkRed18")
res = True
res@gsnFrame = False
res@vpWidthF = 0.5*1.9
res@vpHeightF = 0.32*1.9
res@vpXF = .1*0.1
; res@vpYF = .75
res@mpProjection = "Robinson" ; choose projection
res@mpFillOn = False
res@mpGridAndLimbOn = True ; turn on lat/lon lines
res@mpPerimOn = False
res@mpGridLatSpacingF = 90 ; change latitude line spacing
res@mpGridLonSpacingF = 180. ; change longitude line spacing
res@mpGridLineColor = "transparent" ; trick ncl into drawing
; perimeter
res@mpCenterLonF = 200.
res@cnFillOn = True ; color plot desired
res@cnLinesOn = False ; turn off/on contour lines
res@cnLineLabelsOn = False ; turn off contour lines
res@cnLineColor = "Background"
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
; res@cnMinLevelValF = -150. ; set min contour level
; res@cnMaxLevelValF = 150. ; set max contour level
; res@cnLevelSpacingF = 50. ; set contour spacing
res@lbLabelFontHeightF = 0.02
res@pmLabelBarHeightF = 0.07
res@pmLabelBarWidthF = 0.6
res@pmLabelBarOrthogonalPosF = 0.025
res@gsnLeftString = ""
res@gsnCenterString = ""
res@gsnRightString = ""
plot = gsn_csm_contour_map(wks,x2D,res) ; Draw a contour plot.
end
----------------------
End of pl.oisst.ncl
----------------------