[Thread Prev][Thread Next][Index]

Re: [ferret_users] [ferret users] having variable in return=dsetnum command



Hi Mark,
          If you use double quotes while defining a variable with LET
commad, the result will be "character string". That is why the 
      
      let ivar = "temp"

expression didn't work.

 Obviously, one solution is to define the new variable without double
quotes, as

      let ivar = temp

But if you have multiple datasets loaded in the Ferret session, then 
you have to specify either the dataset number or the dataset name 
(without the path) in this step itself, like 

      let ivar = temp[d=2]
or 
      let ivar = temp[d=levitus_climatology]

One good practice is to define internal variables, as soon as you load
the dataset, so that the variable name reflects the parameter and dataset.
(But this may not be ideal if you have multiple datasets with large size.)
Here "internal" does mean that these variables are available only in the
current Ferret session, and a variable with this name is not there in the
loaded datsets. Here is an example :

    ! load datasets and define internal variables

         use levitus_climatology.nc  ! d=1
         use coads_climatology.nc    ! d=2
         use reynolds_sst_clim.nc    ! d=3
         use tmi_sst_clim.nc         ! d=4

         let sst_lev  = temp[d=1,k=1]
         let sst_coad = sst[d=2]
         let sst_rey  = sst_clim[d=3]
         let sst_tmi  = sst_clim[d=4]

Now you can use sst_* variables without worrying about the dataset
number or name associated with orinal datasets. 

If you can explain what exactly you are trying to do, I can offer a 
better help.

Regards,

Jaison

On Fri, 23 Mar 2007 Mark.Collier@xxxxxxxx wrote:

> use levitus_climatology
> 
> let id="`temp,return=dsetnum`"
> 
>  
> 
> gives the data set number.
> 
>  
> 
> Is it possible to put a variable in the expression, something like (but
> this doesn't work)?
> 
>  
> 
> let ivar="temp"
> 
> let id="`ivar,return=dsetnum`"
> 
>  
> 
> Thanks,
> 
> Mark.
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement