[ncl-talk] gsn_contour_shade and debug-variable in gsn_code.ncl

Rick Brownrigg brownrig at ucar.edu
Tue Feb 18 17:03:38 MST 2020


Hi Caspar,

I concur with your analysis. The "debug" variable is usually defined as
boolean. If you are seeing it as already defined to be an "int" value, then
that would certainly cause the assignment mismatch error on line 12665 of
gsn_code.ncl.  The trick then obviously is to track down where "debug" is
getting set to this integer value. I unfortunately no longer have access to
the glade filesystem, but I would start by looking at the scripts under:

    /glade/u/apps/dav/opt/ncl/6.6.2/intel/18.0.5/lib/ncarg/nclscripts/csm/

as well as any personal scripts that you may be "load"ing.

Rick


On Tue, Feb 18, 2020 at 4:44 PM Caspar Ammann via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi NCL team,
>
> I’m suddenly running into issues with gsn_contour_shade.
>
> An old script that I have used successfully many times suddenly breaks with*
> Assignment type mismatch*, even if I put the command into a new variable
> (previously undefined), Below is a ‘burnt-down’ test script for
> illustration.
>
> Error:
>
> fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be
> coerced to type of left hand side
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 12665 in
> file
> /glade/u/apps/dav/opt/ncl/6.6.2/intel/18.0.5/lib/ncarg/nclscripts/csm/gsn_code.ncl
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 18 in
> file test_shade.ncl
>
> (>> it is in the gsn_contour_shade call, see below).
>
>
> What I see in gsn_code.ncl where the error occurs is this assignment :
>
>     debug = get_res_value_keep(opt,"debug",False)
>
> But debug is not a local variable, but something that appears already
> populated and defined as an integer (for some reason).  Once I set ‘debug'
> to be a local variable inside the function (gsn_contour_shade), then it all
> works as expected. So I do have a temporary fix if I replicate the function
> from gsn_code inside my script with the local variable “debug”. Maybe
> somebody can have a look and see what a more durable solution is.
>
> Thanks,
> Caspar
>
>
>
> begin
> a = addfile("/glade/scratch/ammann/NEWMONT/pr_meanfield_DJF_2085.nc","r")
> b = a->meanfield
>
> wks   = gsn_open_wks ("x11", "coneff" )
> res   = True
> res at gsnDraw         = False    ; We're going to panel later, so don't
> res at gsnFrame        = False    ; draw or advance frame.
>     plot  = gsn_csm_contour_map(wks, b(0,:,:), res )
>
>   opt                  = True
>   opt at gsnShadeFillType = "Pattern"
>   opt at gsnShadeLow      = 3                            ; Use fill Pattern
> #3
>   plot = gsn_contour_shade(plot,0.,-999, opt)   ; should be target
> ; dummy = gsn_contour_shade(plot,0.,-999, opt)   ; dummy: also assignment
> problem
>
> draw(plot)
> frame(wks)
>
> end
>
>
>
> Caspar Ammann
> *National Center for Atmospheric Research*
> *RAL - Climate Science and Applications Program*
>
>
>
> _______________________________________________
> 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/20200218/25283d90/attachment.html>


More information about the ncl-talk mailing list