<div dir="ltr">ugrdprs and vgrdprs are assumed names of your u-wind and v-wind grids. In operational NWP forecasts in the US, these are standard naming conventions. But the names of the u- and v-wind grids may be very different in your framework.<div><br></div><div>Just substitute the actual names representing those fields in your particular data files where I put them in my examples.</div><div><br></div><div>Jeff </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 11, 2020 at 12:33 PM 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>Hello Jeff,<br></div><div><br></div><div>    Thank you for your reply, I apologize for my delayed response, I became very busy suddenly with unrelated tasks this week. I have been working multiple angles at this and will try what you had suggested next. I have discovered a couple more routes I can go after this but I want to try to avoid a manual CAPE calculation if possible, especially with GrADS. Should it come down to it I will reach out again with more details. </div><div>    On a side note, could you please explain a little bit more on the commands "ugrdprs" and "vgrdprs"? I have not worked with these before.</div><div><br></div><div><br></div><div><br></div><div>-Thanks,</div><div>Jon</div><div><br></div><div> _______________________________________________  <br></div>Message: 2<br>Date: Sat, 7 Mar 2020 12:18:59 -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] gradsusr Digest, Vol 121, Issue 6<br>Message-ID:<br>        <CAAig09CqJW7Kv=NZ1Y4VVTcE+W35n_HkfmkbDyFH7Yi_1=<a href="mailto:e%2BBw@mail.gmail.com" target="_blank">e+Bw@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>Jon,<br>Based on what you are telling me, I believe I did understand what you<br>asked, and my original suggestion remains a viable option. In order to get<br>the numerical values of a grid printed out in ASCII format, you need to<br>display one of the fields in your data file. The code snippet you attached<br>in your original email does not have that line anywhere. Because of that<br>omission, you are getting output that differs from your expectations.<br><br>But, given your additional information, this may turn out to be much easier<br>than it first sounded:<br><br>If you do have the fundamental components of BRN (CAPE and shear<br>basically), and especially if you already have an array of CAPE values<br>(thank goodness, because computing that manually from the T/qv grid would<br>be no fun at all), you can calculate BRN directly in grads in one single<br>command (or two or three, depending on how you want to break up the<br>calculation):<br><br>'define shear = mag(ugrdprs(lev=*lev1*)-ugrdprs(lev=*lev2*),vgrdprs(lev=<br>*lev1*)-vgrdprs(lev=*lev2*)'<br>'define BRN = CAPE / pow(shear,2)'<br>'display BRN'<br><br>QED.<br><br>Try that out and see what works. If you're missing CAPE in your data file,<br>then we can talk more about your originally suggested method.<br><br>Jeff Duda<br><br>On Sat, Mar 7, 2020 at 11:56 AM Jan Ising <<a href="mailto:jising@aggies.ncat.edu" target="_blank">jising@aggies.ncat.edu</a>> wrote:<br><br>> Hello Jeff,<br>>     Thank you for your response however, I believe there was some<br>> confusion. Let me explain with more detail. I am trying to calculate the<br>> Bulk Richardson Number (my data file (a .ctl file) does not have this<br>> predefined), to do so I need to calculate each individual component of the<br>> BRN from the different variables in my file (MUCAPE, Wind, etc...)<br>> separately for each gridpoint, since GrADS does not allow for 2D arrays<br>> that the user makes (say for instance in a script). This all works fine and<br>> the values are outputted to my .txt. file, but only as 1 column with x rows<br>> (where x is the number of grid points there are in my file). But I need it<br>> to be in rows AND columns so that I can use the new grid, made only of<br>> numbers (i.e the text file) and continue working with it in MATLAB (say for<br>> example plotting it). Sorry if this was unclear before, I tried to simplify<br>> it so my question is better understood, but it seems I may have<br>> achieved the opposite.<br>><br>><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:1<br>>>         <<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<br>>> 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: <<br>>> <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>>><br>>><br>><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/20200307/f04f89ed/attachment-0001.html" rel="noreferrer" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20200307/f04f89ed/attachment-0001.html</a>><br><br>------------------------------<br><br>Subject: Digest Footer<br><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>End of gradsusr Digest, Vol 121, Issue 7<br>****************************************<div><br></div><div><div></div><br></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>