<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>I got an error when I ran your script as is:<br><br>fatal:_NclBuildArray: each element of a literal array must have the same dimension sizes, at least one item doesn't<br>fatal:["Execute.c":8640]:Execute: Error occurred at or near line 8 in file <a href="http://ncl_help_ex.nc">ncl_help_ex.nc</a><br><br></div>If I change this line:<br><br>fmtHD = str_concat((/tostring(hd_dims),"f5.2"/))<br><br></div>which tries to define an array composed of two elements, one which is a 1D array of two elements, the other a scalar (technically, a 1D array of one element) to:<br><br>fmtHD = str_concat((/tostring(hd_dims(0)),tostring(hd_dims(1)),"f5.2"/))<br><br></div>Then the file gets written as expected<br><br></div>Hope that helps...<br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 23, 2017 at 11:51 AM, David Ross <span dir="ltr"><<a href="mailto:rossdl2@appstate.edu" target="_blank">rossdl2@appstate.edu</a>></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 am a new user to NCL, at Appalachian State University in NC. Our research group is interested in exporting formatted tables of WRF output data into a standard ascii text file. I will use a simplified example matrix, as building the real one requires WRF output files and a complicated loop structure. My issue is specifically with the write_matrix() command.</div><div><br></div><div>hd_array = generate_2d_array<span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">(20,20,-1,1,<wbr>0,(/5,10/))</span></div><div>hd_dims = dimsizes(hd_array)</div><div><br></div><div>The matrix "hd_array" has been successfuly built and yields a nicely formatted matrix to the standard output (terminal) with the code below:</div><div><br></div><div>fmtHD = str_concat((/tostring(hd_<wbr>dims),"f5.2"/))</div><div>write_matrix(hd_array,fmtHD,<wbr>False)</div><div><br></div><div>However, when the option is set to write the matrix to a text file, the file "example.txt" comes up empty even though the command executes without giving errors.</div><div><br></div><div>What am I missing here?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-David</div><div><br></div><div><br></div><div><br></div></font></span></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></div>