<div dir="ltr"><font face="arial, helvetica, sans-serif">Good afternoon from Spain, </font><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">I'm attempting to produce a vector/contour plot of a specific area from ECMWF </span>analysis data. Firstly, my script decodes<font color="#000000" face="arial, helvetica, sans-serif"> the ECMWF variables u10 and v1 with the "doubletofloat" function. Secondly, I calculate the wind module (SPD) in order to generate a </font><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">contour plot of the wind speed (succesfully obtained). </span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">The problem arises when I try to overlay the vector plot on this contour plot. In this case, I obtained a vector plot that has nothing to do with the contour plot. </span></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">Appear to be specific problems associated with coordinates and other issues, because I received error messages such as: </font><font face="garamond, serif"><font color="#000000">"</font><span style="font-variant-ligatures:no-common-ligatures;color:rgb(12,12,12)">A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:</span><span class="gmail-Apple-converted-space" style="font-variant-ligatures:no-common-ligatures;color:rgb(12,12,12)"> </span>(0)<span class="gmail-Apple-tab-span">        </span><span class="gmail-Apple-converted-space"> </span>'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east' "</font></div>
<div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Here is the </span><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">script: </span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></span></div><div><div><font color="#000000" face="arial, helvetica, sans-serif">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">begin</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">input = addfile("../<a href="http://10wind_an.nc">10wind_an.nc</a>", "r")</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> Lon <span style="white-space:pre">        </span> = input->longitude</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> Lat <span style="white-space:pre">        </span> = input->latitude</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> v10 = input->v10</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> u10 = input->u10</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> timean =input->time</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">;;;;;;;; variables u10 y v10 se encuentran codificadas ;;;;;;;;;;;;;;</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">u1 = doubletofloat(u10@scale_factor) ;a=scale_factor</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">u2 = doubletofloat(u10@add_offset) ;b=add_offset</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">v1 = doubletofloat(v10@scale_factor)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">v2 = doubletofloat(v10@add_offset)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> U10_0 = (u10*u1)+u2 ;y=ax+b siendo x=u10</font></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"> V10_0 = (v10*v1)+v2 ;y=ax+b siendo x=v10</span></div><div><div><font color="#000000" face="arial, helvetica, sans-serif"><br class="gmail-Apple-interchange-newline">;printVarSummary(U10_0) ;24x141x201</font></div></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">;Wind Speed module</span></div><div><font color="#000000" face="arial, helvetica, sans-serif"> SPD_0=(U10_0^2+V10_0^2)^(0.5)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">; Set basic resources</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res=True</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> pltres = True ; Plotting resources</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> mpres = True ; Map resources</font></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"> time_utc=cd_calendar(timean,3)</span><br></div><div><font color="#000000" face="arial, helvetica, sans-serif"> ntimes = dimsizes(time_utc) </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> do it = 0,ntimes-1,1 ; TIME LOOP </font></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"> </span><br></div><div><font color="#000000" face="arial, helvetica, sans-serif"> SPD = SPD_0(it,:,:) </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> U10 = U10_0(it,:,:)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> V10 = V10_0(it,:,:)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">;printVarSummary(U10) ;141x201</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> SPD@description = "Wind Speed"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> SPD@units = "m/s"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> wks_type = "png"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> wks_type@wkWidth = 2000</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> wks_type@wkHeight = 2000</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> wks = gsn_open_wks(wks_type, "../spd_AN/SPD_AN_" + time_utc(it) + "")</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> gsn_define_colormap(wks,"BlAqGrYeOrRe")</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnFillOn = True ; turn on color for contours</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnLinesOn = False ; turn off contour lines</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnLineLabelsOn = False ; turn off contour line labels</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@gsnScalarContour = True ; contours desired</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnFillPalette = "WhiteBlueGreenYellowRed"</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@mpLandFillColor = "gray" ; set land to be gray</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@mpMinLatF = 26.50 ; set the minimum latitude</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@mpMaxLatF = 40.00 ; set the maximum latitude</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@mpMinLonF = -30.50 ; set the minimum longitude</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@mpMaxLonF = -11.50 </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> </font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@lbOrientation = "Vertical" ; vertical label bar</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@pmLabelBarOrthogonalPosF = -0.01 ; move label bar closer</font></div><div><br></div><div><font color="#000000" face="arial, helvetica, sans-serif">; note, when doing a subregion, NCL determines the range of the data from</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">; the full domain. If you wish to just consider the domain you are plotting,</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">; you must manually set those levels.</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnMinLevelValF = 0.0 ; set min contour level</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnMaxLevelValF = 24 ; set max contour level</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@cnLevelSpacingF = 2.0 ; set contour spacing</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcRefMagnitudeF = 4.0 ; define vector ref mag</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcRefLengthF = 0.045 ; define length of vec ref</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcRefAnnoArrowLineColor = "black" ; change ref vector color</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcRefAnnoArrowUseVecColor = False ; don't use vec color for ref</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcGlyphStyle = "WindBarb" ; turn on curly vectors</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcLineArrowColor = "white" ; change vector color</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcLineArrowThicknessF = 2.0 ; change vector thickness</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> res@vcVectorDrawOrder = "PostDraw" ; draw vectors last</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"> plot=gsn_csm_vector_scalar_map_ce(wks,U10,V10,SPD,res)</span><br></div><div><br></div><div><font color="#000000" face="arial, helvetica, sans-serif">draw(plot)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif">frame(wks)</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"> end do </font></div><div><font color="#000000" face="arial, helvetica, sans-serif">end</font></div></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">----</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">Any help would be really appreciated. Thank you in advance.</font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div><font color="#000000" face="arial, helvetica, sans-serif">Regards, </font></div><div><font color="#000000" face="arial, helvetica, sans-serif">Lara</font></div></div>