<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Nelson,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the future, please post NCL questions to ncl-talk. You must subscribe first:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="http://mailman.ucar.edu/">http://mailman.ucar.edu/</a><wbr>mailman/listinfo/ncl-talk<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The error is telling you that you have no valid values in your data, which usually is an indication that your values are all missing.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you have problems plotting your data, we tell people to look at their data to make sure it is okay. You can use functions like print, printMinMax and printVarSummary to help you with this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can also use the all and ismissing functions to determine if all your values are missing:<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">print("Is my uAvg data all missing? " + all(ismissing(uAvg)))</div><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">print("Is my vAvg data all missing? " + all(ismissing(vAvg)))</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">print("Is my xAvg data all missing? " + all(ismissing(xAvg)))</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">I would look closely at how these three variables are being calculated and make sure you don't have an error in your script somewhere.  For example, since your data is being calculated with these statements:</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default">         xAvg = dim_avg_Wrap( x(lat|:,lon|:,time|nt) )</div><div class="gmail_default">         uAvg = dim_avg_Wrap( u(lat|:,lon|:,time|nt) )</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">         vAvg = dim_avg_Wrap( v(lat|:,lon|:,time|nt) )</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">then you need to check x, u, and v as well to make sure they have valid values in them. I would do this on the variables as they are being referenced, as it may be the case that your data is all missing for just certain time steps:</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)">         printMinMax(x(nt,:,:),0)</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">         printMinMax(u(nt,:,:),0)</span></div></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">         printMinMax(v(nt,:,:),0)</span></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">A tip: it is expensive to reorder arrays. I recommend using the dim_avg_n_Wrap function so you don't have to reorder the array first:</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">         xAvg = dim_avg_n_Wrap(x(nt,:,:),0)</div><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">         uAvg = dim_avg_n_Wrap(u(nt,:,:),0)</span></div></div><div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">         vAvg = dim_avg_n_Wrap(v(nt,:,:),0)</span><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div></div></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">If you continue to have problems, please subscribe to ncl-talk and post the question there.</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">Thanks,</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial">--Mary</div><div class="gmail_default" style="text-decoration-style:initial;text-decoration-color:initial"><br></div><br class="gmail-Apple-interchange-newline"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 12, 2018 at 11:50 PM, NELSON MATEUS <span dir="ltr"><<a href="mailto:mateus12es@gmail.com" target="_blank">mateus12es@gmail.com</a>></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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi, I'm trying to plot the "mjoclivar_16 and I'm finding some errors" the script and the error are listed below, "could you help me please?<br></div><div dir="ltr">______________________________<wbr>______________________________<wbr>____</div><div dir="ltr"><br></div><div dir="ltr">error : <br></div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">fatal:error in statement</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotInitialize: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div dir="ltr">warning:VectorPlotSetValues: no valid values in vector field; VectorPlot not possible:[errno=1101]</div><div dir="ltr">warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot not possible:[errno=1101]</div><div>______________________________<wbr>______________________________<wbr>___</div><div><br></div><div><br></div><div>Script </div><div><br></div><div><br></div><div><br></div><div><div>******************************<wbr>*****************************</div><div>;</div><div>; mjoclivar_16.ncl</div><div>;</div><div>;*****************************<wbr>******************************</div><div>; Generate life cycle composites based upon daily phase space</div><div>; If the MJO_INDEX is < 1.0 it is not included</div><div>;</div><div>; Source: Eun-Pa Lim: Bureau of Meteorology, Australia</div><div>; July, 2016</div><div>;*****************************<wbr>******************************</div><div>;</div><div>; These files are loaded by default in NCL V6.2.0 and newer</div><div>load "/usr/local/ncarg/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"  </div><div>load "/usr/local/ncarg/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl" </div><div>load "/usr/local/ncarg/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl" </div><div><br></div><div>begin</div><div>   latS    = -90</div><div>   latN    =  90</div><div><br></div><div>   ymdStrt = 20130101                         ; start yyyymmdd</div><div>   ymdLast = 20131231                         ; last  </div><div><br></div><div>   yrStrt  = ymdStrt/10000</div><div>   yrLast  = ymdLast/10000</div><div><br></div><div>   pltSubTitle = "Anomalous: OLR, U850, V850"</div><div><br></div><div>   pltDir  = "./"                             ; plot directory</div><div>   pltType = "pdf"                            ; send graphics to PNG file</div><div>   pltName = "mjoclivar"                      ; yrStrt+"_"+yrLast</div><div>  </div><div>   diro    =  "./"                            ; output directory   </div><div>   diri    =  "./"                            ; input directory   </div><div><br></div><div>   filo    = "<a href="http://olr.day.anomalies.1979-2013.nc" target="_blank">olr.day.anomalies.1979-2013.<wbr>nc</a>"</div><div>  filu    = "<a href="http://u850.day.anomalies.1979-2013.nc" target="_blank">u850.day.anomalies.1979-2013.<wbr>nc</a>"</div><div>  filv    = "<a href="http://v850.day.anomalies.1979-2013.nc" target="_blank">v850.day.anomalies.1979-2013.<wbr>nc</a>"</div><div><br></div><div>;*****************************<wbr>*******************</div><div>; create BandPass Filter</div><div>;*****************************<wbr>*******************</div><div>  ihp      = 2                             ; bpf=>band pass filter</div><div>  nWgt     = 201</div><div>  sigma    = 1.0                           ; Lanczos sigma</div><div>  fca      = 1./100.</div><div>  fcb      = 1./20.</div><div>  wgt      = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )</div><div><br></div><div>;*****************************<wbr>******************************</div><div>; Find the indicies (subscripts) corresponding to the start/end times</div><div>;*****************************<wbr>******************************</div><div><br></div><div>   f       = addfile (diri+filu , "r")                         </div><div>   TIME    = f->time                          ; days since ...</div><div>   YMD     = cd_calendar(TIME, -2)            ; entire (time,6)</div><div><br></div><div>   iStrt   = ind(YMD.eq.ymdStrt)              ; index start</div><div>   iLast   = ind(YMD.eq.ymdLast)              ; index last </div><div>   delete(TIME)</div><div>   delete(YMD )</div><div><br></div><div>   time    = f->time(iStrt:iLast)             ; days since ...</div><div>   u       = f->uwnd_anom(iStrt:iLast,{<wbr>latS:latN},:) </div><div>;*****************************<wbr>******************************</div><div>; Read anomalies frpm other fields</div><div>;*****************************<wbr>******************************</div><div>   f       = addfile (diro+filv , "r")                         </div><div>   v       = f->vwnd_anom(iStrt:iLast,{<wbr>latS:latN},:)</div><div><br></div><div>   f       = addfile (diro+filo , "r")                         </div><div>   x       = f->olr_anom(iStrt:iLast,{latS:<wbr>latN},:) </div><div><br></div><div>   dimx    = dimsizes( x )</div><div>   ntim    = dimx(0)</div><div>   nlat    = dimx(1)</div><div>   mlon    = dimx(2)</div><div>;*****************************<wbr>*******************</div><div>; Apply the band pass filter to the original anomalies</div><div>;*****************************<wbr>*******************</div><div>  x   = wgt_runave_leftdim (x, wgt, 0)</div><div>  u   = wgt_runave_leftdim (u, wgt, 0)</div><div>  v   = wgt_runave_leftdim (v, wgt, 0)</div><div><br></div><div>;*****************************<wbr>******************************</div><div>; Open PC components file created in 'mjo_14.ncl'</div><div>;*****************************<wbr>******************************</div><div>  dirMJO  = "./"                             ; input directory   </div><div>  fMJO    = "MJO_PC_INDEX.nc"                ; created in mjo_14.ncl</div><div>  f       = addfile (dirMJO+fMJO, "r")</div><div><br></div><div>;*****************************<wbr>******************************</div><div>; Find the indices corresponding to the start/end times</div><div>;*****************************<wbr>******************************</div><div>  TIME    = f->time                          ; days since ...</div><div>  YMD     = cd_calendar(TIME, -2)            ; entire (time,6)</div><div><br></div><div>  iStrt   = ind(YMD.eq.ymdStrt)              ; index start</div><div>  iLast   = ind(YMD.eq.ymdLast)              ; index last </div><div>  delete(TIME)</div><div>  delete(YMD )</div><div>  delete(time)</div><div><br></div><div>;*****************************<wbr>******************************</div><div>; Read the data for the desired period</div><div>;*****************************<wbr>******************************</div><div>  pc1     = f->PC1(iStrt:iLast)</div><div>  pc2     = f->PC2(iStrt:iLast)</div><div>  mjo_indx= f->MJO_INDEX(iStrt:iLast)</div><div><br></div><div>  time    = pc1&time </div><div><br></div><div>  ymdhms  = cd_calendar(time, 0)</div><div><br></div><div>  imon    = floattoint( ymdhms(:,1) )   ; convenience</div><div>  iday    = floattoint( ymdhms(:,2) )   ; subscripts must be integer</div><div><br></div><div>;*****************************<wbr>******************************</div><div>; Coloque cada matriz em uma matriz apropriada</div><div>;*****************************<wbr>******************************</div><div>  nPhase      = 8</div><div>  angBnd      = new( (/2,nPhase/), "float")</div><div>  angBnd(0,:) = fspan(  0,315,nPhase)</div><div>  angBnd(1,:) = fspan( 45,360,nPhase)</div><div><br></div><div>  r2d         = 180./(4.*atan(1.0))</div><div>  ang         = atan2(pc2,pc1)*r2d     ; phase space </div><div><br></div><div>  nn          = ind(ang.lt.0)</div><div><br></div><div>  ang(nn)     = ang(nn) + 360          ; make 0 to 360</div><div><br></div><div>;-----------------------------<wbr>-----------------------------</div><div>; 0 <= ang < 45 --> MJO Phase 5 (i.e. +ve PC1 & +ve PC2)</div><div>;</div><div>;  print(pc1(:19)+"  "+pc2(:19)+"  "+ang(:19))</div><div>;-----------------------------<wbr>-----------------------------</div><div><br></div><div>  nDays       = new (nPhase, "integer")</div><div>  pLabel      = "P"+ispan(1,nPhase,1)+": "</div><div><br></div><div>;-----------------------------<wbr>------------------------------<wbr>-</div><div>; PLOTS</div><div>;-----------------------------<wbr>------------------------------<wbr>-</div><div>  ; pltPath = pltDir+pltName+"_rv_16"</div><div>  pltPath = pltDir+pltName</div><div>  wks  = gsn_open_wks(pltType,pltPath)</div><div>  plot = new(nPhase,graphic)              ; create graphic array</div><div><br></div><div>  res                      = True         </div><div>  res@gsnDraw              = False        ; don't draw yet</div><div>  res@gsnFrame             = False        ; don't advance frame yet</div><div> </div><div>  res@mpFillOn             = False        ; turn off map fill</div><div>  res@mpMinLatF            = latS         ; zoom in on map</div><div>  res@mpMaxLatF            = latN</div><div>  res@mpCenterLonF         = 210.</div><div>  res@cnFillOn             = True         ; turn on color fill</div><div>  res@cnFillPalette        = "ViBlGrWhYeOrRe" ; set color map</div><div>  res@cnLinesOn            = False        ; True is default</div><div>  res@cnLineLabelsOn       = False        ; True is default</div><div>  res@lbLabelBarOn         = False        ; turn off individual lb's</div><div>  res@gsnScalarContour     = True         ; contour 3rd array </div><div>  res@gsnMajorLatSpacing   = 15</div><div>  res@gsnMajorLonSpacing   = 60</div><div>  res@tmXBLabelFontHeightF = 0.01</div><div>  res@tmYLLabelFontHeightF = 0.01</div><div><br></div><div>                                          ; common contours </div><div> ;mnmxint = nice_mnmxintvl( min(x) , max(x), 16, False)</div><div>  res@cnLevelSelectionMode = "ManualLevels"</div><div>  res@cnMinLevelValF       =  -40         ; -100; mnmxint(0)</div><div>  res@cnMaxLevelValF       =   40         ;   80; mnmxint(1)</div><div>  res@cnLevelSpacingF      =    5         ;   20; mnmxint(2)</div><div>;print(res)</div><div><br></div><div>  res@vcMinDistanceF            = 0.01            ; thin the vector density</div><div>  res@vcRefMagnitudeF           = 2.0             ; define vector ref mag</div><div>  res@vcRefLengthF              = 0.025           ; define length of vec ref</div><div>  res@vcRefAnnoOrthogonalPosF   = -1.0            ; move ref vector</div><div>  res@vcRefAnnoArrowLineColor   = "black"         ; change ref vector color</div><div>  res@vcRefAnnoArrowUseVecColor = False           ; don't use vec color for ref</div><div><br></div><div>                                          ; panel plot only resources</div><div>  resP                     = True         ; modify the panel plot</div><div>  resP@gsnMaximize         = True         ; large format</div><div>  resP@gsnPanelLabelBar    = True         ; add common colorbar</div><div>  resP@lbLabelFontHeightF  = 0.01</div><div>  resP@gsnPanelBottom      = 0.05         ; add some space at bottom</div><div>  resP@pmLabelBarWidthF    = 0.8          ; label bar width</div><div>  resP@pmLabelBarHeightF   = 0.05</div><div>  resP@<wbr>gsnPanelFigureStringsFontHeigh<wbr>tF = 0.0125  ; bit larger than default</div><div> ;resP@<wbr>pmLabelBarOrthogonalPosF = 0.015   ; move labelbar up a bit</div><div><br></div><div>  txres                  = True             </div><div>  txres@txFontHeightF    = 0.01</div><div>  txid = gsn_create_text(wks, pltSubTitle, txres)</div><div><br></div><div>  amres                  = True </div><div> ;amres@amParallelPosF   =  0.575  </div><div>  amres@amOrthogonalPosF =  0.75  </div><div>  amres@amJust           = "CenterCenter"</div><div> ;amres@amResizeNotify   = True</div><div><br></div><div>;*****************************<wbr>**************</div><div>; Loop over each phase</div><div>;*****************************<wbr>**************</div><div> res@gsnLeftString               = ""</div><div> res@gsnRightString              = ""</div><div> do nSeason=1,2</div><div>    if (nSeason.eq.1) then</div><div>        resP@gsnPanelMainString  = yrStrt+"-"+yrLast+": May to Oct"</div><div>    else</div><div>        resP@gsnPanelMainString  = yrStrt+"-"+yrLast+": Nov to Apr"</div><div>    end if</div><div><br></div><div>  do n=0,nPhase-1</div><div><br></div><div>    na = n+4             ; temporary adjustment for 0 <= ang < 45 represents MJO phase 5 not MJO phase 1 </div><div>    if(na.gt.7) then</div><div>      na = na - 8</div><div>    end if</div><div>;    print(na)</div><div><br></div><div>     if (nSeason.eq.1) then</div><div>         nt = ind(mjo_indx.gt.1.0    .and.                     \</div><div>                 (imon.ge.5          .and. imon.le.10).and.    \</div><div>                  ang.ge.angBnd(0,n) .and. ang.lt.angBnd(1,n))</div><div>     else</div><div>         nt = ind(mjo_indx.gt.1.0    .and.                     \</div><div>                 (imon.ge.11         .or.  imon.le. 4).and.    \</div><div>                  ang.ge.angBnd(0,n) .and. ang.lt.angBnd(1,n))</div><div>     end if</div><div>     if (.not.all(ismissing(nt))) then</div><div>         xAvg = dim_avg_Wrap( x(lat|:,lon|:,time|nt) )</div><div>         uAvg = dim_avg_Wrap( u(lat|:,lon|:,time|nt) )</div><div>         vAvg = dim_avg_Wrap( v(lat|:,lon|:,time|nt) )</div><div>         nDays(na) = dimsizes(nt)</div><div><br></div><div>         res@tmXBLabelsOn         = False    ; do not draw lon labels</div><div>         res@tmXBOn               = False    ;             lon tickmarks</div><div>         if (n.eq.(nPhase-1)) then           ; </div><div>             res@tmXBLabelsOn     = True     ; draw lon labels</div><div>             res@tmXBOn           = True     ;          tickmarks</div><div>         end if</div><div><br></div><div>         plot(n) = gsn_csm_vector_scalar_map(wks,<wbr>uAvg,vAvg,xAvg,res)</div><div>     end if</div><div>     delete(nt)                  ; will change next iteration</div><div>  end do</div><div><br></div><div>  resP@gsnPanelFigureStrings= pLabel+nDays</div><div>  gsn_panel(wks,plot,(/nPhase,1/<wbr>),resP)     ; now draw as one plot</div><div> end do</div><div><br></div><div>end</div></div><div>______________________________<wbr>______________________________<wbr>___</div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
ncarg-talk mailing list<br>
<a href="mailto:ncarg-talk@ucar.edu">ncarg-talk@ucar.edu</a><br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncarg-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncarg-talk</a><br>
<br></blockquote></div><br></div>