[gradsusr] How could I sdfwrite a correct nc file with my binary data?

Huddleston, John Huddleston at cira.colostate.edu
Mon Aug 29 11:36:09 EDT 2011


Xiang

Your commands are correct and they worked fine when I did them by hand.

Copy the file locally.

Try running these commands from the command line
open CTL_2mt_annual1900-1999.ctl
set t 1 100
set undef -999.
define t2m=tmp
set sdfwrite -flt CTL_2mt_annual1900-1999.nc
sdfwrite t2m

Then exit GrADS, run GrADS and open the new file
sdfopen CTL_2mt_annual1900-1999.nc
set t 1
d t2m
c
set t 2
d t2m

My guess is that you are on a very fast server and a glitch occurred getting data from a mount point.

John

From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of xianglin
Sent: Monday, August 22, 2011 10:19 AM
To: gradsusr
Subject: [gradsusr] How could I sdfwrite a correct nc file with my binary data?

Hi, all 
 
     I want to write a nc file with "sdfwrite" ,  but met some error.
The binary file(.grd) and .ctl file have been attached with the mail.
 
 
Here below is my gs file 
 
# ********initialize ******************
'reinit'
'set grads off'
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'open /data1/CAM_zb/t2m/CTL_2mt_annual1900-1999.ctl'
'set t 1 100'
'set undef -999.'
'define t2m=tmp'
'set sdfwrite -flt CTL_2mt_annual1900-1999.nc'
'sdfwrite t2m'
 
 
Here below is the error instruction 
 
ga-> sdfopen CTL_2mt_annual1900-1999.nc                     
Scanning self-describing file:  CTL_2mt_annual1900-1999.nc
SDF file CTL_2mt_annual1900-1999.nc is open as file 1
LON set to 0 360 
LAT set to -87.8638 87.8638 
LEV set to 0 0 
Time values set: 1900:1:1:0 1900:1:1:0 
E set to 1 1
ga-> set t 1
Time values set: 1900:1:1:0 1900:1:1:0 
ga-> d t2m
Contouring: 220 to 300 interval 10 
ga-> set t 2
Time values set: 1901:2:1:0 1901:2:1:0 
ga-> d t2m
Data Request Error: Invalid grid coordinates
  World coordinates convert to non-integer  grid coordinates
    Variable = t2m  Dimension = 3 
  Error ocurred at column 1
DISPLAY error:  Invalid expression 
  Expression = t2m
 
 
I guess the irregular projection of the original data cause such problem. Any one can tell me 
how to write a correct nc file in this case?
 
btw, the grads version is  2.0.a9 
 
Thanks!
 
 
Xiang
 
 
 
 
2011-08-23 
________________________________________
xianglin 




More information about the gradsusr mailing list