<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),var1(i_sta,it),var2(i_sta,it),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">http://www.ncl.ucar.edu/Document/Functions/Built-in/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)"><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"><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"><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"><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="gmail_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 914 432 3108<br></div></div></div>
</div></div>