[gradsusr] Max Function with user defined fields?

Jeff Duda jeffduda319 at gmail.com
Fri May 6 13:48:05 EDT 2016


L.B.,
Set your dimension environment to a time varying span at the time you
define the field. If you're building up the timeseries of fields as you go
(which it sounds like you are), you'll have to create a new 2D field at
each iteration that contains the temporal maximum of the field at all times
leading up to that time. Perhaps the best way to do that is to simply plot
the max between two fields - the current field and the field representing
the max values leading up to the previous hour. Since GrADS doesn't have a
function to do that, you'll have to use a clever combination of const and
maskout to do that. You'll want to verify this for yourself, but your mask
field should probably be the difference field between your current sig tor
values and the previous max values.

Jeff

On Fri, May 6, 2016 at 12:14 PM, L.B. <bcbass2989 at gmail.com> wrote:

> I don't believe so no. How would I go about doing that? That makes more
> sense as to why its not working though. I just do an iteration and jump
> through timesteps and plot the values, so when I define new fields they are
> a fixed time.
>
> *-------*
> William (L.B.) LaForce IV
> Meteorologist
> www.tornadoinsanity.com
>
> On Fri, May 6, 2016 at 12:29 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> L.B.,
>> Is your SigTor parameter defined as a time varying field? If not, then
>> that's why the max() function isn't working the way you want.
>>
>> Jeff
>>
>> On Fri, May 6, 2016 at 11:12 AM, L.B. <bcbass2989 at gmail.com> wrote:
>>
>>> I'm not sure if I have my dimension settings wrong or if the max
>>> function is not capable of calculating the max of user defined fields. Take
>>> for instance the significant tornado parameter:
>>> 'define stp = cterm*ltermA*hterm*stermA'
>>>
>>> To get the max function to work correctly, I cannot just do
>>> max(stp,t=1,t=24), I have to expand out each of the terms in that stp
>>> algorithm down to the actual fields available in the model data such as
>>> CAPEsfc for instance.
>>>
>>> I have a new script that I created that does some if statements and such
>>> that simply cannot be broken down into one single line or their individual
>>> fields from the model data and thus, I cannot get the max function to work.
>>> It only will calculate one timestep.
>>>
>>> I have tried setting t to vary, such as set t 1 24, etc but nothing
>>> works. Is there a way around this, or am I missing something?
>>>
>>> Here is a snippet of the code that I am trying to work with:
>>>
>>> ...
>>>
>>>     if ('hgtprs(z=botzlev)' <= hgt0c)
>>>     'wt=0'
>>>     endif
>>>     if ('hgtdiffZero' > 0 & 'hgtdiffTop' < 0)
>>>     'wt=hgtdiffZero/(HGTtop0C-HGT0C)'
>>>     endif
>>>     if ('hgtdiffTop' >= 0)
>>>     'wt=1'
>>>     endif
>>>     nextZlev = botzlev+1
>>>     'define levDiff = hgtprs(z='nextZlev')-hgtprs(z='botzlev')'
>>>     'hailsum=hailsum+(wt*E*levDiff)'
>>>
>>>     botzlev = botzlev + inc
>>>     endwhile
>>>
>>>   'set gxout shaded'
>>>   'SHI=hailsum*0.1'
>>>   'MEHS=0.1*(2.54*pow(SHI,0.5))'
>>> endif
>>>
>>> 'define hs = max(smth9(MEHS/2.54),t=1,t=24)'
>>>
>>> *-------*
>>> William (L.B.) LaForce IV
>>> Meteorologist
>>> www.tornadoinsanity.com
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>>
>>
>>
>> --
>> Jeff Duda
>> Graduate research assistant
>> University of Oklahoma School of Meteorology
>> Center for Analysis and Prediction of Storms
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160506/72dba0b7/attachment-0001.html 


More information about the gradsusr mailing list