[ncl-talk] fatal:yacc stack overflow

David Brown dbrown at ucar.edu
Wed Feb 18 17:33:59 MST 2015


Well, yes there is a limit to the number of arguments, and this
procedure exceeds the limit. Actually it is not a limit imposed by NCL
per se; rather it
comes from nyacc (our renamed version of Berkeley YACC, the parser
generator). It is easy to change this limit if you build from source
code. From the top of the source tree go to /ni/src/nyacc, edit the
file skeleton.c, and at line 58, change:

"#define YYSTACKSIZE 500",

to a bigger number. I tried 1000 and it allowed me to define a
procedure with the arguments as you have presented them and run it.

That said, if you don't build from source this won't help, and I can't
help commenting that a procedure with 127 arguments does not seem like
a very longterm sustainable solution in any programming language.
Presumably, some of these arguments are scalar values that could be
considered options.
Couldn't you use the typical NCL programming paradigm of using an
"opt" style argument with many of your parameters passed as attributes
of "opt"?
That would allow for default values so that the parameters would only
need to be set for non-default cases.
Alternatively another developer suggested you could create lists of
(maybe closely related) variables and pass a smaller set of list type
variables to the procedure. Of course I don't know your situation and
there may be a good reason for what you are attempting to do.
 -dave





On Wed, Feb 18, 2015 at 3:24 PM, franz <f.trotta at sincem.unibo.it> wrote:
> Dear ncl-team,
>     I'm using the ncl 6.1.2 on imac Darwin 64bit
>     I got this fatal error:
>     fatal:yacc stack overflow: line 410 in file ./setPARFree_surf.ncl
> before or near ,
>                                   lplot_outSwanSurf,
> --------------------------------------------------^
>
> This file ‘setPARFree_surf.ncl’ contain a procedure
> set_inSurfFree_sfigure that has 127 argumens (see below).
> Is there a limit number of arguments for a procedure in ncl?
>
> procedure set_inSurfFree_sfigure(lplot_indataBat,lplot_indataBatC, \
>
> lplot_indataBat_meshmask,lplot_indataBat_zmax, \
>                                   lplot_indataOce,lplot_indataOceC, \
>
> lplot_indataOce_meshmask,lplot_indataOce_temp,lplot_indataOce_sal, \
>
> lplot_indataOce_cur,lplot_indataOce_ssh,lplot_indataOce_temp_zanim, \
>
> lplot_indataOce_sal_zanim,lplot_indataOce_cur_zanim,lplot_indataOce_temp_tanim,
> \
>
> lplot_indataOce_sal_tanim,lplot_indataOce_cur_tanim,lplot_indataOce_ssh_tanim,
> \
>                                   lplot_indataAtm,lplot_indataAtmC, \
>
> lplot_indataAtm_meshmask,lplot_indataAtm_seaLP,lplot_indataAtm_cloudC, \
>
> lplot_indataAtm_wind,lplot_indataAtm_airTemp,lplot_indataAtm_dpTemp, \
>
> lplot_indataAtm_prec,lplot_indataAtm_seaLP_tanim,lplot_indataAtm_cloudC_tanim,
> \
>
> lplot_indataAtm_wind_tanim,lplot_indataAtm_airTemp_tanim,lplot_indataAtm_dpTemp_tanim,
> \
>                                   lplot_indataAtm_prec_tanim, \
>                                   lplot_inrunMesh,lplot_inrunMeshC, \
>
> lplot_inrunMesh_gridT,lplot_inrunMesh_gridU,lplot_inrunMesh_gridV, \
>
> lplot_inrunMesh_gridW,lplot_inrunMesh_gridTUV,lplot_inrunMesh_maskT, \
>
> lplot_inrunMesh_maskU,lplot_inrunMesh_maskV,lplot_inrunMesh_maskW, \
>                                   lplot_inrunMesh_maskTUV, \
>
> lplot_inrunBat,lplot_inrunBatC,lplot_inrunBat_zmax, \
>                                   lplot_inrunOce,lplot_inrunOceC, \
>
> lplot_inrunOce_temp,lplot_inrunOce_sal,lplot_inrunOce_cur, \
>
> lplot_inrunOce_ssh,lplot_inrunOce_temp_zanim,lplot_inrunOce_sal_zanim, \
>
> lplot_inrunOce_cur_zanim,lplot_inrunOce_temp_tanim,lplot_inrunOce_sal_tanim,
> \
>
> lplot_inrunOce_cur_tanim,lplot_inrunOce_ssh_tanim, \
>                                   lplot_inrunAtm,lplot_inrunAtmC, \
>
> lplot_inrunAtm_seaLP,lplot_inrunAtm_cloudC,lplot_inrunAtm_wind, \
>
> lplot_inrunAtm_airTemp,lplot_inrunAtm_dpTemp,lplot_inrunAtm_prec, \
>
> lplot_inrunAtm_seaLP_tanim,lplot_inrunAtm_cloudC_tanim,lplot_inrunAtm_wind_tanim,
> \
>
> lplot_inrunAtm_airTemp_tanim,lplot_inrunAtm_dpTemp_tanim,lplot_inrunAtm_prec_tanim,
> \
>                                   lplot_inrunObc,lplot_inrunObcC,\
>
> lplot_inrunObc_gridT,lplot_inrunObc_gridU,lplot_inrunObc_gridV,\
>
> lplot_inrunObc_temp,lplot_inrunObc_sal,lplot_inrunObc_ssh,\
>
> lplot_inrunObc_curr3d,lplot_inrunObc_curr2d, \
>                                   lplot_outNemoMesh,lplot_outNemoMeshC, \
>
> lplot_outNemoMesh_mapBox,lplot_outNemoMesh_gridT,lplot_outNemoMesh_gridU,lplot_outNemoMesh_gridV,\
>
> lplot_outNemoMesh_gridW,lplot_outNemoMesh_gridTUV,lplot_outNemoMesh_maskT,lplot_outNemoMesh_maskU,\
>
> lplot_outNemoMesh_maskV,lplot_outNemoMesh_maskW,lplot_outNemoMesh_maskTUV,
> \
>                                   lplot_outNemoInit,lplot_outNemoInitC, \
>
> lplot_outNemoInit_ssh,lplot_outNemoInit_rad,lplot_outNemoInit_temp,lplot_outNemoInit_temp_zanim,
> \
>
> lplot_outNemoInit_sal,lplot_outNemoInit_sal_zanim,lplot_outNemoInit_curr,lplot_outNemoInit_curr_zanim,
> \
>                                   lplot_outNemoSurf,lplot_outNemoSurfC, \
>
> lplot_outNemoSurf_temp,lplot_outNemoSurf_temp_zanim,lplot_outNemoSurf_temp_tanim,
> \
>
> lplot_outNemoSurf_sal,lplot_outNemoSurf_sal_zanim,lplot_outNemoSurf_sal_tanim,\
>
> lplot_outNemoSurf_rad,lplot_outNemoSurf_rad_tanim,lplot_outNemoSurf_ssh,lplot_outNemoSurf_ssh_tanim,\
>
> lplot_outNemoSurf_curr,lplot_outNemoSurf_curr_zanim,lplot_outNemoSurf_curr_tanim,\
>                                   lplot_outSwanSurf,lplot_outSwanSurfC,\
>
> lplot_outSwanSurf_hsSca,lplot_outSwanSurf_hsVec)
> _______________________________________________
> 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