<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">________________________________________________________________</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>_______________________________________________________________</div><div><br></div><div><br></div><div>Script </div><div><br></div><div><br></div><div><br></div><div><div>***********************************************************</div><div>;</div><div>; mjoclivar_16.ncl</div><div>;</div><div>;***********************************************************</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>;***********************************************************</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/nclscripts/csm/gsn_code.ncl"  </div><div>load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div><div>load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/contributed.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">olr.day.anomalies.1979-2013.nc</a>"</div><div>  filu    = "<a href="http://u850.day.anomalies.1979-2013.nc">u850.day.anomalies.1979-2013.nc</a>"</div><div>  filv    = "<a href="http://v850.day.anomalies.1979-2013.nc">v850.day.anomalies.1979-2013.nc</a>"</div><div><br></div><div>;************************************************</div><div>; create BandPass Filter</div><div>;************************************************</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>;***********************************************************</div><div>; Find the indicies (subscripts) corresponding to the start/end times</div><div>;***********************************************************</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,{latS:latN},:) </div><div>;***********************************************************</div><div>; Read anomalies frpm other fields</div><div>;***********************************************************</div><div>   f       = addfile (diro+filv , "r")                         </div><div>   v       = f->vwnd_anom(iStrt:iLast,{latS:latN},:)</div><div><br></div><div>   f       = addfile (diro+filo , "r")                         </div><div>   x       = f->olr_anom(iStrt:iLast,{latS: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>;************************************************</div><div>; Apply the band pass filter to the original anomalies</div><div>;************************************************</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>;***********************************************************</div><div>; Open PC components file created in 'mjo_14.ncl'</div><div>;***********************************************************</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>;***********************************************************</div><div>; Find the indices corresponding to the start/end times</div><div>;***********************************************************</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>;***********************************************************</div><div>; Read the data for the desired period</div><div>;***********************************************************</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>;***********************************************************</div><div>; Coloque cada matriz em uma matriz apropriada</div><div>;***********************************************************</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>;----------------------------------------------------------</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>;----------------------------------------------------------</div><div><br></div><div>  nDays       = new (nPhase, "integer")</div><div>  pLabel      = "P"+ispan(1,nPhase,1)+": "</div><div><br></div><div>;------------------------------------------------------------</div><div>; PLOTS</div><div>;------------------------------------------------------------</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@gsnPanelFigureStringsFontHeightF = 0.0125  ; bit larger than default</div><div> ;resP@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>;*******************************************</div><div>; Loop over each phase</div><div>;*******************************************</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,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/),resP)     ; now draw as one plot</div><div> end do</div><div><br></div><div>end</div></div><div>_______________________________________________________________</div></div></div></div></div></div>