<div dir="ltr">Jon,<div>Based on what you are telling me, I believe I did understand what you asked, and my original suggestion remains a viable option. In order to get the numerical values of a grid printed out in ASCII format, you need to display one of the fields in your data file. The code snippet you attached in your original email does not have that line anywhere. Because of that omission, you are getting output that differs from your expectations.</div><div><br></div><div>But, given your additional information, this may turn out to be much easier than it first sounded:</div><div><br></div><div>If you do have the fundamental components of BRN (CAPE and shear basically), and especially if you already have an array of CAPE values (thank goodness, because computing that manually from the T/qv grid would be no fun at all), you can calculate BRN directly in grads in one single command (or two or three, depending on how you want to break up the calculation):</div><div><br></div><div>'define shear = mag(ugrdprs(lev=<i>lev1</i>)-ugrdprs(lev=<i>lev2</i>),vgrdprs(lev=<i>lev1</i>)-vgrdprs(lev=<i>lev2</i>)'</div><div>'define BRN = CAPE / pow(shear,2)'</div><div>'display BRN'</div><div><br></div><div>QED.</div><div><br></div><div>Try that out and see what works. If you're missing CAPE in your data file, then we can talk more about your originally suggested method.</div><div><br>Jeff Duda</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 7, 2020 at 11:56 AM Jan Ising <<a href="mailto:jising@aggies.ncat.edu">jising@aggies.ncat.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hello Jeff,<div>    Thank you for your response however, I believe there was some confusion. Let me explain with more detail. I am trying to calculate the Bulk Richardson Number (my data file (a .ctl file) does not have this predefined), to do so I need to calculate each individual component of the BRN from the different variables in my file (MUCAPE, Wind, etc...) separately for each gridpoint, since GrADS does not allow for 2D arrays that the user makes (say for instance in a script). This all works fine and the values are outputted to my .txt. file, but only as 1 column with x rows (where x is the number of grid points there are in my file). But I need it to be in rows AND columns so that I can use the new grid, made only of numbers (i.e the text file) and continue working with it in MATLAB (say for example plotting it). Sorry if this was unclear before, I tried to simplify it so my question is better understood, but it seems I may have achieved the opposite. </div></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
----------------------------------------------------------------------<br><br>
Date: Fri, 6 Mar 2020 12:30:35 -0700<br>
From: Jeff Duda <<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>><br>
To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><br>
Subject: Re: [gradsusr] Printing values to a text file<br>
Message-ID:<br>
        <<a href="mailto:CAAig09DcTUY1j%2Bk7hNDGMpHr1JhuS4D5k_3PEiVSG20aPV17cw@mail.gmail.com" target="_blank">CAAig09DcTUY1j+k7hNDGMpHr1JhuS4D5k_3PEiVSG20aPV17cw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I think the problem is that you're not displaying a data field in your<br>
code. It looks like you're telling Grads just to spit out a sequence of<br>
integers. You don't need Grads for that. Also, the gxout print and prnopts<br>
probably aren't meant to be used for that. You could easily just do<br>
<br>
a = 1<br>
while (a < 400)<br>
 say a<br>
 a = a + 1<br>
endwhile<br>
<br>
Then copy your screen to a text file, or just use grads -H [*logfile*] to<br>
tell Grads to log commands + output to *logfile*<br>
<br>
Jeff Duda<br>
<br>
On Fri, Mar 6, 2020 at 11:47 AM Jan Ising <<a href="mailto:jising@aggies.ncat.edu" target="_blank">jising@aggies.ncat.edu</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> How would I display multiple values per line in a .txt file from a<br>
> single-valued changing variable (see code)? Based on the code below it is<br>
> currently displaying 1 value per line instead of 200 values per line:<br>
><br>
>  'set gxout print'<br>
> 'set prnopts %f 200 1'<br>
> a = 0<br>
><br>
> while (a < 400)<br>
> a = a + 1<br>
> dummy = write(test_output, a, append)<br>
> endwhile<br>
><br>
><br>
> Result is:<br>
> 1<br>
> 2<br>
> 3<br>
> 4<br>
> 5<br>
> ...<br>
><br>
> Instead of:<br>
> 1 2 3 4 5<br>
> 6 7 8 9 10<br>
><br>
> any help would be greatly appreciated<br>
><br>
> -Thanks,<br>
> Jon<br>
> _______________________________________________<br>
> gradsusr mailing list<br>
> <a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
><br>
<br>
<br>
-- <br>
Jeff Duda, Research Scientist<br>
University of Colorado Boulder<br>
Cooperative Institute for Research in Environmental Sciences<br>
NOAA/OAR/ESRL/Global Systems Division<br>
Boulder, CO<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://gradsusr.org/pipermail/gradsusr/attachments/20200306/31eab672/attachment-0001.html" rel="noreferrer" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20200306/31eab672/attachment-0001.html</a>><br>
<br>
------------------------------<br><br>
</blockquote></div><br clear="all"><div><br></div><br><div dir="ltr"><div dir="ltr">-Thanks,<div>Jon</div></div></div></div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2"><span>Jeff Duda, Research Scientist</span></font></div><div dir="ltr"><font size="2"><span></span></font>University of Colorado Boulder</div><div dir="ltr"><font size="2"><span></span></font>Cooperative Institute for Research in Environmental Sciences</div><div dir="ltr">NOAA/OAR/ESRL/Global Systems Division<br><font size="2"><span>

<span>Boulder, CO<br></span></span></font>



</div></div></div></div></div></div></div></div>