<div dir="ltr"><div>non-NCL response:<br></div><div>   I assume you have a reason for using <span style="color:rgb(0,0,0);font-family:sans-serif,Arial,Helvetica;font-size:12.1440000534058px;line-height:18.2159996032715px"> 3B42RT (real-time) files rather than the 3B42 (research quality) files.</span></div><div>   If you go to  <a href="http://mirador.gsfc.nasa.gov/">http://mirador.gsfc.nasa.gov/</a> and enter the keyword    3B42  you can download the 3B42 data as netCDF.</div><div><br></div><div>---</div><div>NCL</div><div><br></div><div>NCL&#39;s direct access functions can be used to access records of differernt lengths. However, it requires the user to do some book keeping.</div><div>Attached is a script that loops over multiple 3B42RT binary files and creates corresponding netCDF files.</div><div><br></div><div>If you don&#39;t want the netCDF files, remove the &#39;Create netCDF&#39; section.</div><div><br></div><div>Good luck</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 6:31 PM, 闯关东 <span dir="ltr">&lt;<a href="mailto:125536017@qq.com" target="_blank">125536017@qq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><span style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">Dear Sir,</span><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">I am reading the TRMM 3B42RT data with ncl, the data is writen in a direct format with only one record. But in this record, there are a header, 3 short integer and 1 byte arrays.</div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">I am trying to read it with fbindirread, but the data is not OK.</div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><div>The fortran code to read the file is as following:</div><div><br></div><div>            READ ( iunit, REC=1, ERR=100, IOSTAT=iostat ) head (1:2880),</div><div>     +          ( ( i2p (i, j), i = 1, LN ), j = 1, LT ),</div><div>     +          ( ( i2e (i, j), i = 1, LN ), j = 1, LT ),</div><div>     +          ( ( np1 (i, j), i = 1, LN ), j = 1, LT ),</div><div>     +          ( ( i2u (i, j), i = 1, LN ), j = 1, LT )</div></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">The NCL code i want to read the file is as followed,</div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">head = fbindirread(&quot;<span style="font-family:微软雅黑,tahoma,verdana,sans-serif;font-size:12px;line-height:22px;background-color:rgb(246,246,246)">3B42RT.<span data="https://ci4.googleusercontent.com/proxy/geOJX7g43KUxgIdnlHoS33deivd8Y8nqDuqewnaTi9dPsndBVvFl=s0-d-e1-ft#http://2013071318" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204,204,204)"><a href="tel:2013071318" value="+12013071318" target="_blank">2013071318</a></span>.7.bin</span><span style="line-height:1.2">&quot;,0,(/2880/),&quot;Character&quot;)</span></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px">trmm1 = fbindirread(&quot;<span style="font-family:微软雅黑,tahoma,verdana,sans-serif;font-size:12px;line-height:22px;background-color:rgb(246,246,246)">3B42RT.<span data="https://ci4.googleusercontent.com/proxy/geOJX7g43KUxgIdnlHoS33deivd8Y8nqDuqewnaTi9dPsndBVvFl=s0-d-e1-ft#http://2013071318" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204,204,204)"><a href="tel:2013071318" value="+12013071318" target="_blank">2013071318</a></span>.7.bin</span><span style="line-height:1.2">&quot;,1,(/480,1440/),&quot;short&quot;)</span></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><div style="line-height:16.7999992370605px">trmm2 = fbindirread(&quot;<span style="font-family:微软雅黑,tahoma,verdana,sans-serif;font-size:12px;line-height:22px;background-color:rgb(246,246,246)">3B42RT.<span data="https://ci4.googleusercontent.com/proxy/geOJX7g43KUxgIdnlHoS33deivd8Y8nqDuqewnaTi9dPsndBVvFl=s0-d-e1-ft#http://2013071318" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204,204,204)"><a href="tel:2013071318" value="+12013071318" target="_blank">2013071318</a></span>.7.bin</span><span style="line-height:1.2">&quot;,2,(/480,1440/),&quot;short&quot;)</span></div></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><div style="line-height:16.7999992370605px"><div style="line-height:16.7999992370605px"><div style="line-height:16.7999992370605px">trmm3 = fbindirread(&quot;<span style="font-family:微软雅黑,tahoma,verdana,sans-serif;font-size:12px;line-height:22px;background-color:rgb(246,246,246)">3B42RT.<span data="https://ci4.googleusercontent.com/proxy/geOJX7g43KUxgIdnlHoS33deivd8Y8nqDuqewnaTi9dPsndBVvFl=s0-d-e1-ft#http://2013071318" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204,204,204)"><a href="tel:2013071318" value="+12013071318" target="_blank">2013071318</a></span>.7.bin</span><span style="line-height:1.2">&quot;,3,(/480,1440/),&quot;byte&quot;)</span></div><div><div style="line-height:16.7999992370605px"><div style="line-height:16.7999992370605px">trmm4 = fbindirread(&quot;<span style="font-family:微软雅黑,tahoma,verdana,sans-serif;font-size:12px;line-height:22px;background-color:rgb(246,246,246)">3B42RT.<span data="https://ci4.googleusercontent.com/proxy/geOJX7g43KUxgIdnlHoS33deivd8Y8nqDuqewnaTi9dPsndBVvFl=s0-d-e1-ft#http://2013071318" style="border-bottom-width:1px;border-bottom-style:dashed;border-bottom-color:rgb(204,204,204)"><a href="tel:2013071318" value="+12013071318" target="_blank">2013071318</a></span>.7.bin</span><span style="line-height:1.2">&quot;,4,(/480,1440/),&quot;short&quot;)</span></div><div><span style="line-height:1.2"><br></span></div><div>If i set the parameter &quot;rec_num&quot; 0,1,2,3,4 all to 0, the results is also wrong.</div></div></div></div></div></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br></div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><span style="line-height:16.7999992370605px">How to read this file? </span>Attached are the fortran code and a sample data.</div><div style="font-family:宋体,arial,Verdana,sans-serif;line-height:16.7999992370605px"><br>I am waiting for your quick reply. Thanks a lot.<br><br>--<br>yours,<br>Best regards,<br><br>Yuchun</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>