[Thread Prev][Thread Next][Index]
Re: symbols in subscript unrecognized?
Hi Daniel,
I will hazard a guess that your variable "rvar" is a user-defined
variable
(i.e. defined by LET rvar = xxx)
In Ferret version 5.0 and earlier you could not issue a
SHOW GRID user_var
command unless the user variable had previously been loaded (See
http://ferret.wrc.noaa.gov/Ferret/Documentation/Users_Guide/v50/partII.html#SHOW
GRID). I believe that two SHOW GRID commands in a row also behaved like
LOAD var; SHOW GRID var
In Ferret version 5.1 this restriction has been lifted.
- steve
====================================
Daniel Müller wrote:
> Hi ferret users
>
> Here is another thing i don't quite understand. I have a script which
> gets some parameters (i.e. names of variables) and defines some symbols
> for those. It then calls a subscript and hands some parameters to this
> one. Now look at the following script(s) and the error it produces:
>
> go calc_correlation_map ($var_reg) PC_reg
> !-> go calc_correlation_map rvar PC_reg
> !
> ---------------------------------------------------------------------------
> ! Description: calculates correlation map based of ERA data & indexes
>
> ! arguments : $1 : variable name [MSL]
> ! : $2 : correlation type [point, NAO, SOI,
> NAO_JONES,
> ! NAO_NCEP,
> NAO_NCEP_DJFM
> ! PminEpoint,SminEpoint
> ! PminEwGL, SminEwGL,
> ! SH_AOI, PC_reg
> ]
> ! : $3 : longitude
> ! : $4 : latitude
> ! : $5 : lag [0.]
> ! : $6 : file name
> !
> !
> --------------------------------------------------------------------------------
>
> define symbol var_cc = $1%MSL% ! Processed Variable to
> correlate to
> !-> define symbol var_cc = rvar ! Processed Variable
> to correlate to
> define symbol type = $2%point% ! Type of regression
> !-> define symbol type = PC_reg ! Type of regression
> define symbol lon = $3%20w% ! longitude for point
> regression
> !-> define symbol lon = 20w ! longitude for point
> regression
> define symbol lat = $4%60N% ! latitude for point
> regression
> !-> define symbol lat = 60N ! latitude for point
> regression
> define symbol lag = $5%0% ! lag
> !-> define symbol lag = 0 ! lag
> define symbol file_name = $6%file% ! file (regridding for
> NAO_NCEP only)
> !-> define symbol file_name = file ! file (regridding for
> NAO_NCEP only)
>
>
> ! -------------------------------------------------------------------
> ! calculate normalized variable
> go calc_normal_var ($var_cc)
> !-> go calc_normal_var rvar
> !
> ---------------------------------------------------------------------------
> ! Description: calculate normalized variable var
> !
> ! Comment : this script uses a number of working variable
> ($var)_dummy
> ! 1) Use an expilicit region for the calculation.
> ! 2) File must be set befor running the script
> !
> ! Output : Var_norm -> normalized variable var
> ! : Var_std -> standard deviation of variable var
> !
> ! author : ChA 08/97 [christof@climate.unibe.ch]
> ! adapted by : DM 09/1999 [mueller@climate.unibe.ch]
> !
> ! Usage : GO calc_normal_var varibale_name
> !
> ! arguments : $1 : variable name [MSL]
> !
> !
> ---------------------------------------------------------------------------
> !cancel mode verify
> ! - define symbol var
> define symbol var = $1%MSL%
> !-> define symbol var = rvar
>
> show grid ($var)
> !-> show grid rvar
> **ERROR: invalid command: grid for rvar is not available.
> (LOAD this variable and try SHOW GRID again.)
> show grid rvar
> Command file, command group, or REPEAT execution aborted
> yes? show grid ($var)
> !-> show grid rvar
> GRID GIC1
> name axis # pts start end
> LONGITUDE LONGITUDE 144mr 0E 2.5W
> LATITUDE LATITUDE 29 r 20N 90N
> normal Z
> TIME1 T (MON) 472 r 23485 23956
> yes?
>
>
> So it seems, that the command show grid ($var) does work when back in
> ferret typed in manually, but doesn't in the subscript.
> I invoke the show grid command, because the following command in my
> script,
> define symbol min_L = `($var),RETURN=LSTART`
> causes ferret tho hang for several minutes and then to terminate itself
> without any further error massage.
>
> The variable rvar is defined as follows:
> define symbol fn=pres.mon.mean.jan1958_apr1997.des.20_90
> define symbol klimavar=pres_des
> ...
> use "/usr/users/mueller/dataset/mout/($fn).data.cdf"
> let rvar=($klimavar)[d=2]
>
> which seems to be correct, because the following datasets are open:
>
> yes? show data
> currently SET data sets:
> 1>
> /usr/users/mueller/dataset/Wallace/AO_index_jan1958_apr1997.cdf
> name title I J
> K L
> AOI AO Index ... ...
> ... 1:472
>
> 2>
> /usr/users/mueller/dataset/mout/pres.mon.mean.jan1958_apr1997.des.20_90.data.cdf
> name title I J
> K L
> PRES_DES SLP_DESEASONED 1:144 1:29
> ... 1:472
> TREND_STEIG 1:144 1:29
> ... ...
> TREND_ABSN 1:144 1:29
> ... ...
> PRES_DES_MEAN 1:144 1:29
> ... ...
>
> 3>
> /usr/users/mueller/dataset/ncep/pres.mon.mean.jan1958_apr1997.cdf
> name title I J
> K L
> PRES Monthly mean surface pressure 1:144 1:73
> ... 1:472
>
> 4>
> /usr/users/mueller/dataset/mout/weight_my/pres.mon.mean.jan1958_apr1997.des.20_90.DeTrend.DeMean.cdf
> (default)
> name title I J
> K L
> EXPVAR Explained Variance ... ...
> 1:472 ...
> DEXPVAR Error Explained Variance ... ...
> 1:472 ...
> EOF 1:144 1:29
> 1:472 ...
> PC ... ...
> 1:472 1:472
> PRES_DES_CALC 1:144 1:29
> ... 1:472
>
> yes?
>
> Is there anybody who can tell me what's happening (or why it isn't)? And
> even more: Does anybody know a workaround for this?
>
> Thank you in advance!
>
> Daniel
--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement