Hello.
I read in a binary file that I'm told is composed of 16 direct access
binary ("big_endian") records, which are 2 variables at 3-hourly
intervals for 1 day. I used NCL to read in the binary code and write
out one netcdf file.
When I do "ncdump -h" on the netcdf file, I don't get the proper time
(it should be time = UNLIMITED ; // (8 currently)).
Could I have some advice on how to fix this?
-Erik
ENOBLE_at_ATHENA: /usr/people/enoble> ncdump -h sample.nc
netcdf sample {
dimensions:
time = UNLIMITED ; // (0 currently)
lat = 480 ;
lon = 1440 ;
variables:
float COMB_MW(lat, lon) ;
COMB_MW:units = "mm/hr" ;
COMB_MW:long_name = "merged microwave precipitation" ;
double lat(lat) ;
lat:long_name = "lat" ;
lat:units = "degrees_north" ;
double lon(lon) ;
lon:long_name = "lon" ;
lon:units = "degrees-east" ;
float CMORPH(lat, lon) ;
CMORPH:units = "mm/hr" ;
CMORPH:long_name = "CMORPH" ;
// global attributes:
:title = "1 day of daily CMORPH precipitation data" ;
:source =
"ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/3-hourly_025deg" ;
}
ENOBLE_at_ATHENA: /usr/people/enoble>
ncl code:
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************************
begin
a = addfile("sample.nc","c") ; write netCDF file
a_at_title = "1 day of daily CMORPH precipitation data"
a@source = "ftp://ftp.cpc.ncep.noaa.gov/precip/global_CMORPH/3-hourly_025deg"
filedimdef(a,"time",-1,True) ; make time an UNLIMITED
dimension, always recommended
setfileoption ("bin", "ReadByteOrder", "BigEndian")
do i = 0, 14 ; CMORPH binary file contains 16 records. NCL starts
at counting at 0
lat = fbindirread ("./20060901_3hr-025deg_cpc+comb",0, 480, "double")
lon = fbindirread ("./20060901_3hr-025deg_cpc+comb",1, 1440, "double")
cpc_combined_MW = fbindirread
("./20060901_3hr-025deg_cpc+comb",i,(/480,1440/),"float")
CMORPH = fbindirread
("./20060901_3hr-025deg_cpc+comb",i+1,(/480,1440/),"float")
;=============================
; create lat and long coordinate variables
;============================
lon!0 = "lon"
lon_at_long_name = "lon"
lon_at_units = "degrees-east"
lon&lon = lon
lat!0 = "lat"
lat_at_long_name = "lat"
lat_at_units = "degrees_north"
lat&lat = lat
;=============================
; name dimensions of variables
;============================
cpc_combined_MW!0 = "lat"
cpc_combined_MW!1 = "lon"
cpc_combined_MW&lat = lat
cpc_combined_MW&lon = lon
cpc_combined_MW_at_long_name = "merged microwave precipitation"
cpc_combined_MW_at_units = "mm/hr"
print(i)
printVarSummary(cpc_combined_MW)
CMORPH!0 = "lat"
CMORPH!1 = "lon"
CMORPH&lat = lat
CMORPH&lon = lon
CMORPH_at_long_name = "CMORPH"
CMORPH_at_units = "mm/hr"
print(i+1)
printVarSummary(CMORPH)
a->COMB_MW = cpc_combined_MW
a->CMORPH = CMORPH
end do
end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 15 2008 - 18:55:18 MDT
This archive was generated by hypermail 2.2.0 : Fri Jul 18 2008 - 08:51:52 MDT