comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » NetCDF write
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
NetCDF write [message #79647] Thu, 15 March 2012 00:02
Fabrice Lambert is currently offline  Fabrice Lambert
Messages: 6
Registered: March 2012
Junior Member
Hi everybody,

I am trying to write a 2-dimensional dataset to a netCDF file. The
data is as follows:

IDL> help, aodtot
AODTOT FLOAT = Array[128, 64]

Basically it's a world map with 128 points in longitude and 64 points
in latitude.

Here's the code I am using to write the netCDF data:

;----------------------------------------------------------- ------------------------
lon=findgen(128)*2.8125
lat=findgen(64)*2.8125-88.59375

id = NCDF_CREATE('AOD_CCSM_LGM.nc', /CLOBBER) ; Create a new NetCDF
file. LGM
NCDF_CONTROL, id, /FILL ; Fill the file with default values.

xid = NCDF_DIMDEF(id, 'lon', 128) ; Make dimensions.
yid = NCDF_DIMDEF(id, 'lat', 64) ; Make dimensions.

lonid = NCDF_VARDEF(id, 'lon', [xid], /FLOAT) ; Define variables.
latid = NCDF_VARDEF(id, 'lat', [yid], /FLOAT) ; Define variables.
aodtotid = NCDF_VARDEF(id, 'AODtot', [xid, yid], /FLOAT) ; Define
variables.

NCDF_CONTROL, id, /ENDEF ; Put file in data mode.'

NCDF_VARPUT, id, lonid, lon ; Input data.
NCDF_VARPUT, id, latid, lat ; Input data.
NCDF_VARPUT, id, aodtotid, aodtot ; Input data.

end
;----------------------------------------------------------- ---------------------

The problem is that all data above the 47th latitudinal value are
empty (i.e. the northernmost part of the world is missing). If I write
the aodtot variable to a textfile, then no data are missing, so I'm
doing something wrong in the netcdf part. Can anybody spot a mistake?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CAPS LOCK question (pun intended)
Next Topic: Re: NetCDF write

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:52:34 PDT 2025

Total time taken to generate the page: 0.00470 seconds