Re: getting (too?) fancy with attributes

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sun, 30 Nov 2008 07:09:52 -0700

Hi Jonathan,

Dave Brown will need to weigh in about whether attributes have the
concept of their own missing values.

The problem seems to be that "integer_FillValue" itself doesn't have
a missing value, so when you do:

    CONTAINER_at_variableB = integer_FillValue

this is cobbering the _FillValue that CONTAINER_at_variableB had at that
point, and reassigning it to a new value that doesn't have a missing
value.

To fix this, instead of this:

integer_FillValue = -999

try this:

integer_FillValue = new(1,integer)

--Mary

On Nov 28, 2008, at 3:13 PM, Jonathan Vigh wrote:

> ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ; Test the feasibility of passing arguments to functions as
> ; attributes rather than variables.
> ;*****************************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ;********************************************************
>
> ; global parameters
> integer_FillValue = -999
>
>
> procedure do_stuff(CONTAINER)
> local stuff
>
> begin
>
> CONTAINER_at_variableB = integer_FillValue
>
> print("In procedure . . .")
> print("variableA = "+CONTAINER_at_variableA+" ismissing?
> "+ismissing(CONTAINER_at_variableA))
> print("variableB = "+CONTAINER_at_variableB+" ismissing?
> "+ismissing(CONTAINER_at_variableB))
> print(" ")
>
> CONTAINER_at_variableB = -3.4
>
>
>
>
> CONTAINER_at_variableA = -3.4
>
> end
>
>
> ; main program
> begin
>
> CONTAINER = True
> CONTAINER_at_variableA = new(1,"integer",integer_FillValue)
> CONTAINER_at_variableB = new(1,"integer",integer_FillValue)
>
> print("In main program . . .")
> print("variableA = "+CONTAINER_at_variableA+" ismissing?
> "+ismissing(CONTAINER_at_variableA))
> print("variableB = "+CONTAINER_at_variableB+" ismissing?
> "+ismissing(CONTAINER_at_variableB))
> print(" ")
>
> do_stuff(CONTAINER)
>
> end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Nov 30 2008 - 07:09:52 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 30 2008 - 08:25:42 MST