[gradsusr] tcorr error: invalid grid coordinates

Mira Losic mlosic at envsci.rutgers.edu
Tue Nov 16 17:45:23 EST 2010


Hi Eric,

Thanks for the response!  Your suggestion works perfectly when comparing
two WRF files, but when I try and do the same where one file is station
data and one is the WRF time series I get the following:

open RUN3_StationVars.ctl
Scanning description file:  RUN3_StationVars.ctl
Data file RUN3_StationVars.nc is open as file 1
LON set to -116.1 -34.1464
LAT set to 55.9 78.7109
LEV set to 1 1
Time values set: 1981:7:1:6 1981:7:1:6
Notice: Implied interpolation for file RUN3_StationVars.ctl
 Interpolation will be performed on any data displayed from this file
set display color white
set lat 68.47
LAT set to 68.4613 68.4613
set lon -66.82
LON set to -66.8144 -66.8144
set t 1 123
Time values set: 1981:7:1:6 1981:7:31:18
define test2=T2-273.15
Notice:  Automatic Grid Interpolation Taking Place
Define memory allocation size = 492 bytes
close 1
File 1 has been closed
d test2

open CapeHooper.ctl
Scanning description file:  CapeHooper.ctl
Data file CapeHooper.dat is open as file 1
LON set to 0 360
LAT set to -90 90
LEV set to 500 500
Time values set: 1981:7:1:0 1981:7:1:0
set display color white
set t 1 123
Time values set: 1981:7:1:0 1981:7:6:2
set lev 1
LEV set to 1 1
set lat 68.47
LAT set to 68.47 68.47
set lon -66.82
LON set to -66.82 -66.82
d temp
set t 1
Time values set: 1981:7:1:0 1981:7:1:0
d tcorr(temp,test2,t=1,t=123)
TCORR:  dim = 3, start = 1, end = 123
Error from TCORR:  Args must be grid data
Operation Error:  Error from tcorr function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = tcorr(temp,test2,t=1,t=123)
EXEC error:  error in correlationTest.  EXEC stopped.

Do I have to do something specific to the station data in order to use it
in tcorr?

Thanks in advance!
Mira


> Mira,
>
> After you define test2, do not close file 1. Doing so leaves the grads
> dimension environment in an undefined state. If you leave file 1 open, the
> dimension environment continues to be well-defined. You also need to set T
> to be a fixed dimension (e.g. 'set t 1') before using tcorr (but after you
> define test2). tcorr won't work if T is varying. So, in your case, you can
> simply replace the line 'close 1' with 'set t 1' and it should work.
>
> Best regards,
>
> Eric L. Altshuler
> Assistant Research Scientist
> Center for Ocean-Land-Atmosphere Studies
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705-3106
> USA
>
> E-mail: ela at cola.iges.org
> Phone: (301) 902-1257
> Fax: (301) 595-9793
>
> ----- Original Message -----
> From: "Mira Losic" <mlosic at envsci.rutgers.edu>
> To: gradsusr at gradsusr.org
> Sent: Tuesday, November 16, 2010 5:10:38 PM
> Subject: [gradsusr] tcorr error: invalid grid coordinates
>
> Hi everyone,
>
> I'm hoping someone can help me with the tcorr function. I am simply trying
> to correlate two WRF time series of temperature (T2) at a particular grid
> location and level from the beginning to end of my time series. (t=1 to
> t=123). The commands and errors are copied below.
>
> Also, I'd like to use tcorr to correlate my WRF output to my station data.
> Can tcorr find the correlation between station and gridded data?
>
> Many thanks,
> Mira
>
> ga-> open RUN4_StationVars.ctl
> Scanning description file:  RUN4_StationVars.ctl
> Data file RUN4_StationVars.nc is open as file 1
> LON set to -116.1 -34.1464
> LAT set to 55.9 78.7109
> LEV set to 1 1
> Time values set: 1981:7:1:6 1981:7:1:6
> Notice: Implied interpolation for file RUN4_StationVars.ctl
>  Interpolation will be performed on any data displayed from this file
> ga-> set lat 68.47
> LAT set to 68.4613 68.4613
> ga-> set lon -66.82
> LON set to -66.8144 -66.8144
> ga-> set t 1 123
> Time values set: 1981:7:1:6 1981:7:31:18
> ga-> define test=T2-273.15
> Notice:  Automatic Grid Interpolation Taking Place
> Define memory allocation size = 492 bytes
> ga-> close 1
> File 1 has been closed
> ga-> open RUN3_StationVars.ctl
> Scanning description file:  RUN3_StationVars.ctl
> Data file RUN3_StationVars.nc is open as file 1
> LON set to -116.1 -34.1464
> LAT set to 55.9 78.7109
> LEV set to 1 1
> Time values set: 1981:7:1:6 1981:7:1:6
> Notice: Implied interpolation for file RUN3_StationVars.ctl
>  Interpolation will be performed on any data displayed from this file
> ga-> set lat 68.47
> LAT set to 68.4613 68.4613
> ga-> set lon -66.82
> LON set to -66.8144 -66.8144
> ga-> set t 1 123
> Time values set: 1981:7:1:6 1981:7:31:18
> ga-> define test2=T2-273.15
> Notice:  Automatic Grid Interpolation Taking Place
> Define memory allocation size = 492 bytes
> ga-> close 1
> File 1 has been closed
> ga-> d tcorr(test,test2,t=1,t=123)
> TCORR:  dim = 3, start = 1, end = 123
> Data Request Error: Invalid grid coordinates
>   Varying dimension 3 decreases: -2.89491e+06 to -2.89491e+06
>   Error ocurred getting variable 'test'
> Error from TCORR:  Error getting grids
> Operation Error:  Error from tcorr function
>   Error ocurred at column 1
> DISPLAY error:  Invalid expression
>   Expression = tcorr(test,test2,t=1,t=123)
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>




More information about the gradsusr mailing list