[gradsusr] Proble with max function in a script

Martin V. Mathew vmartinmathew at gmail.com
Tue Oct 22 06:11:37 EDT 2013


Hello Juan

I had also faced similar problem earlier. The method I used to workaround
the problem was to use intrinsic function subwrd as follows

'set gxout print'
'mmax=max(max('var', lat=-15, lat=20), lon=-90, lon=0)'
'mmin=min(min('var', lat=-15, lat=20), lon=-90, lon=0)'

'd mmax'
mmax1=subwrd(result,10)

'd mmin'
mmin1=subwrd(result,10)


Regards
Martin


On 22 October 2013 12:06, Amulya Chevuturi <amulya.chevuturi at gmail.com>wrote:

> Dear User,
>
> I have tried your command lines with a gridded dataset I have. These
> command lines are running fine. I am getting and proper numeric value
> output. Please check your dataset extent. Or I would suggest work the same
> script with another gridded dataset, then maybe you can figure out the
> problem. Or explain the problem in greater detail on gradsuser.
>
> Regards
> Amulya
>
>
> On Tue, Oct 22, 2013 at 2:32 AM, juan pablo sierra perez <
> elviejojuanpi at hotmail.com> wrote:
>
>> Hello
>>
>> I am writing a script and I want to extract the maximum value of a
>> variable and save it like a single number in a single variable
>> the code is showed below:
>>
>> 'mmax=max(max('var', lat=-15, lat=20), lon=-90, lon=0)'
>> 'mmin=min(min('var', lat=-15, lat=20), lon=-90, lon=0)'
>> dif=mmax-mmin
>>
>> the "dif" variable have an error, it says: Non numeric  args ti numeric
>> operation
>>
>> I have tried defining the variables mmax and mmin but it doesnt work,
>> what can I do?
>>
>> Than you very much in advance
>>
>> Juan
>>
>> _______________________________________________
>> 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
>
>


-- 
Martin V. Mathew
Research scholar
Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)
IIT Kharagpur
India.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20131022/8ab47eaf/attachment.html 


More information about the gradsusr mailing list