[gradsusr] Help on Areal average using Grads
Anil Kumar
anilku at oceanmanager.com
Mon Jun 23 10:32:43 EDT 2014
Dear Jennifer,
Referencing your below reply, Am trying to use amax() with linear interpolation to the same problem (need area maximum now) But am not getting the maximum values in destination grid. I have gone throu’ the documentation http://www.iges.org/grads/gadoc/gradfunclterp.html but am not getting any clue that we can use amax() function with the ltrep. But when I use it not getting the maximum value’s plot in grads. Below is the command used and CTL file.
reinit
sdfopen D:/WeatherGribFiles/2014/06/11/rtofs_glo_2ds_f024_daily_prog.nc
open D:/WeatherGribFiles/2014/06/11/rtofs_glo_2ds_f024_daily_prog2.ctl
set parea 0 11 0 8.5
set vpage 0 11 0 8.5
set lon -74.16 434
set lat -90 90
set cthick 6
set arrscl 0.10
d lterp(u_velocity.1*1.95,lat.2,amax);lterp(v_velocity.1*1.95,lat.2,amax)
CTL file :
dset D:\WeatherGribFiles\2014\06\22\rtofs_glo_2ds_f024_daily_prog.nc
index D:\WeatherGribFiles\2014\06\22\rtofs_glo_2ds_f024_daily_prog_DUMMY.nc
title 2D Sfc Daily Prognostic 00Z22jun2014: Forecast, downloaded Jun 22 15:20 UTC
undef 1.26765e+30
dtype netcdf
xdef 180 linear 74.16 2.0
ydef 67 linear -90 3.0
zdef 1 linear 1 1
tdef 1 linear 00Z23JUN2014 1mn
options template
vars 2
u_velocity=>u_velocity 1 t,z,y,x eastward_sea_water_velocity (m/s)
v_velocity=>v_velocity 1 t,z,y,x northward_sea_water_velocity (m/s)
endvars
As I change the X def, ydef entries for the dummy destination grid size, value changes but I expect it to be max every time. Please lead me.
Thanks & Regards
Anil Kumar
OceanManager Inc.
From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Jennifer Adams
Sent: Thursday, May 01, 2014 9:09 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] Help on Areal average using Grads
Hi, Anil --
You need to create a new descriptor file that describes a grid you would like to be your 'destination grid'; presumably it would have grid points that correspond to every 8th grid point in your original grid. It can be a dummy descriptor -- use 'dset ^foo.dat' and 'options template' so GrADS won't care if foo.dat doesn't exist. Open both descriptors, then use lterp to regrid using the aave method:
'd lterp(u.1,lat.2,aave); lterp(v.1,lat.2,aave)'
--Jennifer
On May 1, 2014, at 9:58 AM, Anil Kumar wrote:
Hi Grad Users,
I have NetCDF file having Ocean Current Data (attached for reference). Am using below command to display u_velocity and v_velocity and generating vector plot using SKIP() function from Grads.
reinit
sdfopen D:/rtofs_glo_2ds_f024_daily_prog.nc <http://rtofs_glo_2ds_f024_daily_prog.nc/>
set vpage 0 11 0 8.5
set parea 0 11 0 8.5
set lon 74 434
set lat -70 70
set mproj latlon
set display color white
set datawarn off
set grads off
set timelab off
set xlab off
set ylab off
set frame off
set t 1
set cint 40
set display color white
set background 0
set gxout vector
set cthick 6
set ccolor 1
d skip(u_velocity*1.95,8,8);skip(v_velocity*1.95,8,8)
printim D:\output.png x1061 y587 -t 0
output is attached and unfortunately this is not what i need exactly. It is just plotting every 8th point. I want to plot areal average of every 8 points and want exactly the same plot.
<image001.png>
NetCDF file has 4320 LON points and 2160 LAT points. The “display” command is powerful enough to iterate along the longitude and latitude. But aave() <http://www.iges.org/grads/gadoc/gradfuncaave.html> function needs fixed X and Y dimensions, no STRIDE option for X and Y.
How can I achieve this using Grads??? Ultimately I need global vector output.
Please help me on this. Thanks in advance.
-Anil Kumar
<rtofs_glo_2ds_f024_daily_prog.nc><output.png>_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140623/6135e9c6/attachment-0001.html
More information about the gradsusr
mailing list