<div dir="ltr"><div class="gmail_default">Geeta,</div><div class="gmail_default"><br></div><div class="gmail_default">You need to do some debugging on your own to figure out these problems, because it's getting frustrating trying to help. <br></div><div class="gmail_default"><br></div><div class="gmail_default">The "remove primitive" type of warnings are coming from a part of the code that you didn't show in your email.</div><div class="gmail_default"><br></div><div class="gmail_default">The "<span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">fatal:ListSelect: Index out of range" error is telling you exactly what the problem is, and that is you are trying to subscript a list variable with a value that is out-of-range.</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">You said it occurred at line 40, which is:</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"> 40 wrfs = wrfa[n]</span><br style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">Did you check that "wrfa" indeed has at least "n-1" elements? You can use "ListCount" to check this:</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">print(ListCount(wrfa))</span></div><div class="gmail_default"><br></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">You are looping from 0 to 4, and I know this is because you said you have 5 files, but did you make sure that trmmf and wrff actually have 5 file names in them?</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">If you continue to have problems with this, then *please* try to do some debugging on your own. You can do this with print or printVarSummary statements. </span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">Also, in general, it's not a good idea to "hard-code" a do loop with something like:</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"> do n = 0,4</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">It is better to do something like:</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"> nfiles = dimsizes(wrff) ; get the number of files</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"> do n=0,nfiles-1</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">But, you also need to make sure that wrff and trmmf actually have the same number of files, since you are using the same loop counter for both of them.</span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">If you still continue to have problems after debugging on your own, then include the *full* script, and your data files if possible. You can use our anonymous ftp, which I think you already have the information for.</span></div><div class="gmail_default"><br></div><div class="gmail_default"><font color="#000000" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif">--Mary</font></div><div class="gmail_default"><font color="#000000" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif"><br></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 8:39 AM, Geeta Geeta <span dir="ltr"><<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"><div dir="ltr"><span>thanks Dennis for your reply. <br></span></div><div dir="ltr"><span>I used ls only in the systemfunc .</span></div><div dir="ltr"><span><br></span></div><div dir="ltr"><span>My data is of different years. hence I wanted to see if the files are being in the right order in which I wanted (2011, 2013,2014 and 2015). Hence I wanted the date of each file too. </span></div><div dir="ltr"><br><span></span></div><div dir="ltr"><span>I have modified the script slightly to include that. It is like this. <br></span></div><div dir="ltr"><span> ntrmm = dimsizes(trmm)<br>; print(ntrmm)<br><br>; do i = 0, ntr mm-1,1<br>; print(i)<br> trmm0 = trmm[0]->r(0,:,:)<br> trmmdate0 = trmm[0]->time<br> print(trmmdate0)</span></div><div dir="ltr"><br><span></span></div><div dir="ltr"><br><span></span></div><div dir="ltr"><span>the output looks like this. <br></span></div><div dir="ltr"><span>ariable: trmm0<br>Type: float<br>Total Size: 2304000 bytes<br> 576000 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [latitude | 400] x [longitude | 1440]<br>Coordinates: <br> latitude: [-49.875..49.875]<br> longitude: [0.125..359.875]<br>Number Of Attributes: 8<br> time : 0<br> long_name : daily (0Z-21Z) rainfall total<br> units : mm<br> grid_name : grid-1<br> grid_type : linear<br> level_description : Earth surface<br> _FillValue : -9999.9<br> coordinates : time latitude longitude<br><br><br>Variable: trmmdate0<br>Type: double<br>Total Size: 8 bytes<br> 1 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [time | 1]<br>Coordinates: <br> time: [ 0.. 0]<br>Number Of Attributes: 1<br> units : hours since 2011-04-22 00:00:00Z<br>(0) 0<br></span></div><div dir="ltr"><span><br></span></div><div dir="ltr"><br></div><div dir="ltr">I have 5 of TRMM files. I tried read the trmm using the do loop, But unsuccessful. this is what I have done now for this<br></div><div dir="ltr"><br></div><div dir="ltr">18 trmmf = systemfunc("ls 3B42_daily.20*.nc") ; TRMM RF 22 May 2013<br> 19 trmma = addfiles(trmmf,"r") ; TRMM RF 22 May 2013<br> 20 trmms = trmma[0]<br> 21 <br> 22 wrff = systemfunc("ls wrfout_d03_20*_00:00:00") ; model rainfall<br> 23 wrfa = addfiles(wrff,"r")<br> 24 wrfs = wrfa[0]<br> 25 <br> 26 ; a = addfile("<a href="http://3B42_daily.2013.05.22.7.nc" target="_blank">3B42_daily.2013.05.22.7.nc</a>","r") ; TRMM RF 22 May 2013<br> 27 <br> 28 ; f = addfile("wrfout_d03_2013-05-21_00:00:00","r") ; model rainfall<br> 29 <br> 30 ; Plotting TRMM rainfall<br> 31 var = 0<br> 32 <br> 33 plot = new(10,graphic)<br> 34 wks = gsn_open_wks("ps","trmm_model")<br> 35 gsn_define_colormap(wks,"prcp_2")<br> 36 <br> 37 ; print(a)<br> 38 do n = 0, 4<br> 39 trmms= trmma[n]<br> 40 wrfs = wrfa[n]<br> 41 <br> 42 rf = trmms->r(0,:,:)</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"> rainc28 = wrfs->RAINC(28,:,:)<br> 57 rainnc28 = wrfs->RAINNC(28,:,:)<br> 58 rainc4 = wrfs->RAINC(4,:,:)<br> 59 rainnc4 = wrfs->RAINNC(4,:,:)<br> 60 ;</div><div dir="ltr">61 latitude = wrfs->XLAT(0,:,0)<br> 62 longitude = wrfs->XLONG(0,0,:)<br> 63 ; times_in_file = wrfs->Times<br> 64 ; init = times_in_file(:,0)<br> 65 ; print(init)<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">I get an error at the LINE 40. <br></div><div dir="ltr">(0) latitude<br>(1) longitude<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>(0) latitude<br>(1) longitude<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>(0) latitude<br>(1) longitude<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>warning:_NclIRemovePrimitive: First parameter is a missing value, returning missing values<br>fatal:ListSelect: Index out of range<br>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 40 in file trmm-model-</div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Dont know what's going wrong. <br></div><span class="HOEnZb"><font color="#888888"><div dir="ltr"><br><span></span></div><div dir="ltr"><span></span></div><div> </div><div>Geeta.</div></font></span><div><div class="h5"> <br><div><br><br></div><div style="display:block"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div dir="ltr"><font face="Arial" size="2"> On Tuesday, 24 November 2015 12:31 AM, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:<br></font></div> <br><br> <div>Please do not start a new thread. Use the 'reply all' to keep all<br clear="none">emails together<br clear="none"><br clear="none">====<br clear="none"><br clear="none">[1]<br clear="none">Note what I suggested<br clear="none"><br clear="none"> trmm_files = systemfunc("ls 3B42_daily.20*.nc")<br clear="none"><br clear="none">I did *not* use<br clear="none"><br clear="none"> trmm_files = systemfunc("ls -l 3B42_daily.20*.nc")<br clear="none"><br clear="none">the '-l' returns much more information than just the file names.<br clear="none"><br clear="none">===<br clear="none"><br clear="none">[2]<br clear="none">Had you informed ncl-talk that you wanted data for 2011 and the file names are<br clear="none"><br clear="none"><a href="http://3B42_daily.2011.04.22.7.nc" target="_blank">3B42_daily.2011.04.22.7.nc</a> <a href="http://3B42_daily.2014.06.05.7.nc" target="_blank">3B42_daily.2014.06.05.7.nc</a><br clear="none"><a href="http://3B42_daily.2013.05.22.7.nc" target="_blank">3B42_daily.2013.05.22.7.nc</a> <a href="http://3B42_daily.2015.04.23.7.nc" target="_blank">3B42_daily.2015.04.23.7.nc</a><br clear="none"><a href="http://3B42_daily.2014.06.02.7.nc" target="_blank">3B42_daily.2014.06.02.7.nc</a><br clear="none"><br clear="none">Then<br clear="none"><br clear="none"> trmm_files = systemfunc("ls 3B42_daily.2011*.nc")<br clear="none"><br clear="none"> would have been suggested. Note: no '-l'<br clear="none"><br clear="none">[3]<br clear="none">I did *not* use<br clear="none"> nfiles = ListCount(trmm)<br clear="none">but this should return the same as<br clear="none"> nfiles = dimsizes(trmm_files)<br clear="none"><br clear="none">[4]<br clear="none"><br clear="none">re: "In the printVarSummary, I dont get the time info of each file...."<br clear="none"><br clear="none">trmm_rf2011 = trmm[0]->r<br clear="none"> printVarSummary(trmm_rf2011)<br clear="none"> trmm_rf2013 = trmm[1]->r<br clear="none"> printVarSummary(trmm_rf2013)<br clear="none"> trmm_rf2014a = trmm[2]->r<br clear="none"> printVarSummary(trmm_rf2014a)<br clear="none"> trmm_rf2014b = trmm[3]->r<br clear="none"> printVarSummary(trmm_rf2014b)<br clear="none"> trmm_rf2015 = trmm[4]->r<br clear="none"> printVarSummary(trmm_rf2015)<br clear="none"><br clear="none"><br clear="none">Since you did not include any output from 'printVarSummary', how is<br clear="none">ncl-talk supposed to answer the question.<br clear="none"><div><br clear="none">On Sun, Nov 22, 2015 at 10:46 AM, Geeta Geeta <<a shape="rect" href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>> wrote:<br clear="none">> thanks Dennis.<br clear="none">> I want to know if "join" will add the data???.<br clear="none">> Now I have kept the default option as "cat" only.<br clear="none">> But I am facing small problem.<br clear="none">> when I use "ls -l" below<br clear="none">><br clear="none">> trmm_files = systemfunc("ls -l 3B42_daily.20*.nc") ; with ls -l<br clear="none">> printVarSummary is not shown.<br clear="none">> printVarSummary(trmm_files)<br clear="none">><br clear="none">> I dont get the output.<br clear="none">><br clear="none">> Following are the data files.<br clear="none">> <a shape="rect" href="mailto:aditya@agniilap" target="_blank">aditya@agniilap</a>:~/geeta/ncl/TS_rain$ ls 3B42*<br clear="none">> <a href="http://3B42_daily.2011.04.22.7.nc" target="_blank">3B42_daily.2011.04.22.7.nc</a> <a href="http://3B42_daily.2014.06.05.7.nc" target="_blank">3B42_daily.2014.06.05.7.nc</a><br clear="none">> <a href="http://3B42_daily.2013.05.22.7.nc" target="_blank">3B42_daily.2013.05.22.7.nc</a> <a href="http://3B42_daily.2015.04.23.7.nc" target="_blank">3B42_daily.2015.04.23.7.nc</a><br clear="none">> <a href="http://3B42_daily.2014.06.02.7.nc" target="_blank">3B42_daily.2014.06.02.7.nc</a><br clear="none">><br clear="none">><br clear="none">> Can I also get the time info for each file printed for me so that I know<br clear="none">> that the variable trmm_rf2011 has ONLY 2011 data???<br clear="none">><br clear="none">> trmm_files = systemfunc("ls 3B42_daily.20*.nc")<br clear="none">> date_files = systemfunc("ncdump -h 3B42_daily.20*.nc")<br clear="none">> printVarSummary(trmm_files)<br clear="none">> printVarSummary(date_files)<br clear="none">><br clear="none">> trmm = addfiles(trmm_files,"r")<br clear="none">> printVarSummary(trmm)<br clear="none">><br clear="none">> nfiles = ListCount(trmm)<br clear="none">> print(nfiles)<br clear="none">> ListSetType(trmm,"cat")<br clear="none">><br clear="none">> trmm_rf2011 = trmm[0]->r<br clear="none">> printVarSummary(trmm_rf2011)<br clear="none">> trmm_rf2013 = trmm[1]->r<br clear="none">> printVarSummary(trmm_rf2013)<br clear="none">> trmm_rf2014a = trmm[2]->r<br clear="none">> printVarSummary(trmm_rf2014a)<br clear="none">> trmm_rf2014b = trmm[3]->r<br clear="none">> printVarSummary(trmm_rf2014b)<br clear="none">> trmm_rf2015 = trmm[4]->r<br clear="none">> printVarSummary(trmm_rf2015)<br clear="none">><br clear="none">><br clear="none">> In the printVarSummary, I dont get the time info of each file....<br clear="none">><br clear="none">><br clear="none">> Geeta.</div><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> ncl-talk mailing list<br clear="none">> <a shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">> List instructions, subscriber options, unsubscribe:<br clear="none">> <a shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><div><br clear="none">><br clear="none"></div><br><br></div> </div> </div> </div></div></div></div></div><br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>