[gradsusr] Re :problem with grib2ctl.pl

Mubashar Dogar mubashardogar at gmail.com
Fri Jul 22 13:27:13 EDT 2011


Hi Mason,

Yes of course it is synoptic monthly means at 00, 06, 12 and 18 UTC. plz
have a look on the attached netcdf, grib files of the same data set and see
the clear difference between netcdf and grib2ctl.pl generated control file.



Regards,

Mubashar

On Fri, Jul 22, 2011 at 3:53 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. Re: problem with grib2ctl.pl (Rowell, Mason D.)
>   2. Re: GrADS Return Code 141 (Jonas Kaufmann)
>   3. Re: Missing variables in 3-d fwrite binary file (James T. Potemra)
>   4. incorrect time steps (jagadish karmacharya)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 22 Jul 2011 16:06:31 +0000
> From: "Rowell, Mason D." <Mason.D.Rowell-1 at ou.edu>
> Subject: Re: [gradsusr] problem with grib2ctl.pl
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
>        <
> EF993BF88A0DA241AA5B306C9D22DDF753FF5436 at it-kodiak.sooner.net.ou.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Mubashar,
>
> Are you sure the data is what you expect? Does your grib file have 4 time
> steps x 30 some days in the month of interest? Or are you positive it is
> just those for time steps averaged for each day in the month?
>
> Mason
> ________________________________
> From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on
> behalf of Mubashar Dogar [mubashardogar at gmail.com]
> Sent: Friday, July 22, 2011 10:49 AM
> To: gradsusr at gradsusr.org
> Subject: [gradsusr] problem with grib2ctl.pl
>
> Dear GrADS users,
>
> I have downloaded synoptic monthly means analysis data from ECMWF for
> specific humidity at 1000 pressure level both in netcdf and grib format
> (This is the same data in grib & netcdf format for three months of 1989). I
> encountered a bug or some issue in perl script (grib2ctl.pl<
> http://grib2ctl.pl>) that generates GrADS readable control file for the
> grib data set. I am attaching grib file and control file made by
> grib2ctl.pl<http://grib2ctl.pl> as well as index file generated by
> gribmap. The bug is that synoptic monthly means data have 4 time steps (at
> 00, 06, 12, & 18) for each month but grib2ctl.pl<http://grib2ctl.pl> makes
> 4 time steps in each day instead of 4 time step in a month. When I opened
> the ctl file in GrADS, it display some values and shows rest as all
> undefined values. I even changed time in ctl manually and generate index
> again but the problem is yet unresolved. Where is the issue? Does anyone
> already encountered the same problem. Please see attached files for y!
>  our satisfaction.
>
> Mubashar
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110722/c0f45065/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 22 Jul 2011 18:08:45 +0200
> From: Jonas Kaufmann <me at j0nes.de>
> Subject: Re: [gradsusr] GrADS Return Code 141
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID:
>        <CAMaBtSnUgU4aN-9howyDXyrL==2UBZc2J6jFLbj7cA_5O2Vm9A at mail.gmail.com
> >
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
>
> the machine itself was okay - however I have found the answer in the
> mean time. In my original script running on my WRF server I tried to
> capture the output of the remote ssh command for debugging using:
> ssh grads_machine image_generation_script.sh & > logfile 2> errorfile
>
> I changed this to (notice the brackets):
> (ssh grads_machine image_generation_script.sh &) > logfile 2> errorfile
>
> ...and from this point on everything went fine - although I am not
> sure why this failed at all...
>
> Anyway, thank you for your help and for your hints on where to look
> further!
>
> Best regards and have a nice weekend!
>
> Jonas Kaufmann
>
>
> On Fri, Jul 22, 2011 at 17:32, Huddleston, John
> <Huddleston at cira.colostate.edu> wrote:
> > Jonas
> >
> > That's fits my third guess that it fails on a busy machine.
> >
> > What is the hardware, the operating system, the memory (vmstat,free), and
> the ulimit of your space ?on both machines.
> >
> > John
> >
> > -----Original Message-----
> > From: gradsusr-bounces at gradsusr.org [mailto:
> gradsusr-bounces at gradsusr.org] On Behalf Of Jonas Kaufmann
> > Sent: Friday, July 22, 2011 9:03 AM
> > To: GrADS Users Forum
> > Subject: Re: [gradsusr] GrADS Return Code 141
> >
> > Hello,
> >
> > I have examined the environment of the calls on both my grads machine and
> my remote machines. There are three machines involved in this: two remote
> machines where WRF computations are run (these are located in different data
> centers and have a slightly different setup) and my grads machine where the
> output of the WRF computation is pushed and then a script is started via
> ssh.
> >
> > So the basic script on the remote machine looks like this:
> > - wait for new data from the forecast model
> > - scp the data to the grads machine
> > - ssh grads_machine image_generation_script.sh
> >
> > The image_generation_script.sh running on the grads server is also quite
> easy:
> > - set up environment variables
> > - perl script to generate a grads script
> > - grads -b -l -c my_generated_script.gs
> >
> > I have compared the environments on both the remote machines as the
> script is run via cron, and the environment variables are exactly the same
> on both machines. On the grads machine, I have also done this, and the
> environment also matches there when being called from both remote machines.
> There are two things that I don't get:
> > - on one remote machine everything is working fine, and the other one
> fails
> > - if I start the script on my failing remote machine manually, everything
> works fine, but not when it gets executed by cron
> >
> > Is there a way to get any additional output or debug information from
> grads? Do you have any other hints what I could try?
> >
> > Best regards and thank you for your help!
> >
> > Jonas Kaufmann
> >
> >
> > On Fri, Jul 22, 2011 at 16:31, Huddleston, John <
> Huddleston at cira.colostate.edu> wrote:
> >> Jonas
> >>
> >> There could be a number of reasons. Bernd's reply is true in that a cron
> script does not set a PATH and so by sourcing your profile or .bashrc files
> it will establish your environment. It is easier to put those PATH
> assignments in the cron script itself. Add the GrADS variables (GADDIR and
> GASCRP) as well to find the library scripts.
> >>
> >> Second, the error code 141 means it is a SIGPIPE error. 141=128+13. 13
> indicates a pipe error. 128 is the bash script error.
> >>
> >> Third, it could be related to the resources on your machine itself could
> be the problem.
> >>
> >> Can you give us your script?
> >>
> >> John Huddleston
> >>
> >> -----Original Message-----
> >> From: gradsusr-bounces at gradsusr.org
> >> [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Becker, Bernd
> >> Sent: Friday, July 22, 2011 6:50 AM
> >> To: GrADS Users Forum
> >> Subject: Re: [gradsusr] GrADS Return Code 141
> >>
> >>
> >> Normalerweise liegt das an nicht gesetzten Umgebungsvariablen.
> >>
> >> Einfach im Script oben nochmal
> >> . ~/profile
> >> . ~/kshrc
> >>
> >> ausfuehren. Dann klappt das. (Meistens)
> >>
> >> --
> >> Bernd Becker ? Climate Impacts Product Development Met Office Hadley
> >> Centre ? ?FitzRoy Road ?Exeter ? Devon EX1 3PB ?United Kingdom
> >> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
> >> E-mail:bernd.becker at metoffice.gov.uk -
> >> http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decada
> >> l/
> >> bernd-becker
> >>
> >>
> >> -----Original Message-----
> >> From: gradsusr-bounces at gradsusr.org
> >> [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Jonas Kaufmann
> >> Sent: 22 July 2011 12:52
> >> To: GrADS Users Forum
> >> Subject: [gradsusr] GrADS Return Code 141
> >>
> >> Hello,
> >>
> >> in my setup I am running into a strange problem right now. I am calling
> a shell script containing a call to grads from a remote server. When I
> invoke my shell script manually from the remote server, everything is
> working fine - however when running through cron, grads silently crashes.
> Nothing is written on both STDOUT or STDERR. The only thing that I can get
> is that grads gives a return code 141 in the shell after failing.
> >>
> >> Can you tell me what this return code means? Do you have any idea why my
> job can be run manually but not from cron?
> >>
> >> Best regards,
> >> Jonas Kaufmann
> >> _______________________________________________
> >> gradsusr mailing list
> >> gradsusr at gradsusr.org
> >> http://gradsusr.org/mailman/listinfo/gradsusr
> >>
> >> _______________________________________________
> >> gradsusr mailing list
> >> gradsusr at gradsusr.org
> >> http://gradsusr.org/mailman/listinfo/gradsusr
> >>
> >> _______________________________________________
> >> gradsusr mailing list
> >> gradsusr at gradsusr.org
> >> http://gradsusr.org/mailman/listinfo/gradsusr
> >>
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 22 Jul 2011 06:48:54 -1000
> From: "James T. Potemra" <jimp at hawaii.edu>
> Subject: Re: [gradsusr] Missing variables in 3-d fwrite binary file
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID: <4E29A9F6.5030801 at hawaii.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Kevin:
>
> It looks like in your NAM-2011072200.ctl file you are defining one
> vertical level:
>
> zdef 1 levels 315
>
> but you then assign two levels to each variable:
>
> cpd                   2 99 Condensation Pressure Deficit (mb)
> isenps                2 99 Pressure (mb)
> u                     2 99 Zonal component of wind (ms^-1)
> v                     2 99 Meridional component of wind (ms^-1)
>
> I think if you change the "2's" above with "1", or for surface you can
> have "0",
> it should work ok.
>
> Jim
>
> On 7/22/11 2:49 AM, Kevin Huyck wrote:
> > Good morning.
> >
> > I'm attempting to configure some post-processing subroutines for
> > several parameters I find useful. For my pathfinder case, I am
> > creating a binary file using "fwrite" to store four parameters. Each
> > parameter varies in the horizontal plane, but not in the vertical
> > (i.e. only one vertical level is computed). When I output a single
> > timestep, I can open and retrieve the data file and the data display
> > correctly. If I write each variable twice, once for each time step, I
> > can retrieve the first time step, but not the second. At present I'm
> > feeding commands into the command-line interpreter rather than
> > executing a script. I've seen examples in the archives discussing
> > varying the time dimension by way of a "while" loop. Since I'm
> > entering the commands individually the result /should/ be the same as
> > if run from a script.
> >
> > I'm not sure where I'm making my mistake in the process, so any
> > guidance would be appreciated.
> >
> > Input data is the North American Mesoscale (NAM) 40 km model. I am
> > computing values for "t 1" and "t 2" during this trial period.  The
> > variables utilized in the process are "cpd", "isenps", "u", and "v".
> > Command sequence is first, followed by the .ctl file. I use a homemade
> > script file, "compute_cpd.gs", to conduct the necessary calculations.
> > This script accepts three arguments, Theta surface (in Kelvin), grid
> > skip, and working file number. compute_cpd.gs returns cpd, isenps, u,
> > and v. In this case, "z" in NAM-2011072200.dat represents the "theta"
> > level for the isentropic surface.
> >
> > --- Command Listing ---
> > open NAM-2011072200.ctl
> > set t 1
> > run compute_cpd.gs 315 1 1
> >
> > set fwrite ./cpd/NAM-2011072200.dat
> > set gxout fwrite
> >
> > d cpd
> > d isenps
> > d u
> > d v
> >
> > set t 2
> > run compute_cpd.gs 315 1 1
> >
> > d cpd
> > d isenps
> > d u
> > d v
> >
> > disable fwrite
> > reinit
> >
> > open ./cpd/NAM-2011072200.ctl
> > set t 1
> > run ./draw-cpd.gs
> >
> > clear graphics
> > set t 2
> > run ./draw-cpd.gs
> >
> > --- Error Output ---
> > Low Level I/O Error:  Read error on data file
> >   Data file name = ./cpd/NAM-2011072200.dat
> >   Error reading 200 bytes at location 704000
> > Data Request Error:  Error for variable 'cpd'
> >   Error ocurred at column 1
> > DISPLAY error:  Invalid expression
> >   Expression = cpd
> > Cannot plot color bar: No shading information
> > Low Level I/O Error:  Read error on data file
> >   Data file name = ./cpd/NAM-2011072200.dat
> >   Error reading 200 bytes at location 704000
> > Data Request Error:  Error for variable 'cpd'
> >   Error ocurred at column 1
> > DISPLAY error:  Invalid expression
> >   Expression = cpd
> > Low Level I/O Error:  Read error on data file
> >   Data file name = ./cpd/NAM-2011072200.dat
> >   Error reading 200 bytes at location 880000
> > Data Request Error:  Error for variable 'isenps'
> >   Error ocurred at column 1
> > DISPLAY error:  Invalid expression
> >   Expression = isenps
> > Low Level I/O Error:  Read error on data file
> >   Data file name = ./cpd/NAM-2011072200.dat
> >   Error reading 200 bytes at location 1056000
> > Data Request Error:  Error for variable 'u'
> > Operation Error:  Error from skip function
> >   Error ocurred at column 1
> > DISPLAY error:  Invalid expression
> >   Expression = skip(u,2)
> >
> > --- ./cpd/NAM-2011072200.ctl Contents ---
> > dset /home/Agena/klhuyck/cpd/NAM-2011072200.dat
> > title NAM 40km Condensation Pressure Deficit
> > undef -999000000.000000
> > options little_endian
> > xdef 200 linear -145.0 0.5
> > ydef 110 linear 12.0 0.5
> > zdef 1 levels 315
> > tdef 2 linear 00Z22Jul2011 3hr
> > vars 4
> > cpd                   2 99 Condensation Pressure Deficit (mb)
> > isenps                2 99 Pressure (mb)
> > u                     2 99 Zonal component of wind (ms^-1)
> > v                     2 99 Meridional component of wind (ms^-1)
> > endvars
> >
> > --
> > Kevin L. Huyck
> > Forecaster, Meridian Environmental Technology, Inc.
> > klhuyck at meridian-enviro.com <mailto:klhuyck at meridian-enviro.com>
> >
> > Composed using Mozilla Thunderbird!
> >
> >
> > _______________________________________________
> > 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/20110722/4de890bf/attachment-0001.html
>
> ------------------------------
>
> Message: 4
> Date: Fri, 22 Jul 2011 10:07:44 -0700 (PDT)
> From: jagadish karmacharya <j_karmacharya at yahoo.com>
> Subject: [gradsusr] incorrect time steps
> To: "gradsusr at gradsusr.org" <gradsusr at gradsusr.org>
> Message-ID:
>        <1311354464.42717.YahooMailNeo at web31901.mail.mud.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
> I have used CDO operators to create monthly netCDF file from daily data.
> The timestamp of the resulting file when viewed in CDO is:
>
> 1989-01-31T00:00:00
> 1989-02-28T00:00:00
> 1989-03-31T00:00:00
> 1989-04-30T00:00:00
> ......
> .....
>
> But the timestep of the same file in grads is:
>
> 1989-01-31:0
> 1989:3:3:0
>
> 1989:3:31:0
> 1989:5:1:0
> ....
> ....
>
> This is different and I guess is causing problem in time series plot etc.
> How can I overcome the problem?
>
> I am using grads version 2.0.a7.oga.3 in Linux OS.
>
> Any advice will be highly appreciated.
>
>
> Jagadish
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://gradsusr.org/pipermail/gradsusr/attachments/20110722/f7d0c5d5/attachment.html
>
> ------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> End of gradsusr Digest, Vol 17, Issue 24
> ****************************************
>



-- 
Muhammad Mubashar Ahmad Dogar
Scientific Officer (Climatology Section),
Global Change Impact Studies Centre (GCISC),
NCP complex, Quaid-e-Azam University Campus,
Shahdra road, Islamabad, Pakistan.
Tel:  +92519230226
Mob:+923315144169
email: mubashardogar at yahoo.com
          mubashar.ahmad at gcisc.org.pk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110722/51f0a3a7/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.ctl
Type: application/octet-stream
Size: 333 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110722/51f0a3a7/attachment-0009.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.grib
Type: application/octet-stream
Size: 698256 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110722/51f0a3a7/attachment-0010.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.grib.idx
Type: application/octet-stream
Size: 5794 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110722/51f0a3a7/attachment-0011.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.nc
Type: application/x-netcdf
Size: 699252 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110722/51f0a3a7/attachment-0003.nc 


More information about the gradsusr mailing list