# [gradsusr] How do I know which time step in max(xx, t=x, t=y) is actually the max?

Stephen McMillan smcmillan at planalytics.com
Thu Jun 26 11:02:48 EDT 2014

```Robert,
In the example I gave you, the "location" is the time step.  E.g.,
maxloc(temp,t=1,t=6) will return a value between 1 and 6.  So, if the max
temp is at t=3, then the function should return "Result value = 3."
Stephen Mc

On Thu, Jun 26, 2014 at 10:56 AM, Roberto Mera <RMera at ucsusa.org> wrote:

>  Stephen,
>
>  What I need is the actual time, which t (between t=1 and t=6) that has
> the max. I don't need the location, just the time of the max. That way, I
> can use that time to get the appropriate area average for rh.
>
>  Robert
>  ------------------------------
> behalf of Stephen McMillan [smcmillan at planalytics.com]
> *Sent:* Thursday, June 26, 2014 10:50 AM
> *Subject:* Re: [gradsusr] How do I know which time step in max(xx, t=x,
> t=y) is actually the max?
>
>   Robert,
> Use the function maxloc, e.g., maxloc(temp,t=1,t=6).  If lat and lon are
> fixed, it should return a single value with the time step.  If lat and lon
> are not fixed, it should return a spatial map with the max temp time step
> at each grid point.
>
>  Documentation in GrADS Index, but has no examples.
>
>  Stephen McMillan
>
>
> On Thu, Jun 26, 2014 at 10:20 AM, Roberto Mera <RMera at ucsusa.org> wrote:
>
>>  All,
>>
>>  I'm trying to figure out a way to output the maximum temperature and RH
>> in a 5-day period for a month in a superensemble.
>>
>>  I can get the max to write out using this function:
>>
>>  count = 1
>> while (count < 18)
>> 'set e 'count
>>
>>  'd areal'
>> areal=subwrd(result,4)
>>  say areal
>> if (rc != 0) ; break ; endif
>> count = count +1
>> endwhile
>>
>>
>>  However, if I also want the CONCURRENT RH, then I have to know which
>> time step was the max for the temperature. Otherwise it might be a
>> different time step if I do max(rh,t=1,t=6).
>>
>>  Is there a way to query which t in the max(temp,t=1,t=6) is the actual
>> max? i.e. timestep 3. This way I can put it in a new script and get the
>> appropriate rh.
>>
>>  Robert
>>
>> _______________________________________________
>>
>>
>  ***************************************************
> The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary.
>
> If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
> ***************************************************
>
>
>
> _______________________________________________
>
>

***************************************************
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary.

If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
***************************************************
-------------- next part --------------
An HTML attachment was scrubbed...