[gradsusr] Max field over multiple files

Semyon Grodsky senya at umd.edu
Wed May 16 10:35:48 EDT 2018


Hi Tracey,

for me, the attached function does the job. For multiple fields, a cycle 
will be required.

--Senya


On 5/16/2018 9:32 AM, Tracey Dorian wrote:
> Good morning,
>
> Does anybody know if there is a way in GrADS to find the max or min 
> value over multiple control files?  For example, if I wanted to find 
> the maximum temperature between file1.ctl, file2.ctl, file3.ctl, and 
> file4.ctl?
>
> I imagine it would be something like this, but I don't think GrADS 
> supports this:
>
> d max(temp, file1.ctl, file2.ctl, file3.ctl, file4.ctl)
>
> Thanks in advance for any assistance,
> Tracey
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 
-----------------------------------------------
Semyon Grodsky
University of Maryland
Department of Atmospheric and Oceanic Science
Room 2409, Atlantic Building (224)
4254 Stadium Dr.
College Park, MD 20742

Phone:  301-405-5330
Fax:    301-314-9482
E-mail: senya at atmos.umd.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180516/bb8717ef/attachment.html>
-------------- next part --------------
function max_xy(args)
if args=''
say 'USAGE max_xy x y varout'
return
endif

if subwrd(args,3)=''
varout='maxxy'
else
varout = subwrd(args,3)
endif

varout'=('subwrd(args,1)'+'subwrd(args,2)'+abs('subwrd(args,1)'-'subwrd(args,2)'))/2'



More information about the gradsusr mailing list