<div dir="ltr">Thanks Dennis it worked.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Aug 10, 2016 at 4:51 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class=""><div>x      = short2flt( f-&gt;precip(iStrt:iLast,{latS:la<wbr>tN},{lonL:lonR}))<br>    <br></div></span>x    = x*86400<br></div>x@units = &quot;mm/day&quot;<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 10, 2016 at 4:42 AM, Nitin Patil <span dir="ltr">&lt;<a href="mailto:nitinpatil85@gmail.com" target="_blank">nitinpatil85@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><br></div>Dear NCL usrs,<br><br></div>In my script I am trying to multiply my data by a constant value like in this rainfall data I want to multiply by 86400 to change unit I tried but not getting compile, any idea where to put it?<br><div><div><br>=================<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl&quot;<br><br>begin<br><br>;*****************************<wbr>*******************<br>; Specify geographical region and time span (year-month start and end<br>;*****************************<wbr>*******************<br><br>  latS     = -90               <br>  latN     =  90<br>  lonL     =  0<br>  lonR     = 360<br><br>  ymStrt   = 197101     <br>  ymLast   = 201012<br>  <br>  pltType  = &quot;ps&quot;  <br>  pltName  = &quot;regress&quot;<br>  pltTitle = &quot;Globe: &quot;+(ymStrt/100)+&quot;-&quot;+(ymLast/100<wbr>)<br><br>;*****************************<wbr>*******************<br>; Read from netCDF file: variable is type short...unpack<br>;*****************************<wbr>*******************<br>   diri   = &quot;/media/Work/3_LTS_echam6_Data<wbr>/EACSST_ens_1971-2010/&quot;<br>   fili   = &quot;EACSST_E1_1971-2010_Precip.nc<wbr>&quot;<br>   f      = addfile(diri+fili,&quot;r&quot;) <br><br>   YYYYMM = cd_calendar( f-&gt;time, -1)<br><br>   iStrt  = ind(YYYYMM.eq.ymStrt)<br>   iLast  = ind(YYYYMM.eq.ymLast)<br><br>   x      = short2flt( f-&gt;precip(iStrt:iLast,{latS:la<wbr>tN},{lonL:lonR}))<br>    <br>x@units= &quot;mm/day&quot;<br><br>   printVarSummary(x)            <wbr>                ; [time| 1344]x[lat| 91]x[lon| 180]<br><br>   yyyymm = cd_calendar(x&amp;time, -1)<br>   yyyy   = yyyymm/100<br><br>   dimx = dimsizes(x)<br>   ntim = dimx(0)                ; all years and months<br>   nlat = dimx(1)<br>   mlon = dimx(2)<br><br>   year  = ispan(yyyy(0), yyyy(ntim-1), 1)<br>   nyrs  = dimsizes(year)<br><br>;*****************************<wbr>*******************<br>; Areal averages: cos(lat) is good enough<br>;*****************************<wbr>*******************<br><br>   xann  = month_to_annual(x , 1)                 ; [year| 112]x[lat| 91]x[lon| 180]<br>   xann&amp;year  = year<br>   printVarSummary(xann)<br><br>;*****************************<wbr>*******************<br>; Calculate the regression coefficients (slopes)    <br>;*****************************<wbr>*******************<br>   rc           = regCoef(year,xann(lat|:,lon|:,<wbr>year|:))            <br>   <br>   rc@long_name = &quot;Trend&quot;<br>   rc@units     = xann@units+&quot;/year&quot;<br>   copy_VarCoords(xann(0,:,:), rc)                ; copy lat,lon coords<br><br>   printVarSummary(rc)<br><br>;*****************************<wbr>*******************<br>; for illustration: change units to degC/period-used<br>;*****************************<wbr>*******************<br>   rc           = rc*nyrs                       ; (C/year)*(nyrs)<br>   rc@units     = &quot;&quot;+nyrs+&quot; year&quot;<br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br>   wks  = gsn_open_wks(&quot;eps&quot;,&quot;EACSST_tre<wbr>nd_yearly_precip&quot;)       ; specifies a ps plot<br>   gsn_define_colormap(wks,&quot;preci<wbr>p2_15lev&quot;)<br>   res                       = True     <br>   res@gsnMaximize           = True             ; make large<br><br>   res@cnFillOn              = True             ; turn on color<br>   res@cnLinesOn             = False            ; turn off contour lines<br>   res@cnLineLabelsOn        = False            ; turn off contour line labels<br> ;;res@cnFillMode            = &quot;RasterFill&quot;<br><br>   res@mpMinLatF             =  5                  ;-- sub-region minimum latitude<br>   res@mpMaxLatF             =  40                 ;-- sub-region maximum latitude<br>   res@mpMinLonF             =  60                  ;-- sub-region minimum longitude<br>   res@mpMaxLonF             =  100                  ;-- sub-region maximum longitude<br><br><br>   res@cnLevelSelectionMode  = &quot;ManualLevels&quot;   ; set manual contour levels<br>   res@cnMinLevelValF        =  -0.18            ; set min contour level<br>   res@cnMaxLevelValF        =  0.18            ; set max contour level<br>   res@cnLevelSpacingF       =  0.01            ; set contour interval<br><br>   res@mpFillOn              = False            ; turn off default background gray<br>  ;res@mpCenterLonF          = 180<br><br>   res@gsnCenterString       = year(0)+&quot;-&quot;+year(nyrs-1) <br>   <br>   res@tiMainString          = &quot;Yearly trend (precip EACSST)&quot;    ; fili<br>   plot = gsn_csm_contour_map_ce(wks,rc,<wbr>res)    <br>  end<br>=================<br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
</div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>