[Thread Prev][Thread Next][Index]

Re: [ferret_users] the role of comment/uncomment the command 'List'



Hi,

 solution to your problem :

     use model.cdf
     set reg/y=-40.5:-30.5/l=1
     let lev1   = 36.21
     let rho    = rho_un(salt,temp,2000)-1000
     let mask   = if rho le lev1 then 1
     let masku  = mask[gx=u]
     let u_upper= u*masku
     let tr     = u_upper[y=@din,k=@din]*1e-6
     list tr[x=-24]

     Two IMPORTANT points :

   1. LIST is an "action" command (see Ch3 Sec2.  EXPRESSIONS for details).
         Ferret does some calculation or plotting only with the action command.
         Till you issue an action command, a variable may not be evaluated and
         the array indices may not be set ......and so and so...

   2. There are 3-options to restrict the data axis/coordinate range.

          1) "set reg" command (eg.  set reg/x=-62.5:-22.5 )

               this command have a global nature, which WILL affect all subsequent
               calculation/plotting (all action commands) that follows.

          2) as a qualifier to action commands (eg.  list/x=-62.5:-22.5  var_name)

               this method specifies the region only for a specific action command
               and will NOT affect any calculation/plotting in any other parts
               of the script.

          3) as a part of variable name (eg.  list var_name[x=-62.5:-22.5])

               This method works just fine with action commands like list/plot.
               However, there are some concerns when you use this method to define
               a variale like

                     let  var_new = var_old[x=-63:-22]

               Here, you DO NOT have access to individual elements in var_new
               along X-axis, before "loading" the var_new on to Ferret, using any
               of the action commands. Once you list it without specifying X value,
               the data is "loaded" into Ferret session and there after you can
               use [x=-25]....that is why you observed a change in behaviour with
               and without an initial "list command"

                Let us see an example.

                   use levitus_climatology
                   set reg/y=-40.5:-30.5/k=1
                   let tr  = temp[x=-62.5:-22.5,y=@DIN]
                   list tr[x=-25]
              **ERROR: illegal limits: X axis limits don't match variable def'n: TR
                  Are you giving explicit limits when SET REGION would suffice ?
                      list tr[x=-25]
                  Command file, command group, or REPEAT execution aborted

               Because of above rule, you cannot directly access "tr"'s array
               elements using "[ ]". But try

                      list/x=-25 tr

               and it will work !!!


 Confused? May be the developers can explain how exactly Ferret deals the 3
set region commands above, in more detail ...

Thanks and Regards,

Jaison

> hi, Ferreters,
>
>   It's a strange problem I got several times. Does the command 'List' impact on the
> later command?
>
>   I use model results in which Arawaka C-grid is used. Sometimes I have to regrid my
> results from density point to U or V point.  In the following script,  I get a
> variable 'tr', which is the volumn transport integrated from surface to density
> surface (36.21).  It's so tricky when I comment/uncomment 'list tr' ( the command
> before the last line).
>
>   IF don't execute 'list tr', then get the following error messages:
>
>    **ERROR: illegal limits: X axis limits don't match variable def'n: TR
>           Are you giving explicit limits when SET REGION would suffice ?
>           list tr[x=-24]
>           Command file, command group, or REPEAT execution aborted
>
>   IF execute 'list tr' before list tr[x=-24], then get
>
>                LONGITUDE: 24W(-24)
>              LATITUDE : 40.5S to 30.5S
>              DEPTH (m): 0 to 5200
>              TIME     : 16-JAN-1982 11:00
>                 17.396
>
>   I don't think the command 'List' can impact on the later results, but I can't explain
> this problem.
>
>   Dawn
>
>
>    use model.cdf
>  set reg/x=-62.5:-22.5/y=-40.5:-30.5
>    let lev1 = 36.21
>  let rho=rho_un(salt,temp,2000)-1000
>  let mask= if rho le lev1 then 1
>  let masku=mask[gx=u,x=-63:-22];
>  let u_upper=u[x=-63:-22]*masku
>  let masku=mask[gx=u,x=-63:-22];
>  let tr=u_upper[y=@din,k=@din,l=1]*1e-6;
> !----------Attention--------
>    list tr
>   !-----------------------------
>  list tr[x=-24]     ! only this number is what I really want.
>
>
> ---------------------------------
> Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
>



[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement