[gradsusr] error with fprintf command (dipak sahu)

Roopashree Shrivastava rss1901 at gmail.com
Wed Jul 27 08:06:35 EDT 2011


Hi Dipak,

*
Look at the foll two lines
ga->* set x 1 72
*ga->* fprintf ts ts.csv %g, 72 0

I think you should give

set x 1 54
> set t 25
> fprintf  t2-273.15   T2-24hr.csv  %g, 54 0
try it and let me know or else if poss send me the data i will check.

Bye
Roopa

On Wed, Jul 27, 2011 at 3:50 PM, Roopashree Shrivastava
<rss1901 at gmail.com>wrote:

> hi Dipak,
>  I think with the fprintf function u will have to set y values also. From
> the script u sent
>
> > set x 1 54 (since the .dat file has 54 longitude and 36 latitude points)
> > set t 25
> > fprintf  t2-273.15   T2-24hr.csv  %g, 54
> u are varying x dimension at some constant time, what about y?? But then
> also your output file should contain only one row of 54 values since by
> default grads must have set latitude to the first value in the domain. Try
> by giving some value to y dimension.
>
> Bye
> Roopa
>
> On Wed, Jul 27, 2011 at 10:49 AM, <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: Missing variables in 3-d fwrite binary file (Kevin Huyck)
>>   2. error with fprintf command (dipak sahu)
>>   3. Re: Grads 2.0.9 error (chinh ta huu)
>>   4. Variable 'HFX' from ctl file (Salvador Salazar)
>>   5. time format (Simon Kiertscher)
>>   6. Re: time format (Yaqiang Wang)
>>   7. Re: time format (Simon Kiertscher)
>>   8. Re: time format (Yaqiang Wang)
>>   9. Re: say to stderr (Davide Sacchetti)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Mon, 25 Jul 2011 14:26:52 -0500
>> From: Kevin Huyck <klhuyck at meridian-enviro.com>
>> Subject: Re: [gradsusr] Missing variables in 3-d fwrite binary file
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Message-ID: <4E2DC37C.3000703 at meridian-enviro.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Jim,
>>
>> I thought those values represented the time step. After changing them to
>> "1" as you suggested, the data are what I was expecting. My next step is
>> creating multiple levels corresponding to numerous isentropic levels.
>> For each level I add, I'll increment the "1"s to the number of vertical
>> levels.
>>
>> Many, many thanks for you suggestion.
>>
>> Kevin L. Huyck
>> Forecaster, Meridian Environmental Technology, Inc.
>> klhuyck at meridian-enviro.com <mailto:klhuyck at meridian-enviro.com>
>>
>> Composed using Mozilla Thunderbird!
>>
>> On 07/22/11 11:48, James T. Potemra wrote:
>> > 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
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://gradsusr.org/pipermail/gradsusr/attachments/20110725/933b4073/attachment-0001.html
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: klhuyck.vcf
>> Type: text/x-vcard
>> Size: 307 bytes
>> Desc: not available
>> Url :
>> http://gradsusr.org/pipermail/gradsusr/attachments/20110725/933b4073/attachment-0001.vcf
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Tue, 26 Jul 2011 10:18:45 +0530
>> From: dipak sahu <dipakmath at gmail.com>
>> Subject: [gradsusr] error with fprintf command
>> To: gradsusr at gradsusr.org
>> Message-ID:
>>        <CAE1_8Lbco=bBx9rcWNU-fb0d8HP=Z=
>> E-_yT-DDabmnuWDhwO9w at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Dear all
>>      I tried to write the grads out put values into a ascii file by using
>> the fprintf.gs script. I tried the following command
>>
>> > set x 1 54 (since the .dat file has 54 longitude and 36 latitude points)
>> > set t 25
>> > fprintf  t2-273.15   T2-24hr.csv  %g, 54
>>
>> but the file T2-24hr.csv  has only two rows of data instead of 36 rows of
>> data. What may be the error with this script or command.
>>
>> waiting for your kind reply
>>
>> thanking you
>> with regards
>> Dipak Sahu
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://gradsusr.org/pipermail/gradsusr/attachments/20110726/09c72c64/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Tue, 26 Jul 2011 17:50:18 -0700
>> From: chinh ta huu <chinhth2010 at gmail.com>
>> Subject: Re: [gradsusr] Grads 2.0.9 error
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Message-ID:
>>        <CAHiZ=QPdOkgoRAO2Mg9FVCqWFBw-7-ApCno1j0gNbAr=
>> QvE5+g at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Dear Guilherme
>>     For this software, not make install. You only copy to
>> /opt/opengrads/opengrads/
>> And then set envir variable in bashfile. It is ok
>> Best regards
>> Chinh
>>
>>
>> On Thu, Jul 7, 2011 at 1:09 PM, Guilherme Martins <jgmsantos at gmail.com
>> >wrote:
>>
>> > Hi users,
>> >
>> > I need help. I'm trying to install grads2.0.9, but I receive the message
>> > below when I type make:
>> >
>> > gagx.o: In function `gakml':
>> > /home/gui/grads-2.0.a9/src/gagx.c:3986: undefined reference to `gxqdrgb'
>> > gagx.o: In function `gagtif':
>> > /home/gui/grads-2.0.a9/src/gagx.c:4290: undefined reference to `gxqdrgb'
>> > ../../supplibs/lib/libcurl.a(timeval.o): In function `curlx_tvnow':
>> > timeval.c:(.text+0x89): undefined reference to `clock_gettime'
>> > make[2]: ** [grads] Erro 1
>> > make[2]: Saindo do diret?rio `/home/gui/grads-2.0.a9/src'
>> > make[1]: ** [all] Erro 2
>> > make[1]: Saindo do diret?rio `/home/gui/grads-2.0.a9/src'
>> > make: ** [all-recursive] Erro 1
>> > gui at curupira:~/grads-2.0.a9$
>> >
>> > May anyone help me?
>> >
>> > Thanks a lot,
>> >
>> > Guilherme.
>> >
>> > --
>> > Guilherme Martins
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> >
>>
>>
>> --
>> (Mr.) Ta Huu Chinh
>> National, Weather Forecasting Center, Ha Noi, Viet Nam.
>> No: 4th, Dang Thai Than, Hoan Kiem, Ha Noi
>> Tel: 84-903-402-181
>> Fax: 84-43-824-4917
>> Email: chinhth2010 at gmail.com
>> Website: http://vn.myblog.yahoo.com/chinhth2005/
>> Website: http://bestknowledge-chinhth.blogspot.com/
>> Website: http://anhcuoidep.vn
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://gradsusr.org/pipermail/gradsusr/attachments/20110726/6b6229ad/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Wed, 27 Jul 2011 00:19:26 -0700
>> From: Salvador Salazar <sal.salazar1 at gmail.com>
>> Subject: [gradsusr] Variable 'HFX' from ctl file
>> To: gradsusr at gradsusr.org
>> Message-ID:
>>        <CA+_3LvrzGiTY_nsK33FKTuX==
>> uW6o0bVGQFEqj5nHS84yv8AqQ at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi guys,
>>
>> I have a question about the variable 'HFX' that from the ARWpost .ctl
>> file. The description reads 'upward heat flux at the surface', and I
>> wanted to know if this meant total heat flux or simply sensible heat
>> flux.
>>
>> Any ideas are appreciated!
>>
>> --
>> Sal!
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Wed, 27 Jul 2011 10:27:59 +0200
>> From: Simon Kiertscher <simon.kiertscher at gmx.de>
>> Subject: [gradsusr] time format
>> To: gradsusr at gradsusr.org
>> Message-ID: <4E2FCC0F.6080607 at gmx.de>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Dear all,
>>
>> i have a problem with opening a file.
>> I use (GrADS) Version 2.0.a9 on Suse
>>
>> ga-> sdfopen GKSS-2.nc
>> Scanning self-describing file:  GKSS-2.nc
>> gadsdf: Error parsing time_units for SDF file.
>>
>> the format is as follows:
>> (from ncdump)
>>
>>         double time(time) ;
>>                 time:units = "day as %Y%m%d.%f" ;
>>                 time:calendar = "proleptic_gregorian" ;
>>                 time:axis = "t" ;
>>                 time:long_name = "time" ;
>>
>> So i think this is valid format? Can anyone tell my what is wrong?
>>
>> Best Regards,
>> Simon
>>
>>
>> ------------------------------
>>
>> Message: 6
>> Date: Wed, 27 Jul 2011 16:41:49 +0800
>> From: Yaqiang Wang <yaqiang.wang at gmail.com>
>> Subject: Re: [gradsusr] time format
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Message-ID:
>>        <
>> CABvomDVQ8XZGPpaKnHwyn6a2t-usuxxAEKOW0JYhP6-ixTVh6g at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>>  time:units = "day as %Y%m%d.%f"   It does not follow GOARDS
>> conventions which is used in 'sdfopen' function. So you need to write
>> a control file to tell GrADS the dimensions and variables in the data
>> set. You have to use 'xdfopen' or 'open' commands to open the data
>> file.
>>
>> On Wed, Jul 27, 2011 at 4:27 PM, Simon Kiertscher
>> <simon.kiertscher at gmx.de> wrote:
>> > Dear all,
>> >
>> > i have a problem with opening a file.
>> > I use (GrADS) Version 2.0.a9 on Suse
>> >
>> > ga-> sdfopen GKSS-2.nc
>> > Scanning self-describing file: ?GKSS-2.nc
>> > gadsdf: Error parsing time_units for SDF file.
>> >
>> > the format is as follows:
>> > (from ncdump)
>> >
>> > ? ? ? ? double time(time) ;
>> > ? ? ? ? ? ? ? ? time:units = "day as %Y%m%d.%f" ;
>> > ? ? ? ? ? ? ? ? time:calendar = "proleptic_gregorian" ;
>> > ? ? ? ? ? ? ? ? time:axis = "t" ;
>> > ? ? ? ? ? ? ? ? time:long_name = "time" ;
>> >
>> > So i think this is valid format? Can anyone tell my what is wrong?
>> >
>> > Best Regards,
>> > Simon
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>>
>>
>>
>> --
>> *************************************************
>> Dr. Yaqiang Wang
>> Chinese Academy of Meteorological Sciences (CAMS)
>> 46, Zhong-Guan-Cun South Avenue
>> Beijing, 100081
>> China
>>
>> yaqiang.wang at gmail.com
>> **************************************************
>>
>>
>>
>> ------------------------------
>>
>> Message: 7
>> Date: Wed, 27 Jul 2011 11:14:17 +0200
>> From: Simon Kiertscher <simon.kiertscher at gmx.de>
>> Subject: Re: [gradsusr] time format
>> To: gradsusr at gradsusr.org
>> Message-ID: <4E2FD6E9.1040002 at gmx.de>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Dear Yaqiang,
>>
>> thank you for the information, where can i find the GrADS conventions to
>> know which  format is ok,  and which not?
>> I'm very new to GrADS, so can you give me a source where i can find a
>> example of a control file? I have no idea how to do that.
>>
>> Best Regards,
>> Simon
>> >   time:units = "day as %Y%m%d.%f"   It does not follow GOARDS
>> > conventions which is used in 'sdfopen' function. So you need to write
>> > a control file to tell GrADS the dimensions and variables in the data
>> > set. You have to use 'xdfopen' or 'open' commands to open the data
>> > file.
>> >
>> > On Wed, Jul 27, 2011 at 4:27 PM, Simon Kiertscher
>> > <simon.kiertscher at gmx.de>  wrote:
>> >> Dear all,
>> >>
>> >> i have a problem with opening a file.
>> >> I use (GrADS) Version 2.0.a9 on Suse
>> >>
>> >> ga->  sdfopen GKSS-2.nc
>> >> Scanning self-describing file:  GKSS-2.nc
>> >> gadsdf: Error parsing time_units for SDF file.
>> >>
>> >> the format is as follows:
>> >> (from ncdump)
>> >>
>> >>          double time(time) ;
>> >>                  time:units = "day as %Y%m%d.%f" ;
>> >>                  time:calendar = "proleptic_gregorian" ;
>> >>                  time:axis = "t" ;
>> >>                  time:long_name = "time" ;
>> >>
>> >> So i think this is valid format? Can anyone tell my what is wrong?
>> >>
>> >> Best Regards,
>> >> Simon
>> >> _______________________________________________
>> >> gradsusr mailing list
>> >> gradsusr at gradsusr.org
>> >> http://gradsusr.org/mailman/listinfo/gradsusr
>> >>
>> >
>> >
>>
>>
>>
>> ------------------------------
>>
>> Message: 8
>> Date: Wed, 27 Jul 2011 17:32:44 +0800
>> From: Yaqiang Wang <yaqiang.wang at gmail.com>
>> Subject: Re: [gradsusr] time format
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Message-ID:
>>        <CABvomDXSwC3X=
>> EEA7_JxvwFAZOXG6vbmntskZxsGzo_6y03CBQ at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> The information could be found at
>> http://www.iges.org/grads/gadoc/gradcomdsdfopen.html.
>>
>> On Wed, Jul 27, 2011 at 5:14 PM, Simon Kiertscher
>> <simon.kiertscher at gmx.de> wrote:
>> > Dear Yaqiang,
>> >
>> > thank you for the information, where can i find the GrADS conventions to
>> > know which ?format is ok, ?and which not?
>> > I'm very new to GrADS, so can you give me a source where i can find a
>> > example of a control file? I have no idea how to do that.
>> >
>> > Best Regards,
>> > Simon
>> >> ? time:units = "day as %Y%m%d.%f" ? It does not follow GOARDS
>> >> conventions which is used in 'sdfopen' function. So you need to write
>> >> a control file to tell GrADS the dimensions and variables in the data
>> >> set. You have to use 'xdfopen' or 'open' commands to open the data
>> >> file.
>> >>
>> >> On Wed, Jul 27, 2011 at 4:27 PM, Simon Kiertscher
>> >> <simon.kiertscher at gmx.de> ?wrote:
>> >>> Dear all,
>> >>>
>> >>> i have a problem with opening a file.
>> >>> I use (GrADS) Version 2.0.a9 on Suse
>> >>>
>> >>> ga-> ?sdfopen GKSS-2.nc
>> >>> Scanning self-describing file: ?GKSS-2.nc
>> >>> gadsdf: Error parsing time_units for SDF file.
>> >>>
>> >>> the format is as follows:
>> >>> (from ncdump)
>> >>>
>> >>> ? ? ? ? ?double time(time) ;
>> >>> ? ? ? ? ? ? ? ? ?time:units = "day as %Y%m%d.%f" ;
>> >>> ? ? ? ? ? ? ? ? ?time:calendar = "proleptic_gregorian" ;
>> >>> ? ? ? ? ? ? ? ? ?time:axis = "t" ;
>> >>> ? ? ? ? ? ? ? ? ?time:long_name = "time" ;
>> >>>
>> >>> So i think this is valid format? Can anyone tell my what is wrong?
>> >>>
>> >>> Best Regards,
>> >>> Simon
>> >>> _______________________________________________
>> >>> 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
>> >
>>
>>
>>
>> --
>> *************************************************
>> Dr. Yaqiang Wang
>> Chinese Academy of Meteorological Sciences (CAMS)
>> 46, Zhong-Guan-Cun South Avenue
>> Beijing, 100081
>> China
>>
>> yaqiang.wang at gmail.com
>> **************************************************
>>
>>
>>
>> ------------------------------
>>
>> Message: 9
>> Date: Wed, 27 Jul 2011 11:34:40 +0200
>> From: Davide Sacchetti <davide.sacchetti at arpal.gov.it>
>> Subject: Re: [gradsusr] say to stderr
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Message-ID: <1311759280.885.5.camel at davide>
>> Content-Type: text/plain; charset="UTF-8"
>>
>> inside a script you could redirect using unix shell
>> e.g.:
>> '!echo ERROR ON FILE >&2'
>>
>> I've just tried and it seems to work
>>
>> bye bye
>> Davide
>>
>> On Mon, 2011-07-25 at 14:27 +0200, Simon Kiertscher wrote:
>> > -----BEGIN PGP SIGNED MESSAGE-----
>> > Hash: SHA1
>> >
>> > Hi John,
>> >
>> > thanks you for your effort.
>> >
>> > Best Regards,
>> > Simon
>> >
>> > Am 22.07.2011 16:10, schrieb Huddleston, John:
>> > > Simon
>> > >
>> > > I looked through the GrADS source code, specifically gscrpt.c file and
>> the 'printf' function is used.
>> > >
>> > > The 'printf' always goes to stdout.  Had it been fprintf(FILE
>> *somefp,...) then maybe it could have been.
>> > >
>> > > However, I don't think the original designers (aka Brian Doty) was
>> concerned about writing to stderr.
>> > >
>> > > John
>> > >
>> > > -----Original Message-----
>> > > From: gradsusr-bounces at gradsusr.org [mailto:
>> gradsusr-bounces at gradsusr.org] On Behalf Of Simon Kiertscher
>> > > Sent: Friday, July 22, 2011 2:25 AM
>> > > To: gradsusr at gradsusr.org
>> > > Subject: Re: [gradsusr] say to stderr
>> > >
>> > > Hi John,
>> > >
>> > > thanks for your answer. I know how to redirect channels on the command
>> line.
>> > > But how to decide IN the script, what should go to stderr and what to
>> stdout, 'say' always put the output to stdout.
>> > > So in bash i would do echo "foobar" 1>&2 to get the foobar to the
>> stderr, how can i do this in GrADS? Is there a way?
>> > >
>> > > Best Regards,
>> > > Simon
>> > >> Simon
>> > >>
>> > >> If you are running GrADS in batch mode you can re-direct output as
>> > >> follows
>> > >>
>> > >> grads -lbc 'run somescript.gs' 2>  say.err 1>&2
>> > >>
>> > >> In interactive mode there is no output to the screen it simply goes
>> to the file.
>> > >>
>> > >> Does that answer your question?
>> > >>
>> > >> John Huddleston
>> > >>
>> > >> -----Original Message-----
>> > >> From: gradsusr-bounces at gradsusr.org
>> > >> [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Simon Kiertscher
>> > >> Sent: Wednesday, July 20, 2011 7:36 AM
>> > >> To: gradsusr at gradsusr.org
>> > >> Subject: [gradsusr] say to stderr
>> > >>
>> > >> Dear gradsusers
>> > >>
>> > >> i can not find any information about sending text to the stderror
>> channel of the shell while using the say command. Has some one an idea?
>> > >>
>> > >> Best Regards,
>> > >> Simon
>> > >> _______________________________________________
>> > >> 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
>> > >
>> > -----BEGIN PGP SIGNATURE-----
>> > Version: GnuPG v1.4.9 (MingW32)
>> >
>> > iEYEARECAAYFAk4tYU8ACgkQG0AVdCSrH+YQTwCguP5vZwnTglV57tNoXdBLQHfr
>> > Z8EAnizKje0vZYEoHntzY/0Omx67IPSf
>> > =Y7CV
>> > -----END PGP SIGNATURE-----
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> >
>>
>> --
>> --> Attenzione cambio indirizzo: davide.sacchetti at arpal.gov.it
>> --
>> Davide Sacchetti
>> Centro Funzionale Meteo Idrologico di Protezione Civile della Regione
>> Liguria
>> ARPAL Unit? Tecnica Complessa di livello Regionale
>> V.le Brigare Partigiane 2 16121 Genova (I)
>> tel: +39 010 6437535                    fax: +39 010 6437520
>> mail: davide.sacchetti at arpal.gov.it     web: www.meteoliguria.it
>>
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>> End of gradsusr Digest, Vol 17, Issue 27
>> ****************************************
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110727/5a8b0aab/attachment-0003.html 


More information about the gradsusr mailing list