reading gtopo30 data

From: p s <prabshr_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 26 2009 - 19:52:39 MST

I am having some problem trying to read the gtopo30 binary data, could
anyone help me out?
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

 z=fbindirread ("E060N40.DEM",0,(/nlon,nlat/),"byte")
 lat = ulat + ispan(-nlat,0,1)*res
 lon = ispan(0,nlon,1)*res + ulon

 ; create lat and long coordinate variables
 lon!0 = "lon"
 lon@long_name = "lon"
 lon@units = "degrees-east"
 lon&lon = lon

 lat!0 = "lat"
 lat@long_name = "lat"
 lat@units = "degrees_north"
 lat&lat = lat
 ; name dimensions of z and assign coordinate variables
  z!0 = "lat"
  z!1 = "lon"
  z&lat = lat
  z&lon = lon
  z@long_name = "Elevation"
  z@units = "meters"

Its giving a error message saying
fatal:Coordinate variables must be the same dimension as their dimension
fatal:No coordinate variable exists for dimension (lat) in variable (z)
Segmentation fault

Also I am not sure if the format is "byte" if I use double or float while
reading the binary file, it gives error message.

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Nov 26 19:52:45 2009

This archive was generated by hypermail 2.1.8 : Sun Nov 29 2009 - 20:52:58 MST