[Thread Prev][Thread Next][Index]

Re: problem variable names in LAS/Ferret



Dave,

Thanks for this bug report.

It turns out that 'NE' is a reserved keyword in Ferret.  I've modified the code in
Ferret.pl to catch all the reserved keywords and have checked that code in to be
part of the LAS v6.2 release.  Here's a 'diff -e' to show what is new.  You should
be able to patch your existing LAS v6.0/v6.1 Ferret.pl file.

111,112c
    if (
        $varname eq 'i' || $varname eq 'j' ||
        $varname eq 'k' || $varname eq 'l' ||
        $varname eq 'x' || $varname eq 'y' ||
        $varname eq 'z' || $varname eq 't' ||
        $varname eq 'xbox' || $varname eq 'ybox' ||
        $varname eq 'zbox' || $varname eq 'tbox' ||
        $varname eq 'and' || $varname eq 'or' ||
        $varname eq 'gt' || $varname eq 'ge' ||
        $varname eq 'lt' || $varname eq 'le' ||
        $varname eq 'eq' || $varname eq 'ne'
       ) {
.


-- Jon


Dave Brown wrote:

> Hi Jon et al,
>
> (Jon, this continues a discussion we had at the DODS meeting.)
>
> Using earlier versions of LAS/Ferret, when I encountered problems
> with NetCDF variable names that were  problematic in Ferret because they
> clashed with reserved symbol names, I was advised to work around the
> problem using an init script. The file in question has a variable called
> "NE". Prior to LAS 6.x, by changing the variable name to 'fake_ne' in
> the xml file and setting the ferret init_script property to point
> to a script with the following contents:
> ----------------------------------
> def var/title ="ELECTRON DENSITY"/units="CM^3" fake_ne = 'NE'
> ----------------------------------
> Ferret would handle the variable properly.
>
> Now however, using LAS 6.1, I get this error:
> ----------------------------------------
> LAS Error
> The following error message was received from LAS:
>
> Adding an acceptable error string: "*** NOTE: ".
>         NOAA/PMEL TMAP
>         FERRET v5.41
>         Solaris 5.8 - 09/18/02
>         25-Mar-03 17:41
>
> yes? cancel mode verify
> yes? cancel mode interp
> yes? canc data/all
> yes? go init_ne "/home/dbrown/tiegcm/pyrb001.nc" "1" "1" "fake_ne"
> yes? set axis/modulo `fake_ne[d=1],return=xaxis`
>  **ERROR: unknown data set: D=1
>
> -----------------------------------------------------
> Although some variable names that used to cause problems (e.g. "Z")
> now work without an init script, "NE" does not. Ferret complains
> as follows:
> ----------------------------------
> Adding an acceptable error string: "*** NOTE: ".
>         NOAA/PMEL TMAP
>         FERRET v5.41
>         Solaris 5.8 - 09/18/02
>         25-Mar-03 17:51
>
> yes? cancel mode verify
> yes? cancel mode interp
> yes? canc data/all
> yes? go std_initialize "/home/dbrown/tiegcm/pyrb001.nc" "1" "1" "ne"
>  *** NOTE: Units on axis "lev" are not recognized: ln(p0/p)
>  *** NOTE: They will not be convertible:
>  *** NOTE: Units on axis "mlev" are not recognized: ln(p0/p)
>  *** NOTE: They will not be convertible:
> yes? set axis/modulo `ne[d=1],return=xaxis`
> yes? set
> region/x="180":"540"/y="-87.5":"87.5"/z="-7":"-7"/t="01-Jan-1993":"01-Jan-1993"
> yes? set win/size=.5
> yes? set win/asp=0.729166666666667
> yes? GO "/tmp/lasgo278911946537.jnl"
>  **ERROR: command syntax: ne
>           ne may not start an expression
> DEFINE VARIABLE STRIDE_istart = `ne,return=istart`
> Command file, command group, or REPEAT execution aborted
> ---------------------------------------
>
> By modifying the script "stride_create_symbols.jnl", I can get a plot.
> I changed:
> -----------------------------
> let STRIDE_istart = `$1,return=istart`
> let STRIDE_iend   = `$1,return=iend`
> let STRIDE_iincr  = int((STRIDE_iend-STRIDE_istart)/$2)
>
> let STRIDE_jstart = `$1,return=jstart`
> let STRIDE_jend   = `$1,return=jend`
> let STRIDE_jincr  = int((STRIDE_jend-STRIDE_jstart)/$3)
> -------------------------------
> to:
> ----------------------------------
> let STRIDE_istart = `$1[d=1],return=istart`
> let STRIDE_iend   = `$1[d=1],return=iend`
> let STRIDE_iincr  = int((STRIDE_iend-STRIDE_istart)/$2)
>
> let STRIDE_jstart = `$1[d=1],return=jstart`
> let STRIDE_jend   = `$1[d=1],return=jend`
> let STRIDE_jincr  = int((STRIDE_jend-STRIDE_jstart)/$3)
> ----------------------------------
>
> It's interesting that this makes it work, but I don't expect
> it's a real solution: it  most likely cause a problem when more
> than a single dataset is involved.
>  -dave
>  dbrown@ucar.edu



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement