[gradsusr] Problem in loading variables in different files.

James T. Potemra jimp at hawaii.edu
Wed Jan 26 13:08:15 EST 2011


Henry:

I think you will need to specify the z-level explicitly in each block 
(right now you just specify x,y,t), e.g.,
...
'set t 1 753'
'set z 1'
...
for each variable.

Jim

Hang wrote:
> Hi,
>  
> I want to do some calculations using the values in different files but 
> an error message was shown :
>  
> /Data Request Error: Invalid grid coordinates
>   World coordinates convert to non-integer  grid coordinates
>     Variable = vwnd10m  Dimension = 1
> Operation Error:  Error from ave function
>   Error ocurred at column 32
> DEFINE error:  Invalid expression./
>  
> _The following are the main components of my script:_
>  
>  
> /'sdfopen /home2/h08hang/redata/uwnd10m.mon.mean.nc'
> 'set lat -90 90'
> 'set lon 0 360'
> 'set t 1 753'
> 'define uwnd10m=uwnd'
> 'close 1'/
> // 
> /'sdfopen /home2/h08hang/redata/vwnd10m.mon.mean.nc'
> 'set lat -90 90'
> 'set lon 0 360'
> 'set t 1 753'
> 'define vwnd10m=vwnd'
> 'close 1'/
> // 
> /'sdfopen /home2/h08hang/redata/shum2m.mon.mean.nc'
> 'set lat -90 90'
> 'set lon 0 360'
> 'set t 1 753'
> 'define shum2m=shum'
> 'close 1'/
>
> /'sdfopen /home2/h08hang/redata/uwnd.mon.mean.nc'/
>
> /'sdfopen /home2/h08hang/redata/vwnd.mon.mean.nc'/
> // 
> /'sdfopen /home2/h08hang/redata/shum.mon.mean.nc'/
> // 
> /..../
> /   /
> /   lon1=112.5
>    lon2=115
>    lat1=22.5
>    lat2=25/
> // 
> /   'set lat 'lat1' 'lat2
>    'set lon 'lon1
>    'set t 'time
>    'set lev 'level1/
> // 
> */   'define 
> wind=(ave(uwnd.1,lat='lat1',lat='lat2')+ave(uwnd10m,lat='lat1',lat='lat2'))/2'/*
>  
>  
>  
>  
>  
> For the first three files I opened (uwnd10m,vwnd10m,shum2m), the 
> variables are uwnd,vwnd and shum respectively.  I define three new 
> variables to store them as their varable name crash with the next 
> three file I am going to open. I close the each file after I have 
> defined the new variables (for the first three files)
>  
> For the next three files I opened,* *they have a *different Grids* as 
> shown below.* Is this the reason why I cannot run my script, or 
> something else?*
> *But what I want is to use the values from different files (those with 
> different Grids to do my calculation)  How can I solve this? *
>  
> Can anyone give me some help? Thanks a lot (and sorry for the lengthy 
> question)
>  
>  
> File 1 : NCEP Reanalysis monthly ltm surface pressure
>   Descriptor: /home2/h08hang/redata/pres.mon.mean.nc
>   Binary: /home2/h08hang/redata/pres.mon.mean.nc
>   Type = Gridded
> *  Xsize = 144  Ysize = 73  Zsize = 1  Tsize = 756  Esize = 1
> *  Number of Variables = 1
>     pres 0 -103 Monthly Mean of Surface Pressure
> File 2 : monthly mean u wind
>   Descriptor: /home2/h08hang/redata/uwnd10m.mon.mean.nc
>   Binary: /home2/h08hang/redata/uwnd10m.mon.mean.nc
>   Type = Gridded
> *  Xsize = 192  Ysize = 94  Zsize = 1  Tsize = 756  Esize = 1
> *  Number of Variables = 1
>     uwnd 0 -103 Monthly Mean of U-Wind
> File 3 : monthly mean u wind
>   Descriptor: /home2/h08hang/redata/vwnd10m.mon.mean.nc
>   Binary: /home2/h08hang/redata/vwnd10m.mon.mean.nc
>   Type = Gridded
> *  Xsize = 192  Ysize = 94  Zsize = 1  Tsize = 756  Esize = 1
> *  Number of Variables = 1
>     vwnd 0 -103 Monthly Mean V wind at 10 m
>  
> File 4 : monthly mean u wind from the NCEP Reanalysis
>   Descriptor: /home2/h08hang/redata/uwnd.mon.mean.nc
>   Binary: /home2/h08hang/redata/uwnd.mon.mean.nc
>   Type = Gridded
> *  Xsize = 144  Ysize = 73  Zsize = 17  Tsize = 751  Esize = 1
> *  Number of Variables = 1
>     uwnd 17 -103 Monthly mean u wind
> File 5 : monthly mean v wind from the NCEP Reanalysis
>   Descriptor: /home2/h08hang/redata/vwnd.mon.mean.nc
>   Binary: /home2/h08hang/redata/vwnd.mon.mean.nc
>   Type = Gridded
> *  Xsize = 144  Ysize = 73  Zsize = 17  Tsize = 751  Esize = 1
> *  Number of Variables = 1
>     vwnd 17 -103 Monthly mean v wind
> File 6 : 4x daily NMC reanalysis
>   Descriptor: /home2/h08hang/redata/shum.mon.mean.nc
>   Binary: /home2/h08hang/redata/shum.mon.mean.nc
>   Type = Gridded
> *  Xsize = 144  Ysize = 73  Zsize = 8  Tsize = 752  Esize = 1
> *  Number of Variables = 1
>     shum 8 -103 Monthly Mean of Specific Humidity
>  
> Best,
> Henry
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>   



More information about the gradsusr mailing list