[gradsusr] Custom (And Simple) Function Script Refuses To Pass Variable Back To Main Script

Perry, Aaron @ LSC Aaron.Perry at lsc.vsc.edu
Fri May 30 18:12:21 EDT 2014


Good Evening All,

I'm currently trying to create a very simple function script (.gsf) where a weekday is changed from say "Sun" to "Sunday" and then plotted. I have sought help from a few people who are GrADS-proficient and they are as stumped as I am.

Here's what I'm dealing with:

Function Script:

function convertday(fday)

rc = gsfallow("on")

if (fday="Sun"); newday="Sunday"; endif
if (fday="Mon"); newday="Monday"; endif
if (fday="Tue"); newday="Tuesday"; endif
if (fday="Wed"); newday="Wednesday"; endif
if (fday="Thu"); newday="Thursday"; endif
if (fday="Fri"); newday="Friday"; endif
if (fday="Sat"); newday="Saturday"; endif

return(newday)

Command to function in main script:

'/home/aaron/grads/day_abv.gsf 'fday''

How I'm attempting to plot the variable:

'draw string 2.60 8.05 Valid: 'thour' 'tz' ('thour2') 'newday' 'fday2' 'fmonth' 'fyear''

Also, I'm using 'q time' fday = subwrd(result,6) to get the actual weekday name at the top of the main script.

This function should be working, as it's probably as simple as you could get for a function.

Any ideas?


Onward and Upward,

Aaron D. Perry
Atmospheric Sciences
Lyndon State College
Class of 2016
Boston, MA
Twitter: @AaronPerryLSC<https://twitter.com/AaronPerryLSC>
Mobile: 617-780-4312
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140530/acf119a4/attachment.html 


More information about the gradsusr mailing list