Writing out to a file and cdiff

Charles Seman Charles.Seman at NOAA.GOV
Thu Feb 11 17:34:55 EST 2010


Following what Davide Sacchetti sent to the Listserv a number of years 
ago, try something like:

set z 2 nz-1
define dvardz = (var(z+1)-var(z-1))/(lev(z+1)-lev(z-1))

if your "zdef" vertical coordinate is "z"; or else if say pressure is 
your "zdef" vertical coordinate and you have zht(x,y,z) as a GrADS 
variable, then substitute (zht(z+1)-zht(z-1)) for centered vertical 
differences...

Hope this helps,
Chuck

Jeffrey Duda wrote:
> Yeah.  I can't define a product that involves the cdiff command in the 
> z-dimension.  However, for some odd reason, I can display a product 
> using the cdiff command in the z-dimension.  What I mean is, I can't 
> have the following INSIDE a grads script:
>
> 'define dz = cdiff(hght,z)'
>
> However, If I wanted to display something like vertical wind shear, I 
> could do so by typing in the command window:
>
> 'display cdiff(u,z)/cdiff(hght,z)'
>
> and it would display just fine.  I'm not sure why this is.  I'm 
> running version 2.0.a5 though, so maybe it's a problem with the version.
>
> Jeff
>
> On Thu, Feb 11, 2010 at 1:44 PM, J-P Michael <jm08j at fsu.edu 
> <mailto:jm08j at fsu.edu>> wrote:
>
>     Jeff,
>     This may be a foregone conclusion for most but there is some issue
>     with cdiff in z, depending on the version of GrADS you are using.
>     Are you able to cdiff in x and y and failing in the z?
>
>     J-P Michael
>     Florida State University
>
>     ----- Original Message -----
>     From: Jeffrey Duda <jdduda at IASTATE.EDU <mailto:jdduda at IASTATE.EDU>>
>     Date: Tuesday, February 9, 2010 4:55 pm
>     Subject: Writing out to a file and cdiff
>     To: GRADSUSR at LIST.CINECA.IT <mailto:GRADSUSR at LIST.CINECA.IT>
>
>     > I have two questions.
>     >
>     > 1) How do you write data out to a file in text format?  I know
>     > there is an
>     > fwrite command, but I don't really know how it works.
>     >
>     > 2) Can the cdiff command work when three environment dimensions are
>     > varying?  I'm trying to compute EPV, but to do so, I need to do a
>     > cdiffcommand in the x, y, and z dimensions, but I always get an
>     > error and usually
>     > Grads crashes when I do it.
>     >
>     > Jeff Duda
>     >
>     > --
>     > Jeff Duda
>     > Iowa State University
>     > Meteorology Graduate Student
>     > 3134 Agronomy Hall
>     > www.meteor.iastate.edu/~jdduda
>     <http://www.meteor.iastate.edu/%7Ejdduda>
>     >
>
>
>
>
> -- 
> Jeff Duda
> Iowa State University
> Meteorology Graduate Student
> 3134 Agronomy Hall
> www.meteor.iastate.edu/~jdduda <http://www.meteor.iastate.edu/%7Ejdduda>

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not necessarily
reflect any position of the Government or NOAA."



More information about the gradsusr mailing list