[gradsusr] gradsusr Digest, Vol 121, Issue 6

Jan Ising jising at aggies.ncat.edu
Sat Mar 7 13:24:56 EST 2020


Hello Jeff,
    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.


> ----------------------------------------------------------------------
>
> Date: Fri, 6 Mar 2020 12:30:35 -0700
> From: Jeff Duda <jeffduda319 at gmail.com>
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Subject: Re: [gradsusr] Printing values to a text file
> Message-ID:
>         <
> CAAig09DcTUY1j+k7hNDGMpHr1JhuS4D5k_3PEiVSG20aPV17cw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I think the problem is that you're not displaying a data field in your
> code. It looks like you're telling Grads just to spit out a sequence of
> integers. You don't need Grads for that. Also, the gxout print and prnopts
> probably aren't meant to be used for that. You could easily just do
>
> a = 1
> while (a < 400)
>  say a
>  a = a + 1
> endwhile
>
> Then copy your screen to a text file, or just use grads -H [*logfile*] to
> tell Grads to log commands + output to *logfile*
>
> Jeff Duda
>
> On Fri, Mar 6, 2020 at 11:47 AM Jan Ising <jising at aggies.ncat.edu> wrote:
>
> > Hello,
> >
> > How would I display multiple values per line in a .txt file from a
> > single-valued changing variable (see code)? Based on the code below it is
> > currently displaying 1 value per line instead of 200 values per line:
> >
> >  'set gxout print'
> > 'set prnopts %f 200 1'
> > a = 0
> >
> > while (a < 400)
> > a = a + 1
> > dummy = write(test_output, a, append)
> > endwhile
> >
> >
> > Result is:
> > 1
> > 2
> > 3
> > 4
> > 5
> > ...
> >
> > Instead of:
> > 1 2 3 4 5
> > 6 7 8 9 10
> >
> > any help would be greatly appreciated
> >
> > -Thanks,
> > Jon
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
>
>
> --
> Jeff Duda, Research Scientist
> University of Colorado Boulder
> Cooperative Institute for Research in Environmental Sciences
> NOAA/OAR/ESRL/Global Systems Division
> Boulder, CO
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://gradsusr.org/pipermail/gradsusr/attachments/20200306/31eab672/attachment-0001.html
> >
>
> ------------------------------
>
>


-Thanks,
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20200307/ec7e66e5/attachment.html>


More information about the gradsusr mailing list