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

xianglin xianglin at pku.org.cn
Mon Aug 22 12:19:26 EDT 2011


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110823/1d39bac1/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CTL_2mt_annual1900-1999.ctl
Type: application/octet-stream
Size: 1466 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110823/1d39bac1/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CTL_2mt_annual1900-1999.grd
Type: application/octet-stream
Size: 3276800 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20110823/1d39bac1/attachment-0007.obj 


More information about the gradsusr mailing list