<div dir="ltr">Hello,<div><br></div><div>I am having some issues extracting some time data with my GrADS script. A little more information below:</div><div><br></div><div>I am running a WRF model with 15 minute output. This creates a bit of a hassle when extracting times and dates from various timesteps. For example, timestep numbers 1, 5, 9, 13, 17, 21, 25, etc. are all whole numbered hours (i.e. 12Z, 13Z, 14Z). All other timesteps (2, 3, 4, 6, 7, 8, 10, 11, 12, etc) are intra-hour values such as 1215Z or 1345Z. </div><div><br></div><div>In my sample code below, a random timestep number is chosen and set within the GrADS environment. When 'q time' is ran, the resulting string differ in length because some are simply 06Z30OCT2012 (a whole numbered hour), while others are longer such as 19:45Z28OCT2012. This requires two sets of code to extract the correct times and dates from each string. My code below shows my attempt to solve this issue, but if the timestep satisfies the first condition of the if statement, it still seems to skip over it and use the second conditions method of extracting the values which screws it all up. What exactly am I doing wrong here?</div><div><br></div><div>Hopefully this makes sense. If you need more clarification, please ask.</div><div><br></div><div>Thanks.</div><div><br></div><div><div>'set t 17'</div><div>if (t=1 | t=5 | t=9 | t=13 | t=17 | t=21 | t=25 | t=29 | t=33 | t=37 | t=41 | t=45 | t=49)</div><div> 'q time' </div><div> res = subwrd(result,3)</div><div> btime = substr(res,1,12)</div><div> bhr = substr(btime,1,2)</div><div> bmonth = substr(btime,6,3)</div><div> bday = substr(btime,4,2)</div><div> byr = substr(btime,9,4)</div><div>else</div><div> 'q time'</div><div> res = subwrd(result,3)</div><div> btime = substr(res,1,15)</div><div> bhr = substr(btime,1,5)</div><div> bmonth = substr(btime,9,3)</div><div> bday = substr(btime,7,2)</div><div> byr = substr(btime,12,4)</div><div>endif</div></div><div><br></div><div><div><div class="gmail_signature"><div dir="ltr"><div><b>-------</b></div><b>William (L.B.) LaForce<br></b>Meteorologist<div><a href="http://www.tornadoinsanity.com" target="_blank">www.tornadoinsanity.com</a></div></div></div></div>
</div></div>