<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Jeff,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I tried this and am still getting the same error, I attached the 2 scripts, thought this might be easier so you can see what I’m doing. I’m not sure if this is necessary but in the test script (not in there now) I also tried setting lev to zlev and got an error message with that.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks again for helping me out with this!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Meredith<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> gradsusr-bounces@gradsusr.org [mailto:gradsusr-bounces@gradsusr.org] <b>On Behalf Of </b>Jeffrey Duda<br><b>Sent:</b> Thursday, April 21, 2011 4:52 PM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] zinterp.gs<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Meredith,<br>No problem. It took me awhile to figure out how to use functions like this, too.<br><br>If you have the standard script from the website script library (that begins like this:)<o:p></o:p></p><pre>function zinterp(field,zgrid,zlev)<br><br><o:p></o:p></pre><pre>*----------------------------------------------------------------------<br>* <br>* Bob Hart (<a href="mailto:hart@ems.psu.edu">hart@ems.psu.edu</a>) / PSU Meteorology<br>* 3/4/1999<br>*<br>* GrADS function to interpolate within a 3-D grid to a specified<br><br><o:p></o:p></pre><pre>* height level. Can also be used on non-pressure level data, such<br>* as sigma or eta-coordinate output where height is a function<br>* of time and grid level.<o:p></o:p></pre><p class=MsoNormal style='margin-bottom:12.0pt'>then you need to put your call to the function outside of the code that contains the function (i.e., either before the first line that says "function zinterp(field,zgrid,zlev)" or after the last line "Return(interp)". The code says it will return to you a newly defined variable called "interp". Thus you will then want to display that variable. You can do it any of the ways suggested in the notes. One way I would suggest is:<br><br>'zinterp(temp,height,5000)'<br>'d interp'<br><br>See if following that method works.<br><br>Jeff<o:p></o:p></p><div><p class=MsoNormal>On Thu, Apr 21, 2011 at 3:25 PM, Meredith Croke <<a href="mailto:mcroke@airdat.com">mcroke@airdat.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Thanks Jeff, </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>I should have mentioned, initially I tried running zinterp from a script, but once that wasn’t working I was trying to trouble shoot on the command line. I tried your suggestion and put</span><span style='font-size:10.0pt;color:#1F497D'> </span><span style='font-size:10.0pt'>'zinterp(tmpprs,hgtprs,5000)' <span style='color:#1F497D'>as the first line in the <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> script, I then tried running a very short script that just opened a ctl file and ‘d zinterp(tmpprs,hgtprs,5000)’</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'>I again get the following error: </span><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'>Syntax Error: Invalid Operand </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'> 'zinterp' not a variable or function name</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'> Error ocurred at column 1</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'>DISPLAY error: Invalid expression </span><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'> Expression = zinterp(tmprs,hgtprs,5000)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'>I also tried putting ‘zinterp(tmpprs,hgtprs,5000)’ on the second line of <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> (under function zinterp(field,zgrid,zlev)) and got the same error.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'>Not sure what I’m missing.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'>Thanks for the help,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'>Meredith</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a> [mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>] <b>On Behalf Of </b>Jeffrey Duda<br><b>Sent:</b> Thursday, April 21, 2011 3:45 PM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] <a href="http://zinterp.gs" target="_blank">zinterp.gs</a></span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>Meredith,<br>To my knowledge, you can't run a function from the Grads command prompt. Instead, you need to put in a call to it inside a script that contains the function code. Thus, just put the line 'zinterp(tmpprs,hgtprs,5000)' as the first line of code in the <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> script file.<br><br>Jeff Duda<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Thu, Apr 21, 2011 at 2:02 PM, Meredith Croke <<a href="mailto:mcroke@airdat.com" target="_blank">mcroke@airdat.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>Hi Grads Users,<br><br><br><br>I'm trying to use the <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> function to determine the 6km wind from<br>model data that is output on pressure levels, however I'm running into<br>some issues with <a href="http://zinterp.gs" target="_blank">zinterp.gs</a>.<br><br><br><br>To test the function I am attempting to run it from the command line and<br>follow the samples in the script, so I have tried<br><br>'d zinterp(tmpprs,hgtprs,5000)', to display a temperature field at 5000,<br>however I receive this error:<br><br>Syntax Error: Invalid Operand<br><br> 'zinterp' not a variable or function name<br><br> Error ocurred at column 1<br><br>DISPLAY error: Invalid expression<br><br> Expression = zinterp(tmpprs,hgtprs,5000)<br><br><br><br>The function is in my directory, what else do I need to do to get this<br>to work?<br><br>I am using grads v1.9b4<br><br><br><br>Thanks for your help.<br><br><br><br>Regards,<br><span style='color:#888888'><br><br><br>Meredith<br><br><br><br></span><br>_______________________________________________<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><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br><br clear=all><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/%7Ejdduda" target="_blank">www.meteor.iastate.edu/~jdduda</a><o:p></o:p></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><o:p></o:p></p></div></body></html>