<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body ocsi="0" fpstyle="1" bgcolor="#FFFFFF">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi Jim,<br>
<br>
I really appreciate all the assistance with this date issue. <br>
<br>
Unfortunately, using sublin(d,1) absolutely refuses to work for me so, I think I'm just going to try setting the date outside of GrADS before I run my script:<br>
<br>
Ex:<b><br>
<br>
<u>In bash script:</u><br>
</b><br>
YMD=`date &#43;%Y%m%d`<br>
<br>
grads -clb &quot;run ${HOMEDIR}${PATH3}500gph_${FHR0}.gs ${YMD}<br>
<u><b><br>
In GrADS .gs script:</b></u><br>
<br>
function pull (args)<br>
<br>
currdate = subwrd(args,1)<br>
<br>
<br>
Believe it or not, I'm still having an issue where &quot;No Files Open&quot; still popping up when GrADS is run and the valid forecast hour not showing up on my plots. I've attached a sample of what's happening to this email and an updated version of the script. I feel
 like the issue is with fdate and fday from 'q time' but, from what I can tell the coding checks out.<br>
<br>
This is becoming quite frustrating...<br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="3"><font face="Arial"><font size="2" face="Tahoma"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font size="2" face="Tahoma">Boston, MA<br>
Mobile: 617-780-4312</font><br>
</font></font></font></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF572849" style="direction:ltr"><font size="2" color="#000000" face="Tahoma"><b>From:</b> gradsusr-bounces@gradsusr.org [gradsusr-bounces@gradsusr.org] on behalf of James T. Potemra [jimp@hawaii.edu]<br>
<b>Sent:</b> Thursday, December 26, 2013 6:11 PM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] &quot;No Files Open&quot; When Running In Batch Mode<br>
</font><br>
</div>
<div></div>
<div>Hi Aaron:<br>
<br>
Just to be clear, in your script the line '!date &#43;.....' will create a single line file with the date as the single line, e.g., 20131226.&nbsp; Then, the third line in<br>
your script is sysdate = sublin(d,2) which is trying to read the second line of the file created (which I think should only have one line).&nbsp; So, you should
<br>
change this third line (I think) to:<br>
<br>
sysdate = sublin(d,1)<br>
<br>
Next, you have an issue with the &quot;date&quot; command redirect.&nbsp; On most operating systems a &quot;&gt;&gt;&quot; (double) will append to an existing file, and a
<br>
&quot;&gt;!&quot; will overwrite the file.&nbsp; The single &quot;&gt;&quot; is different on different systems, on some it overwrites and on others it appends.&nbsp; So, ideally I think<br>
you want a &quot;&gt;!&quot; since a &quot;&gt;&gt;&quot; will append to a file, but you are always reading the same line (hope that makes sense).&nbsp; Finally, at least on my<br>
system the grads script is reading the single quote in the date command as a termination of the command.&nbsp; So, I think what you really want is:<br>
<br>
'!date &#43;&quot;%Y%m%d&quot; &gt;! /home/muaddib/grads/date/date.formatted'<br>
d = read('/home/muaddib/grads/date/date.formatted')<br>
sysdate = sublin(d,1)<br>
<br>
However, the ! part of &gt;! is apparently not allowed in the Grads script (I think the ! means to escape from grads for a system command).&nbsp; So,<br>
if you can confirm that a single &quot;&gt;&quot; will overwrite a file, and change the sublin(d,2) to sublin(d,1) you are probably ok:<br>
<br>
'!date &#43;'%Y%m%d' &gt; /home/muaddib/grads/date/date.formatted'<br>
d = read('/home/muaddib/grads/date/date.formatted')<br>
sysdate = sublin(d,1)<br>
<br>
Jim<br>
<br>
<div class="moz-cite-prefix">On 12/26/13 12:18 PM, Perry, Aaron @ LSC wrote:<br>
</div>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi Jim,<br>
<br>
I tried the changes that you suggested and unfortunately I still have the same problem. I also tried just entering the actual date instead of trying to set a command to create the current date, didn't work.<br>
<br>
Adding the &quot; &quot; around !date &#43;%Y%m%d seemed to help and so did doing just one &quot;&gt;&quot; but, when I tried changing &gt;&gt; to &gt;!, I kept getting this error message &quot;date: extra operand `/home/muaddib/grads/date/date.formatted' Try `date --help` for more information&quot; and
 then it goes back to the usual &quot;No Files Open No files open&quot; message.<br>
<br>
Could you elaborate a little bit more about the .bashrc approach? In my bash script, I'm defining the date variable as &quot;YMD=`date &#43;%Y%m%d` to pull .grib2 data via wget and then convert it through g2ctl and gribmap. I wouldn't think that would affect GrADS,
 right?<br>
