<div dir="ltr"><div dir="ltr"><div>[1] <br></div><div>The MJO_Clivar diagnostics specify that anomalies be used. Certainly, you can input the full wind fields because the underlying code has no way of detecting if the input are as expected (anomalies). I am not sure hoe the output would be interpreted.<br></div><div><br></div><div>[2]</div><div>I *speculate* ithe olr on the file are type 'short'<br></div><div><br></div><div>x = f->olr_anom ; f->olr_anom(:,:,:)</div><div><b>printVarSummary(</b>x) ; what type are olr?</div><div><br></div><div>If they are type short, then use NCL's <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml"><b>short2flt</b></a></div><div><br></div><div>x = short2flt(x) <br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 7:58 PM nelson mateus <<a href="mailto:nelsonbuchinho1992@gmail.com">nelsonbuchinho1992@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br clear="all"><div><div>Hello .</div><div><br></div><div>I'm trying to use the mjo_clivar 16 script, and I'm trying to run the wind fields "without being anomaly", and it's giving me the following error:</div><div><br></div><div><br></div><div><div>fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side</div><div>fatal:["Execute.c":8640]:Execute: Error occurred at or near line 80 in file mjoc_anom.ncl</div></div><div><br></div><div><br></div><div><br class="gmail-m_-4506922926726161756gmail-Apple-interchange-newline">can anybody help me ?<br></div><div>##########################SCRIPT ########################</div><div><br></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>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>load "/usr/local/ncarg/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl" </div><div>begin</div><div> latS = -60</div><div> latN = 20</div><div><br></div><div><br></div><div> lonE = 0</div><div> lonW = 270</div><div><br></div><div><br></div><div> ymdStrt = 19800101 ; começo yyyymmdd</div><div> ymdLast = 19800102 ; término</div><div><br></div><div> yrStrt = ymdStrt/10000</div><div> yrLast = ymdLast/10000</div><div><br></div><div> pltSubTitle = "Anomalia: OLR, U850, V850x<span style="white-space:pre-wrap"> </span>"</div><div><br></div><div> pltDir = "./" ; plot directory</div><div> pltType = "pdf" </div><div> pltName = "mjoclivar200uv" ; yrStrt+"_"+yrLast</div><div> </div><div> diri = "./" ; input directory </div><div><br></div><div> filo = "<a href="http://olr.anomalia.1979-2017.nc" target="_blank">olr.anomalia.1979-2017.nc</a>"</div><div> filu = "<a href="http://uwnd1979_2017.nc" target="_blank">uwnd1979_2017.nc</a>"</div><div> filv = "<a href="http://vwnd1979_2017.nc" target="_blank">vwnd1979_2017.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>; on the source data files.</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 ; days since ...</div><div> u = f->uwnd(:,0,:,:)</div><div>;delete(u) </div><div>;***********************************************************</div><div>; Read anomalies frpm other fields</div><div>;***********************************************************</div><div> f = addfile (diri+filv , "r") </div><div> v = f->vwnd(:,0,:,:)</div><div>;delete(v)</div><div><br></div><div> f = addfile (diri+filo , "r") </div><div> x = f->olr_anom(:,:,:) </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><br></div><div> x = wgt_runave_n (x, wgt, 0, 0) ; better</div><div> ;u = wgt_runave_n (u, wgt, 0, 0)</div><div> ;v = wgt_runave_n (v, wgt,0, 0)</div><div><br></div><div>;***********************************************************</div><div>; Open PC components file created in 'mjo_14.ncl'</div><div>;***********************************************************</div><div> diri = "./" ; input directory </div><div> fMJO = "MJO_PC_INDEX.nc" ; created in mjo_14.ncl</div><div> f = addfile (diri+fMJO, "r")</div><div><br></div><div>;***********************************************************</div><div>; Find the indices corresponding to the start/end times</div><div>; on the MJO_PC_INDEX.nc file</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><br></div><div>;***********************************************************</div><div>; Read the data for the desired period</div><div>;***********************************************************</div><div> pc1 = f->PC1</div><div> pc2 = f->PC2</div><div> mjo_indx= f->MJO_INDEX</div><div><br></div><div> time = f->time</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>;***********************************************************</div><div>; Place each array into an appropriate array</div><div>;;***********************************************************</div><div> ;phase = (/ 202.5, 247.5, 292.5, 337.5 \ ; phi: Matt Wheeler's f77 code</div><div> ; , 22.5, 67.5, 112.5, 157.5 /) </div><div><br></div><div><br></div><div> phase =(/ 112.5, 67.5,22.5 \</div><div> , 337.5, 292.5, 247.5, 202.5, 157.5 /)</div><div> nPhase = dimsizes(phase)</div><div> phaBnd = 180.0/nPhase</div><div> angBnd = new( (/2,nPhase/), "float")</div><div> angBnd(0,:) = phase-phaBnd </div><div> angBnd(1,:) = phase+phaBnd</div><div> ;print("phase: "+phase+" angBnd: "+angBnd(0,:)+" - "+angBnd(1,:))</div><div><br></div><div> r2d = 180./(4.*atan(1.0))</div><div> ang = atan2(pc2,pc1)*r2d ; phase space </div><div> nn = ind(ang.lt.0)</div><div> ang(nn) = ang(nn) + 360 ; make 0 to 360</div><div> print(ang)</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</div><div><br></div><div> wks = gsn_open_wks(pltType,pltPath)</div><div> gsn_define_colormap(wks,"ViBlGrWhYeOrRe") </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> res@gsnSpreadColors = True ; spread out color table</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 = 220.</div><div> res@cnFillOn = True ; turn on color fill</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 = -20 ; -100; mnmxint(0)</div><div> res@cnMaxLevelValF = 20 ; 80; mnmxint(1)</div><div> res@cnLevelSpacingF = 5 ; 20; mnmxint(2)</div><div>;print(res)</div><div><br></div><div> res@vcMinDistanceF = 0.01 ;0.01 ; thin the vector density</div><div> res@vcRefMagnitudeF = 3 ;1.0 ; define vector ref mag,aqui era 2</div><div> res@vcRefLengthF = 0.025 ;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@lbLabelAutoStride = True ; auto stride on labels</div><div> resP@lbLabelFontHeightF = 0.01</div><div> resP@gsnPanelBottom = 0.05 ; add some space at bottom</div><div> resP@pmLabelBarWidthF = 0.47 ; 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><br></div><div> res@gsnLeftString = ""</div><div> res@gsnRightString = ""</div><div> do nSeason=1,2</div><div> if (nSeason.eq.1) then</div><div> resP@txString = yrStrt+"-"+yrLast+": Maio a Outubro"</div><div> else</div><div> resP@txString = yrStrt+"-"+yrLast+": Novembro a Abril"</div><div> end if</div><div> do n=0,nPhase-1</div><div> </div><div> ; All times where the following criteria are met</div><div> if (nSeason.eq.1) then</div><div><br></div><div> nt = ind(mjo_indx.gt.2.5 .and. \</div><div> ;nt = ind((mjo_indx.gt.1.0 .and. <a href="http://mjo_indx.lt" target="_blank">mjo_indx.lt</a>. 2.5) .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.2.5 .and. \</div><div> ;nt = ind((mjo_indx.gt.1.0 .and. <a href="http://mjo_indx.lt" target="_blank">mjo_indx.lt</a>. 2.5) .and. \</div><div> (imon.ge.12 .or. imon.le. 2).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) ) ; original</div><div> ;;uAvg = dim_avg_Wrap( u(lat|:,lon|:,time|nt) )</div><div> ;;vAvg = dim_avg_Wrap( v(lat|:,lon|:,time|nt) )</div><div><br></div><div> xAvg = dim_avg_n_Wrap( x(nt,:,:), 0) ; better</div><div> ;uAvg = dim_avg_n_Wrap( u(nt,:,:), 0)</div><div> ;vAvg = dim_avg_n_Wrap( v(nt,:,:), 0)</div><div><br></div><div> nDays(n) = 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_ce(wks,uAvg,vAvg,xAvg,res)</div><div> ;plot = gsn_csm_contour_map_ce(wks,uAvg,vAvg,xAvg,res)</div><div><br></div><div> end if</div><div> delete(nt) ; will change next iteration</div><div> end do</div><div><br></div><div>;;ann3 = gsn_add_annotation(plot(0), txid, amres)</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>;system("gv "+pltPath+"."+pltType)</div><div>end</div><div><br></div></div><div><br></div><div>can anybody help me ?</div></div>-- <br><div dir="ltr" class="gmail-m_-4506922926726161756gmail_signature"><div dir="ltr">Nelson Pedro António Mateus </div></div></div></div></div></div>
_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>