<div dir="ltr"><div><div><div><div><div><div><div>How about addfiles<br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml</a><br>-------------<br><br></div><span style="font-family:arial,helvetica,sans-serif"> diri = "./" <br></span></div><span style="font-family:arial,helvetica,sans-serif"> fili = systemfunc("cd "+diri+" ;<font color="#000000"><span style="font-size:13.3333px"> ls 3B42RT.2013*.7.<wbr>nc4")<br></span></font></span></div><font face="courier" color="#000000"><span style="font-size:13.3333px"><span style="font-family:arial,helvetica,sans-serif"> pthi = diri+fili</span><br></span></font></div><font face="courier" color="#000000"><span style="font-size:13.3333px"> print(fili)<br><br></span></font></div><font face="courier" color="#000000"><span style="font-size:13.3333px"> f = addfiles(pthi, "r")<br></span></font></div><font face="courier" color="#000000"><span style="font-size:13.3333px"> prc = f[:]-></span></font><font face="courier" color="#000000"><span style="font-size:13.3333px">precipitation<br><br></span></font></div><font face="courier" color="#000000"><span style="font-size:13.3333px"> printVarSummary(prc)<br></span></font><font face="courier" color="#000000"><span style="font-size:13.3333px"></span></font><font face="courier" color="#000000"><span style="font-size:13.3333px"></span></font></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 8, 2018 at 6:51 AM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@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 style="word-wrap:break-word;line-break:after-white-space">You should provide clean code when writing to ncl-talk. There are a lot of commented lines in your script and it is hard to understand what you are actually doing. Everyone's time here is valuable ;) <div><br></div><div>I suspect that your error is coming from this line </div><div><br></div><div><span class=""><blockquote type="cite"><div dir="ltr"><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><pre style="background-color:rgb(255,255,255);margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><font face="courier"><span style="font-size:13.3333px"> prc_all = (prc1 + prc2 + prc3 + prc4 + prc5 + prc6 + prc7 + prc8 + prc9 + prc10 + prc11 + prc12 + prc13 + prc14 + prc15 + prc16 + prc17 + prc18 + prc19 + prc20 + prc21 + prc22 + prc23 + prc24 + prc25 + prc26 + prc27 + prc28 + prc29 + prc30 + prc31 + prc32 + prc33 + prc34 + prc35 + prc36 + prc37 + prc38 + prc39 + prc40 + prc41 + prc42 + prc43 + prc44 + prc45 + prc46 + prc47 + prc48 + prc49)</span></font></pre></pre></div></div></blockquote><div><br></div></span><div>In this assignment every metadata (including coordinate variables) will be lost. Thus, NCL doesn't know how to interpret the coordinates of the variable that you are trying to plot. It's weird because it appears that in a commented part of your code you were exactly trying to fix this problem </div><div><br></div><div><span class=""><blockquote type="cite"><div dir="ltr"><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><pre style="background-color:rgb(255,255,255);margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent"><font face="courier"><span style="font-size:13.3333px"> ;prc_last := prc_all->precipitation
;prc!0 = "lat" ; 1st ... name the dimensions
;prc!1 = "lon"
;prc&lat = lat ; create coordinate variable
;prc&lon = lon </span></font></pre></pre></div></div></blockquote><div><br></div></span><div>So...few options to fix this.</div><div><br></div><div>[1] Re-assign coordinate variables as you did in the aforementioned part of the code which is now commented out. Note that you should use the names lat2d and lon2d if your coordinate variables are 2d instead of 1d. </div><div><br></div><div>[2] Directly copy var coordinates (and possibly attributes) using one of the function <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarCoords.shtml:" target="_blank">https://www.ncl.ucar.<wbr>edu/Document/Functions/<wbr>Contributed/copy_VarCoords.<wbr>shtml:</a> <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarMeta.shtml" target="_blank">https://www.ncl.ucar.<wbr>edu/Document/Functions/<wbr>Contributed/copy_VarMeta.shtml</a><wbr>.</div><div><br></div><div>Doing copy_VarCoords(prc1,prc_all) should do the trick.</div><div><br></div><div>[3] Manually assign the coordinate variables to the plotting routine using the resources sfXarray and sfYArray. (this <a href="https://www.ncl.ucar.edu/Applications/contour1d.shtml" target="_blank">https://www.ncl.ucar.<wbr>edu/Applications/contour1d.<wbr>shtml</a> can help).</div><div><br></div><div><br></div><div>Cheers </div></div><div><br><blockquote type="cite"><div><div class="h5"><div>On 8. Apr 2018, at 13:48, Md. Jalal Uddin <<a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@gmail.com</a>> wrote:</div><br class="m_2847081368397693755Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Dear Sir/ Madam,<div><br></div><div>I am a new user in NCL. I am getting following error in NCL. I tried to fix it by following NCL guidelines, but don't know why it is not fixing. I used TRMM3B42 3 hourly data. Could you help me, please?</div><div><br></div><div>
<pre style="margin:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">(0) check_for_y_lat_coord: Warning: Data either does
not contain a valid latitude coordinate array or doesn't
contain one at all
(0) check_for_lon_coord: Warning: Data either does
not contain a valid longitude coordinate array or doesn't
contain one at all</pre><pre style="margin:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-decoration-style:initial;text-decoration-color:initial"><pre style="background-color:rgb(255,255,255);font-family:courier;font-size:13.3333px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px;margin:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0px;text-align:left">(0) is_valid_lat_ycoord: Warning: The units attribute of
the Y coordinate array is not set to one of the allowable
units values (i.e. 'degrees_north'). Your latitude labels
may not be correct.
(0) is_valid_lat_xcoord: Warning: The units attribute of
the X coordinate array is not set to one of the allowable
units values (i.e. 'degrees_east'). Your longitude labels
may not be correct.</pre><pre style="background-color:rgb(255,255,255);font-family:courier;font-size:13.3333px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;word-spacing:0px;margin:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0px;text-align:left">;;;;;My script</pre><pre style="background-color:rgb(255,255,255);margin:0px;padding:0px;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0px;text-align:left;text-decoration-style:initial;text-decoration-color:initial"><font face="courier"><span style="font-size:13.3333px">
;*****************************<wbr>******************
;
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
begin
;*****************************<wbr>*******************
; Read the file
;*****************************<wbr>*******************
f1 = addfile("3B42RT.2013051100.7.<wbr>nc4","r")
prc1 = f1->precipitation ;; prc1 here is two dimensional
f2 = addfile("3B42RT.2013051103.7.<wbr>nc4","r")
prc2 = f2->precipitation
f3 = addfile("3B42RT.2013051106.7.<wbr>nc4","r")
prc3 = f3->precipitation
f4 = addfile("3B42RT.2013051109.7.<wbr>nc4","r")
prc4 = f4->precipitation
f5 = addfile("3B42RT.2013051112.7.<wbr>nc4","r")
prc5 = f5->precipitation
f6 = addfile("3B42RT.2013051115.7.<wbr>nc4","r")
prc6 = f6->precipitation
f7 = addfile("3B42RT.2013051118.7.<wbr>nc4","r")
prc7 = f7->precipitation
f8 = addfile("3B42RT.2013051121.7.<wbr>nc4","r")
prc8 = f8->precipitation
f9 = addfile("3B42RT.2013051200.7.<wbr>nc4","r")
prc9 = f9->precipitation
f10 = addfile("3B42RT.2013051203.7.<wbr>nc4","r")
prc10 = f10->precipitation
f11 = addfile("3B42RT.2013051206.7.<wbr>nc4","r")
prc11 = f11->precipitation
f12 = addfile("3B42RT.2013051209.7.<wbr>nc4","r")
prc12 = f12->precipitation
f13 = addfile("3B42RT.2013051212.7.<wbr>nc4","r")
prc13 = f13->precipitation
f14 = addfile("3B42RT.2013051215.7.<wbr>nc4","r")
prc14 = f14->precipitation
f15 = addfile("3B42RT.2013051218.7.<wbr>nc4","r")
prc15 = f15->precipitation
f16 = addfile("3B42RT.2013051221.7.<wbr>nc4","r")
prc16 = f16->precipitation
f17 = addfile("3B42RT.2013051300.7.<wbr>nc4","r")
prc17 = f17->precipitation
f18 = addfile("3B42RT.2013051303.7.<wbr>nc4","r")
prc18 = f18->precipitation
f19 = addfile("3B42RT.2013051306.7.<wbr>nc4","r")
prc19 = f19->precipitation
f20 = addfile("3B42RT.2013051309.7.<wbr>nc4","r")
prc20 = f20->precipitation
f21 = addfile("3B42RT.2013051312.7.<wbr>nc4","r")
prc21 = f21->precipitation
f22 = addfile("3B42RT.2013051315.7.<wbr>nc4","r")
prc22 = f22->precipitation
f23 = addfile("3B42RT.2013051318.7.<wbr>nc4","r")
prc23 = f23->precipitation
f24 = addfile("3B42RT.2013051321.7.<wbr>nc4","r")
prc24 = f24->precipitation
f25 = addfile("3B42RT.2013051400.7.<wbr>nc4","r")
prc25 = f25->precipitation
f26 = addfile("3B42RT.2013051403.7.<wbr>nc4","r")
prc26 = f26->precipitation
f27 = addfile("3B42RT.2013051406.7.<wbr>nc4","r")
prc27 = f27->precipitation
f28 = addfile("3B42RT.2013051409.7.<wbr>nc4","r")
prc28 = f28->precipitation
f29 = addfile("3B42RT.2013051412.7.<wbr>nc4","r")
prc29 = f29->precipitation
f30 = addfile("3B42RT.2013051415.7.<wbr>nc4","r")
prc30 = f30->precipitation
f31 = addfile("3B42RT.2013051418.7.<wbr>nc4","r")
prc31 = f31->precipitation
f32 = addfile("3B42RT.2013051421.7.<wbr>nc4","r")
prc32 = f32->precipitation
f33 = addfile("3B42RT.2013051500.7.<wbr>nc4","r")
prc33 = f33->precipitation
f34 = addfile("3B42RT.2013051503.7.<wbr>nc4","r")
prc34 = f34->precipitation
f35 = addfile("3B42RT.2013051506.7.<wbr>nc4","r")
prc35 = f35->precipitation
f36 = addfile("3B42RT.2013051509.7.<wbr>nc4","r")
prc36 = f36->precipitation
f37 = addfile("3B42RT.2013051512.7.<wbr>nc4","r")
prc37 = f37->precipitation
f38 = addfile("3B42RT.2013051515.7.<wbr>nc4","r")
prc38 = f38->precipitation
f39 = addfile("3B42RT.2013051518.7.<wbr>nc4","r")
prc39 = f39->precipitation
f40 = addfile("3B42RT.2013051521.7.<wbr>nc4","r")
prc40 = f40->precipitation
f41 = addfile("3B42RT.2013051600.7.<wbr>nc4","r")
prc41 = f41->precipitation
f42 = addfile("3B42RT.2013051603.7.<wbr>nc4","r")
prc42 = f42->precipitation
f43 = addfile("3B42RT.2013051606.7.<wbr>nc4","r")
prc43 = f43->precipitation
f44 = addfile("3B42RT.2013051609.7.<wbr>nc4","r")
prc44 = f44->precipitation
f45 = addfile("3B42RT.2013051612.7.<wbr>nc4","r")
prc45 = f45->precipitation
f46 = addfile("3B42RT.2013051615.7.<wbr>nc4","r")
prc46 = f46->precipitation
f47 = addfile("3B42RT.2013051618.7.<wbr>nc4","r")
prc47 = f47->precipitation
f48 = addfile("3B42RT.2013051621.7.<wbr>nc4","r")
prc48 = f48->precipitation
f49 = addfile("3B42RT.2013051700.7.<wbr>nc4","r")
prc49 = f49->precipitation
prc_all = (prc1 + prc2 + prc3 + prc4 + prc5 + prc6 + prc7 + prc8 + prc9 + prc10 + prc11 + prc12 + prc13 + prc14 + prc15 + prc16 + prc17 + prc18 + prc19 + prc20 + prc21 + prc22 + prc23 + prc24 + prc25 + prc26 + prc27 + prc28 + prc29 + prc30 + prc31 + prc32 + prc33 + prc34 + prc35 + prc36 + prc37 + prc38 + prc39 + prc40 + prc41 + prc42 + prc43 + prc44 + prc45 + prc46 + prc47 + prc48 + prc49)
;prc_last := prc_all->precipitation
;prc!0 = "lat" ; 1st ... name the dimensions
;prc!1 = "lon"
;prc&lat = lat ; create coordinate variable
;prc&lon = lon
;lat_p = (/-35,-30,-25,-20,-15,-10,-5,<wbr>0,5,10,15,20,25,30/)
;lon_p = (/0,10,20,30,40,50,60,70,80,<wbr>90,100,110,120,130,135/)
;X!0 = "lat"
;Y!1 = "lon"
;X&lat@units = "degrees_north"
;Y&lon@units = "degrees_east"
;grid = new((/14,15),float)
;grid&lat = lat_p
;grid&lon = lon_p
printVarSummary(prc_all)
;*****************************<wbr>*******************
; create colors
;*****************************<wbr>********************
wks = gsn_open_wks("png","Mahasen") ; open a workstation and send data to eps
colors = (/ (/255,255,255/), (/244,255,244/), \
(/217,255,217/), (/163,255,163/), (/106,255,106/), \
(/43,255,106/), (/0,224,0/), (/0,134,0/),(/255,255,0/),\
(/255,127,0/) /) / 255. ; be sure to make this a float!
;*****************************<wbr>*******************
; create panel plots
;*****************************<wbr>********************
res = True ; plot options desired
res@cnFillOn = True ; turn on color fill
res@cnLinesOn = False ; turn off contour lines
res@cnFillPalette = colors
res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels
res@cnLevels = (/5,10,15,20,25,30,35,40,45,<wbr>50,55/)
;res@cnLevels = (/0.1,0.2,0.4,0.8,1.6,3.2,6.4,<wbr>12.8,20,25,30/)
res@mpFillOn = True ; turn on gray continents
res@pmTickMarkDisplayMode = "Always"
res@mpLimitMode = "LatLon" ; select subregion
res@mpMinLatF = -35.
res@mpMaxLatF = 30.
res@mpMinLonF = 0.
res@mpMaxLonF = 135.
;res@mpProjection = "Mercator"
res@lbOrientation = "horizontal"
res@trGridType = "TriangularMesh"
;res@trGridType = "curvilinear"
res@tmYROn = False ; turn off right and top tickmarks
res@tmXTOn = False
; add polygon to plot
y = (/10.3, 10.8, 11.4, 11.9, 12.3, 13.1, 13.7, 14.2, 14.7, 15.6, 16.5, 17.5, 18.5, 19.7, 20.7, 22.4, 24.3/)
x = (/87.0, 86.7, 86.5, 86.2, 85.6, 85.4, 85.4, 85.8, 86.2, 86.7, 87.2, 87.6, 88.4, 89.0, 89.9, 91.1, 92.6/)
resp = True ; mods yes
resp@gsLineThicknessF = 3.0 ; line thickness
resp@gsLineColor = "black"
;Add markers to the trajectories.
amres = True ; marker resources for best track
amres@gsMarkerIndex = 14 ; marker style (filled circle)
amres@gsMarkerSizeF = 8.0 ; marker size
amres@gsMarkerColor = "black" ; maker color
plot = gsn_csm_contour_map(wks, prc_all,res) ; create plot
d = gsn_add_polyline(wks,plot,x,y,<wbr>resp)
d1 = gsn_add_polymarker(wks,plot,x,<wbr>y,amres)
draw(plot)
frame(wks)
end</span></font></pre>Best Wishes<br>Jalal</pre>-- <br><div class="m_2847081368397693755gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr">Jasmine Jiangsu Government Scholar<br>Cell: +8613260859092</div><div>Office: Beichen Building, School of Geography and Remote Sensing, Room No. 406</div><div dir="ltr"><font style="background-color:rgb(255,255,255)"><b><br></b></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)"><b>AND </b></font></div><div dir="ltr">B.Sc. in Disaster Management (Hons.) </div><div dir="ltr">Patuakhali Science and Technology University, Bangladesh.<br>Cell: +8801792052662, +8801838613203 </div><div dir="ltr"><font size="2">Email:<b> </b><a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@gmail.com</a><br>Web: <a href="http://www.dmjalal90.weebly.com/" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-<wbr>jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div></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" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><span class="HOEnZb"><font color="#888888"><br></font></span></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="m_2847081368397693755Apple-interchange-newline">Guido Cioni</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista" target="_blank">http://guidocioni.altervista</a>.<wbr>org</div>
</div>
<br></font></span></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>