<html><body><div style="color:#000; background-color:#fff; font-family:garamond, new york, times, serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1422237206843_40227"><span>Hi Everyone,</span></div><div id="yui_3_16_0_1_1422237206843_40282" dir="ltr"><span id="yui_3_16_0_1_1422237206843_40281">I am trying to calculate average summer sst for 30 years.</span></div><div id="yui_3_16_0_1_1422237206843_40502" dir="ltr"><span id="yui_3_16_0_1_1422237206843_40281">What could be wrong with this script. I will appreciate suggestions Please. <br></span></div><div id="yui_3_16_0_1_1422237206843_40872" dir="ltr"><span id="yui_3_16_0_1_1422237206843_40281">Thanks</span></div><div id="yui_3_16_0_1_1422237206843_41057" dir="ltr"><span id="yui_3_16_0_1_1422237206843_40281"><br></span></div><div id="yui_3_16_0_1_1422237206843_40868" dir="ltr"><span id="yui_3_16_0_1_1422237206843_40281">'reinit'<br style="" class="">'sdfopen d:\HadSST2_1x1.nc'<br style="" class="">'set grads off'<br style="" class="">'set gxout shaded'<br style="" class="">'define a=ave(sst,t=1577,t=1581)'<br style="" class="">'define b=ave(sst,t=1589,t=1593)'<br style="" class="">'define c=ave(sst,t=1601,t=1605)'<br style="" class="">'define d=ave(sst,t=1613,t=1617)'<br style="" class="">'define e=ave(sst,t=1625,t=1629)'<br style="" class="">'define f=ave(sst,t=1637,t=1641)'<br style="" class="">'define g=ave(sst,t=1649,t=1653)'<br style="" class="">'define h=ave(sst,t=1661,t=1665)'<br style="" class="">'define i=ave(sst,t=1673,t=1677)'<br style="" class="">'define j=ave(sst,t=1685,t=1689)'<br style="" class="">'define k=ave(sst,t=1697,t=1701)'<br style="" class="">'define l=ave(sst,t=1709,t=1713)'<br style="" class="">'define m=ave(sst,t=1721,t=1725)'<br style="" class="">'define n=ave(sst,t=1733,t=1737)'<br style="" class="">'define o=ave(sst,t=1745,t=1749)'<br style="" class="">'define p=ave(sst,t=1757,t=1761)'<br style="" class="">'define q=ave(sst,t=1769,t=1773)'<br style="" class="">'define r=ave(sst,t=1781,t=1785)'<br style="" class="">'define s=ave(sst,t=1793,t=1797)'<br style="" class="">'define t=ave(sst,t=1805,t=1809)'<br style="" class="">'define u=ave(sst,t=1817,t=1821)'<br style="" class="">'define v=ave(sst,t=1829,t=1833)'<br style="" class="">'define w=ave(sst,t=1841,t=1845)'<br style="" class="">'define x=ave(sst,t=1853,t=1857)'<br style="" class="">'define y=ave(sst,t=1865,t=1869)'<br style="" class="">'define z=ave(sst,t=1877,t=1881)'<br style="" class="">'define a1=ave(sst,t=1889,t=1893)'<br style="" class="">'define a2=ave(sst,t=1901,t=1905)'<br style="" class="">'define a3=ave(sst,t=1913,t=1917)'<br style="" class="">'define a4=ave(sst,t=1925,t=1929)'<br style="" class="">'define b1=(a+b+c+d+e+f+g+h+i+j)/10'<br style="" class="">'define b2=(k+l+m+n+o+p+q+r+s+t)/10'<br style="" class="">'define b3=(u+v+w+x+y+z+a1+a2+a3+a4)/10'<br style="" class="">'d (b1+b2+b3)'<br style="" class="">'cbar'<br style="" class="">'enable print d:\sst-1.png'<br style="" class="">'print'<br style="" class="">'disable print'<br style="" class=""><br style="" class=""><br></span></div><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: garamond, new york, times, serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Sunday, January 25, 2015 11:39 PM, "gradsusr-request@gradsusr.org" <gradsusr-request@gradsusr.org> wrote:<br> </font> </div> <br><br> <div class="y_msg_container">Send gradsusr mailing list submissions to<br> <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>or, via email, send a message with subject or body 'help' to<br> <a ymailto="mailto:gradsusr-request@gradsusr.org" href="mailto:gradsusr-request@gradsusr.org">gradsusr-request@gradsusr.org</a><br><br>You can reach the person managing the list at<br> <a ymailto="mailto:gradsusr-owner@gradsusr.org" href="mailto:gradsusr-owner@gradsusr.org">gradsusr-owner@gradsusr.org</a><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: Creating a Binary File in Grads (Kishore Ragi)<br> 2. Creating a grads file from station data (dolesibeni)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Sun, 25 Jan 2015 08:34:46 +0530<br>From: Kishore Ragi <<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>><br>Subject: Re: [gradsusr] Creating a Binary File in Grads<br>To: GrADS Users Forum <<a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Message-ID:<br> <CAN4rXbSe-yTcnt4=PRp61CM8Eg7tDAsa75ACOCHJNjw5y+<a ymailto="mailto:shsg@mail.gmail.com" href="mailto:shsg@mail.gmail.com">shsg@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>If you follow my suggestions carefully, you can get whatt you wanted.<br><br>Yes, I understand that you have .dat file with ctl. But, by the previous<br>suggestions, you can convert those .dat and ctl files to netcdf. Then you<br>can merge them as a combined netcdf. Handling of netcdf files is much<br>simpler than any other climate data files, atleast for me.<br><br>You just copy paste those commands that I have posted in the previous<br>email, if you already installed CDO in your machine.<br><br>But, if your goal is only to write grads script, other grads users may help<br>you.<br><br>Good luck !<br><br>Regards,<br><br>Kishore<br><br><br><br>On Sun, Jan 25, 2015 at 2:59 AM, Valeria Benson-Lira <<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>><br>wrote:<br><br>> Hi Kishore,<br>><br>> Thank you for your suggestions. The problem is that I need to have the<br>> script working for grads.<br>> For instance, my precipitation control files open a .dat file, they are<br>> not a netcdf.<br>> In this case, I want to create a binary file (.dat) which has all the<br>> precipitation values recorded in the 4 different files.<br>> No calculations are needed.<br>><br>> Any suggestions?<br>><br>> Thanks,<br>> Valeria<br>><br>><br>><br>> On Fri, Jan 23, 2015 at 11:11 PM, Kishore Ragi <<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>><br>> wrote:<br>><br>>> After getting this, if you still want only binary files, please let me<br>>> know. there are couple of options to make nc file to .dat file, even with<br>>> grads.<br>>><br>>> On Sat, Jan 24, 2015 at 11:37 AM, Kishore Ragi <<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>><br>>> wrote:<br>>><br>>>><br>>>><br>>>> *Hi Valeria Benson-Lira,*<br>>>> If you don't have problem working with nc files, I will give you other<br>>>> option to achieve your task.<br>>>><br>>>> First, you make your ctl file into netcdf files as below<br>>>><br>>>> cdo -f nc import_binary ENCB1_precip_apr2008.ctl precip.april.nc<br>>>> cdo -f nc import_binary ENCB1_precip_may2008.ct precip.may.nc<br>>>> cdo -f nc import_binary ENCB1_precip_jun2008.ctl precip.june.nc<br>>>> cdo -f nc import_binary ENCB1_precip_july2008.ctl precip.july.nc<br>>>><br>>>> now merge them all in a single file like below<br>>>><br>>>> cdo mergetime precip.april.nc precip.may.nc precip.june.nc<br>>>> precip.july.nc precip.AMJJ.nc<br>>>><br>>>> Though, I did not help with grads, hope this helps.<br>>>><br>>>> Cheers,<br>>>><br>>>> Kishore<br>>>><br>>>> On Sat, Jan 24, 2015 at 11:11 AM, Valeria Benson-Lira <<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>><br>>>> wrote:<br>>>><br>>>>> Dear Grads users,<br>>>>><br>>>>> Can someone please help me with my script? I am trying to write a<br>>>>> binary file that contains all the values recorded in four different control<br>>>>> files. My new binary file will have the hourly precipitation records from<br>>>>> April through July. So far, the script works for the first month but not<br>>>>> for the following months.<br>>>>><br>>>>> This is the script:<br>>>>><br>>>>><br>>>>> 'reinit'<br>>>>><br>>>>> 'open ENCB1_precip_apr2008.ctl'<br>>>>><br>>>>> 'open ENCB1_precip_may2008.ct'<br>>>>><br>>>>> 'open ENCB1_precip_jun2008.ctl'<br>>>>><br>>>>> 'open ENCB1_precip_july2008.ctl'<br>>>>><br>>>>><br>>>>> 'set gxout fwrite'<br>>>>><br>>>>> 'set fwrite ENCB1_AMJJ_precip.dat '<br>>>>><br>>>>><br>>>>> *****Write April data First.<br>>>>><br>>>>> *****Recall that April has 720 hours (30 days)<br>>>>><br>>>>> *index*_t = 1<br>>>>><br>>>>> while(*index*_t<=720)<br>>>>><br>>>>> 'set t '*index*_t<br>>>>><br>>>>> say *index*_t<br>>>>><br>>>>> 'd precip.1 '<br>>>>><br>>>>> *index*_t = *index*_t + 1<br>>>>><br>>>>> endwhile<br>>>>><br>>>>><br>>>>> *****Write May data Next.<br>>>>><br>>>>> *****Recall that May has 744 hours (31 days)<br>>>>><br>>>>> *index*_t = 1<br>>>>><br>>>>> while(*index*_t<=744)<br>>>>><br>>>>> 'set t '*index*_t<br>>>>><br>>>>> say *index*_t<br>>>>><br>>>>> 'd precip.2 '<br>>>>><br>>>>> *index*_t = *index*_t + 1<br>>>>><br>>>>> endwhile<br>>>>><br>>>>><br>>>>> *****Write June data Next.<br>>>>><br>>>>> *****Recall that June has 720 hours (30 days)<br>>>>><br>>>>> *index*_t = 1<br>>>>><br>>>>> while(*index*_t<=720)<br>>>>><br>>>>> 'set t '*index*_t<br>>>>><br>>>>> say *index*_t<br>>>>><br>>>>> 'd precip.3 '<br>>>>><br>>>>> *index*_t = *index*_t + 1<br>>>>><br>>>>> endwhile<br>>>>><br>>>>><br>>>>> *****Write July data Next.<br>>>>><br>>>>> *****Recall that July has 744 hours (31 days)<br>>>>><br>>>>> *index*_t = 1<br>>>>><br>>>>> while(*index*_t<=744)<br>>>>><br>>>>> 'set t '*index*_t<br>>>>><br>>>>> say *index*_t<br>>>>><br>>>>> 'd precip.4 '<br>>>>><br>>>>> *index*_t = *index*_t + 1<br>>>>><br>>>>> endwhile<br>>>>><br>>>>><br>>>>> *************************<br>>>>><br>>>>> 'disable fwrite'<br>>>>><br>>>>> *************************<br>>>>><br>>>>> *****Always reinitialize when finished,<br>>>>><br>>>>> *****to avoid mistakingly writing extraneous data<br>>>>><br>>>>> 'reinit'<br>>>>><br>>>>><br>>>>> Do you have a suggestion of how I can fix it?<br>>>>><br>>>>> Thanks,<br>>>>><br>>>>> *Valeria Benson-Lira*<br>>>>> *Graduate Teaching Assistant, Geography M.A.*<br>>>>> *e-mail: <a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a> <<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>>*<br>>>>><br>>>>><br>>>>><br>>>>> _______________________________________________<br>>>>> gradsusr mailing list<br>>>>> <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>>>>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>>>>><br>>>>><br>>>><br>>><br>>> _______________________________________________<br>>> gradsusr mailing list<br>>> <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>>><br>>><br>><br>> _______________________________________________<br>> gradsusr mailing list<br>> <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>><br>><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20150125/0e31fb31/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20150125/0e31fb31/attachment-0001.html </a><br><br>------------------------------<br><br>Message: 2<br>Date: Sun, 25 Jan 2015 16:01:12 +0200<br>From: dolesibeni <<a ymailto="mailto:dolesibeni@gmail.com" href="mailto:dolesibeni@gmail.com">dolesibeni@gmail.com</a>><br>Subject: [gradsusr] Creating a grads file from station data<br>To: <a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>, <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>Message-ID: <<a ymailto="mailto:ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com" href="mailto:ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com">ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>Dear Sir<br>Sorry for writing you pesronally instead of using the forum. I have on several occassion tried to ask through the forum but i dont get response.<br>My question is i have station data which i would like to read using grads. So from search i noted that i need to convert my station dsts to gridded format either using fortran or c. I tried several times but i am unable to come up with a .dat or .bin file which can be read by grads using my descriptor file.ctl.<br>My Datas is in this format:?<br>Stn name ? year month day var1 var2 var3 var4<br>A 2001 1 1 234 210 329 543<br><br>My descriptor file looks like this<br>Dset rainfall.dat<br>Dtype station<br>Stnmap rainfall.map<br>Undef -999<br>Title stationdata<br>Tdef 4 linear 1jan2000 1dy<br>Vars 4<br>Janprc 0 99 janary daily rainfall<br>Febprc 0 99 february daily rainfall<br>........<br>Up to ApRil<br>Endvars<br><br>Can you please help me to convert my station dats to grads format so that i can read it in grads.<br><br>Regards,<br>Charles Vanya<br><br><br><br><br>Sent from Samsung tablet<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20150125/1fd13970/attachment.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20150125/1fd13970/attachment.html </a><br><br>------------------------------<br><br>_______________________________________________<br>gradsusr mailing list<br><a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br><br><br>End of gradsusr Digest, Vol 59, Issue 46<br>****************************************<br><br><br></div> </div> </div> </div> </div></body></html>