[gradsusr] Problems with the automation of GRADS.

Juan Jose Amides Figueroa Urbano juanjosefigueroa at gmail.com
Tue Jan 11 12:42:07 EST 2011


I tried changing the command "printim" by the "wi" and now it works, do not
know why but it works, can someone explain why?

Thaks for the answer John, i try it too!

On Tue, Jan 11, 2011 at 1:23 PM, <gradsusr-request at gradsusr.org> wrote:

> Send gradsusr mailing list submissions to
>        gradsusr at gradsusr.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://gradsusr.org/mailman/listinfo/gradsusr
> or, via email, send a message with subject or body 'help' to
>        gradsusr-request at gradsusr.org
>
> You can reach the person managing the list at
>        gradsusr-owner at gradsusr.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gradsusr digest..."
>
>
> Today's Topics:
>
>   1. Problems with the automation of GRADS.
>      (Juan Jose Amides Figueroa Urbano)
>   2. How to read HDF5 data by using the latest version of      GrADS?
>      (muhammad hasan ali baig)
>   3. Re: Problems with the automation of GRADS. (Huddleston, John)
>   4. Re: Script errors (Murphy, Darren W)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 11 Jan 2011 16:56:57 +0000
> From: Juan Jose Amides Figueroa Urbano <juanfigueroa at marn.gob.sv>
> Subject: [gradsusr] Problems with the automation of GRADS.
> To: gradsusr at gradsusr.org
> Message-ID:
>        <AANLkTim_cOO0noOn0pBg6LED71=_gw4cB1F1q-t1cDUr at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I'm working on automating the GrADS run through a script ".sh" and crontab
> in linux environment, Ubuntu 10.04 LTS, when the script is run manually
> with
> the console generates the images, but when it runs automatically with
> crontab does not generate the images, any help?
>
> This is the script for crontab:
>
> #!/bin/sh
> cd /home/jjfigueroa/WRF_CPM/ARWpost
> grads -l << EOF
> open autoteste1.ctl
> run gen.gs
>
> This is the script for GrADS called "gen.gs:
>
> 'set mpdset hires'
> 'set display color white'
> 'set rbcols 0 11 5 13 3 10 7 12 8 2'
> 'c'
> t = 1
> while (t <= 41)
> 'set t 't''
> 'set gxout shaded'
> 'd t2-273.15'
> 'cbarn'
> 'set gxout contour'
> 'd t2-273.15'
> 'q time'
> x1=sublin(result,1)
> t1=subwrd(x1,3)
> te2=subwrd(x1,5)
> 'draw title TEMPERATURA PARA 't1' EN CELSIUS'
> 'printim /home/jjfigueroa/WRF/SALIDAS/temp't'.png'
> 'c'
> t= t+1
> endwhile
>
> Thanks
>
> Juan Jos? Amides Figueroa Urbano
> Servicio Meteorol?gico Nacional
> Servicio Nacional de Estudios Territoriales (SNET)
> Ministerio de Medio Ambiente y Recursos Naturales (MARN)
> Tel: (503) 2233-9544
>
> jn 3:16
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110111/fd81b6b2/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Wed, 12 Jan 2011 01:12:10 +0800
> From: muhammad hasan ali baig <mhasanbaig at gmail.com>
> Subject: [gradsusr] How to read HDF5 data by using the latest version
>        of      GrADS?
> To: gradsusr at gradsusr.org
> Message-ID:
>        <AANLkTikQNa3t5O1N4n9c89eQq8EEbDnsfUp37aAmUjJB at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi dear all!
>               I am using the latest version of GrADS. I tried to use it in
> converting SST data of Chinese satellite FY2C which is available in HDF5
> format into grib2 format. But unfortunately, it couldnt read the HDF5
> format. What should i do?
> ==================================================================
> *Muhammad Hasan Ali Baig,
> *
>
> *Key Laboratory of Meteorological Disaster of Ministry of
> Education?Nanjing*
>
> *University of Information Science & Technology, Nanjing 210044, P. R.
> China
> *
> *School of Atmospheric Physics*
> *Nanjing University of Information Science & Technology 210044, P. R.
> China*
> *Mobile: +8615251705047
> ==================================================================
> *
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110112/70572585/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Tue, 11 Jan 2011 09:14:42 -0800
> From: "Huddleston, John" <Huddleston at cira.colostate.edu>
> Subject: Re: [gradsusr] Problems with the automation of GRADS.
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
>        <
> F367071F539DC64FB75E7D7690B8160D010D7C2360E2 at EXVMBX003-2.exch003intermedia.net
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Juan
>
> The cron environment is not always the same as your login (csh,bash,sh)
> environment; so, put the full path to grads in your cron script e.g.
>
> /usr/local/bin/grads  -lbc  << EOF
> open autoteste1.ctl
> run gen.gs<http://gen.gs>
> EOF
>
> John Huddleston, PhD
> Cooperative Institute for Research in the Atmosphere
>
> From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org]
> On Behalf Of Juan Jose Amides Figueroa Urbano
> Sent: Tuesday, January 11, 2011 9:57 AM
> To: gradsusr at gradsusr.org
> Subject: [gradsusr] Problems with the automation of GRADS.
>
> I'm working on automating the GrADS run through a script ".sh" and crontab
> in linux environment, Ubuntu 10.04 LTS, when the script is run manually with
> the console generates the images, but when it runs automatically with
> crontab does not generate the images, any help?
>
> This is the script for crontab:
>
> #!/bin/sh
> cd /home/jjfigueroa/WRF_CPM/ARWpost
> grads -l << EOF
> open autoteste1.ctl
> run gen.gs<http://gen.gs>
>
> This is the script for GrADS called "gen.gs<http://gen.gs>:
>
> 'set mpdset hires'
> 'set display color white'
> 'set rbcols 0 11 5 13 3 10 7 12 8 2'
> 'c'
> t = 1
> while (t <= 41)
> 'set t 't''
> 'set gxout shaded'
> 'd t2-273.15'
> 'cbarn'
> 'set gxout contour'
> 'd t2-273.15'
> 'q time'
> x1=sublin(result,1)
> t1=subwrd(x1,3)
> te2=subwrd(x1,5)
> 'draw title TEMPERATURA PARA 't1' EN CELSIUS'
> 'printim /home/jjfigueroa/WRF/SALIDAS/temp't'.png'
> 'c'
> t= t+1
> endwhile
>
> Thanks
>
> Juan Jos? Amides Figueroa Urbano
> Servicio Meteorol?gico Nacional
> Servicio Nacional de Estudios Territoriales (SNET)
> Ministerio de Medio Ambiente y Recursos Naturales (MARN)
> Tel: (503) 2233-9544
>
> jn 3:16
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110111/62632727/attachment-0001.html
>
> ------------------------------
>
> Message: 4
> Date: Tue, 11 Jan 2011 09:32:07 -0800
> From: "Murphy, Darren W" <dwmurphy at nps.edu>
> Subject: Re: [gradsusr] Script errors
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID: <C951D417.14F1%dwmurphy at nps.edu<C951D417.14F1%25dwmurphy at nps.edu>
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Jeff,
>
> Changing the value from 0 to 0.0 didn?t change the results.
>
> I?ve updated the script with some changes in reference to Austin and your
> suggestions.  However, I still have the issue of entering the minval>0 if
> statement with a value <0, and an error for clevs.
>
> Thanks,
> Darren
>
>
> prompt 'Enter EOF #:'
> pull EF
>
> eofnum = EF
>
> 'clear'
> 'set poli on'
> 'set ccolor 0'
>
> 'open
>
> /Users/Darren/Desktop/output/MaxT_2x2x1dy_NormByMeanSTD_Afg_1979to2009_1to36
> 5_EOF_eof.ctl'
>
>
> 'q dims'
> res2 = sublin(result,2)
> res3 = sublin(result,3)
> lon1 = subwrd(res2,6)
> lon2 = subwrd(res2,8)
> lat1 = subwrd(res3,6)
> lat2 = subwrd(res3,8)
>
> 'set z 'eofnum
>
> 'maxval = max(max(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'
> 'minval = min(min(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'
>
>
> * These are the BLUE shades
> 'set rgb 16 0 0 255'
> 'set rgb 17 55 55 255'
> 'set rgb 18 110 110 255'
> 'set rgb 19 165 165 255'
> 'set rgb 20 220 220 255'
>
> * These are the RED shades
> 'set rgb 21 255 220 220'
> 'set rgb 22 255 165 165'
> 'set rgb 23 255 110 110'
> 'set rgb 24 255 55 55'
> 'set rgb 25 255 0 0'
>
> 'cval1 = minval/5*4'
> 'cval2 = minval/5*3'
> 'cval3 = minval/5*2'
> 'cval4 = minval/5*1'
>
> 'cval5 = maxval/5*1'
> 'cval6 = maxval/5*2'
> 'cval7 = maxval/5*3'
> 'cval8 = maxval/5*4'
>
>
> if ('minval' > 0.0)
> 'minval = 0.0'
> prompt 'minval greater than 0 '
> 'cval1 = maxval/10*1'
> 'cval2 = maxval/10*2'
> 'cval3 = maxval/10*3'
> 'cval4 = maxval/10*4'
> 'cval5 = maxval/10*5'
> 'cval6 = maxval/10*6'
> 'cval7 = maxval/10*7'
> 'cval8 = maxval/10*8'
>
> endif
>
> if ('maxval' < 0.0)
> prompt 'maxval less than 0 '
> 'maxval = 0.0'
> 'cval1 = minval/10*8'
> 'cval2 = minval/10*7'
> 'cval3 = minval/10*6'
> 'cval4 = minval/10*5'
> 'cval5 = minval/10*4'
> 'cval6 = minval/10*3'
> 'cval7 = minval/10*2'
> 'cval8 = minval/10*1'
>
> endif
>
> 'set gxout shaded'
> 'set clevs minval cval1 cval2 cval3 cval4 cval5 cval6 cval7 cval8 maxval'
> 'set ccols 16 17 18 19 20 1 21 22 23 24 25'
>
> 'set mpt * off'
> 'set mpdset hires'
> 'set mpt 0 0 1 7'
> 'set mpt 1 0 1 7'
> 'draw map'
>
> 'set background 1'
> 'set annot 0 5'
> 'd eof(z='eofnum')'
>
> 'run /Users/Darren/Desktop/cbarm.gs'
>
> 'close 1'
>
>
> On 1/10/11 9:48 AM, "Jeffrey Duda" <jdduda at iastate.edu> wrote:
>
> > Darren,
> > Did you try putting in 0.0 instead of just 0?? Perhaps there is a
> difference
> > in how Grads is reading the precision of that number and in how your
> system
> > is.
> >
> > Jeff
> >
> > On Mon, Jan 10, 2011 at 10:38 AM, Murphy, Darren W <dwmurphy at nps.edu>
> wrote:
> >> Austin,
> >>
> >> Thanks for checking out the script. ?I had been doing some testing of
> the
> >> script and changing the logic to check to see if it was by default
> entering
> >> the statement. ?I forgot to change it back. ?Those lines should read...
> >>
> >>
> >>>> >> if (minval > 0)
> >>>> >> prompt 'minval greater than 0'
> >>
> >> The problem persists though. ?With minval of -0.52 it still enters the
> >> minval>0 statement.
> >>
> >> Thanks,
> >> Darren
> >>
> >> On 1/10/11 7:57 AM, "Austin Conaty" <Austin.L.Conaty at nasa.gov> wrote:
> >>
> >>> > Darren,
> >>> >
> >>> > if (minval <= 0)
> >>> > prompt 'minval greater than 0'
> >>> >
> >>> > I think this is where you have a logic problem
> >>> >
> >>> > If minval less than or equal to zero
> >>> > prompt minval greater than zero
> >>> >
> >>> > Is this really what you mean to do?
> >>> >
> >>> > Murphy, Darren W wrote:
> >>>> >> All,
> >>>> >>
> >>>> >> I?m using Grads 2.0.a9.
> >>>> >>
> >>>> >> The script below throws a couple of errors. ?Earlier I thought it
> was an
> >>>> >> string
> >>>> >> not compatible with numeric calculations. ?Following Jeff Duda?s
> (Thank
> >>>> you
> >>>> >> Jeff) advice I found some errors in the script syntax. ?I can
> verify
> >>>> that the
> >>>> >> script is accepting the user input, and that that the ?maxval? and
> >>>> ?minval?
> >>>> >> values are correct.
> >>>> >>
> >>>> >> The first issue is the if statements. ?I have a value of minval
> being
> >>>> -.52
> >>>> >> and
> >>>> >> still entering the if statement for minval greater than 0.
> >>>> >>
> >>>> >> Second I am getting an error ?SET error: ?Missing or invalid
> arguments
> >>>> for
> >>>> >> CLEVS
> >>>> >> option?. ?I can also verify that the cvals1 through cval8 are being
> >>>> >> calculated,
> >>>> >> but perhaps I have a syntax error on that line?
> >>>> >>
> >>>> >> Thank you,
> >>>> >> Darren
> >>>> >>
> >>>> >>
> >>>> >>
> >>>> >> prompt 'Enter EOF #: '
> >>>> >> pull EF
> >>>> >>
> >>>> >> eofnum = EF
> >>>> >>
> >>>> >> 'clear'
> >>>> >> 'set poli on'
> >>>> >> 'set ccolor 0'
> >>>> >>
> >>>> >> 'open
> >>>> >>
> >>>>
>
> /Users/Darren/Desktop/output/MaxT_2x2x1dy_NormByMeanSTD_Afg_1979to2009_1to365
> >>>> >> _EOF_eof.ctl'
> >>>> >>
> >>>> >> 'q dims'
> >>>> >> res2 = sublin(result,2)
> >>>> >> res3 = sublin(result,3)
> >>>> >> lon1 = subwrd(res2,6)
> >>>> >> lon2 = subwrd(res2,8)
> >>>> >> lat1 = subwrd(res3,6)
> >>>> >> lat2 = subwrd(res3,8)
> >>>> >>
> >>>> >> 'set z 'eofnum
> >>>> >>
> >>>> >> 'maxval =
> max(max(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'
> >>>> >> 'minval =
> min(min(eof,lon='lon1',lon='lon2'),lat='lat1',lat='lat2')'
> >>>> >>
> >>>> >> * BLUE shades
> >>>> >> 'set rgb 16 0 0 255'
> >>>> >> 'set rgb 17 55 55 255'
> >>>> >> 'set rgb 18 110 110 255'
> >>>> >> 'set rgb 19 165 165 255'
> >>>> >> 'set rgb 20 220 220 255'
> >>>> >>
> >>>> >> * RED shades
> >>>> >> 'set rgb 21 255 220 220'
> >>>> >> 'set rgb 22 255 165 165'
> >>>> >> 'set rgb 23 255 110 110'
> >>>> >> 'set rgb 24 255 55 55'
> >>>> >> 'set rgb 25 255 0 0'
> >>>> >>
> >>>> >> 'cval1 = 'minval'/5*4'
> >>>> >> 'cval2 = 'minval'/5*3'
> >>>> >> 'cval3 = 'minval'/5*2'
> >>>> >> 'cval4 = 'minval'/5*1'
> >>>> >>
> >>>> >> 'cval5 = 'maxval'/5*1'
> >>>> >> 'cval6 = 'maxval'/5*2'
> >>>> >> 'cval7 = 'maxval'/5*3'
> >>>> >> 'cval8 = 'maxval'/5*4'
> >>>> >>
> >>>> >> if (minval <= 0)
> >>>> >> prompt 'minval greater than 0'
> >>>> >> 'minval = 0'
> >>>> >> 'cval1 = 'maxval'/10*1'
> >>>> >> 'cval2 = 'maxval'/10*2'
> >>>> >> 'cval3 = 'maxval'/10*3'
> >>>> >> 'cval4 = 'maxval'/10*4'
> >>>> >> 'cval5 = 'maxval'/10*5'
> >>>> >> 'cval6 = 'maxval'/10*6'
> >>>> >> 'cval7 = 'maxval'/10*7'
> >>>> >> 'cval8 = 'maxval'/10*8'
> >>>> >>
> >>>> >> endif
> >>>> >>
> >>>> >> if (maxval < 0)
> >>>> >> prompt 'maxval less than 0 '
> >>>> >> 'maxval = 0'
> >>>> >> 'cval1 = 'minval'/10*8'
> >>>> >> 'cval2 = 'minval'/10*7'
> >>>> >> 'cval3 = 'minval'/10*6'
> >>>> >> 'cval4 = 'minval'/10*5'
> >>>> >> 'cval5 = 'minval'/10*4'
> >>>> >> 'cval6 = 'minval'/10*3'
> >>>> >> 'cval7 = 'minval'/10*2'
> >>>> >> 'cval8 = 'minval'/10*1'
> >>>> >>
> >>>> >> endif
> >>>> >>
> >>>> >> 'set gxout shaded'
> >>>> >> 'set clevs minval cval1 cval2 cval3 cval4 cval5 cval6 cval7 cval8
> >>>> maxval'
> >>>> >> 'set ccols 16 17 18 19 20 1 21 22 23 24 25'
> >>>> >>
> >>>> >> 'set mpt * off'
> >>>> >> 'set mpdset hires'
> >>>> >> 'set mpt 0 0 1 7'
> >>>> >> 'set mpt 1 0 1 7'
> >>>> >> 'draw map'
> >>>> >>
> >>>> >> 'set background 1'
> >>>> >> 'set annot 0 5'
> >>>> >> 'd eof(z='eofnum')'
> >>>> >>
> >>>> >> 'run /Users/Darren/Desktop/cbarm.gs <http://cbarm.gs> '
> >>>> >>
> >>>> >>
> >>>> >> 'close 1'
> >>>> >>
> >>> >
> >>
> >>
> >> _______________________________________________
> >> gradsusr mailing list
> >> gradsusr at gradsusr.org
> >> http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110111/b5b87e0e/attachment.html
>
> ------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> End of gradsusr Digest, Vol 11, Issue 15
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110111/1b44c787/attachment-0003.html 


More information about the gradsusr mailing list