Cannot override gribfilter.init function that sets the default grib files names

Bug #984489 reported by Jose F Nieves
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nbsp
Fix Released
High
Jose F Nieves

Bug Description

I put this in /usr/local/etc/nbsp/site/g
ribfilter.conf

rename gribfilter_make_default_name gribfilter_make_default_name.orig

proc gribfilter_make_default_name {rc_array_name f_flag {modelname ""}} {
    #
    # "modelname" is put as an argument because some rules use a special
    # value. If f_flag is 1, the forecast time is included in the name;
    # otherwise it is not.
    #
    upvar 1 $rc_array_name rc;

    if {$modelname eq ""} {
        set modelname $rc(gribmodel);
    }

    set fname "";
    append fname $modelname "_" $rc(gribgrid) "_" $rc(gribymdh);
    if {$f_flag == 1} {
        append fname "_" [format "%03d" $rc(gribforecasttime)];
    }
    append fname [gribfilter_make_default_ext $rc(gribedition)];

    return $fname;
}

And I get an error saying

can't rename "gribfilter_make_default_name": command doesn't exist
    while executing
"rename gribfilter_make_default_name gribfilter_make_default_name.orig"
    (file "/usr/local/etc/nbsp/site/gribfilter.conf" line 1)
    invoked from within
"source ${_localconfname}"
    ("foreach" body line 4)
    invoked from within
"foreach _d $gribfilter(localconfdirs) {
    set _localconfname ${_d}/${_confname}
    if {[file exists ${_localconfname}] == 1} {
        source ${_lo..."
    (file "/usr/local/etc/nbsp/gribfilter.conf" line 112)
    invoked from within
"source $gribfilter(conf)"
    invoked from within
"if {[file exists $gribfilter(conf)] == 1} {
    source $gribfilter(conf);
}"
    (file "/usr/local/libexec/nbsp/gribfilter.init" line 59)
    invoked from within
"source $grib_init_file"
    (file "/usr/local/libexec/nbsp/gribfilter" line 36)

So i edited the /usr/local/libexec/nbsp/gribfilter.init and changed the
line to

    if {$f_flag == 1} {
        append fname "_" [format "%03d" $rc(gribforecasttime)];
    }

and now nothing shows up in data/grib/data/grb but all the files do show up
in data/grib/data/grids

I tried "%03f" but still no data in data/grib/data/grb.

On Mon, Apr 16, 2012 at 4:17 PM, Jose F Nieves <email address hidden> wrote:

> Jason
>
> In this portion
>
> if {$f_flag == 1} {
> append fname "_" $rc(gribforecasttime);
> }
>
>
> replace the statement on the middle by the following
>
> append fname "_" [format "%03d" $rc(gribforecasttime)];
>
> That will give you things like
>
> 00n
> 0mn
>
> Jose
>
>
>

--
Jason Brooks
KE5FSE

Jose F Nieves (nieves)
Changed in nbsp:
assignee: nobody → Jose F Nieves (nieves)
status: New → Confirmed
importance: Low → High
Jose F Nieves (nieves)
Changed in nbsp:
status: Confirmed → Fix Committed
Jose F Nieves (nieves)
Changed in nbsp:
milestone: none → 2.2.3.r1
Jose F Nieves (nieves)
Changed in nbsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.