<br>
Here's the part in the bash script where I'm running GrADS:<br>
<br>
<b>GRADS=/usr/local/lib/grads/./grads<br>
PATH3=/grads/scripts/gem/25km/12/<br>
FHR0=000<br>
HOMEDIR=/home/muaddib<br>
<br>
${GRADS} -clb &quot;run ${HOMEDIR}${PATH3}500GPH_${FHR0}.gs&quot;</b><br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="3"><font face="Arial"><font size="2" face="Tahoma"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font size="2" face="Tahoma">Boston, MA<br>
Mobile: 617-780-4312</font><br>
</font></font></font></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF490290" style="direction:ltr"><font size="2" color="#000000" face="Tahoma"><b>From:</b>
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">
gradsusr-bounces@gradsusr.org</a> [<a class="moz-txt-link-abbreviated" href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>] on behalf of James T. Potemra [<a class="moz-txt-link-abbreviated" href="mailto:jimp@hawaii.edu" target="_blank">jimp@hawaii.edu</a>]<br>
<b>Sent:</b> Thursday, December 26, 2013 4:06 PM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] &quot;No Files Open&quot; When Running In Batch Mode<br>
</font><br>
</div>
<div>Aaron:<br>
<br>
I think the problem is with the &quot;date&quot; command.&nbsp; You can test this with<br>
specifying the date (replace the top lines with a constant date).&nbsp; If this<br>
is indeed the case, some suggestions:<br>
<br>
1.&nbsp; Try with double quotes around the arguments to date, e.g.,<br>
<br>
'!date &#43;&quot;%Y%m%d&quot; &gt;&gt; /home/muaddib/grads/date/date.formatted'<br>
<br>
I think you want a date like 20131226, but with single quotes around<br>
the argument I think you'll get something like &quot;Ymd&quot;.<br>
<br>
2.&nbsp; Is it possible you have two different &quot;date&quot; commands?&nbsp; It could<br>
be running in batch mode is using a different path that when you are<br>
running interactively (e.g., you have a .bashrc or .cshrc that is not<br>
accessed in batch mode).<br>
<br>
3.&nbsp; The &gt;&gt; syntax will append the output to file date.formatted,<br>
but your script is always accessing the second line of this file:<br>
sysdate = sublin(d,2)<br>
Not sure why you have this.&nbsp; Have you tried &gt;! to overwrite the<br>
file, then read the first line?<br>
<br>
Jim<br>
<br>
<br>
<div class="moz-cite-prefix">On 12/26/13 8:46 AM, Perry, Aaron @ LSC wrote:<br>
</div>
<blockquote type="cite"><style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
body
        {direction:ltr;
        font-family:Tahoma;
        color:#000000;
        font-size:10pt}
p
        {margin-top:0;
        margin-bottom:0}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {direction:ltr;
        font-family:Tahoma;
        color:#000000;
        font-size:10pt}
p
        {margin-top:0;
        margin-bottom:0}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
body
        {scrollbar-base-color:undefined;
        scrollbar-highlight-color:undefined;
        scrollbar-darkshadow-color:undefined;
        scrollbar-arrow-color:undefined}
-->
BODY {direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;}P {margin-top:0;margin-bottom:0;}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}</style>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Good Afternoon Jennifer,<br>
<br>
Thanks for the reply! Sorry about not attaching the script that I'm having issues with!<br>
<br>
I've attached it to this email.<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="3"><font face="Arial"><font size="2" face="Tahoma"><font size="2"><br>
Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font size="2" face="Tahoma">Boston, MA<br>
Mobile: 617-780-4312</font><br>
</font></font></font></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF123183" style="direction:ltr"><font size="2" color="#000000" face="Tahoma"><b>From:</b>
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">
gradsusr-bounces@gradsusr.org</a> [<a class="moz-txt-link-abbreviated" href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>] on behalf of Jennifer Adams [<a class="moz-txt-link-abbreviated" href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a>]<br>
<b>Sent:</b> Thursday, December 26, 2013 10:05 AM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] &quot;No Files Open&quot; When Running In Batch Mode<br>
</font><br>
</div>
<div>You've probably got a 'q time' command in your script before you open any files, or after you open a file with some error. But without knowing what script you're running on startup, it's impossible to help any further.
<div>--Jennifer</div>
<div><br>
<div><br>
<div>
<div>On Dec 26, 2013, at 12:56 AM, Perry, Aaron @ LSC wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite"><span class="Apple-style-span" style="border-collapse:separate; font-family:Helvetica; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; font-size:medium">
<div>
<div style="direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-size:10pt">
Good Morning All,<br>
<br>
Currently, I'm having an issue where &quot;No Files Open&quot; pops up every time that I run GrADS in Batch Mode (grads -clb).<span class="Apple-converted-space">&nbsp;</span><br>
<br>
This results in the Valid Forecast Time not being displayed on my plots. At first, I thought that it was an issue of the 'set t 1' placement after 'reinit', as I'm using g2ctl/gribmap ctl files.<br>
<br>
I've sort of narrowed this down to just a batch mode problem because, when I open the .gs file with 'grads -l' , &quot;No Files Open&quot; does not pop up and the Valid Forecast Time shows up on the plot.<br>
<br>
Has anybody else had this issue before?<br>
<br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="3"><font face="Arial"><font size="2" face="Tahoma"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font size="2" face="Tahoma">Boston, MA<br>
Mobile: 617-780-4312</font><br>
</font></font></font></font></div>
</div>
</div>
</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>
</div>
</span></blockquote>
</div>
<br>
<div><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-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; font-size:medium"><span class="Apple-style-span" style="border-collapse:separate; 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; text-indent:0px; text-transform:none; orphans:2; white-space:normal; widows:2; word-spacing:0px">
<div style="word-wrap:break-word"><span class="Apple-style-span" style="border-collapse:separate; 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; text-indent:0px; text-transform:none; orphans:2; white-space:normal; widows:2; word-spacing:0px"><span class="Apple-style-span" style="border-collapse:separate; 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; 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&nbsp;<br>
<br>
</div>
<div><br class="khtml-block-placeholder">
</div>
<br class="Apple-interchange-newline">
</span></span></div>
</span></span><br class="Apple-interchange-newline">
</div>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader" target="_blank"></fieldset> <br>
<pre>_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader" target="_blank"></fieldset> <br>
<pre>_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
</body>
</html>