<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Oops … there was one missing line in parseargs.gsf … it is now highlighted in red. <div><br><div><div>On Oct 30, 2015, at 6:37 PM, Jennifer Adams <<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><font face="Courier"><span style="font-size: 14px;">> cat yourMainScript.gs</span></font></div><div><font face="Courier"><span style="font-size: 14px;">function main(args)</span></font></div><div><font face="Courier"><span style="font-size: 14px;">rc=gsfallow("on")</span></font></div><div><font face="Courier"><span style="font-size: 14px;">parseargs(args) ;* parses the args</span></font></div><div><font face="Courier"><span style="font-size: 14px;">myshades() ;* defines colors</span></font></div><div><font face="Courier"><span style="font-size: 14px;"><br></span></font></div><div><span style="font-size: 14px; font-family: Courier;">> cat myshades.gsf</span></div><div><div><font face="Courier"><span style="font-size: 14px;">function myshades()</span></font></div><div><font face="Courier"><span style="font-size: 14px;">'set rgb 16 90 0 0' ;* map color</span></font></div><div><font face="Courier"><span style="font-size: 14px;">'set rgb 17 100 100 100' ;* dark grey</span></font></div><div><font face="Courier"><span style="font-size: 14px;">'set rgb 18 200 200 200' ;* light grey</span></font></div></div><div><font face="Courier"><span style="font-size: 14px;"><br></span></font></div><div><font face="Courier"><span style="font-size: 14px;">> cat parseargs.gsf</span></font></div><div><div><span style="font-size: 14px; font-family: Courier;">function parseargs(args)</span></div></div></div></div></blockquote><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><div><span style="font-size: 14px; font-family: Courier;"><font color="#e32400"><b>a=1</b></font></span></div><div><font face="Courier"></font></div></div></div></div></blockquote><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><div><font face="Courier"><span style="font-size: 14px;">while (1)</span></font></div><div><font face="Courier"><span style="font-size: 14px;"> _arg.a=subwrd(args,a)</span></font></div><div><font face="Courier"><span style="font-size: 14px;"> if (_arg.a=''); break; endif</span></font></div><div><font face="Courier"><span style="font-size: 14px;"> a=a+1</span></font></div><div><font face="Courier"><span style="font-size: 14px;">endwhile</span></font></div></div><div><font face="Courier"><span style="font-size: 14px;">_nargs=a-1</span></font></div><div><font face="Courier"><span style="font-size: 14px;"><br></span></font></div><div><font face="Courier"><span style="font-size: 14px;"><br></span></font></div><div><br></div><div>It is so much easier to explain by showing an example. </div><div>—Jennifer</div><div><br></div><div><br></div></div><br><div><div>On Oct 30, 2015, at 6:23 PM, Christopher Gilroy <<a href="mailto:chris.gilroy@gmail.com">chris.gilroy@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hey Jennifer,<div><br></div><div>Thanks for the reply. Yea I figured out how to partially get it to work. Since I have a function that reads command line arguments apparently that has to be the very first thing in the file or grads hangs. In other words it can't be in the "master" file, even if that's the first thing, on the first line, that grads does. The actual function that handles the command line argument needs to be the first thing (seemingly) in the actual grads script.</div></div></blockquote><blockquote type="cite"><div dir="ltr"><div><br></div><div>Am I missing something or is that normal?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 30, 2015 at 6:13 PM, Jennifer Adams <span dir="ltr"><<a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">What you are talking about are GrADS script functions. <a href="http://iges.org/grads/gadoc/gsf.html" target="_blank">http://iges.org/grads/gadoc/gsf.html</a><div>—Jennifer</div><div><br><div><div><div class="h5"><div>On Oct 30, 2015, at 12:54 PM, Christopher Gilroy <<a href="mailto:chris.gilroy@gmail.com" target="_blank">chris.gilroy@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">So basically instead of having:<div><br></div><div><div>function map(arg)</div><div>if (arg = '')</div><div> pull cmdline</div><div>else</div><div> cmdline=arg</div><div>endif</div><div><br></div><div>map=subwrd(cmdline,1)</div><div><br></div><div>if (map = 'conus')</div><div> latr='18 62'</div><div> lonr='-130 -58'</div><div>endif</div><div><br></div><div>if (map = 'alaska')</div><div> latr='50 74'</div><div> lonr='-170 -135'</div><div>endif</div><div><br></div><div>if (map = 'test')</div><div> latr='48 56'</div><div> lonr='-85 -63'</div><div>endif</div><div><br></div><div>if (map = 'blah')</div><div> latr='62 70'</div><div> lonr='-162 -150'</div><div>endif</div><div><br></div><div>'open /gfsmodeldata/gfs.ctl'</div><div>'set dfile 1'</div><div><br></div><div>'set mproj latlon'</div><div>'set display color white'<br></div><div>'set csmooth on'</div><div>'set grid off'</div><div>'set grads off'</div><div>'set mpdset hires'</div><div>'set map auto'</div><div>'set line 1'</div><div>'set csmooth on'</div><div>'set grads off'</div><div>'set gxout shaded'</div><div>*PAGE SIZE</div><div>'set vpage 0.0 11.0 0.0 8.5'</div><div>*PLOT SIZE</div><div>'set parea 0.4 10.3 0.4 7.9'</div><div><br></div><div>at the top of all of our gfs scripts, we can put that into a "<a href="http://gfs_master.gs/" target="_blank">gfs_master.gs</a>" and just "include" that in at the very top of all of our gfs scripts? This way as we add more "defaults" to the configuration we just edit one file instead of every single script?</div>
</div></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></blockquote></div><br><div>
<span style="border-collapse:separate;border-spacing:0px"><span style="border-collapse: separate; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br></div><br></span></span><br>
</div>
<br></div></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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">-Chris A. Gilroy</div>
</div>
_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px;"><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span><br class="Apple-interchange-newline">
</div>
<br></div>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>