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

Home » Public Forums » archive » Re: Retrieving variables from a subroutine
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Retrieving variables from a subroutine [message #52615 is a reply to message #52612] Tue, 20 February 2007 08:51 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Andy Heaps wrote:
>
> I've written some IDL code to retrieve all the variables from a NetCDF
> file. This takes the form of:
> ncopen, 'file.nc'
> @ncread
>
> where the ncopen routine opens up the NetCDF file and writes all the
> variable information into a set of system strings in a !variable. The
> batch file statement @ncread then accesses these strings to read the
> data so all the variables are available from within the calling routine.
>
> This process is the only way I could think of to get the variables to
> appear in the calling procedure without having the NetCDF code directly
> in the user's program. Although this works, I cannot help thinking this
> is not the most elegant way of doing the job. I'd certainly like to
> just have one command to do the job, rather than two, if at all possible.
>
> As this program is for the use of undergrad students I don't want to use
> structures as they'll think IDL is very complicated and we all know that
> that isn't the case ;-) One of the ideas I had was to somehow get the
> returning ncopen procedure to call @ncread but I cannot think of a way
> to do that.
>
> Does anyone know of any IDL magic that could be used to have a single
> procedural (or other) call, and then somehow end up with the NetCDF
> variables extracted back in the the calling procedure?

I have a function to read netcdf files. See:

http://tinyurl.com/3apa9f

cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: import vrml in idl
Next Topic: Re: import vrml in idl

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

Current Time: Sat Oct 11 01:37:33 PDT 2025

Total time taken to generate the page: 6.79759 seconds