<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ipshita,<br>
<br>
I think you need to remove the "_" (underscore) from your variable
name. So, month_ave will not work but monthave should be ok.<br>
<br>
Jim<br>
<br>
<div class="moz-cite-prefix">On 9/23/14 9:25 AM, Ipshita Majhi
wrote:<br>
</div>
<blockquote
cite="mid:CA+ObMNB_FXx4KgU2riB858g+iuCEh8vTwiHEm0_8oQqiSrCokQ@mail.gmail.com"
type="cite">
<div dir="ltr">Dear Grad users,<br>
<br>
I am trying to convert daily data to monthly data and I am
getting error which says unknown command for averaging. I will
attach the data file and ctl as well. It will be great if
someone could help me. Thank You<br>
*************************************************************************************************<br>
*Date 09/23/2014<br>
*This script is to convert daily values to monthly values for
different years which starts from 1901 <br>
* and ends in 2010<br>
**************************************************************************************************<br>
<br>
'reinit'<br>
mday = '31 28 31 30 31 30 31 31 30 31 30 31'<br>
month = 'jan feb mar apr may jun jul aug sep oct nov dec'<br>
<br>
'open prec.mean.imr'<br>
<br>
<br>
'set gxout fwrite'<br>
'set fwrite outputfile'<br>
<br>
yr1 = 1901<br>
yr2 = 2010<br>
<br>
yr = yr1<br>
while(yr<=yr2)<br>
<br>
leap = 0<br>
if(math_mod(yr,400) = 0 | math_mod(yr,4) = 0 &
math_mod(yr,100) != 0)<br>
<br>
leap = 1<br>
<br>
say yr' is a leap year.'<br>
endif<br>
<br>
imon = 1<br>
while(imon <= 12)<br>
md = subwrd(mday,imon)<br>
mc = subwrd(month,imon)<br>
if(imon = 2); md = md + leap; endif;<br>
time1 = '01'mc''yr<br>
time2 = md''mc''yr<br>
<br>
' month_avg= ave(p,time='time1',time='time2')'<br>
imon = imon + 1<br>
endwhile<br>
yr = yr + 1<br>
endwhile<br>
<br>
return(month_avg)<br>
<br>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</body>
</html>