<div dir="ltr">Yea I think I just realized why I can&#39;t see that solution working, sadly, because it looks so much nicer but I&#39;ve used it just trying to do tmp2m and I can see how it&#39;s working. So, I&#39;m ultimately working on a dynamic ratio for snowaccum. Now, I have exact working code but it uses IF blocks, but for each t I&#39;m pulling multiple columns of air temp. I&#39;m then running a calculation to come up with the ratio. I&#39;m then taking weasdsfc and multiplying it by that number so it looks like so:<div><br></div><div>&#39;set t &#39;%trecord - For the sake of it just know every frame trecord increments by 1</div><div>&#39;define column1 = var1-273.15&#39;</div><div>&#39;define column2 = var2-273.15&#39;</div><div>&#39;define column3 = var3-273.15&#39;</div><div>&#39;define column4 = var4-273.15&#39;</div><div><br></div><div>&#39;define ratiocalc = 100/(50-((column1 + column2 + column3 + column4)/2)*10)&#39;</div><div><br></div><div>&#39;define snow = const((sum(maskout(weasdsfc-weasdsfc(t-1),weasdsfc-weasdsfc(t-1)),t=2,t=2)*0.0393701), 0, -u)&#39;</div><div><br></div><div>&#39;d snow * ratiocalc&#39;</div><div><br></div><div>Now that plots t2 great, paying close attention to what I&#39;m doing in the sum dim2. t3&#39;s would be t=3,t=3 because what it was doing on me with t=2,t=3 it was taking the weasdsfc from 2 and 3 and applying that to t3&#39;s ratio of course. t4&#39;s would have been t=2,t=4 and doing it against t4&#39;s ratio, etc. The only way I knew how to get around that is that each frame needs to calculate the snowdepth of t2 (using the air from t2 and the weasdsfc from t2) with obviously the snowdepth of t3 (using the air from t3 and weasdsfc from 3). t4 would need to draw the snowdepth of t2 (using data from t2) with t3 (using data from t3) and then t4, using the data from t4. And I would eventually (on t40 for example) end up with:</div><div><br></div><div>&#39;d snow02+snow03+snow04+snow05...+snow39+snow40&#39;</div><div><br></div><div>I don&#39;t know if that makes sense but think of it as a &quot;layer&quot; per se. Hence why I said each t would have a unique value. So snowfall, in inches, using that ratiocalc var you would have:</div><div><br></div><div>t2 = 2 inches</div><div>t3 = 4.2 inches + t2&#39;s 2 inches</div><div>t4 = 8.9 inches + t3&#39;s 4.2 inches + t2&#39;s 2 inches</div><div><br></div><div><br></div><div>Lastly, I was more concerned, than anything, with grads dying out from the (8mb? internal memory allocation) since each t the calcuation become more and more. Speaking of that, is it common to have grads die when trying to plot a grid at 0.25? It seems like almost all grids I have to re(var, .50) at a minimum, some var&#39;s I have to go re(var, 2.0) and it&#39;s definitely not the machine we&#39;re on as we have 64gb of ram available on this test machine.</div><div><br></div><div>I sincerely appreciate the time you guys have taken to reply to this question so far.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 20, 2015 at 8:04 PM, James T. Potemra <span dir="ltr">&lt;<a href="mailto:jimp@hawaii.edu" target="_blank">jimp@hawaii.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    This should produce a variable &quot;t2mtotal&quot; that is equal to the sum
    of all previous and current values (not including the value at the
    first time step).  It will only be defined for t=2, 3 and 4 (not
    t=1, and not t= something greater than four), but you can change
    this in the &quot;set t 2 4&quot; line.<span class=""><br>
    <br>
    &#39;set dfile 1&#39;<br>
    <br>
    &#39;set tonsofoptions&#39;<br>
    &#39;set tonsofoptions1&#39;<br>
    &#39;set tonsofoptions2&#39;<br>
    <br></span>
    &#39;set t 2 4&#39;<br>
    &#39;define t2mtotal = sum ( tmp2m-273.15, t=2, t+0 )&#39;<br>
    &#39;d t2mtotal&#39;<span class=""><br>
    <br>
    &#39;set string 1 tl 0 0&#39;<br>
    &#39;set strsiz 0.13&#39;<br>
    &#39;draw string 0.4 8.35 Sample String&#39;<br>
    <br>
    </span><div><div class="h5"><div>On 10/20/15 1:53 PM, Christopher Gilroy
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hey Jeff (and Jim),
        <div><br>
        </div>
        <div>Thanks for the replies!</div>
        <div><br>
        </div>
        <div>I download and process all plots one at a time because I
          download them in real-time, as they become available. Not all
          files are available at the same time, unless ftpprd&#39;s NOMADS
          server is slow to replicate the data, heh. Everything works
          great having something (again simple, but still the majority
          jist of the code) like this:</div>
        <div><br>
        </div>
        <div>
          <div>&#39;open /gfsmodeldata/gfs.ctl&#39;</div>
          <div>&#39;set dfile 1&#39;</div>
        </div>
        <div><br>
        </div>
        <div>&#39;set tonsofoptions&#39;</div>
        <div>&#39;set tonsofoptions1&#39;<br>
        </div>
        <div>&#39;set tonsofoptions2&#39;<br>
        </div>
        <div><br>
        </div>
        <div>
          <div style="font-size:12.8px">if (t=2)<br>
          </div>
          <div style="font-size:12.8px">
            <div>&#39;set t 2&#39;<br>
            </div>
            <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
            </div>
            <div><br>
            </div>
            <div>&#39;define t2mtotal= t2m06&#39; <br>
            </div>
            <div>&#39;d t2mtotal&#39;<br>
            </div>
            <div>endif</div>
            <div><br>
            </div>
            <div>if (t=3)</div>
            <div>
              <div>&#39;set t 2&#39;<br>
              </div>
              <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
              </div>
              <div><br>
              </div>
            </div>
            <div>&#39;set t 3&#39;</div>
            <div>&#39;define t2m12 = tmp2m-273.15&#39;</div>
            <div><br>
            </div>
            <div>&#39;define t2mtotal= t2m06+t2m12&#39; <br>
            </div>
            <div>&#39;d t2mtotal&#39;<br>
            </div>
            <div>endif</div>
          </div>
          <div style="font-size:12.8px"><br>
          </div>
          <div>
            <div style="font-size:12.8px">if (t=4)</div>
            <div style="font-size:12.8px">
              <div>&#39;set t 2&#39;<br>
              </div>
              <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
              </div>
              <div><br>
              </div>
            </div>
            <div style="font-size:12.8px">&#39;set t 3&#39;</div>
            <div style="font-size:12.8px">&#39;define t2m12 = tmp2m-273.15&#39;</div>
            <div style="font-size:12.8px"><br>
            </div>
            <div style="font-size:12.8px">
              <div>&#39;set t 4&#39;</div>
              <div>&#39;define t2m18 = tmp2m-273.15&#39;</div>
            </div>
            <div style="font-size:12.8px"><br>
            </div>
            <div style="font-size:12.8px">&#39;define t2mtotal=
              t2m06+t2m12+t2m18&#39; <br>
            </div>
            <div style="font-size:12.8px">&#39;d t2mtotal&#39;<br>
            </div>
            <div style="font-size:12.8px">endif</div>
            <div style="font-size:12.8px"><br>
            </div>
            <div>
              <div><span style="font-size:12.8px">&#39;set string 1
                  tl 0 0&#39;</span></div>
              <div><span style="font-size:12.8px">&#39;set strsiz
                  0.13&#39;</span></div>
              <div><span style="font-size:12.8px">&#39;draw string
                  0.4 8.35 Sample String&#39;</span></div>
              <div><span style="font-size:12.8px"><br>
                </span></div>
              <div><span style="font-size:12.8px"><br>
                </span></div>
              <div><span style="font-size:12.8px">But as I said
                  I was just curious if there was an easier way than
                  having to have a huge IF block to do it. I&#39;m going to
                  play with Jims example since that may very well work
                  after I play with it.</span></div>
              <div><span style="font-size:12.8px"><br>
                </span></div>
            </div>
          </div>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Oct 20, 2015 at 7:28 PM, Jeff
          Duda <span dir="ltr">&lt;<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>If you&#39;re trying to process the files one-by-one
                  (and I&#39;m assuming each file represents only one time
                  step), then I don&#39;t see a simple way of integrating
                  over time as you desire. Is there a specific reason
                  you are not doing a batch download (of all the files
                  first)? Also, if you really are going to do this
                  sequentially, I would think you&#39;d have to include the
                  shell command prompt (!) in your script so that you
                  could create a control file and open it as you go
                  through the times. I didn&#39;t see that in your code
                  example.<br>
                  <br>
                </div>
                Basically, what I&#39;m trying to say is, coding wise, it
                would be much easier if you just downloaded all the
                files first, then processed them all at once. If you
                absolutely must process the files sequentially, I think
                you&#39;re going to be stuck hard coding each and every
                step.<br>
                <br>
              </div>
              Jeff Duda<br>
            </div>
            <div class="gmail_extra">
              <div>
                <div><br>
                  <div class="gmail_quote">On Tue, Oct 20, 2015 at 2:24
                    PM, James T. Potemra <span dir="ltr">&lt;<a href="mailto:jimp@hawaii.edu" target="_blank"></a><a href="mailto:jimp@hawaii.edu" target="_blank">jimp@hawaii.edu</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                      <div bgcolor="#FFFFFF" text="#000000">
                        Christopher,<br>
                        <br>
                        How about this, e.g., for the first 10 time
                        steps:<br>
                        <br>
                        &#39;set t 1 10&#39;<br>
                        &#39;define t2mtotal = sum ( tmp2m-273.15, t=1, t+0
                        )&#39;<br>
                        &#39;d t2mtotal&#39;<br>
                        <br>
                        Jim
                        <div>
                          <div><br>
                            <br>
                            <div>On 10/20/15 3:42 AM, Christopher Gilroy
                              wrote:<br>
                            </div>
                          </div>
                        </div>
                        <blockquote type="cite">
                          <div>
                            <div>
                              <div dir="ltr">Ok, so I know I can
                                &#39;easily&#39; do this via a massive if block
                                but I&#39;m trying to avoid that, and I have
                                been. I have a calculation that will
                                return a unique value depending on which
                                t it&#39;s running on.
                                <div><br>
                                </div>
                                <div>So when I get to t=10 I need to run
                                  a calculation on data contained in
                                  t=1, t=2, t=3, etc. t=20 would need to
                                  run the calculation t=1, t=2, t=3, etc
                                  up to t=20. The actual value of of
                                  each t would be the same for the
                                  entire run if that helps to understand
                                  though.</div>
                                <div><br>
                                </div>
                                <div>So take this horrible example:</div>
                                <div><br>
                                </div>
                                <div>&#39;define t2m = tmp2m-273.15&#39;<br>
                                </div>
                                <div>&#39;d t2m+allpreviousforecasthourt2ms&#39;</div>
                                <div><br>
                                </div>
                                <div>Now, the other key is that I don&#39;t
                                  download all files and then run in one
                                  big loop. I download each file
                                  one-by-one and process one-by-one, in
                                  real-time, as they are released.</div>
                                <div><br>
                                </div>
                                <div>A real snippet of how I&#39;m currently
                                  achieving this would look like:</div>
                                <div><br>
                                </div>
                                <div>if (t=2)<br>
                                </div>
                                <div>
                                  <div>&#39;set t 2&#39;<br>
                                  </div>
                                  <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>&#39;define t2mtotal= t2m06&#39; <br>
                                  </div>
                                  <div>&#39;d t2mtotal&#39;<br>
                                  </div>
                                  <div>endif</div>
                                  <div><br>
                                  </div>
                                  <div>if (t=3)</div>
                                  <div>
                                    <div>&#39;set t 2&#39;<br>
                                    </div>
                                    <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
                                    </div>
                                    <div><br>
                                    </div>
                                  </div>
                                  <div>&#39;set t 3&#39;</div>
                                  <div>&#39;define t2m12 = tmp2m-273.15&#39;</div>
                                  <div><br>
                                  </div>
                                  <div>&#39;define t2mtotal= t2m06+t2m12&#39; <br>
                                  </div>
                                  <div>&#39;d t2mtotal&#39;<br>
                                  </div>
                                  <div>endif</div>
                                </div>
                                <div><br>
                                </div>
                                <div>
                                  <div>if (t=4)</div>
                                  <div>
                                    <div>&#39;set t 2&#39;<br>
                                    </div>
                                    <div>&#39;define t2m06 = tmp2m-273.15&#39;<br>
                                    </div>
                                    <div><br>
                                    </div>
                                  </div>
                                  <div>&#39;set t 3&#39;</div>
                                  <div>&#39;define t2m12 = tmp2m-273.15&#39;</div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div>&#39;set t 4&#39;</div>
                                    <div>&#39;define t2m18 = tmp2m-273.15&#39;</div>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>&#39;define t2mtotal=
                                    t2m06+t2m12+t2m18&#39; <br>
                                  </div>
                                  <div>&#39;d t2mtotal&#39;<br>
                                  </div>
                                  <div>endif</div>
                                </div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div>So, whether t2m06 is ran during
                                  hour 06, 12, 18, 240, etc t2m06 is
                                  going to be the exact same value. As
                                  you can see, the if blocks get
                                  exponentially bigger each t and that&#39;s
                                  what concerns me in terms of grads
                                  memory limits or if there&#39;s simply a
                                  better/faster approach.</div>
                                <div> </div>
                              </div>
                              <br>
                              <fieldset></fieldset>
                              <br>
                            </div>
                          </div>
                          <pre>_______________________________________________
gradsusr mailing list
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
                        </blockquote>
                        <br>
                      </div>
                      <br>
                      _______________________________________________<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <br>
                </div>
              </div>
              <span><font color="#888888">-- <br>
                  <div>Jeff Duda<br>
                    Graduate research assistant<br>
                    University of Oklahoma School of Meteorology<br>
                    Center for Analysis and Prediction of Storms<br>
                  </div>
                </font></span></div>
            <br>
            _______________________________________________<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div>-Chris A. Gilroy</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
gradsusr mailing list
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
    </blockquote>
    <br>
  </div></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></div>