Yi-Chih,<br>I've done some experimenting with my own data sets.� Here's what worked for me.� You'll want to adjust the ii, jj, and max values back to your own.� I forgot to reset jj = 1 in the first while loop (not the same as FORTRAN DO loops).� Also, I guess you have to define the first guess field as a non-constant field (i.e., just define it as one of your other fields already in the data file).� Also, I had to add the lines "line = sublin(result,2)" to correspond to the output to the aave command.� You may not need that if Grads does not need to interpolate.� You can find out by manually entering the aave command at the command prompt and look at the text output.<br>
<br>ii = 1<br>jj = 1<br>ii_max = 440<br>jj_max = 252<br>'define uave = u'<br>'define vave = v'<br>'d aave(u, x=1, x=440, y=1, y=252)'<br>line = sublin(result,2)<br>u_value = subwrd(line,4)<br>'d aave(v, x=1, x=440, y=1, y=252)'<br>
line = sublin(result,2)<br>v_value = subwrd(line,4)<br>while (ii <= ii_max)<br>�� jj = 1<br>�� while (jj <= jj_max)<br>����� 'set defval uave 'ii' 'jj' 'u_value<br>����� 'set defval vave 'ii' 'jj' 'v_value<br>
����� jj = jj + 1<br>�� endwhile<br>�� ii = ii + 1<br>endwhile<br><br>Jeff<br><br><div class="gmail_quote">On Wed, Nov 9, 2011 at 4:17 PM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yi-Chih,<br>The range error may be due to the units used for the grid location.� See the example on the set defval page: <a href="http://www.iges.org/grads/gadoc/gradcomdsetdefval.html" target="_blank">http://www.iges.org/grads/gadoc/gradcomdsetdefval.html</a><br>
<br>You might need to start ii and jj at 1 and 1, and translate them to match the actual grid you have.� Thus, you may need to modify the script like this:<br><br>ii = 1<br>jj = 1<br>ii_max = 93-65<br>jj_max = 65-37<div>
<br>'define uave = 0'<br>
'define vave = 0'<br>'d aave(u, x=65, x=93, y=37, y=65)'<br>u_value = subwrd(result,4)<br>'d aave(v, x=65, x=93, y=37, y=65)'<br>
v_value = subwrd(result,4)<br>while (ii <= ii_max)<br>�� while (jj <= jj_max)<br>����� 'set defval uave 'ii' 'jj' 'u_value<br>����� 'set defval vave 'ii' 'jj' 'v_value<br>
����� jj = jj + 1<br>�� endwhile<br>�� ii = ii + 1<br>endwhile<br><br></div>At the end, make sure you are displaying uave and vave, not u_value and v_value.� u_value and v_value are just dummy variables in your script, whereas the grid/field you want to display is uave and vave.<br>
<font color="#888888">
<br>Jeff<br><br></font><div class="gmail_quote"><div><div></div><div>On Wed, Nov 9, 2011 at 4:05 PM, Yi-Chih Huang <span dir="ltr"><<a href="mailto:dscpln@gmail.com" target="_blank">dscpln@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
Jeff,<br><br>��� Thanks much for the updated information.� The updated error messages are as follows.� The ranges of x and y should be suitable for aave(u, x=65, x=93, y=37, y=65).� I don't understand where "Out of Range" came from.<br>
<br>��� Thanks,<br><br>����������������� Yi-Chih<br><br>############################################################<br>ga-> q file<br>File 1 : OUTPUT FROM WRF V3.3 MODEL<br>� Descriptor: Morakot_d01.ctl<br>� Binary: Morakot_d01_%y4-%m2-%d2_%h2:%n2.dat<br>
� Type = Gridded<br>� Xsize = 94� Ysize = 84� Zsize = 27� Tsize = 57� Esize = 1<br><br>#############################################################<br>ga-> test<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>SET DEFVAL Error:� Out of Range<br>
Syntax Error:� Invalid Operand <br>� 'u_value' not a variable or function name<br>� Error ocurred at column 1<br>DISPLAY error:� Invalid expression <br>� Expression = u_value<br><br>###########################################�� <a href="http://test.gs" target="_blank">test.gs</a><br>
ii = 65<br>jj = 37<br>ii_max = 93<br>jj_max = 65<br>'define uave = 0'<br>'define vave = 0'<br>'d aave(u, x=65, x=93, y=37, y=65)'<br>u_value = subwrd(result,4)<br>'d aave(v, x=65, x=93, y=37, y=65)'<br>
v_value = subwrd(result,4)<br>while (ii <= ii_max)<br>�� while (jj <= jj_max)<br>����� 'set defval uave 'ii' 'jj' 'u_value<br>����� 'set defval vave 'ii' 'jj' 'v_value<br>
����� jj = jj + 1<br>�� endwhile<br>�� ii = ii + 1<br>endwhile<br><br>'d u_value;v_value'<br>#############################################<br><br><div class="gmail_quote">On Wed, Nov 9, 2011 at 4:48 PM, Jeff Duda <span dir="ltr"><<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Yi-Chih,<br>For my second suggestion, just define the variable as a dummy value first.� <br>
<br>define uave = 0<br>define vave = 0<br><br>I think set defval will then overwrite the data.<br><br>Jeff</blockquote></div>
<br></div></div><div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></div></blockquote></div><div><div></div><div><br><br clear="all"><br>-- <br>Jeff Duda<br>Grad student - PhD, Meteorology<br>University of Oklahoma School of Meteorology - Center for Analysis and Prediction of Storms<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Grad student - PhD, Meteorology<br>University of Oklahoma School of Meteorology - Center for Analysis and Prediction of Storms<br><br>