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

Roberto Mera RMera at ucsusa.org
Thu Jun 26 10:56:08 EDT 2014

```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
________________________________
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<mailto: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.
***************************************************

-------------- next part --------------
An HTML attachment was scrubbed...