<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" class="gmail_signature"><div dir="ltr">-Thanks,<div>Jon</div></div></div></div>