<div dir="ltr">You only use the dots (.) to denote arrays from different files. Once you define new arrays in Grads (as you have done with rn), you do not need to use the dots to reference the array. In fact, that is probably giving you an error since you only define rn once anyway (Grads does not assume you perform the operation on data with the same name from multiple files as far as I'm aware). Here is what I would suggest if you are looking for text output of the area mean RMSE.<div>
<br></div><div style>'set t 't1' 't2<br></div><div style>'define fcstrain = rainc.1 + rainnc.1 - rainc.1(t-1) - rainnc.1(t-1)'</div><div style>'define obsrain = rainc.2 + rainnc.2 - rainc.2(t-1) - rainnc.2(t-1)'</div>
<div style>'define rainerror = fcstrain - obsrain'</div><div style>'define sqerror = pow(rainerror,2)'</div><div style>'define mse = amean(sqerror,l<span style="font-size:13px;font-family:arial,sans-serif">on=115,lon=135,</span><span style="font-size:13px;font-family:arial,sans-serif">lat=4,lat=25)'</span></div>
<div style>'define rmse = sqrt(mse)'</div><div style><br></div><div style>Here I have assumed you have script variables t1 and t2 defined before this section of code and that you are computing the RMSE of a precip accumulation interval defined by the difference between two adjacent time slices (as is indicated in your code). I am also assuming you will have appropriate means of writing out the values to a file. What you have done above is probably okay, although the way I've coded it, the array rmse will be a time series rather than a single value. To me that sounds more efficient, although I'm not sure the write command will correctly write each data point out in the file. You can also look into the script <a href="http://fprintf.gs">fprintf.gs</a>, which you can find through a Google search.</div>
<div style><br></div><div style>Hope this helps.</div><div style><br></div><div style>Jeff Duda</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 9:32 PM, Lyndon Mark Olaguera <span dir="ltr"><<a href="mailto:olagueralyndonmark429@gmail.com" target="_blank">olagueralyndonmark429@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hello fellow grad user,<br></div> <br></div>i want to find the rmse for the accumulated rainfall,I pasted my sample script below but it is not working..grads is giving an error.<br>
<br></div>
<div>Any help will be appreciated.<br><br><br><br>'open obsnudge/observation_nudging.ctl'<br>'open model/fnl_nonudging.ctl'<br>Time_val=2<br>Time_prev=1<br>'set t 'Time_val<br>'define rn=(rainc+rainnc)-(rainc(t='Time_prev')-rainnc(t='Time_prev'))'<br>
'd rn'<br>'define dif=rn.1-rn.2'<br> 'define sq=dif*dif'<br> 'define am=amean(sq,lon=115,lon=135,lat=4,lat=25)'<br> 'define rmse=sqrt(am)'<br> 'd rmse'<br> a=subwrd(result,4)<br>
output=a<br> res=write(rmsewind_v.csv,output,append)<br> 'undefine dif'<br> 'undefine sq'<br> 'undefine am'<br><br>Time_val=Time_val+1<br>Time_prev=Time_prev+1<br>endwhile<br>quit<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888">Lyndon<br></font></span></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a 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></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
</div>