<div dir="ltr">Hello Barry<div><br></div><div>1. If I did this, I will make station_name(i_sta) to ,station_name(i_sta,it)</div><div><br></div><div>Then I can use write_table to do pretty print.</div><div><br></div><div>2. Also, you can make a fortran subroutine to do this.</div><div><br></div><div>Above is my experiences. If 1. take time, 2. may be an efficient way.</div><div><br></div><div>Hope this help,</div><div>Tao</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 6, 2017 at 5:20 AM, Barry Lynn <span dir="ltr">&lt;<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.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 dir="ltr">Hello:<div><br></div><div>I would like to write variables with this format.</div><div><br></div><div>do i_sta = 0,n_stations-1</div><div>do it = 0,ntimes-1</div><div><br></div><div>write(station_name(i_sta),<wbr>var1(i_sta,it),var2(i_sta,it),<wbr>var3(i_sta,it), a10,3(f6.2,1x))</div><div><br></div><div>end do</div><div>end do</div><div><br></div><div>I found this:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/asciiwrite.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>asciiwrite.shtml</a><br></div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"><p style="margin:10px 0px 20px;padding:0px;color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:10pt;line-height:12pt">Example 2 in the new <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/write_table.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133)" target="_blank"><strong style="margin:0px;padding:0px">write_table</strong></a> function in NCL 6.1.0 is
one approach. Another approach: do your own line formatting.

</p><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em">     outfile = &quot;out.txt&quot;
     x = (/ (/ 4.35,   4.36,   9.73,   4.91 /), \
            (/ 4.39,   4.66,  -5.84,   4.59 /), \
            (/ 0.27,   3.77,   0.89,  -3.09 /)    /)
     
    
     dimx  = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">dimsizes</strong></a> (x)
     nrows = dimx(0)                                  ; ncols = dimx(1)
     lines = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/new.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">new</strong></a> (nrows, string)
     
     do i = 0, nrows-1
       lines(i) = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/str_concat.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank"><strong style="margin:0px;padding:0px">str_concat</strong></a> (sprintf (&quot;%7.2f,&quot;, x(i,:)))
     end do
     
     <strong style="margin:0px;padding:0px">asciiwrite</strong> (outfile, lines)</pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em">The problem is that my variable need to write each station&#39;s data </pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em">for the time index before writing the next stations&#39;s data.</pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:10pt;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;text-indent:0em">Thank you.</pre></pre></div><div><div><br></div>-- <br><div class="m_-7369979331167107799gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_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 style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">******************************************************</span><br></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">盧 涛 (ル タオ) </span><span style="font-family:arial,helvetica,sans-serif;font-size:small">修士課程2年</span><br style="font-size:12.8000001907349px"><p style="font-size:12.8000001907349px;margin:0px"><font size="2" face="arial, helvetica, sans-serif">〒<span lang="EN-US">112-8551 </span>東京都文京区春日<span lang="EN-US">1-13-27</span></font></p><p style="font-size:12.8000001907349px;margin:0px"><font size="2" face="arial, helvetica, sans-serif">中央大学理工学研究科都市環境学専攻</font></p><p style="font-size:12.8000001907349px;margin:0px"><font size="2" face="arial, helvetica, sans-serif">河川・水文<span lang="EN-US"><span lang="EN-US"><span lang="EN-US">研究</span></span><span lang="EN-US"><span lang="EN-US">室</span></span></span></font><span style="font-family:arial,helvetica,sans-serif;font-size:small">(山田正教授)</span></p></div><div style="font-size:12.8000001907349px"><p style="font-size:12.8000001907349px;margin:0px"><font size="2" face="arial, helvetica, sans-serif"><span lang="EN-US"><br></span></font></p><p style="font-size:12.8000001907349px;margin:0px"><font size="2" face="arial, helvetica, sans-serif"><span lang="EN-US">TEL: 03-3817-3406;   </span></font><span style="font-family:arial,helvetica,sans-serif;font-size:small">Phone: 070-2188-7509</span></p>Email1: <a href="mailto:mail%3Amet.yamos@gmail.com" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank">hakufu.asano@gmail.com</a><br style="font-size:12.8000001907349px">Email2: <a href="mailto:mail%3Ayamoto@civil.chuo-u.ac.jp" style="color:rgb(17,85,204);font-size:12.8000001907349px" target="_blank">lutao@civil.chuo-u.ac.jp</a><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">*******************************************************</span></div><div style="font-size:12.8000001907349px"><span style="font-size:small;font-family:arial">******************************</span><span style="font-size:small;font-family:arial">************************</span><br></div><div><span style="font-size:small;font-family:arial">Tao Lu    (M. Eng)</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:12.8px">Laboratory of River Engineering and Hydrology,</span><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial">Dept. of Civil and Environmental Engineering,</span><br style="font-family:arial;font-size:small"><span style="font-family:arial,helvetica,sans-serif;font-size:12.8px">Graduate School of Science and Engineering,</span><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial">Chuo University</span><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial"> </span><br style="font-family:arial;font-size:small">1-13-27<span style="font-size:small;font-family:arial">,Kasuga,Bunkyo-ku,Tokyo</span><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial">112-8551, Japan</span><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial">TEL: </span>03-3817-1805<font size="2" face="arial, helvetica, sans-serif"><span lang="EN-US">;   </span></font><span style="font-family:arial,helvetica,sans-serif;font-size:small">Phone: 070-2188-7509</span><br style="font-family:arial;font-size:small"><span style="font-size:12.8px">Email1: </span><a href="mailto:mail%3Amet.yamos@gmail.com" style="font-size:12.8px;color:rgb(17,85,204)" target="_blank">hakufu.asano@gmail.com</a><br style="font-size:12.8px"><span style="font-size:12.8px">Email2: </span><a href="mailto:mail%3Ayamoto@civil.chuo-u.ac.jp" style="font-size:12.8px;color:rgb(17,85,204)" target="_blank">lutao@civil.chuo-u.ac.jp</a><br style="font-family:arial;font-size:small"><span style="font-size:small;font-family:arial">******************************</span><span style="font-size:small;font-family:arial">***********************</span><span style="font-size:12.8px"><br></span></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>