[gradsusr] binary to netCDF conversion problems

Rosalyn F Maccracken rmaccrac at gmu.edu
Tue Feb 5 13:07:08 EST 2013


Dear Users,

I am trying to convert a binary file to a netCDF4 
file using sdfwrite.  I have a control file
which looks like:

DSET tsfc_3hr_%y4%m2.dat
OPTIONS TEMPLATE
UNDEF -1000.
XDEF 720 LINEAR  -179.75 0.50
YDEF 360 LINEAR   -89.75 0.50
ZDEF    1 LEVELS 1000.
TDEF 8768 LINEAR 00z01Jan2007 3hr
VARS 1
tsfc  0   99   
ENDVARS

When I do 'q dims', I get:
Default file number is: 1
X is varying   Lon = 0 to 360   X = 360.5 to 1080.5
Y is varying   Lat = -89.75 to 89.75   Y = 1 to 360
Z is fixed     Lev = 1000  Z = 1
T is fixed     Time = 00Z01JAN2007  T = 1
E is fixed     Ens = 1  E = 1

So, lon should have 720 points, lat should
have 180 points, and for a 30 day month, there
should be 248 time steps.

However, when I use the sdfwrite command:

open tsfc_3hr.ctl
set time 00Z01Jan2007 21Z30Jan2007
define tsfc = tsfc
set sdfwrite -flt -nc4 <tsfc_file>.nc4
sdfwrite tsfc

I get metadata that has the wrong lon
dimension:
netcdf tsfc_3hr_Aug1995 {
dimensions:
	lon = 722 ;
	lat = 360 ;
	time = 248 ;
(etc)

So, my questions are, why is the lon dimension 
wrong and how do I fix this? 

Thanks,
Roz

********************************
Rosalyn F. MacCracken, Ph.D.
Postdoctoral Research Fellow
Department of Geography and Geoinformation Science
George Mason University
Fairfax, VA
(301) 335-1222
rmaccrac at gmu.edu




More information about the gradsusr mailing list