[ncl-talk] Deleting multiple coordinate variables

David Brown dbrown at ucar.edu
Tue Nov 4 10:54:32 MST 2014


Hi Walter,
We believe this problem has been fixed. The fix will be available in
the upcoming 6.3.0 release.
 -dave

On Mon, Nov 3, 2014 at 2:40 PM, Walter Hannah
<whannah at atmos.colostate.edu> wrote:
> Hi,
>
> I recently noticed a bug in NCL 6.2.0. Deleting a single coordinate variable
> works without an issue, but the newer method for deleting multiple items at
> once, does not work for coordinate variables. I've pasted a little NCL
> script below. If I'm not crazy, then the last printVarSummary() should show
> that the variable "z" stilll has two coordinate variables.
>
> begin
> ;===========================================================================================
> ;===========================================================================================
>     line =
> "---------------------------------------------------------------------------"
>     nx = 100
>     ny = 100
>
>     x = new(nx,double)
>     y = new(ny,double)
>     z = new((/ny,nx/),float)
>
>     x = fspan(0,nx-1,nx)
>     y = fspan(0,ny-1,ny)
>     z = random_uniform(0,1,(/ny,nx/))
>
>     z!0 = "y"
>     z!1 = "x"
>     z&y = y
>     z&x = x
> ;===========================================================================================
> ;===========================================================================================
>     print(""+line)
>     print("Here's what z looks like:")
>     print(""+line)
>     printVarSummary(z)
>
>     print(""+line)
>     delete(z&y)
>     print("The y-coord has been deleted")
>     print(""+line)
>     printVarSummary(z)
>
>     print(""+line)
>     z&y = y
>     print("Now we have replaced the y-coord")
>     print(""+line)
>     printVarSummary(z)
>
>     print(""+line)
>     print("Now both x and y coords have been deleted (but they are still
> there!)")
>     delete([/z&y,z&x/])
>     print(""+line)
>     printVarSummary(z)
> ;===========================================================================================
> ;===========================================================================================
> end
>
>
> Thanks,
> Walter Hannah
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list