<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:16px"><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3623" class="">Dear NCL,</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3625" class=""><br id="yui_3_16_0_1_1449203162812_3627" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3629" class="">I was run SPI scripts as below and it worked, but I want the output this script is netCDF or csv, does anyone know how to do this? Please help me.</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3631" class=""><br id="yui_3_16_0_1_1449203162812_3633" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3635" class=""><br id="yui_3_16_0_1_1449203162812_3637" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3639" class="">Thank you very much,</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3641" class=""><br id="yui_3_16_0_1_1449203162812_3643" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3645" class=""><br id="yui_3_16_0_1_1449203162812_3647" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3649" class="">Misna</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3651" class=""><br id="yui_3_16_0_1_1449203162812_3653" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3655" class=""><br id="yui_3_16_0_1_1449203162812_3657" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;" id="yui_3_16_0_1_1449203162812_3621" dir="ltr" class=""><pre style="color: rgb(0, 0, 0); word-wrap: break-word;" id="yui_3_16_0_1_1449203162812_3620" class="">;-----------------------------<wbr id="yui_3_16_0_1_1449203162812_3661" class="">------------------------------<wbr id="yui_3_16_0_1_1449203162812_3663" class="">-----------
; spi_2.ncl
;
; Concepts illustrated:
; - Computing the Standardized Precipitation Index (SPI)
; - Reading data from the GPCP (Global Precipitation Climatology Project)
;-----------------------------<wbr id="yui_3_16_0_1_1449203162812_3665" class="">------------------------------<wbr id="yui_3_16_0_1_1449203162812_3667" class="">-----------
load "$NCARG_ROOT/lib/ncarg/<wbr id="yui_3_16_0_1_1449203162812_3669" class="">nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/<wbr id="yui_3_16_0_1_1449203162812_3671" class="">nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/<wbr id="yui_3_16_0_1_1449203162812_3673" class="">nclscripts/csm/contributed.<wbr id="yui_3_16_0_1_1449203162812_3675" class="">ncl"
diri = "./"
fili = "<a href="http://v22_gpcp.1979-2010.nc/" target="_blank" style="color: rgb(17, 85, 204);" id="yui_3_16_0_1_1449203162812_3677" class="">V22_GPCP.1979-2010.nc</a>"
f = addfile(diri+fili, "r")
prc = flt2dble(f->PREC)
pmsg = prc@_FillValue ; convenience
printVarSummary(prc)
printMinMax(prc,0)
runlen = (/ 12, 24 /)
nrun = dimsizes(runlen)
;*****************************<wbr id="yui_3_16_0_1_1449203162812_3679" class="">****
; plot parameters
;*****************************<wbr id="yui_3_16_0_1_1449203162812_3681" class="">****
dimprc = dimsizes(prc)
ntim = dimprc(0)
nlat = dimprc(1)
mlon = dimprc(2)
yyyymm = f->date
yyyymm = yyyymm/100
year = yyyymm/100
yrStrt = year(0)
yrLast = year(ntim-1)
nyear = yrLast-yrStrt+1
yyyymm = yyyymm_time(yrStrt, yrLast, "integer")
yrfrac = (/ yyyymm_to_yyyyfrac(yyyymm, 0.0) /)
prc&time = (/ yyyymm /)
;=============================<wbr id="yui_3_16_0_1_1449203162812_3683" class="">====
wks = gsn_open_wks ("ps","spi")
gsn_define_colormap(wks,"<wbr id="yui_3_16_0_1_1449203162812_3685" class="">BlueWhiteOrangeRed")
gsn_reverse_colormap(wks) ; Reverse the color map.
res = True
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
res@gsnSpreadColors = True
res@cnFillOn = True ; color Fill
res@cnFillMode = "RasterFill" ; Raster Mode
res@cnLinesOn = False ; Turn off contour lines
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = -3.0 ; set min contour level
res@cnMaxLevelValF = 3.0 ; set max contour level
res@cnLevelSpacingF = 0.5 ; set contour spacing
res@lbLabelBarOn = False ; turn off individual cb's
resP = True ; panel resources
resP@txString = "SPI: 1979-2010 (GPCP)" ; add center string
resP@gsnPanelLabelBar= True ; add common colorbar
plot = new ( 2, "graphic")
do nr=0,nrun-1
spi = dim_spi_n(prc, runlen(nr), False, 0)
spi@long_name = "SPI"
spi@units = "run="+runlen(nr)
copy_VarCoords(prc, spi)
res@gsnCenterString = yyyymm({200007})
plot(0) = gsn_csm_contour_map_ce(wks,<wbr id="yui_3_16_0_1_1449203162812_3687" class="">spi({200007},:,:), res)
res@gsnCenterString = yyyymm({201012})
plot(1) = gsn_csm_contour_map_ce(wks,<wbr id="yui_3_16_0_1_1449203162812_3689" class="">spi({200612},:,:), res)
gsn_panel(wks,plot,(/2,1/),<wbr id="yui_3_16_0_1_1449203162812_3691" class="">resP) ; now draw as one plot
end do</pre><pre style="color: rgb(0, 0, 0); word-wrap: break-word;" id="yui_3_16_0_1_1449203162812_3620" class=""><br></pre><pre style="color: rgb(0, 0, 0); word-wrap: break-word;" id="yui_3_16_0_1_1449203162812_3620" class=""><br></pre></div></div></body></html>