<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" &lt;gradsusr-request@gradsusr.org&gt; wrote:<br> </font> </div>  <br><br> <div class="y_msg_container">Send gradsusr mailing list submissions to<br>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;  1. Re: Creating a Binary File in Grads (Kishore Ragi)<br>&nbsp;  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 &lt;<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>&gt;<br>Subject: Re: [gradsusr] Creating a Binary File in Grads<br>To: GrADS Users Forum &lt;<a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;CAN4rXbSe-yTcnt4=PRp61CM8Eg7tDAsa75ACOCHJNjw5y+<a ymailto="mailto:shsg@mail.gmail.com" href="mailto:shsg@mail.gmail.com">shsg@mail.gmail.com</a>&gt;<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 &lt;<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>&gt;<br>wrote:<br><br>&gt; Hi Kishore,<br>&gt;<br>&gt; Thank you for your suggestions. The problem is that I need to have the<br>&gt; script working for grads.<br>&gt; For instance, my precipitation control files open a .dat file, they are<br>&gt; not a netcdf.<br>&gt; In this case, I want to create a binary file (.dat) which has all the<br>&gt; precipitation values recorded in the 4 different files.<br>&gt; No calculations are needed.<br>&gt;<br>&gt; Any suggestions?<br>&gt;<br>&gt; Thanks,<br>&gt; Valeria<br>&gt;<br>&gt;<br>&gt;<br>&gt; On Fri, Jan 23, 2015 at 11:11 PM, Kishore Ragi &lt;<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>&gt;<br>&gt; wrote:<br>&gt;<br>&gt;&gt; After getting this, if you still want only binary files, please let me<br>&gt;&gt; know. there are couple of options to make nc file to .dat file, even with<br>&gt;&gt; grads.<br>&gt;&gt;<br>&gt;&gt; On Sat, Jan 24, 2015 at 11:37 AM, Kishore Ragi &lt;<a ymailto="mailto:kishoreragi@gmail.com" href="mailto:kishoreragi@gmail.com">kishoreragi@gmail.com</a>&gt;<br>&gt;&gt; wrote:<br>&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; *Hi Valeria Benson-Lira,*<br>&gt;&gt;&gt; If you don't have problem working with nc files, I will give you other<br>&gt;&gt;&gt; option to achieve your task.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; First, you make your ctl file into netcdf files as below<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; cdo -f nc import_binary ENCB1_precip_apr2008.ctl precip.april.nc<br>&gt;&gt;&gt; cdo -f nc import_binary ENCB1_precip_may2008.ct precip.may.nc<br>&gt;&gt;&gt; cdo -f nc import_binary ENCB1_precip_jun2008.ctl precip.june.nc<br>&gt;&gt;&gt; cdo -f nc import_binary ENCB1_precip_july2008.ctl precip.july.nc<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; now merge them all in a single file like below<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; cdo mergetime precip.april.nc precip.may.nc precip.june.nc<br>&gt;&gt;&gt; precip.july.nc precip.AMJJ.nc<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Though, I did not help with grads, hope this helps.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Cheers,<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Kishore<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Sat, Jan 24, 2015 at 11:11 AM, Valeria Benson-Lira &lt;<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>&gt;<br>&gt;&gt;&gt; wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Dear Grads users,<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Can someone please help me with my script? I am trying to write a<br>&gt;&gt;&gt;&gt; binary file that contains all the values recorded in four different control<br>&gt;&gt;&gt;&gt; files. My new binary file will have the hourly precipitation records from<br>&gt;&gt;&gt;&gt; April through July. So far, the script works for the first month but not<br>&gt;&gt;&gt;&gt; for the following months.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; This is the script:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'reinit'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'open ENCB1_precip_apr2008.ctl'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'open ENCB1_precip_may2008.ct'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'open ENCB1_precip_jun2008.ctl'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'open ENCB1_precip_july2008.ctl'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'set gxout fwrite'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'set fwrite ENCB1_AMJJ_precip.dat '<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Write April data First.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Recall that April has 720 hours (30 days)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *index*_t = 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; while(*index*_t&lt;=720)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'set t '*index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  say *index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'd precip.1 '<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  *index*_t = *index*_t + 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; endwhile<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Write May data Next.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Recall that May has 744 hours (31 days)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *index*_t = 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; while(*index*_t&lt;=744)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'set t '*index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  say *index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'd precip.2 '<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  *index*_t = *index*_t + 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; endwhile<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Write June data Next.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Recall that June has 720 hours (30 days)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *index*_t = 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; while(*index*_t&lt;=720)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'set t '*index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  say *index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'd precip.3 '<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  *index*_t = *index*_t + 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; endwhile<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Write July data Next.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Recall that July has 744 hours (31 days)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *index*_t = 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; while(*index*_t&lt;=744)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'set t '*index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  say *index*_t<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  'd precip.4 '<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&nbsp;  *index*_t = *index*_t + 1<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; endwhile<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *************************<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'disable fwrite'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *************************<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****Always reinitialize when finished,<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *****to avoid mistakingly writing extraneous data<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; 'reinit'<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Do you have a suggestion of how I can fix it?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Thanks,<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; *Valeria Benson-Lira*<br>&gt;&gt;&gt;&gt; *Graduate Teaching Assistant, Geography M.A.*<br>&gt;&gt;&gt;&gt; *e-mail: <a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a> &lt;<a ymailto="mailto:vbensonl@asu.edu" href="mailto:vbensonl@asu.edu">vbensonl@asu.edu</a>&gt;*<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; gradsusr mailing list<br>&gt;&gt;&gt;&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt;&gt;&gt;&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; gradsusr mailing list<br>&gt;&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt;&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; gradsusr mailing list<br>&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;<br>&gt;<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 &lt;<a ymailto="mailto:dolesibeni@gmail.com" href="mailto:dolesibeni@gmail.com">dolesibeni@gmail.com</a>&gt;<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: &lt;<a ymailto="mailto:ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com" href="mailto:ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com">ptn3t71x5fh2e1ol7n8b9095.1422193122265@email.android.com</a>&gt;<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>