<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Dear Ricardo,<BR> <BR>Thank you very much. Your script works and I am happy.<BR> <BR>Best regards,<BR> <BR>T.<br> <BR><div><div id="SkyDrivePlaceholder"></div>> From: gradsusr-request@gradsusr.org<br>> Subject: gradsusr Digest, Vol 36, Issue 29<br>> To: gradsusr@gradsusr.org<br>> Date: Wed, 6 Feb 2013 02:36:24 -0500<br>> <br>> Send gradsusr mailing list submissions to<br>>         gradsusr@gradsusr.org<br>> <br>> To subscribe or unsubscribe via the World Wide Web, visit<br>>         http://gradsusr.org/mailman/listinfo/gradsusr<br>> or, via email, send a message with subject or body 'help' to<br>>         gradsusr-request@gradsusr.org<br>> <br>> You can reach the person managing the list at<br>>         gradsusr-owner@gradsusr.org<br>> <br>> When replying, please edit your Subject line so it is more specific<br>> than "Re: Contents of gradsusr digest..."<br>> <br>> <br>> Today's Topics:<br>> <br>> 1. Re: binary to netCDF conversion problems (Jeff Duda)<br>> 2. Re: Average in two different time and locations (Ricardo Hallak)<br>> 3. Re: linear trend in grads (Roberto Mera)<br>> 4. Vertical gradient of the saturation mixing ratio<br>> (Morwakoma Matabane)<br>> 5. Vertical gradient of the saturation mixing ratio<br>> (Morwakoma Matabane)<br>> <br>> <br>> ----------------------------------------------------------------------<br>> <br>> Message: 1<br>> Date: Tue, 5 Feb 2013 15:04:58 -0600<br>> From: Jeff Duda <jeffduda319@gmail.com><br>> Subject: Re: [gradsusr] binary to netCDF conversion problems<br>> To: GrADS Users Forum <gradsusr@gradsusr.org><br>> Message-ID:<br>>         <CAAig09D1yvoR-vOQ+qwkFfK4vSZwOLXM3NxPGWJvJ=DSCktuWQ@mail.gmail.com><br>> Content-Type: text/plain; charset="iso-8859-1"<br>> <br>> >From your 'q dims' result:<br>> X is varying Lon = 0 to 360 X = 360.5 to 1080.5<br>> <br>> I'd be willing to bet my grad stud
ent stipend Grads is using the points x =<br>> 360 through x = 1081 (inclusive) to write out the data. You should set<br>> your dimension to something else to avoid having half-index values or<br>> decrease your x-dimension environment boundaries by 1.0 points each ('set x<br>> 361 1080'). Either that, or adjust the XDEF entry in your control file to<br>> match what you're setting in your dimension environment.<br>> <br>> Jeff Duda<br>> <br>> On Tue, Feb 5, 2013 at 12:07 PM, Rosalyn F Maccracken <rmaccrac@gmu.edu>wrote:<br>> <br>> > Dear Users,<br>> ><br>> > I am trying to convert a binary file to a netCDF4<br>> > file using sdfwrite. I have a control file<br>> > which looks like:<br>> ><br>> > DSET tsfc_3hr_%y4%m2.dat<br>> > OPTIONS TEMPLATE<br>> > UNDEF -1000.<br>> > XDEF 720 LINEAR -179.75 0.50<br>> > YDEF 360 LINEAR -89.75 0.50<br>> > ZDEF 1 LEVELS 1000.<br>> > TDEF 8768 LINEAR 00z01Jan2007 3hr<br>> > VARS 1<br>> > tsfc 0 99<br>> > ENDVARS<br>> ><br>> > When I do 'q dims', I get:<br>> > Default file number is: 1<br>> > X is varying Lon = 0 to 360 X = 360.5 to 1080.5<br>> > Y is varying Lat = -89.75 to 89.75 Y = 1 to 360<br>> > Z is fixed Lev = 1000 Z = 1<br>> > T is fixed Time = 00Z01JAN2007 T = 1<br>> > E is fixed Ens = 1 E = 1<br>> ><br>> > So, lon should have 720 points, lat should<br>> > have 180 points, and for a 30 day month, there<br>> > should be 248 time steps.<br>> ><br>> > However, when I use the sdfwrite command:<br>> ><br>> > open tsfc_3hr.ctl<br>> > set time 00Z01Jan2007 21Z30Jan2007<br>> > define tsfc = tsfc<br>> > set sdfwrite -flt -nc4 <tsfc_file>.nc4<br>> > sdfwrite tsfc<br>> ><br>> > I get metadata that has the wrong lon<br>> > dimension:<br>> > netcdf tsfc_3hr_Aug1995 {<br>>
> dimensions:<br>> > lon = 722 ;<br>> > lat = 360 ;<br>> > time = 248 ;<br>> > (etc)<br>> ><br>> > So, my questions are, why is the lon dimension<br>> > wrong and how do I fix this?<br>> ><br>> > Thanks,<br>> > Roz<br>> ><br>> > ********************************<br>> > Rosalyn F. MacCracken, Ph.D.<br>> > Postdoctoral Research Fellow<br>> > Department of Geography and Geoinformation Science<br>> > George Mason University<br>> > Fairfax, VA<br>> > (301) 335-1222<br>> > rmaccrac@gmu.edu<br>> ><br>> > _______________________________________________<br>> > gradsusr mailing list<br>> > gradsusr@gradsusr.org<br>> > http://gradsusr.org/mailman/listinfo/gradsusr<br>> ><br>> <br>> <br>> <br>> -- <br>> Jeff Duda<br>> Graduate research assistant<br>> University of Oklahoma School of Meteorology<br>> Center for Analysis and Prediction of Storms<br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/08b6f718/attachment-0001.html <br>> <br>> ------------------------------<br>> <br>> Message: 2<br>> Date: Tue, 5 Feb 2013 18:19:52 -0300<br>> From: "Ricardo Hallak" <hallak@model.iag.usp.br><br>> Subject: Re: [gradsusr] Average in two different time and locations<br>> To: GrADS Users Forum <gradsusr@gradsusr.org><br>> Message-ID: <20130205204710.M95724@model.iag.usp.br><br>> Content-Type: text/plain; charset="iso-8859-1"<br>> <br>> Dear Theresa,<br>> <br>> try this piece of script below:<br>> <br>> ?'reinit'<br>> ?'open E:\test.ctl'<br>> ?'set t 5'<br>> ?'set lat 7'<br>> ?'set lon 107'<br>> * 'define r1= sst'? !NOT NECESSARY, since you have already set a single point.<br>> ?'d sst'<br>> r1=subwrd(result,4)<br>> say r1<br>> 'close 1'<br
>> ?'sdfopen sst.nc' <br>> ?'set t 5'<br>> ?'set lat 7'<br>> ?'set lon 107'<br>> ?*'define r2= sst' !NOT NECESSARY <br>> 'd sst'<br>> ?r2=subwrd(result,4)<br>> say r2<br>> <br>> 'define aver= ('r1'+'r2')/2'<br>> ?<br>> 'd aver'<br>> ?Ar=subwrd(result,4)<br>> ?say Ar<br>> ? <br>> NOTE that, now, r1 and r2 are "script variables" (not "grads prompt variables"), since they were "captured" with "subwrd", and not with "define". So, r1 and r2 have to appear between quotes in the Ar definition. Note also that you can not use this kind of construction in the grads prompt terminal:<br>> <br>> 'd sst'<br>> ?r2=subwrd(result,4)<br>> <br>> So, script variables CAN NOT be directly displayed in the grads graphic window: they exist only in the script memory.<br>> <br>> On the other hand, DEFINED variables exist in the "GrADS prompt memory" and in the "script memory". These defined variables can be directly displayed in the grads graphic window. Of course, to make computations with defined variables, you don't need to put quotes in the variables. Is it clear enough?<br>> ?<br>> Please, let me know if this doesn't work as you expect.<br>> <br>> Regards,<br>> Ricardo<br>> <br>> On Tue, 5 Feb 2013 18:10:01 +0000, T. haghroosta wrote<br>> > Dear Ricardo,<br>> > ?<br>> > The script that you helped me to write, was run correctly. Now I would like to calculate the average of one parameter in two different files. I wrote this script, but it doesn't show me any outputs. Could you please tell me what is the problem?<br>> > ?<br>> > 'reinit'<br>> > 'open E:\test.ctl'<br>> > 'set t 5'<br>> > 'set lat 7'<br>> > 'set lon 107'<br>> > 'define r1= sst'<br>> > 'close 1'<br>> > 'sdfopen sst.nc'<br>> > 'set t 5'<br>> > 'set lat 7'<br>> > 'set lon 107'<br>> > 'define r2= sst'<br>> > 'define aver= (r1+r2)/2'<br>> > 'd aver'<br>> > Ar=subwrd(result,4)
<br>> > say Ar<br>> > <br>> > Regards,<br>> > ?<br>> > T.?<br>> > <br>> > > <br>> > > <br>> > > Today's Topics:<br>> > > <br>> > > 1. Re: Average in two different time and locations (T. haghroosta)<br>> > > <br>> > > <br>> > > ----------------------------------------------------------------------<br>> > ><br>> <br>> <br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130205/07eacbaa/attachment-0001.html <br>> <br>> ------------------------------<br>> <br>> Message: 3<br>> Date: Tue, 05 Feb 2013 13:56:15 -0800<br>> From: Roberto Mera <rjmera@coas.oregonstate.edu><br>> Subject: Re: [gradsusr] linear trend in grads<br>> To: GrADS Users Forum <gradsusr@gradsusr.org><br>> Message-ID: <51117FFF.4070606@coas.oregonstate.edu><br>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>> <br>> Michael,<br>> <br>> I'm also interested in how to find out the significance. Any help would <br>> be great?<br>> <br>> BTW, the scripts worked perfectly.<br>> <br>> Robert<br>> <br>> On 8/3/2012 11:06 AM, Tereza Cavazos wrote:<br>> > Hi Michael,<br>> ><br>> > And how do you know if the trend is suignificant?<br>> > Do you have a program for that?<br>> ><br>> > Thanks,<br>> > Tereza<br>> ><br>> > El 03/08/2012 09:28 a.m., J-P Michael escribi?:<br>> >> Robert,<br>> >><br>> >> Here is my solution. Perhaps someone else has a more eloquent script for<br>> >> this.<br>> >><br>> >> function get_trend (args)<br>> >><br>> >> varname=subwrd(args,1)<br>> >> xlimit=subwrd(args,2)<br>> >> ylimit=subwrd(args,3)<br>> >> zlimit=subwrd(args,4)<br>> >> tlimit=subwrd(args,5)
<br>> >> if (varname = '')<br>> >> say ''<br>> >> say 'you must first open the file to be detrended'<br>> >> say ''<br>> >> say 'then you must call this script like so: '<br>> >> say 'scripts/get_trend.gs varname x y z t'<br>> >> say 'example:'<br>> >> say 'scripts/get_trend.gs temp 320 366 1 2400'<br>> >> say ''<br>> >> return<br>> >> endif<br>> >><br>> >><br>> >> 'set x 1 'xlimit<br>> >> 'set y 1 'ylimit<br>> >> 'set loopdim z'<br>> >><br>> >> 'set t 1 'tlimit<br>> >> 'set z 1 'zlimit<br>> >> 'set x 1'<br>> >> 'set y 1'<br>> >> 'define base = const ('varname', 1, -a)'<br>> >> 'define ttime = sum(base, t = 1, t+1)'<br>> >> 'set z 1 'zlimit<br>> >> 'set x 1 'xlimit<br>> >> 'set y 1 'ylimit<br>> >> 'set t 1'<br>> >> 'define trend = tregr(ttime, 'varname', t=1, t = 'tlimit')'<br>> >> 'set z 1 'zlimit<br>> >><br>> >> _______________________________________________<br>> >> gradsusr mailing list<br>> >> gradsusr@gradsusr.org<br>> >> http://gradsusr.org/mailman/listinfo/gradsusr<br>> ><br>> <br>> <br>> <br>> ------------------------------<br>> <br>> Message: 4<br>> Date: Wed, 6 Feb 2013 09:29:22 +0200<br>> From: Morwakoma Matabane <Morwakoma.Matabane@weathersa.co.za><br>> Subject: [gradsusr] Vertical gradient of the saturation mixing ratio<br>> To: "'gradsusr@gradsusr.org'" <gradsusr@gradsusr.org><br>> Message-ID:<br>>         <06B0A85218E0A34EBBFFF4435CA4BAA45B45C7CFBA@sawsptahub01.saws.local><br>> Content-Type: text/plain; charset="us-ascii"<br>> <br>> Good day,<br>> <br>> I have managed to compute the saturation vapor pressure of two levels, say z-1 and z+1. And after computing the mixing ratios for the
respective levels, I cannot seem to be able to calculate the dQs/dz (the vertical gradient of the mixing ratios). All I get whenever I attempt to compute the dQs/dz is an ERROR.<br>> ...<br>> <br>> 'set z 3'<br>> <br>> *At temperature t1=t(z+1)<br>> <br>> 'define qs1=0.622*es1/lev'<br>> <br>> *At temperature t2=t(z-1)<br>> <br>> 'define qs2=0.622*<br>> <br>> 'define dq=(qs1-qs2)/(lev(z+1)-le(z-1))'<br>> <br>> 'd dq'<br>> <br>> OUTPUTS AN ERROR<br>> <br>> How can I avoid the erroneous situation? Your help is highly appreciated.<br>> <br>> <br>> Regards<br>> Morwakoma<br>> South African Weather Service (SAWS) Scientist<br>> <br>> <br>> <br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130206/a0b077e2/attachment-0001.html <br>> <br>> ------------------------------<br>> <br>> Message: 5<br>> Date: Wed, 6 Feb 2013 09:36:17 +0200<br>> From: Morwakoma Matabane <Morwakoma.Matabane@weathersa.co.za><br>> Subject: [gradsusr] Vertical gradient of the saturation mixing ratio<br>> To: "'gradsusr@gradsusr.org'" <gradsusr@gradsusr.org><br>> Message-ID:<br>>         <06B0A85218E0A34EBBFFF4435CA4BAA45B45C7CFBB@sawsptahub01.saws.local><br>> Content-Type: text/plain; charset="us-ascii"<br>> <br>> Good day,<br>> <br>> I have managed to compute the saturation vapor pressure of two levels, say z-1 and z+1. And after computing the mixing ratios for the respective levels, I cannot seem to be able to calculate the dQs/dz (the vertical gradient of the mixing ratios). All I get whenever I attempt to compute the dQs/dz is an ERROR.<br>> ...<br>> <br>> 'set z 3'<br>> <br>> *At temperature t1=t(z+1)<br>> <br>> 'define qs1=0.622*es1/lev'<br>> <br>> *At temperature t2=t(z-1)<br>> <br>> 'define qs2=0.622*es2/lev'<br>> <br>> 'define dq=(qs1-qs2)/(lev(z+1)-le(z-1))'<br
>> <br>> 'd dq'<br>> <br>> OUTPUTS AN ERROR<br>> <br>> How can I avoid the erroneous situation? Your help is highly appreciated.<br>> <br>> <br>> Regards<br>> Morwakoma<br>> South African Weather Service (SAWS) Scientist<br>> <br>> <br>> Morwakoma M Matabane BSc Witwatersrand, H. Dipl. Comp. Sc Witwatersrand, BSc Hon Pretoria, MSc Reading, Research Scientist<br>> South African Weather Service 442 Rigel Avenue South Erasmusrand Pretoria 0181<br>> Tel: +27(0)12 367 6234 Fax:+27(0)12 367 6189<br>> E-mail: morwakoma.matabane@weathersa.co.za Website:www.weathersa.co.za<br>> [cid:image001.png@01CE044D.69CE1730]<br>> "Power our future with weather, climate and water"<br>> "Big whorls have little whorls that feed on their velocity, and little whorls have lesser whorls and so on to viscosity", Lewis F Richardson.<br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130206/963bc8e0/attachment.html <br>> -------------- next part --------------<br>> A non-text attachment was scrubbed...<br>> Name: image001.png<br>> Type: image/png<br>> Size: 4963 bytes<br>> Desc: image001.png<br>> Url : http://gradsusr.org/pipermail/gradsusr/attachments/20130206/963bc8e0/attachment.png <br>> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> gradsusr mailing list<br>> gradsusr@gradsusr.org<br>> http://gradsusr.org/mailman/listinfo/gradsusr<br>> <br>> <br>> End of gradsusr Digest, Vol 36, Issue 29<br>> ****************************************<br></div>                                            </div></body>
</html>