<div dir="ltr">Dear Sir Dennis, <div><br></div><div>Thank you so much for your help.</div><div><br></div><div>Actually, I was trying to use the ncl script used to read asc5.txt in the example page (<a href="https://www.ncl.ucar.edu/Applications/read_ascii.shtml">https://www.ncl.ucar.edu/Applications/read_ascii.shtml</a>)</div><div><br></div><div><br></div><div>But I am getting the following error:</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">(0)<span class="gmail-Apple-tab-span" style="white-space:pre">       </span>nfields = 9</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">fatal:Subscript out of range, error in subscript #0</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 186 in file read_3G68.ncl</span></p></div><div><br></div><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">I'm not sure how to assign the variable type per column and in cases when there is missing data.  The number of fields should be 16. </font></span><span style="font-family:arial,sans-serif;font-variant-ligatures:no-common-ligatures">Not all columns are "float", some are integer.</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:normal;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span></p><pre style="color:rgb(0,0,0);white-space:pre-wrap">int hr,min, row, col, tmiTotal,tmiRain;
      int prTotal,prRain;
      int combTotal,combRain;
      float tmiMean,tmiPercent;
      float prMean,prPercent;
      float combMean,combPercent;</pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif">I am attaching the modified script. I'll appreciate any help on pointing out the problem in my modified script.</font></pre><pre style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, sans-serif"><br></font></pre></div><div>Sincerely,</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 10:40 PM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</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></div><div>In any language: NCL, GrADS, Python, Matlab .... there are text/ascii/string handling functions.</div><div>I think you would learn a lot by trying to read the text file with code you have written in your favorite language.</div><div>The 3G68 text file is not 'regular' as noted in the documentation.. The different line types are intermingled.</div><div>This makes it a nuisance to read correctly. You have to determine an input strategy: <br></div><div>         Read documentation (carefully) ...Think ... Code</div><div>i)   There are header lines. Is there information that needs to be read?<br></div><div>ii)   How to determine what line 'Type' ? The differing line lengths make reading a nuisance.</div><div>iii)  You have to devise a book keeping strategy. It ia all about detail. <br></div><div>---</div><div>Type A. (Case when there is no PR pixel in cell)<br></div><div>0 5 106 59 24 24 0.87 0 0<br></div><div><pre>...<br>Type B.  (Case when a line has both TMI and PR data)<br> 10 109 109 48 0 0 0 133 32 0.39 34 133 32 0.35 28<br>...<br>Type C. (Case when a line has no TMI but has PR). <b>-9</b> is missing.
2 0 157 196 0 0 <b>-9 -9</b> 33 3 0.04 0 33 3 0.03 0<br>========================================================================<br></pre><pre>Attached is something that works (I think).<br></pre><pre>It generates some plots.<br><br></pre><pre>%> ncl 3G68.ncl<br><br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 23, 2020 at 9:18 AM Lyndz via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</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><div dir="ltr"><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>Dear NCL-expert,</div><div><br></div><div>I am reading an ascii file, which I uploaded here:</div><div><br></div><div><a href="https://www.dropbox.com/s/47t7ue9j1rx08x7/3G68.20090113.7.txt?dl=0" target="_blank">https://www.dropbox.com/s/47t7ue9j1rx08x7/3G68.20090113.7.txt?dl=0</a><br></div><div><br></div><div><a href="http://apdrc.soest.hawaii.edu/doc/README.3G68" target="_blank">http://apdrc.soest.hawaii.edu/doc/README.3G68</a><br></div><div><a href="http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/TRMM/TRMM_PR/3G68_hourly" target="_blank">http://apdrc.soest.hawaii.edu/dods/public_data/satellite_product/TRMM/TRMM_PR/3G68_hourly</a><br></div><div><br></div><div>[Problem]</div><div>I am confused as to how to convert the row and column into a lat on coordinates after reading the file.</div><div>I just want to read and plot the PR_mean variable.</div><div><br></div><div>Anyone here who has processed this file before?</div><div>I'll appreciate any help on this matter.</div><div><br></div><div>Sincerely,</div><div>Lyndz</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></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></blockquote></div>
</blockquote></div>