unsubscribe

PEDRO JOSE MULERO mulero at WISC.EDU
Thu Jun 21 15:39:09 EDT 2007


Please get me out of this list.

If this is not the way to do it, may I ask how to?



----- Original Message -----
From: Arindam Chakraborty <arindam at MET.FSU.EDU>
Date: Tuesday, June 19, 2007 2:30 pm
Subject: Re: "define" values are different.  why?
To: GRADSUSR at LIST.CINECA.IT


>
>
> Dear Users,
>
>     just an add up here, although last few mails including MJ's one
> completely explains why the values are different. I noted that:
>
> (after all previous define commands as MJ):
>
>
>
> ga-> d a(x=30)
>
> Result value = 1010.57
>
> ga-> d a(x=31)
>
> Result value = 1010.45
>
> ga-> d b(x=29)
>
> Result value = 1010.57
>
> ga-> d c(x=29)
>
> Result value = 1010.57
>
>
>
> ga-> d a(x=1)
>
> Result value = 1011.56
>
> ga-> d a(x=145)
>
> Result value = 1011.56
>
> ga-> d a(x=2)
>
> Result value = 1011.69
>
> ga-> d a(x=146)
>
> Result value = 1011.69
>
>
>
> So, reiterating the previous explanations, x is defined for 146 grid
> points (-1.25 to 361.25). Given that somebody does this (although
> setting x from 1 to 144 and defining the variable is probably the best
> way), aren't the results what to be expected? From my personal point of
> view I would like to see that in a bracketed dimension expression
> [e.g., a(x=30)], the value of the variable at the 30th grid point of
> that variable is extracted instead of the 30th grid point of the
> default file. And that's exactly what grads is doing. For that reason,
>
> a(x=31) is same as b(x=30) and so on.
>
>
>
>
>
> regards,
>
>
>
> arindam
>
>
>
> Mary Jo Nath wrote:
>
>
>   Hi,
>
>
>
> I wasn't able to find anything on the board regarding this issue. Maybe
> someone can explain why do I get different values in the script (below)
> for the defined variable "a" & "b" ? ("b" and "c" are the same and
> correct.)  I would expect a = b = c regardless of how I access the
> values of those variables.
>
>
>
> Below is the full script and the results. The data file is attached if
> anyone would like to run the script on their machine . If you get
> different results, please let me know.
>
>
>
> (I'm using Config: v1.9b4 32-bit little-endian on a Linux workstation.
> I get the same results, though, using older versions 1.7beta9 and
> 1.8SL10.)
>
>
>
>  I think this is occurring because of this data's grid, where X=1 is
> longitude 1.25E instead of 0E. By default GrADS maps "set lon 0 360"
> into "X = 0.5 to 144.5", so however "define" works, GrADS returns  the
> proper value for "a" if "set x 30" is done first, but doesn't return
> the expected value if you do
>
> "d a(x=30)". Variables "b" and "c" work because I explicitly "set x 1
> 144" or "set lon 1.25 358.75" (which correspond to X=1 and X=144 ).
>
>
>
> When I ran a similar script using NCEP data which starts at Lon = 0.,
> I
> didn't have this problem.
>
>
>
> Thanks,
>
> Mary Jo
>
>
>
> SCRIPT:
>
>
>
> sdfopen model.slp.nc
>
> set lat 0
>
> q dims
>
> define a=slp
>
> set x 1 144
>
> q dims
>
> define b=slp
>
> set lon 1.25 358.75
>
> q dims
>
> define c=slp
>
> set x 30
>
> d a
>
> d b
>
> d c
>
> d a(x=30)
>
> d b(x=30)
>
> d c(x=30)
>
> d a-b
>
> d a(x=30)-b(x=30)
>
> d a-c
>
> d a(x=30)-c(x=30)
>
> d b-c
>
> d b(x=30)-c(x=30)
>
>
>
>
>
> RESULTS:
>
>
>
>   sdfopen /net2/mjn/model.slp.nc
>
> Scanning self-describing file:  /net2/mjn/model.slp.nc
>
> SDF file /net2/mjn/model.slp.nc is open as file 1
>
> LON set to 0 360
>
> LAT set to -89.4944 89.4944
>
> LEV set to 0 0
>
> Time values set: 1870:1:16:12 1870:1:16:12
>
>   set lat 0
>
> LAT set to 1.01124 1.01124
>
>   q dims
>
> Default file number is: 1
>
> X is varying   Lon = 0 to 360   X = 0.5 to 144.5
>
> Y is fixed     Lat = 1.01124  Y = 46
>
> Z is fixed     Lev = 0  Z = 1
>
> T is fixed     Time = 12Z16JAN1870  T = 1
>
>   define a=slp
>
> Define memory allocation size = 584 bytes
>
>   set x 1 144
>
> LON set to 1.25 358.75
>
>   q dims
>
> Default file number is: 1
>
> X is varying   Lon = 1.25 to 358.75   X = 1 to 144
>
> Y is fixed     Lat = 1.01124  Y = 46
>
> Z is fixed     Lev = 0  Z = 1
>
> T is fixed     Time = 12Z16JAN1870  T = 1
>
>   define b=slp
>
> Define memory allocation size = 576 bytes
>
>   set lon 1.25 358.75
>
> LON set to 1.25 358.75
>
>   q dims
>
> Default file number is: 1
>
> X is varying   Lon = 1.25 to 358.75   X = 1 to 144
>
> Y is fixed     Lat = 1.01124  Y = 46
>
> Z is fixed     Lev = 0  Z = 1
>
> T is fixed     Time = 12Z16JAN1870  T = 1
>
>   define c=slp
>
> Define memory allocation size = 576 bytes
>
>   set x 30
>
> LON set to 73.75 73.75
>
>   d a
>
> Result value = 1010.45
>
>   d b
>
> Result value = 1010.45
>
>   d c
>
> Result value = 1010.45
>
>   d a(x=30)
>
> Result value = 1010.57   <==== ????
>
>   d b(x=30)
>
> Result value = 1010.45
>
>   d c(x=30)
>
> Result value = 1010.45
>
>   d a-b
>
> Result value = 0
>
>   d a(x=30)-b(x=30)
>
> Result value = 0.122498  <==== a != b
>
>   d a-c
>
>   Result value = 0
>
> d a(x=30)-c(x=30)
>
> Result value = 0.122498  <=== a != c
>
>   d b-c
>
> Result value = 0
>
>   d b(x=30)-c(x=30)
>
> Result value = 0
>
> EOF EXECuting test_script
>
>
>
>
>
> --
> ----------------------------
>  ARINDAM CHAKRABORTY
>  Department of Meteorology
>  Florida State University
>  Tallahassee, FL-32306, USA
>  Tel: +001-850-6443524 (Off)
>       +001-850-5758550 (Res)
>  Fax: +001-850-6449642
> ____________________________
>
>
>



More information about the gradsusr mailing list