[Thread Prev][Thread Next][Index]
Re: [ferret_users] string variable as file name
Thank you Paulo and Ansley,
I tried, and the correct one should be:
yes? let filename= "/home/data01/OUTPUT_A5F_SP2/
hist_spinup.nc"
yes? use "`filename`"
we must put the double quotation marks beside the embedded _expression_ because the grave accent will give only the VALUE of the varialbe, so in the case of
yes? use `filename`, it will give error to say:
**ERROR: unknown command qualifier: home
becuase ferret interpreted the command as:
it interpret /home as qualifier, but in the case of:
yes? use "`filename`"
ferret interpret as:
That's why it's correct. A good chance of study for me!!
cheers,
Chao
2011/5/20 Ansley Manke
<ansley.b.manke@xxxxxxxx>
Hi -
The reason for this is that Ferret needs the VALUE of the variable, the string filename in this case, in order to use it in the command line.
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/variables-xpressions/EMBEDDED-XPRESSIONS/
-ansley
On 5/20/2011 9:02 AM, Paulo Santiago wrote:
Hi Chao,
Try
yes? let filename= "/home/data01/OUTPUT_A5F_SP2/hist_spinup.nc"
yes? use `filename`
(delimit variable with grave accent)
Cheers,
Paulo Santiago
2011/5/20 Chao YUE
<chaoyuejoy@xxxxxxxxx>
Dear all,
A very simple question, why I if use
yes? use "/home/data01/OUTPUT_A5F_SP2/hist_spinup.nc" it works.
but if I do like this:
yes? let filename= "/home/data01/OUTPUT_A5F_SP2/hist_spinup.nc"
yes? use filename
it will fail?
The problem is simplified because I want to use the file names stored in a string array.
Thanks a lot,
Chao
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30; Fax:01.69.08.77.16
************************************************************************************
--
Paulo Santiago
Doutorado em Meteorologia
Programa de Pós-Graduação em Meteorologia
Instituto Nacional de Pesquisas Espaciais
Tel.: (12) 3186 8637
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30; Fax:01.69.08.77.16
************************************************************************************
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement