Documentation on String References

From: Lunde, Bruce N CIV NAVOCEANO, NP1 <bruce.lunde_at_nyahnyahspammersnyahnyah>
Date: Mon Mar 01 2010 - 14:09:28 MST

Hello,

In following page on "String references"

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#StringRef

should the last example concerning "dimnames()"
make use of "dimnames()" in the line

coord0 = temperature&$temperature!0$

such as in

coord0 = temperature&$dimnames(0)$

or are you trying to show something else ?

Thanks, Bruce

String references
Sometimes it is impossible to know the names of the attributes and coordinates before writing a script, or these names may vary from variable to variable. To solve this problem, string variables can be used to reference attributes and coordinates by enclosing the variable reference within dollar signs '$'. The following are examples of this:
        dimnames = (/"frtime","lat","lon"/)
        attnames = (/"_FillValue", "long_name"/)

;
; access to attribute
;
        att0 = temperature@$attnames(0)$

;
; Example of referencing a coordinate variable
; without knowing the dimension name
;
        if(iscoord(dimnames(0))
                coord0 = temperature&$temperature!0$
        end if

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Mon Mar 1 14:09:35 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 04 2010 - 15:07:06 MST