Re: when the variable name contains a dash...

From: Dave Brown (dbrown AT XXXXXX)
Date: Fri Jul 18 2003 - 12:32:51 MDT

  • Next message: Mary Haley: "new version of NCL"

    Andres,
    Try this:

    vars = getfilevarnames(a)
    do i = 0, dimsizes(vars)-1
        if (vars(i).eq. "stream-heating")
            psi750 = a->$vars(i)$(0,{750},:,:)
        end if
    end do

     -dave
     dbrown@ucar.edu

    On Fri, 18 Jul 2003, Andres Roubicek wrote:

    >
    > Hi,
    >
    > Does anyone know how to handle NetCDF files with a variable name like
    > "stream-heat"? I would prefer not to recreate the file, it's an output
    > from someone else's model. Here is the line in question:
    >
    > psi750 = a->stream-heating(0,{750},:,:)
    >
    > and the error message:
    >
    > fatal:Either file (a) isn't defined or variable (stream) is not a variable in the file
    >
    > Thank you,
    >
    > Andres Roubicek
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >

    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Mon Jul 21 2003 - 07:23:49 MDT