[ncl-talk] Delete variables in loop before and/or after each iteration. Feature(s)?

David Brown dbrown at ucar.edu
Thu Mar 5 18:44:55 MST 2015


Have you tried using the "reassign" operator?

x = "a string"
print(x)
x := 20.04
print(x)
x := (/ 1,2,3,4/)
print(x)

 -dave

On Thu, Mar 5, 2015 at 6:12 PM, Erik Jan Schaffernicht
<eschaffe at uni-koeln.de> wrote:
> Using NCL 6.2.1:
> I run a loop to process several similar netcdf files with NCL.
> In this loop many variables are assigned different values/dimensions during
> each iteration compared to their state in the iteration before.
> This causes errors.
>
> (a)  Is there a ncl delete command that does not throw an error if I try to
> delete  variables  that do not exist?    So I can place a delete()  after
> the beginning of my loop and not only just before the end-loop statement?
> (b1) Many asked it already... but just for the nice-to-have-feature-list:
> a command that tells ncl to forget/delete  after each iteration of a loop
> all variables that were defined in that loop during that iteration without
> mentioning each var explicitly.
>     Something like two markers and a trigger:
>     "delete all var that are defined from here onwards"
>      "delete until here"
>    and a trigger command
>     "delete all newly defined Var in marked range now"
> (b2) a  deleteVarInMostRecentBlock()  which deletes var defined in the block
> (block markers like "begin"  "end" exist already)
>
> (c) a deleteAllVar() would be nice as well.
>
>
>
>
>
>
>
>
> _______________________________________________
> 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