[gradsusr] Find positions a value of variable

Zablone Owiti zablonowiti at yahoo.com
Sun Feb 13 23:01:12 EST 2011


Hi Laura,
Try the following commands that uses the maxloc function: 

'd maxloc(max(hgt, lon=-40, lon=10), lat=-50, lat=0)'  for latitude of maximum value and

'd maxloc(max(hgt, lat=-20, lat=40), lon=-40, lon=10)' for longitude of maximum value


===================================================
ZABLONE OWITI
GRADUATE STUDENT
Nanjing University of Information, Science and Technology
College of Atmospheric Science
Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China
Tel: +86-25-58731402
Fax: +86-25-58731456
Mob. 15077895632
Website: www.nuist.edu.cn
====================================================
"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."
 



From: Maria Laura Cariaga <laura.cariaga at gmail.com>
To: gradsusr at gradsusr.org
Cc: 
Sent: Monday, 14 February 2011 3:57 AM
Subject: [gradsusr] Find positions a value of variable


Hi!
I'm trying to make a program do the following:
I read a file from the reanalysis (NetCDF)
I have monthly average data, 52, single variable, at a fixed level.
I want to search on a domain, the maximum value of that variable, and also the value of the latitudinal and longitudinal position of the maximum.
Find the maximum value is not a problem. The problem is to find positions.
Could you help me? I can not find the solution ... : (

The script that I created is:
----------------------------------------------------------------------------------------------------------
'reinit'

'sdfopen ene61dic10.nc'

'set lev 1000'
'set lat -50 0'
'set lon -40 10'
'q time'
                     

t=1
while (t<601)
'set t 't
'set gxout print'
'd max(max(hgt,lon=-40,lon=10),lat=-50,lat=0)' 
ret=result
res=write('salida_aas.txt',ret) 

t = t + 1
endwhile
-------------------------------------------------------------------------------------------------------------

Best regards,
Maria Laura Cariaga

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110213/9e12fac2/attachment-0003.html 


More information about the gradsusr mailing list