[ncl-talk] How to read a specific variable name

Dennis Shea shea at ucar.edu
Tue Nov 29 17:32:35 MST 2016


field = "cldfrac"
x      = fin->$field$
printVarSummary(x)


fout->$field$ = ...

On Tue, Nov 29, 2016 at 5:24 PM, Laura Fowler <laura at ucar.edu> wrote:

> Hello:
>
> I am trying the following command line:
>
> ncl 'filename="2621442.cldfrac.mp_thompson_aerosols.2011-01-31_18.00.00.nc
> "'
> 'date="2011-01-31_18.00.00.nc"' 'field="cldfrac"'
> write.rectangular.toNETCDFs.ncl in which the variable cldfrac is the
> actual name of the variable I would liked to read.
>
> Inside the ncl script write.rectangular.toNETCDFs.ncl, how do I read
> that variable using the generic variable field? I tried something like
> diag = f->"field" and other combinations bu that did not work.
>
> When I write a new netcdf file out, how do I use
> ncdf->field = ....
>
> Looks like I always come up with a syntax error and have not been able
> to fix it.
>
> Thanks,
> Laura
>
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-----------------------------------------------------------
> --------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161129/b5c3c739/attachment.html 


More information about the ncl-talk mailing list