Re: how to read netcdf automatically

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 20 2012 - 11:08:48 MDT

Jinqiang,

Please try:

data = f->$variable(i)$

Wei

huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Jul 20, 2012, at 10:33 AM, Jinqiang Chen wrote:

>
>
> Hi there,
>
> I want to know how to read netcdf variable automatically. Now I am
> analyzing tons of CMIP5 data and I write an array of all the variable
> names and I want to use the loop to let ncl to read the specific variable
> name but I don't know how to do that. For example,
> I build a vector named variable s.t. variable = (/"cct","ccb"/)
> but it doesn't work for the case that: data = f->variable(i)
> in which i is the loop index and f is the addfile netcdf variable. Every
> time ncl read f->variable(i) it never change variable(i) to its real name,
> like cct, or ccb. Could you tell me how to deal with that?
>
> Thanks!
>
> Jinqiang Chen
>
>
>
> --
> Jinqiang Chen
> Environmental Science and Engineering
> California Institute of Technology
> 1200 E. California Blvd.
> mc: 131-24
> Pasadena, CA 91125
> tel: (626) 395-8704
> email: jcchen@caltech.edu
> jcchen@gps.caltech.edu
> http://www.gps.caltech.edu/~jcchen/
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 20 11:08:59 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2012 - 09:48:26 MDT