<div dir="ltr">For clarity, I removed the hard code numbers<br><br><div>        nrow  = 5<br>        ncol   = 10<br>        hd_array = <b>generate_2d_array</b>(20,20,-1,1,<wbr>0,(/nrow,ncol/))<br>        hd_dims = <b>dimsizes</b>(hd_array)<br><br>        fmtHD  = nrow + "f7.2"<br>        <b>write_matrix</b>(hd_array,fmtHD,<wbr>False)<br><br>        TXTdir = "./"<br>        TXTout = "example.txt"<br>        TXTpth = TXTdir + TXTout<br>        <b>system</b>("/bin/rm -f "+TXTpth)    ; rm any pre-existing file<br><br>        opt1 = True<br>        opt1@fout = TXTpth<br>        <b>write_matrix</b>(hd_array,fmtHD,<wbr>opt1)<br><br>====<br></div><div>Note: <br></div><div>If you are "new to NCL", I suggest that you read the excellent tutorial by DKRZ at:<br><br><a href="https://www.ncl.ucar.edu/Document/Manuals/" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Manuals/</a><br><br><a href="https://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide" target="_blank">NCL User Guide, V1.1</a><br><br></div><div>There are many examples.<br>====<br><br></div><div>When posting to ncl-talk, it helps if users include the version of NCL they are using.<br><br></div><div>%> ncl -V<br><br>====<br></div><div>From NCL 6.2.0 onward, the following libraries are 'auto-loaded'<br><br><pre>    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<br><br></pre><pre>Also, you do not need the '<b>begin</b>' and '<b>end</b>' for the MAIN script <br></pre><pre>From NCL 6.4.0 onward, the following libraries are 'auto-loaded'<br><br>    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/bootstrap.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/extval.ncl"
    "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl"<br><br>===<br><br></pre><pre>Good luck<br></pre></div><div><br><br></div></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>