<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;">Jim!<br>
<br>
I moved 'q time' and 'q dims" below where the open .ctl file line is and it worked!<br>
<br>
That totally makes sense now! I was trying to call the date before the file was even opened. So it was trying to call information that hadn't yet been opened.<br>
<br>
Simple errors...<br>
<br>
Thank you again so much for helping me with this little speed bump!<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 face="Tahoma" size="2"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma" size="2">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 style="direction: ltr;" id="divRpF618576"><font color="#000000" face="Tahoma" size="2"><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 8:09 PM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] "No Files Open" When Running In Batch Mode<br>
</font><br>
</div>
<div></div>
<div><br>
Also, it's not really clear in your function what the "args" are directly following 'q time'. Typically you open the file first,
<br>
then can "q time". It appears in your script that you don't have an open file, so I think 'q time' will return "No Files Open".<br>
Second, the output from 'q time' is written to 'result' (like you have for 'q dims'). So, try move the entire block from<br>
'q time' to just above the line 'path 1...' to after you open a file and define the time/lat/lon.<br>
<br>
It might be the case that the "date" part is working (you get the right file open) but the time is not read correctly from<br>
that file. <br>
<br>
Jim<br>
<br>
<div class="moz-cite-prefix">On 12/26/13 2:35 PM, Perry, Aaron @ LSC wrote:<br>
</div>
<blockquote type="cite">
<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 +%Y%m%d`<br>
<br>
grads -clb "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 "No Files Open" 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 face="Tahoma" size="2"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma" size="2">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 color="#000000" face="Tahoma" size="2"><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 6:11 PM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] "No Files Open" When Running In Batch Mode<br>
</font><br>
</div>
<div>Hi Aaron:<br>
<br>
Just to be clear, in your script the line '!date +.....' will create a single line file with the date as the single line, e.g., 20131226. 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). 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 "date" command redirect. On most operating systems a ">>" (double) will append to an existing file, and a
<br>
">!" will overwrite the file. The single ">" is different on different systems, on some it overwrites and on others it appends. So, ideally I think<br>
you want a ">!" since a ">>" will append to a file, but you are always reading the same line (hope that makes sense). 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. So, I think what you really want is:<br>
<br>
'!date +"%Y%m%d" >! /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 >! is apparently not allowed in the Grads script (I think the ! means to escape from grads for a system command). So,<br>
if you can confirm that a single ">" will overwrite a file, and change the sublin(d,2) to sublin(d,1) you are probably ok:<br>
<br>
'!date +'%Y%m%d' > /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 " " around !date +%Y%m%d seemed to help and so did doing just one ">" but, when I tried changing >> to >!, I kept getting this error message "date: extra operand `/home/muaddib/grads/date/date.formatted' Try `date --help` for more information" and
then it goes back to the usual "No Files Open No files open" 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 "YMD=`date +%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 "run ${HOMEDIR}${PATH3}500GPH_${FHR0}.gs"</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 face="Tahoma" size="2"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma" size="2">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 color="#000000" face="Tahoma" size="2"><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] "No Files Open" When Running In Batch Mode<br>
</font><br>
</div>
<div>Aaron:<br>
<br>
I think the problem is with the "date" command. You can test this with<br>
specifying the date (replace the top lines with a constant date). If this<br>
is indeed the case, some suggestions:<br>
<br>
1. Try with double quotes around the arguments to date, e.g.,<br>
<br>
'!date +"%Y%m%d" >> /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 "Ymd".<br>
<br>
2. Is it possible you have two different "date" commands? 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. The >> 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. Have you tried >! 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-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}BODY {scrollbar-base-color:undefined;scrollbar-highlight-color:undefined;scrollbar-darkshadow-color:undefined;scrollbar-track-color:undefined;scrollbar-arrow-color:undefined}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 face="Tahoma" size="2"><font size="2"><br>
Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma" size="2">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 color="#000000" face="Tahoma" size="2"><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] "No Files Open" 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 "No Files Open" pops up every time that I run GrADS in Batch Mode (grads -clb).<span class="Apple-converted-space"> </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' , "No Files Open" 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 face="Tahoma" size="2"><font size="2">Onward and Upward,<br>
<br>
</font>Aaron Perry<br>
</font><font size="3"><font size="3"><font face="Tahoma" size="2">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 <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>
<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>
</body>
</html>